On Sun, Feb 14, 2021 at 8:45 AM Harsh Rathod via Gcc-help <gcc-help@xxxxxxxxxxx> wrote: > > I'm trying to build GCC 10.2 from source on Fedora 33 with the following configuration: > [root@harshrathod gccgo]# ../gcc-10.2.0/configure --disable-shared --enable-languages=go --disable-multilib --with-ld=/usr/bin/ld.gold --enable-gold=yes > After configuration, I set up the $CXXFLAGS global variable: export CXXFLAGS="-fPIC" > But still, I get the error on make: > /usr/bin/ld.gold: error: /root/gccgo/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.a(cp-demangle.o): requires unsupported dynamic reloc 11; recompile with -fPICcollect2: error: ld returned 1 exit statusmake[3]: *** [Makefile:560: libcc1.la] Error 1make[3]: Leaving directory '/root/gccgo/libcc1'make[2]: *** [Makefile:436: all] Error 2make[2]: Leaving directory '/root/gccgo/libcc1'make[1]: *** [Makefile:18941: all-libcc1] Error 2make[1]: Leaving directory '/root/gccgo'make: *** [Makefile:1009: all] Error 2[root@harshrathod gccgo]# requires unsupported dynamic reloc 11; recompile with -fPIC-bash: requires: command not found-bash: recompile: command not found[root@harshrathod gccgo]# > Even though I used the -fPIC flag, why do I still get this error? Did I set the global variable wrong way? Please help me understand what is going on. While trying to reproduce this I spent an awful amount of time on learning that trying to build gcc (--enable-languages=c,c++ --disable-multilib) without findutils installed leads to this puzzling error, which in no way seems to bear any connection to a missing command: make[3]: Entering directory '/build/gcbuild/gcc' /build/gcbuild/./prev-gcc/xg++ -B/build/gcbuild/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/build/gcbuild/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/build/gcbuild/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -I/build/gcbuild/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/build/gcbuild/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -I/build/gcc-10.2.0/libstdc++-v3/libsupc++ -L/build/gcbuild/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/build/gcbuild/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -static-libstdc++ -static-libgcc -no-pie -o build/genmddeps \ build/genmddeps.o build/read-md.o build/errors.o .././libiberty/libiberty.a /usr/bin/ld: build/read-md.o: in function `md_reader::~md_reader()': read-md.c:(.text+0x1e43): undefined reference to `operator delete(void*, unsigned long)' /usr/bin/ld: build/read-md.o: in function `noop_reader::~noop_reader()': read-md.c:(.text._ZN11noop_readerD0Ev[_ZN11noop_readerD5Ev]+0x1a): undefined reference to `operator delete(void*, unsigned long)' /usr/bin/ld: build/read-md.o:(.rodata._ZTV9md_reader[_ZTV9md_reader]+0x20): undefined reference to `__cxa_pure_virtual' collect2: error: ld returned 1 exit status make[3]: *** [Makefile:2923: build/genmddeps] Error 1 make[3]: Leaving directory '/build/gcbuild/gcc' make[2]: *** [Makefile:4793: all-stage2-gcc] Error 2 make[2]: Leaving directory '/build/gcbuild' make[1]: *** [Makefile:27160: stage2-bubble] Error 2 make[1]: Leaving directory '/build/gcbuild' make: *** [Makefile:1007: all] Error 2 At least I can confirm that your problem is easily reproducible.