DMD on x86_64

Robert Clipsham robert at octarineparrot.com
Wed Feb 17 08:39:58 PST 2010


On 17/02/10 06:20, Brad Roberts wrote:
> On 2/16/2010 10:05 PM, Jesse Phillips wrote:
>> Robert Clipsham wrote:
>>
>>> On 16/02/10 15:20, Jesse Phillips wrote:
>>>> Robert Clipsham wrote:
>>>>
>>>>> I don't use ubuntu, so those instructions don't apply to me.
>>>>
>>>> I don't either, but the instructions still apply to me. What distro are
>>>> you using? If you figure it out, write up some instructions for it.
>>>>
>>>
>>> I'm using Arch Linux. I've found a gcc-multilib package in AUR (
>>> http://aur.archlinux.org/packages.php?ID=28545 ), it's out of date and
>>> doesn't build for me though, it seems to require the de_DE locale too
>>> for some unknown reason. I'm hoping when this package is updated it'll
>>> do what I need, I'm not holding my breath though.
>>
>> Oh, yeah Arch dropped most efforts to support 32bit didn't they. This
>> probably won't help but maybe trying
>>
>> dmd test.d -L-L/opt/lib32/lib -L-melf_i386
>>
>> I'd hope that would at least stop it complaining about libpthread. (but
>> so should have your gcc -m32
>
> The other thing you could try is to take dmd out of the loop.  Can you build a
> 32 bit c/c++ app with gcc/g++ directly?  If you can't get that to work, it's
> unlikely that dmd will we successful either, given that it relies on gcc to
> invoke the linker, picking up all the right c library pieces.

# Compile normally
% gcc hello.c
% ./a.out
Hello World!

# Compile as 32 bit
% gcc -m32 hello.c
In file included from /usr/include/features.h:371,
                  from /usr/include/stdio.h:28,
                  from hello.c:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or 
directory

# Stop #including and extern printf directly

% gcc -m32 hello.c
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/libgcc.a when searching for 
-lgcc
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/libgcc.a when searching for 
-lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status

# Add some -L's

% gcc -m32 hello.c -L/opt/lib32/lib -L/opt/lib32/usr/lib
/usr/bin/ld: skipping incompatible /lib/libc.so.6 when searching for 
/lib/libc.so.6
/usr/bin/ld: cannot find /lib/libc.so.6
collect2: ld returned 1 exit status

# As a side note, libc.so.6 can be found in /opt/lib32/lib.
# I don't feel like symlinking that to make it work as it'll
# break 64 bit builds :) Seems the path is hard coded there,
# there might be an option to fix that, I don't know it though


More information about the Digitalmars-d-learn mailing list