https://sourceware.org/bugzilla/show_bug.cgi?id=19526
Bug ID: 19526 Summary: Using "gcc -o /dev/null" gives "ld: final link failed: File truncated" error Product: binutils Version: unspecified URL: https://trac.macports.org/ticket/45994 Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: deller at gmx dot de CC: dave.anglin at bell dot net Target Milestone: --- Host: hppa-unknown-linux-gnu Target: hppa-unknown-linux-gnu When running this trivial check if a library (here: libm.so) exists on the hppa platform I get an error: echo 'int main(){}' | gcc -v -o /dev/null -x c - -lm ; echo $? /usr/bin/ld: final link failed: File truncated collect2: error: ld returned 1 exit status This error does not happen on e.g, the x86_64 platform. This kind of test is used in various programs, e.g. in "pymol" (Log: https://buildd.debian.org/status/fetch.php?pkg=pymol&arch=hppa&ver=1.7.2.1-2.2&stamp=1453925483). The full log is: root@sibaris:~# echo 'int main(){}' | gcc -v -o /dev/null -x c - -lm ; echo $? Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/hppa-linux-gnu/5/lto-wrapper Target: hppa-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 5.3.1-7' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libssp --disable-libitm --disable-libsanitizer --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-hppa/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-hppa --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-hppa --with-arch-directory=parisc --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-libstdcxx-pch --enable-checking=release --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-linux-gnu Thread model: posix gcc version 5.3.1 20160121 (Debian 5.3.1-7) COLLECT_GCC_OPTIONS='-v' '-o' '/dev/null' /usr/lib/gcc/hppa-linux-gnu/5/cc1 -quiet -v -imultilib . -imultiarch hppa-linux-gnu - -quiet -dumpbase - -auxbase - -version -o /tmp/ccnsiCwf.s GNU C11 (Debian 5.3.1-7) version 5.3.1 20160121 (hppa-linux-gnu) compiled by GNU C version 5.3.1 20160121, GMP version 6.1.0, MPFR version 3.1.3-p5, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/local/include/hppa-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/hppa-linux-gnu/5/../../../../hppa-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/hppa-linux-gnu/5/include /usr/local/include /usr/lib/gcc/hppa-linux-gnu/5/include-fixed /usr/include/hppa-linux-gnu /usr/include End of search list. GNU C11 (Debian 5.3.1-7) version 5.3.1 20160121 (hppa-linux-gnu) compiled by GNU C version 5.3.1 20160121, GMP version 6.1.0, MPFR version 3.1.3-p5, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 26054780b51578997fdc10bfd741a0f3 COLLECT_GCC_OPTIONS='-v' '-o' '/dev/null' as -v -o /tmp/ccuV3ojv.o /tmp/ccnsiCwf.s GNU assembler version 2.25.90 (hppa-linux-gnu) using BFD version (GNU Binutils for Debian) 2.25.90.20160101 COMPILER_PATH=/usr/lib/gcc/hppa-linux-gnu/5/:/usr/lib/gcc/hppa-linux-gnu/5/:/usr/lib/gcc/hppa-linux-gnu/:/usr/lib/gcc/hppa-linux-gnu/5/:/usr/lib/gcc/hppa-linux-gnu/ LIBRARY_PATH=/usr/lib/gcc/hppa-linux-gnu/5/:/usr/lib/gcc/hppa-linux-gnu/5/../../../hppa-linux-gnu/:/usr/lib/gcc/hppa-linux-gnu/5/../../../:/lib/hppa-linux-gnu/:/lib/:/usr/lib/hppa-linux-gnu/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-o' '/dev/null' /usr/lib/gcc/hppa-linux-gnu/5/collect2 -plugin /usr/lib/gcc/hppa-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/hppa-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccrTnsON.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -dynamic-linker /lib/ld.so.1 -o /dev/null /usr/lib/gcc/hppa-linux-gnu/5/../../../hppa-linux-gnu/crt1.o /usr/lib/gcc/hppa-linux-gnu/5/../../../hppa-linux-gnu/crti.o /usr/lib/gcc/hppa-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/hppa-linux-gnu/5 -L/usr/lib/gcc/hppa-linux-gnu/5/../../../hppa-linux-gnu -L/usr/lib/gcc/hppa-linux-gnu/5/../../.. -L/lib/hppa-linux-gnu -L/usr/lib/hppa-linux-gnu /tmp/ccuV3ojv.o -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/hppa-linux-gnu/5/crtend.o /usr/lib/gcc/hppa-linux-gnu/5/../../../hppa-linux-gnu/crtn.o /usr/bin/ld: final link failed: File truncated collect2: error: ld returned 1 exit status 1 -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils