Running dmd on ubuntu with AMD64

Jason House jason.james.house at gmail.com
Sun Apr 22 11:10:41 PDT 2007


Any further tips on getting rebuild/dsss to work?  I'm getting linker 
errors.  I'm assuming dmd is generating a 32 bit executable and failing 
to link with 64 bit libraries.  Can dmd generate a 64 bit executable? 
I'm not sure how to configure it to do so.  I did try hacking at the 
rebuild config files to see if I could get it to work (resulting file 
below).

Can gdc do better?

> $ dsss build
> housebot.d => housebot-0.6
> + /bin/rebuild -Idsss_imports/ -I. -S./ -I/include/d -S/lib/   -oqdsss_objs -Dddoc -unittest -w -gc housebot.d -ofhousebot-0.6
> gcc dsss_objs/_housebot.o dsss_objs/nmd_gcstats.o dsss_objs/_ipc.o dsss_objs/_gtp.o -o housebot-0.6 -g -m32 -lphobos -lpthread -lm -Xlinker --start-group -Xlinker -lphobos -Xlinker -L./ -Xlinker -L/lib/ -Xlinker -L/home/jhouse/housebot/dmd/bin/../lib -Xlinker -L/home/jhouse/housebot/dmd/bin/../lib
> /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
> --- errorlevel 1
> Command /bin/rebuild returned with code 65280, aborting.

$ cat /etc/rebuild/default
profile=dmd-posix

$ cat /etc/rebuild/dmd-posix
profile=phobos

compiler=dmd
inifile=dmd.conf

exeext=
objext=o


version=DigitalMars
noversion=GNU
version=linux
noversion=Unix
version=Posix
noversion=Windows
noversion=Win32
noversion=Win64
noversion=X86
noversion=PPC
version=X86_64
version=D_InlineAsm
noversion=D_InlineAsm_X86
noversion=D_InlineAsm_PPC
version=D_InlineAsm_X86_64
version=LittleEndian
noversion=BigEndian


[compile]
cmd=dmd -version=Posix -c $i

flag=$i
incdir=-I$i
libdir=-L-L$i
optimize=-O
version=-version=$i


[link]
cmd=dmd -L--start-group -L-lphobos $i -of$o

libdir=-L-L$i
lib=-L-l$i
flag=-L$i


[liblink]
safe=yes
cmd=ar rc $o $i

libdir=
lib=
flag=


[postliblink]
cmd=ranlib $i


[shliblink]
shlibs=no

[dyliblink]
dylibs=no



Frits van Bommel wrote:
> Jason House wrote:
>> I've discovered that the ubuntu linux distribution refuses to run 32 
>> bit applications out of the box.  Are there plans for releasing a 64 
>> bit version of dmd?  Is there anyone more experienced than me that has 
>> created a .deb (debian package) file that I can use?
>>
>> jhouse at server:~/dmd/bin$ ls -al dmd
>> -rwxr-xr-x 1 jhouse jhouse 1009284 2007-03-26 00:45 dmd
>>
>> jhouse at server:~/dmd/bin$ ./dmd
>> -bash: ./dmd: No such file or directory
>>
>> jhouse at server:~/dmd/bin$ ldd dmd
>>         not a dynamic executable
>>
>> jhouse at server:~/dmd/bin$ file dmd
>> dmd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for 
>> GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
> 
> Try installing the "ia32-libs" package.
> 
> Works just fine for me:
> =====
> urxae at urxae:~/opt/dmd/bin$ ls -l dmd
> -rwx------ 1 urxae urxae 1014564 2007-04-19 12:04 dmd
> urxae at urxae:~/opt/dmd/bin$ ./dmd | head -n 2     # to shorten the output
> Digital Mars D Compiler v1.013
> Copyright (c) 1999-2007 by Digital Mars written by Walter Bright
> urxae at urxae:~/opt/dmd/bin$ file dmd
> dmd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for 
> GNU/Linux 2.2.5, dynamically linked (uses shared libs), for GNU/Linux 
> 2.2.5, stripped
> urxae at urxae:~/opt/dmd/bin$ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description:    Ubuntu 6.10
> Release:        6.10
> Codename:       edgy
> urxae at urxae:~/opt/dmd/bin$ uname -m
> x86_64
> =====


More information about the Digitalmars-d-learn mailing list