Found during FreeBSD exp run while building libjpeg-turbo
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198611
g++ -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -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-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-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 arm-c.o glibc-c.o \
cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a insn-modes.o ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -lmpc -lmpfr -lgmp -rdynamic -lz
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): no group info for section .data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): no group info for section .data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(compatibility.o): no group info for section .data.DW.ref._ZTIN10__cxxabiv115__forced_unwindE
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): no group info for section .data.DW.ref._ZTISt9bad_alloc
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): no group info for section .data.DW.ref._ZTISt9bad_alloc
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): invalid SHT_GROUP entry
/usr/local/bin/ld: /usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a(new_opv.o): no group info for section .data.DW.ref._ZTISt9bad_alloc
/usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd11.0/4.9.2/../../../libstdc++.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
This is building the gnatdroid-armv7 port, but presumably due to a broken libstdc++.a from the gcc 4.9.2 port.
compatibility.o and new_opv.o are extracted from libstdc++-unstripped.a
Should be fixed by [r3184].
--strip-debug should now work correctly with SHT_GROUP sections.
Related
Commit: [r3184]
It looks like the issue still exists at r3815 -- see the most recent updates in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198611
I will try to obtain more detail.
Ed, I finally realized I forgot to update the content of SHT_GROUP sections.
Of course the ld(1) won't work if the indices in the SHT_GROUP sections are pointing
to wrong sections... Sorry about being sloppy.
Please, if possible, make a new exp run for [r3207].
Ticket reopened.
Related
Commit: [r3207]
Latest exp-run shows there's still an issue; when building other software that uses the library the cross-gcc crashes:
http://package23.nyi.freebsd.org/data/headi386PR198611-default/2015-05-20_07h02m11s/logs/errors/gnatdroid-armv7-20141023.log
Last edit: Ed Maste 2015-05-20
I've opened a PR to track this issue in FreeBSD also - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200350
The failure is now rather different.
See Ticket #494 and Ticket #495 for further SHT_GROUP failures. It may be that the issue originally encountered here is fixed by r3207 and the new failure is due to issues reported in those tickets.
Ed, thanks for all the testing.
SHT_GROUP failures should be fixed now.
The gcc crash issue in this ticket should be fixed by [r3216].
From my own testing gnatdroid-armv7 is now building fine.
Although I guess a new exp-run is still needed.
Related
Commit: [r3216]
The exp-run PR (http://bugs.freebsd.org/198611) now has a patch to update FreeBSD to [r3222].
Related
Commit: [r3222]
Confirmed fixed with exp-run at r3223