Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GCC 13.1 build issues

137 views
Skip to first unread message

David Richards

unread,
Apr 30, 2023, 2:11:25 PM4/30/23
to
Hello - GCC 13.1 fails to build:
Debian 10 (Buster - X86-64 bit system)
Configured with:
configure --prefix=/usr/local/GCC --disable-nls --disable-multilib --enable-languages=c,c++
Building with gcc/g++ 12.2
Any insights - much appreciated (to say the least)!

I get as far as a stage 3 build and then it fails during linking with this message:

/usr/bin/ld: .libs/hwasan.o: relocation R_X86_64_PC32 against undefined symbol `__ehdr_start' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:559: libhwasan.la] Error 1

The whole link attempt looks like this:

libtool: link: /home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc/xgcc -shared-libgcc -B/home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc -nostdinc++ -L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src -L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/local/GCC/x86_64-pc-linux-gnu/bin/ -B/usr/local/GCC/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/GCC/x86_64-pc-linux-gnu/include -isystem /usr/local/GCC/x86_64-pc-linux-gnu/sys-include -fPIC -DPIC -shared -nostdlib /lib/x86_64-linux-gnu/crti.o /home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc/crtbeginS.o .libs/hwasan_allocation_functions.o .libs/hwasan_allocator.o .libs/hwasan.o .libs/hwasan_dynamic_shadow.o .libs/hwasan_exceptions.o .libs/hwasan_fuchsia.o .libs/hwasan_globals.o .libs/hwasan_interceptors.o .libs/hwasan_interceptors_vfork.o .libs/hwasan_linux.o .libs/hwasan_memintrinsics.o .libs/hwasan_new_delete.o .libs/hwasan_poisoning.o .libs/hwasan_report.o .libs/hwasan_setjmp_aarch64.o .libs/hwasan_setjmp_x86_64.o .libs/hwasan_tag_mismatch_aarch64.o .libs/hwasan_thread.o .libs/hwasan_thread_list.o .libs/hwasan_type_test.o -Wl,--whole-archive ../sanitizer_common/.libs/libsanitizer_common.a ../interception/.libs/libinterception.a ../libbacktrace/.libs/libsanitizer_libbacktrace.a -Wl,--no-whole-archive -Wl,-rpath -Wl,/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -Wl,-rpath -Wl,/usr/local/GCC/lib/../lib64 -L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src -L/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -ldl -lrt -lpthread ../../libstdc++-v3/src/.libs/libstdc++.so -lm -L/home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -lc -lgcc_s /home/odysseus/Downloads/gcc-13.1.0/objdir/./gcc/crtendS.o /lib/x86_64-linux-gnu/crtn.o -mshstk -Wl,-soname -Wl,libhwasan.so.0 -o .libs/libhwasan.so.0.0.0
/usr/bin/ld: .libs/hwasan.o: relocation R_X86_64_PC32 against undefined symbol `__ehdr_start' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:559: libhwasan.la] Error 1
make[4]: Leaving directory '/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libsanitizer/hwasan'
make[3]: *** [Makefile:532: all-recursive] Error 1
make[3]: Leaving directory '/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libsanitizer'
make[2]: *** [Makefile:419: all] Error 2
make[2]: Leaving directory '/home/odysseus/Downloads/gcc-13.1.0/objdir/x86_64-pc-linux-gnu/libsanitizer'
make[1]: *** [Makefile:19101: all-target-libsanitizer] Error 2
make[1]: Leaving directory '/home/odysseus/Downloads/gcc-13.1.0/objdir'
make: *** [Makefile:1082: all] Error 2


David Richards

unread,
Aug 18, 2023, 8:47:04 AM8/18/23
to
FYI to anyone who is curious: The issue was binutils - I upgraded to version 2.40 (careful, I installed it to /usr/local/binutils not wanting to interfere with the rest of the system) and set my LD_LIBRARY_PATH accordingly. After which building GCC 13.2 was successful!
0 new messages