Package: binutils-gold Version: 2.21.0.20110322-1 Severity: normal
I was recompiling today my project in D and immiedietly discovered a problem in linking process. A smallest test case is: ---- void main() {} ---- Then test.o produced using dmd2 -c test.d, with provided simplest possible test.d. For convinience I attach test.o file. I used dmd version 2.052, but bugs exists in few version i tested, which previously worked. libphobos2.a is also from dmd 2.052. (binary provided by upstream) I do not recompiled it. Both files available in http://ftp.digitalmars.com/dmd.2.052.zip (13MB) in zip a linux/bin/dmd is a compilers, and linux/lib32/libphobos2.a is a precompiled object file. Please download it directly, because I do not know if I can redistribute this zip or libphobos2.a alone, and it is big (9MB). Put test.o and libphobos2.a in single directory, then do $ gcc -v test.o -o test -m32 -Xlinker -L. -lrt -lphobos2 -pthread Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.5.2/lto-wrapper Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.2-7' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.5.2 (Debian 4.5.2-7) COMPILER_PATH=/usr/lib/gcc/i486-linux-gnu/4.5.2/:/usr/lib/gcc/i486-linux-gnu/4.5.2/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.5.2/:/usr/lib/gcc/i486-linux-gnu/ LIBRARY_PATH=/usr/lib/gcc/i486-linux-gnu/4.5.2/:/usr/lib/gcc/i486-linux-gnu/4.5.2/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.5.2/../../../:/lib/:/usr/lib/:/usr/lib/i486-linux-gnu/ COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-m32' '-pthread' '-mtune=generic' '-march=i586' /usr/lib/gcc/i486-linux-gnu/4.5.2/collect2 --build-id --no-add-needed --eh-frame-hdr -m elf_i386 --hash-style=both -dynamic-linker /lib/ld-linux.so.2 -o test /usr/lib/gcc/i486-linux-gnu/4.5.2/../../../../lib/crt1.o /usr/lib/gcc/i486-linux-gnu/4.5.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.5.2/crtbegin.o -L/usr/lib/gcc/i486-linux-gnu/4.5.2 -L/usr/lib/gcc/i486-linux-gnu/4.5.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.5.2/../../.. -L/usr/lib/i486-linux-gnu test.o -L. -lrt -lphobos2 -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i486-linux-gnu/4.5.2/crtend.o /usr/lib/gcc/i486-linux-gnu/4.5.2/../../../../lib/crtn.o /usr/bin/ld: internal error in make_view, at ../../gold/fileread.cc:395 collect2: ld returned 1 exit status $ gold test.o -o test -L. -lrt -lphobos2 -lpthread gold: internal error in make_view, at ../../gold/fileread.cc:395 # ld.bfd works properly. My architecture is i386, gcc -v gives gcc version 4.5.2 (Debian 4.5.2-7) Thanks, Witek -- Witold Baryluk JID: witold.baryluk // jabster.pl
void main() { }
test.o
Description: application/object