https://sourceware.org/bugzilla/show_bug.cgi?id=20006
Bug ID: 20006 Summary: Linking gcc and gold with ld.bfd with compressed debug sections fails on final close Product: binutils Version: 2.27 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: dilyan.palauzov at aegee dot org Target Milestone: --- When I compile binutils-gdb.git(3e2e34f86) with "/git/binutils-gdb/configure --enable-plugins --with-system-zlib --enable-gold --with-expat --with-python --disable-tui --with-system-readline && make && make install" and then compile gcc.git(a9ad7efd6e2b255) with "./configure --enable-host-shared --enable-threads=posix --enable-targets=all --enable-nls --with-linker-hash-style=gnu --with-system-zlib --disable-multilib --enable-languages=c,c++,jit,lto && make && make install" everything is fine. If I pass however to binutils/configure "--enable-compressed-debug-sections=all": /git/binutils-gdb/configure --enable-plugins --with-system-zlib --enable-gold --with-expat --with-python --disable-tui --with-system-readline --enable-compressed-debug-sections=all && make && make install and try to recompile gcc with the same options, I get at stage1: make[3]: Leaving directory '/git/gcc/host-x86_64-pc-linux-gnu/libdecnumber' make[3]: Entering directory '/git/gcc/host-x86_64-pc-linux-gnu/gcc' g++ -std=gnu++98 -no-pie -g -DIN_GCC -fPIC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -Wl,-z,relro,-O1 -o cc1 c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-array-notation.o c/c-fold.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-cilkplus.o c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o i386-c.o glibc-c.o \ cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a ../libiberty/pic/libiberty.a ../libdecnumber/libdecnumber.a -lisl -lmpc -lmpfr -lgmp -rdynamic -ldl -lz cc1: final close failed: Invalid operation collect2: error: ld returned 1 exit status ../.././gcc/c/Make-lang.in:71: recipe for target 'cc1' failed make[3]: *** [cc1] Error 1 make[3]: Leaving directory '/git/gcc/host-x86_64-pc-linux-gnu/gcc' Makefile:4391: recipe for target 'all-stage1-gcc' failed make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory '/git/gcc' Makefile:20572: recipe for target 'stage1-bubble' failed make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory '/git/gcc' Makefile:913: recipe for target 'all' failed make: *** [all] Error 2 In fact, I cannot even link gold, when gas and ld.bfd are using compression: make -k make[4]: Leaving directory '/home/d/binutils/gold/testsuite' make[4]: Entering directory '/home/d/binutils/gold' g++ -W -Wall -Wstack-usage=262144 -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=dwp -pipe -O3 -static-libstdc++ -static-libgcc -Wl,-z,relro,-O1 -o dwp dwp.o libgold.a ../libiberty/libiberty.a -ldl -lz -ldl dwp: final close failed: Invalid operation collect2: error: ld returned 1 exit status Makefile:803: recipe for target 'dwp' failed make[4]: *** [dwp] Error 1 g++ -W -Wall -Wstack-usage=262144 -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=ld-new -pipe -O3 -static-libstdc++ -static-libgcc -Wl,-z,relro,-O1 -o ld-new main.o i386.o x86_64.o sparc.o powerpc.o arm.o arm-reloc-property.o tilegx.o mips.o aarch64.o aarch64-reloc-property.o s390.o libgold.a ../libiberty/libiberty.a -ldl -lz -ldl ld-new: final close failed: Invalid operation collect2: error: ld returned 1 exit status Makefile:809: recipe for target 'ld-new' failed make[4]: *** [ld-new] Error 1 g++ -W -Wall -Wstack-usage=262144 -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=incremental-dump -pipe -O3 -static-libstdc++ -static-libgcc -Wl,-z,relro,-O1 -o incremental-dump incremental-dump.o i386.o x86_64.o sparc.o powerpc.o arm.o arm-reloc-property.o tilegx.o mips.o aarch64.o aarch64-reloc-property.o s390.o libgold.a ../libiberty/libiberty.a -ldl -lz -ldl incremental-dump: final close failed: Invalid operation collect2: error: ld returned 1 exit status Makefile:806: recipe for target 'incremental-dump' failed make[4]: *** [incremental-dump] Error 1 make[4]: Target 'all-am' not remade because of errors. make[4]: Leaving directory '/home/d/binutils/gold' Makefile:940: recipe for target 'all-recursive' failed make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory '/home/d/binutils/gold' Makefile:691: recipe for target 'all' failed make[2]: *** [all] Error 2 make[2]: Leaving directory '/home/d/binutils/gold' Makefile:6080: recipe for target 'all-gold' failed make[1]: *** [all-gold] Error 2 make[2]: Entering directory '/home/d/binutils/gprof' For all compilations I use gcc 7.0.0 20160426 (a9ad7ef) and export CFLAGS="-pipe -O3" CXXFLAGS="-pipe -O3" LDFLAGS="-Wl,-z,relro,-O1" -- 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