Build for i586

Alexander Zhirov azhirov1991 at gmail.com
Thu Jul 28 10:50:14 UTC 2022


On Thursday, 28 July 2022 at 10:26:36 UTC, kdevel wrote:
> On Thursday, 28 July 2022 at 06:12:49 UTC, Alexander Zhirov 
> wrote:
>> On Thursday, 28 July 2022 at 06:01:17 UTC, Alexander Zhirov 
>> wrote:
>>> ```sh
>>> /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
>>> ```
>
> So you eventually built GCC 9.5.0? I have used the
>
> ```
>    --with-arch-32=pentium3
> ```
>
> option in the configure step for compiling GCC 12.1.0. The 
> build gdc
> generates codes which successfully runs on my Pentium III.

The only thing I did (but it still didn't work) was I 
[built](https://wiki.dlang.org/Building_under_Posix#Building_DMD) 
a `dmd` compiler:

```sh
root at host ~/program # dmd --version
DMD32 D Compiler v2.100.1-3-g76e3b4137
Copyright (C) 1999-2022 by The D Language Foundation, All Rights 
Reserved written by Walter Bright

root at host ~/program # dmd -mcpu=native app.d -v
predefs   DigitalMars LittleEndian D_Version2 all Posix ELFv1 
linux CRuntime_Glibc CppRuntime_Gcc D_InlineAsm D_InlineAsm_X86 
X86 D_PIC assert D_PreConditions D_PostConditions D_Invariants 
D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binary    dmd
version   v2.100.1-3-g76e3b4137
config    /root/usr/program/dmd/2.100.1/usr/bin/dmd.conf
DFLAGS    
-I/root/usr/program/dmd/2.100.1/usr/bin/../include/dmd/druntime/import -I/root/usr/program/dmd/2.100.1/usr/bin/../include/dmd/phobos -L-L/root/usr/program/dmd/2.100.1/usr/bin/../lib -L--export-dynamic -fPIC
parse     app
importall app
import    object    
(/root/usr/program/dmd/2.100.1/usr/bin/../include/dmd/druntime/import/object.d)
...
function  std.typecons.Tuple!(uint, "data", uint, 
"count").Tuple.opCmp!(const(Tuple!(uint, "data", uint, 
"count"))).opCmp
cc app.o -o app -m32 -Xlinker --export-dynamic 
-L/root/usr/program/dmd/2.100.1/usr/bin/../lib -Xlinker -Bstatic 
-lphobos2 -Xlinker -Bdynamic -lpthread -lm -lrt -ldl

root at host ~/program # ./app
Illegal instruction
```


More information about the Digitalmars-d-learn mailing list