-
-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build for i586 #4013
Comments
This is perhaps due to the D runtime and stdlib being built for i686. You can build runtime and stdlib yourself using ldc-build-runtime, see: https://wiki.dlang.org/Building_LDC_runtime_libraries |
And how would it be more correct in my case to build libraries? I'm not really familiar with the necessary parameters to pass as flags. |
Can you try |
Something like: |
|
Sorry... i586 needed |
So your LLVM apparently defaults to i686. I'm not sure whether |
Yes, I did it! I have an
mkdir /root/source/gcc && cd /root/source/gcc
wget https://ftp.mpi-inf.mpg.de/mirrors/gnu/mirror/gcc.gnu.org/pub/gcc/releases/gcc-9.5.0/gcc-9.5.0.tar.gz
tar xf gcc-9.5.0.tar.gz -C source
cd source
./contrib/download_prerequisites
mkdir /root/source/gcc/build && cd /root/source/gcc/build
../source/configure --prefix=$PWD/../install --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++
make -j16
make install
mkdir /root/source/llvm && cd /root/source/llvm
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-project-10.0.1.tar.xz
tar xf llvm-project-10.0.1.tar.xz -C source
mkdir /root/source/llvm/build && cd /root/source/llvm/build
export CC=/root/source/gcc/install/bin/gcc
export CXX=/root/source/gcc/gcc-install/bin/g++
cmake ../source -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/../install -DLLVM_TARGETS_TO_BUILD='X86' -DCOMPILER_RT_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF
make -j16
make install
mkdir -p ~/ldc/build && cd ~/ldc
git clone --recursive https://github.com/ldc-developers/ldc.git source
cd build
export PATH=<PATH_TO_GCC_BIN>:$PATH
cmake ../source -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/../install -DLLVM_ROOT_DIR=<PATH_TO_LLVM_INSTALL> -DD_COMPILER=<PATH_TO_DMD_COMPILER_X32>
make
make install
ldc-build-runtime --dFlags="-mcpu=i586" --cFlags="-march=i586" When performing the actions, I may have connected the necessary paths to Now Thank you so much for your help! |
Great, so I guess compiling on that box is severely limited by CPU speed and available RAM. If you just want to cross-compile to that target, see https://wiki.dlang.org/Cross-compiling_with_LDC. You'll 'just' need an additional cross-gcc toolchain from your host to i586 (incl. all required C libs) to make cross-linking work. |
The problem is that I can't compile GCC, I always get this error: ...
checking for suffix of object files... mv -f .deps/findcomp.Tpo .deps/findcomp.Plo
configure: error: in `/root/source/gcc/9.5.0/build/i586-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
Makefile:14150: recipe for target 'configure-target-libgcc' failed
make[1]: *** [configure-target-libgcc] Error 1
make[1]: *** Waiting for unfinished jobs....
... I wrote about it in my very first post. |
Let's close this then, this was never an LDC issue per se. |
I am faced with a problem about compiling a compiler
ldc
for processorGeode LX800
.The bottom line is that I have a processor on which I want to compile the program, is an
i586
architecture.The official documentation says that "... the core is a combination of Intel Pentium ® processor, AMD Athlon™ processor, and AMD Geode LX processor specific instructions." - this means that the processor architecture is <
i686
. And judging by the fact that Linux gives a description when callinguname
:# uname -m i586
This suggests that the processor is CLEARLY
i586
. The problem is that I can't assemble the software I need for this processor, since it is automatically assembled fori686
.What have I done?
I built an
ldc
compiler on this machine:# ldc2 --version LDC - the LLVM D compiler (1.30.0-git-32f5a35): based on DMD v2.100.1 and LLVM 10.0.1 built with DMD32 D Compiler v2.086.1 Default target: i686-pc-linux-gnu Host CPU: geode http://dlang.org - http://wiki.dlang.org/LDC Registered Targets: x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64
And when I try to compile the program through it, I create a binary file, but when I start it outputs Illegal instruction:
Here's using the
mcpu
flag:# ldc2 --mcpu=i586 app.d -v binary /mnt/disc/sdb/part1/program/ldc/1.30/install/bin/ldc2 version 1.30.0-git-32f5a35 (DMD v2.100.1, LLVM 10.0.1) config /mnt/disc/sdb/part1/program/ldc/1.30/install/etc/ldc2.conf (i686-pc-linux-gnu) predefs LDC all D_Version2 assert D_PreConditions D_PostConditions D_Invariants D_ModuleInfo D_Exceptions D_TypeInfo X86 D_InlineAsm_X86 D_HardFloat LittleEndian D_PIC linux Posix CRuntime_Glibc CppRuntime_Gcc LDC_LLVM_1000 parse app importall app import object (/root/usr/program/ldc/1.30/install/include/d/object.d) import core.attribute (/root/usr/program/ldc/1.30/install/include/d/core/attribute.d) import ldc.attributes (/root/usr/program/ldc/1.30/install/include/d/ldc/attributes.d) import core.internal.hash (/root/usr/program/ldc/1.30/install/include/d/core/internal/hash.d) import core.internal.traits (/root/usr/program/ldc/1.30/install/include/d/core/internal/traits.d) import core.internal.entrypoint (/root/usr/program/ldc/1.30/install/include/d/core/internal/entrypoint.d) import core.internal.array.appending (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/appending.d) import core.internal.array.comparison (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/comparison.d) import core.internal.array.equality (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/equality.d) import core.internal.array.casting (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/casting.d) import core.internal.array.concatenation (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/concatenation.d) import core.internal.array.construction (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/construction.d) import core.internal.array.capacity (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/capacity.d) import core.internal.dassert (/root/usr/program/ldc/1.30/install/include/d/core/internal/dassert.d) import core.atomic (/root/usr/program/ldc/1.30/install/include/d/core/atomic.d) import core.internal.attributes (/root/usr/program/ldc/1.30/install/include/d/core/internal/attributes.d) import core.internal.atomic (/root/usr/program/ldc/1.30/install/include/d/core/internal/atomic.d) import ldc.intrinsics (/root/usr/program/ldc/1.30/install/include/d/ldc/intrinsics.di) import core.internal.destruction (/root/usr/program/ldc/1.30/install/include/d/core/internal/destruction.d) import core.internal.moving (/root/usr/program/ldc/1.30/install/include/d/core/internal/moving.d) import core.internal.postblit (/root/usr/program/ldc/1.30/install/include/d/core/internal/postblit.d) import core.internal.switch_ (/root/usr/program/ldc/1.30/install/include/d/core/internal/switch_.d) import core.lifetime (/root/usr/program/ldc/1.30/install/include/d/core/lifetime.d) import core.builtins (/root/usr/program/ldc/1.30/install/include/d/core/builtins.d) semantic app entry main app.d semantic2 app semantic3 app import std.stdio (/root/usr/program/ldc/1.30/install/include/d/std/stdio.d) import core.stdc.stddef (/root/usr/program/ldc/1.30/install/include/d/core/stdc/stddef.d) import std.algorithm.mutation (/root/usr/program/ldc/1.30/install/include/d/std/algorithm/mutation.d) import std.traits (/root/usr/program/ldc/1.30/install/include/d/std/traits.d) import std.meta (/root/usr/program/ldc/1.30/install/include/d/std/meta.d) import std.range.primitives (/root/usr/program/ldc/1.30/install/include/d/std/range/primitives.d) import std.typecons (/root/usr/program/ldc/1.30/install/include/d/std/typecons.d) import std.format.spec (/root/usr/program/ldc/1.30/install/include/d/std/format/spec.d) import std.format.write (/root/usr/program/ldc/1.30/install/include/d/std/format/write.d) import std.format.internal.write (/root/usr/program/ldc/1.30/install/include/d/std/format/internal/write.d) import std.internal.attributes (/root/usr/program/ldc/1.30/install/include/d/std/internal/attributes.d) import std.range (/root/usr/program/ldc/1.30/install/include/d/std/range/package.d) import std.array (/root/usr/program/ldc/1.30/install/include/d/std/array.d) import std.functional (/root/usr/program/ldc/1.30/install/include/d/std/functional.d) import std.conv (/root/usr/program/ldc/1.30/install/include/d/std/conv.d) import std.ascii (/root/usr/program/ldc/1.30/install/include/d/std/ascii.d) import std.range.interfaces (/root/usr/program/ldc/1.30/install/include/d/std/range/interfaces.d) import core.stdc.stdio (/root/usr/program/ldc/1.30/install/include/d/core/stdc/stdio.d) import core.stdc.stdint (/root/usr/program/ldc/1.30/install/include/d/core/stdc/stdint.d) import core.stdc.config (/root/usr/program/ldc/1.30/install/include/d/core/stdc/config.d) import core.stdc.signal (/root/usr/program/ldc/1.30/install/include/d/core/stdc/signal.d) import core.stdc.wchar_ (/root/usr/program/ldc/1.30/install/include/d/core/stdc/wchar_.d) import core.stdc.stdarg (/root/usr/program/ldc/1.30/install/include/d/core/stdc/stdarg.d) import core.stdc.time (/root/usr/program/ldc/1.30/install/include/d/core/stdc/time.d) import core.sys.posix.stdc.time (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/stdc/time.d) import core.sys.posix.sys.types (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/sys/types.d) import core.sys.posix.config (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/config.d) import core.sys.posix.stdio (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/stdio.d) import std.exception (/root/usr/program/ldc/1.30/install/include/d/std/exception.d) import core.stdc.errno (/root/usr/program/ldc/1.30/install/include/d/core/stdc/errno.d) import std.utf (/root/usr/program/ldc/1.30/install/include/d/std/utf.d) import core.exception (/root/usr/program/ldc/1.30/install/include/d/core/exception.d) import core.internal.string (/root/usr/program/ldc/1.30/install/include/d/core/internal/string.d) import std.algorithm.comparison (/root/usr/program/ldc/1.30/install/include/d/std/algorithm/comparison.d) import core.stdc.string (/root/usr/program/ldc/1.30/install/include/d/core/stdc/string.d) import std.format (/root/usr/program/ldc/1.30/install/include/d/std/format/package.d) import std.format.read (/root/usr/program/ldc/1.30/install/include/d/std/format/read.d) import std.format.internal.read (/root/usr/program/ldc/1.30/install/include/d/std/format/internal/read.d) import std.algorithm.searching (/root/usr/program/ldc/1.30/install/include/d/std/algorithm/searching.d) import std.bitmanip (/root/usr/program/ldc/1.30/install/include/d/std/bitmanip.d) import std.system (/root/usr/program/ldc/1.30/install/include/d/std/system.d) import core.bitop (/root/usr/program/ldc/1.30/install/include/d/core/bitop.d) import core.memory (/root/usr/program/ldc/1.30/install/include/d/core/memory.d) import core.time (/root/usr/program/ldc/1.30/install/include/d/core/time.d) import core.sys.posix.time (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/time.d) import core.sys.posix.signal (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/signal.d) import core.sys.posix.sys.time (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/sys/time.d) import core.sys.posix.sys.select (/root/usr/program/ldc/1.30/install/include/d/core/sys/posix/sys/select.d) import core.sys.linux.sys.time (/root/usr/program/ldc/1.30/install/include/d/core/sys/linux/sys/time.d) import core.sys.linux.config (/root/usr/program/ldc/1.30/install/include/d/core/sys/linux/config.d) import core.internal.array.utils (/root/usr/program/ldc/1.30/install/include/d/core/internal/array/utils.d) import core.checkedint (/root/usr/program/ldc/1.30/install/include/d/core/checkedint.d) import std.string (/root/usr/program/ldc/1.30/install/include/d/std/string.d) import std.uni (/root/usr/program/ldc/1.30/install/include/d/std/uni/package.d) import std.internal.unicode_tables (/root/usr/program/ldc/1.30/install/include/d/std/internal/unicode_tables.d) import core.internal.lifetime (/root/usr/program/ldc/1.30/install/include/d/core/internal/lifetime.d) import std.format.internal.floats (/root/usr/program/ldc/1.30/install/include/d/std/format/internal/floats.d) import std.math.operations (/root/usr/program/ldc/1.30/install/include/d/std/math/operations.d) import std.math (/root/usr/program/ldc/1.30/install/include/d/std/math/package.d) import std.math.algebraic (/root/usr/program/ldc/1.30/install/include/d/std/math/algebraic.d) import core.math (/root/usr/program/ldc/1.30/install/include/d/core/math.d) import core.stdc.math (/root/usr/program/ldc/1.30/install/include/d/core/stdc/math.d) import std.math.constants (/root/usr/program/ldc/1.30/install/include/d/std/math/constants.d) import std.math.exponential (/root/usr/program/ldc/1.30/install/include/d/std/math/exponential.d) import std.math.hardware (/root/usr/program/ldc/1.30/install/include/d/std/math/hardware.d) import core.stdc.fenv (/root/usr/program/ldc/1.30/install/include/d/core/stdc/fenv.d) import core.cpuid (/root/usr/program/ldc/1.30/install/include/d/core/cpuid.d) import std.math.remainder (/root/usr/program/ldc/1.30/install/include/d/std/math/remainder.d) import std.math.rounding (/root/usr/program/ldc/1.30/install/include/d/std/math/rounding.d) import std.math.traits (/root/usr/program/ldc/1.30/install/include/d/std/math/traits.d) import std.math.trigonometry (/root/usr/program/ldc/1.30/install/include/d/std/math/trigonometry.d) import std.internal.unicode_grapheme (/root/usr/program/ldc/1.30/install/include/d/std/internal/unicode_grapheme.d) GC stats 0M used, 5M free, 5M total code app /root/usr/program/gcc/9.5.0/install/bin/cc app.o -o app -L/root/usr/program/ldc/1.30/install/lib -lphobos2-ldc -ldruntime-ldc -Wl,--gc-sections -lrt -ldl -lpthread -lm -m32
The GCC compiler is built on
i686
:# cc --version cc (GCC) 9.5.0
At first I thought that I needed to rebuild the
GCC
compiler for thei586
architecture. I downloaded GCC 9.5.0 and started the installation:But during the installation process I got an error:
If I do it without a flag
--target=i586-pc-linux-gnu
, then everything is assembled without errors.Even tried with such a flag separately, it still doesn't work:
I also tried with
i586
andpentium
- the result is the same.I'm at a dead end, please help, guys.
The text was updated successfully, but these errors were encountered: