AMD64 Linux

Thomas Kuehne thomas-dloop at kuehne.cn
Thu Aug 24 07:31:09 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Demme schrieb am 2006-08-24:

> Thanks for your help... sorry I'm not responding quicker- I haven't had much
> time to devote to this issue.  Here are the results.  They don't mean much
> to me- I haven't bothered learning x86 assembly yet.
>
> teqdruid at home ~/temp $ /user/gdc/bin/gdc -m32 -save-temps -c test.d
> test.s: Assembler messages:
> test.s:10: Error: suffix or operands invalid for `push'
> test.s:86: Error: suffix or operands invalid for `push'
> test.s:93: Error: suffix or operands invalid for `pop'

> teqdruid at home ~/temp $ cat test.s

>         pushl   %ebp

>         pushl   %ebp

>         popl    %ebp

It seems like the -m32 has been lost in the tool chain. test.s is
32bit but the compiler seems to use the 64bit assembly driver...

#
# gdc -v -m32 test.s -o test -lm -lgcc -lpthread -lgphobos -L/where/ever/gphobos/is
# ./test
# > Hello
#

The above should succeed and print:
#
# Reading specs from /opt/gdc/gdc-0.19/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/specs
# Reading specs from /lib/libgphobos.spec
# rename spec lib to liborig
# Configured with: ./configure --prefix=/opt/gdc/gdc-0.19 --enable-languages=c,d --enable-checking=misc,tree,gc,rtl,rtlflag,fold,gcac
# Thread model: posix
# gcc version 3.4.6 (Gentoo Hardened 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9) (gdc 0.19, using dmd 0.162)
#  as -V -Qy --32 -o /tmp/ccQi0vUU.o a.s
# GNU assembler version 2.16.1 (x86_64-pc-linux-gnu) using BFD version 2.16.1
# /opt/gdc/gdc-0.19/libexec/gcc/x86_64-unknown-linux-gnu/3.4.6/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z relro -z now -o test /usr/lib/../lib32/Scrt1.o /usr/lib/../lib32/crti.o /opt/gdc/gdc-0.19/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/32/crtbeginS.o -L/where/ever/gphobos/is -L/opt/gdc/gdc-0.19/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/32 -L/opt/gdc/gdc-0.19/lib/gcc/x86_64-unknown-linux-gnu/3.4.6 -L/opt/gdc/gdc-0.19/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/../../../../lib32 -L/opt/gdc/gdc-0.19/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/../../.. -L/lib/../lib32 -L/usr/lib/../lib32 /tmp/ccQi0vUU.o -lgcc -lpthread -lgphobos -lgphobos -lm -lgcc_s_32 -lgcc -lm -lpthread -lc -lgcc_s_32 -lgcc /opt/gdc/gdc-0.19/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/32/crtendS.o /usr/lib/../lib32/crtn.o
#

If that fails - most likely the "--32" in the "as" line is missing - it is
a GDC bug.

The following should always succeed:
#
# gcc -v -m32 test.s -o test -lm -lgcc -lpthread -lgphobos -L/where/ever/gphobos/is
# ./test
# > Hello
#

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFE7axaLK5blCcjpWoRAn7eAJ0QaoZOeKGXgBsMZHGwdzwZ04TYtQCgl7TG
FGCHD7eIBgfLCht/xliwcXA=
=5eOt
-----END PGP SIGNATURE-----



More information about the D.gnu mailing list