(May 1, 2023 at 9:53 am)HappySkeptic Wrote: It tells you the problem:I've tried to do the following before running `configure`:
"recompile with -fPIC"
Google what that means. I've always used it in my UNIX or LINUX compiles. It doesn't make sense not to use it.
Code:
# Downgrade GCC to the one that comes with Debian.
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
# Tell "configure" to always add "-fPIC" when invoking GCC
export CFLAGS="-fPIC"
export CXXFLAGS=$CFLAGS
1. The error occurs at the Stage 2 of the compilation of GCC. That means the GCC being invoked isn't the GCC you have already installed on your system, but the newly-built GCC 13.1. It's the `xgcc`, the minimal GCC used to compile the rest of GCC. It shouldn't matter which version of GCC was used to produce `xgcc` in the Stage 1 (unless you assume there is some weird wrong-code bug).
2. Take a look at the invocation that occurs right before the error:
Code:
libtool: link: /home/teo/gcc-objdir/./gcc/xgcc -shared-libgcc -B/home/teo/gcc-objdir/./gcc -nostdinc++ -L/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libstdc++-v3/src -L/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -fPIC -DPIC -shared -nostdlib /usr/lib/x86_64-linux-gnu/crti.o /home/teo/gcc-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/teo/gcc-objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -Wl,-rpath -Wl,/usr/local/lib/../lib64 -L/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libstdc++-v3/src -L/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -ldl -lrt -lpthread ../../libstdc++-v3/src/.libs/libstdc++.so -lm -L/home/teo/gcc-objdir/./gcc -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -lc -lgcc_s /home/teo/gcc-objdir/./gcc/crtendS.o /usr/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