Bug 2963 – dmd will not link on 64bit linux

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-05-11T07:29:00Z
Last change time
2015-06-09T01:26:25Z
Assigned to
nobody
Creator
one_mad_alien

Comments

Comment #0 by one_mad_alien — 2009-05-11T07:29:53Z
I have an AMD quad core with 64bit linux (xubuntu) `uname -a` Linux akira 2.6.24-23-generic #1 SMP Wed Apr 1 21:43:24 UTC 2009 x86_64 GNU/Linux `gcc --version` gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3) `ld --version` GNU ld (GNU Binutils for Ubuntu) 2.18.0.20080103 and I'm trying to use dmd .... I have tried -L-m32 (which is what I've used in the past to build 32 bit binaries on a 64bit system) but I get gcc main.o -o main -m32 -Xlinker -L/home/mwynn/bin/dmd/linux/lib -Xlinker -m32 -lphobos2 -lpthread -lm /usr/bin/ld: unrecognised emulation mode: 32 Supported emulations: elf_x86_64 elf_i386 i386linux collect2: ld returned 1 exit status --- errorlevel 1 if I try - L-mi386linux I get gcc main.o -o main -m32 -Xlinker -L/home/mwynn/bin/dmd/linux/lib -Xlinker -mi386linux -lphobos2 -lpthread -lm /usr/bin/ld: unrecognized option '--eh-frame-hdr' /usr/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status --- errorlevel 1 and -L-melf_i386 gives me the same error as no options given ... gcc main.o -o main -m32 -Xlinker -L/home/mwynn/bin/dmd/linux/lib -Xlinker -melf_i386 -lphobos2 -lpthread -lm /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/bin/../lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/bin/../lib/libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread /usr/bin/ld: cannot find -lpthread collect2: ld returned 1 exit status Is D going to go 64bit or is it me with a poorly setup linux system ?
Comment #1 by one_mad_alien — 2009-05-11T07:30:26Z
dmd Digital Mars D Compiler v2.029
Comment #2 by jarrett.billingsley — 2009-05-11T08:08:28Z
DMD doesn't produce 64-bit executables. You need to have the 32-bit libraries installed. Try installing the 'libc6-deb-i386' and 'lib32stdc++6' packages and see if it works.
Comment #3 by jarrett.billingsley — 2009-05-11T08:27:56Z
(In reply to comment #2) > installed. Try installing the 'libc6-deb-i386' and 'lib32stdc++6' packages and Erm, libc6-dev-i368
Comment #4 by one_mad_alien — 2009-05-16T09:14:49Z
I've tried `sudo apt-get install lib32stdc++6` and `sudo apt-get install libc6-dev-i368` (the former I had but the latter was missing) I now fail to find a compatible libgcc I have tried `sudo apt-get install lib32gcc1` but that is already installed. (I tried apt-cache search for 'gcc' and 'lib32' so see if I could find a hint ...) + dmd -v -I~/bin/dmd/src/druntime/import -I~/bin/dmd/src/phobos -L-L/home/mwynn/bin/dmd/linux/lib main.d parse main semantic main import object (/home/mwynn/bin/dmd/src/druntime/import/object.di) import std.c.stdio (/home/mwynn/bin/dmd/src/phobos/std/c/stdio.d) import core.stdc.stdio (/home/mwynn/bin/dmd/src/druntime/import/core/stdc/stdio.d) import core.stdc.config (/home/mwynn/bin/dmd/src/druntime/import/core/stdc/config.d) import core.stdc.stddef (/home/mwynn/bin/dmd/src/druntime/import/core/stdc/stddef.d) import core.stdc.stdarg (/home/mwynn/bin/dmd/src/druntime/import/core/stdc/stdarg.d) semantic2 main semantic3 main code main function main gcc main.o -o main -m32 -Xlinker -L/home/mwynn/bin/dmd/linux/lib -lphobos2 -lpthread -lm /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/libgcc.a when searching for -lgcc /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.4/libgcc.a when searching for -lgcc /usr/bin/ld: cannot find -lgcc collect2: ld returned 1 exit status
Comment #5 by yebblies — 2011-06-10T09:59:17Z
This is an environment problem, not a bug in dmd.