https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96240
Bug ID: 96240 Summary: Error in building gcc-11 with --disable-shared Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: 570070308 at qq dot com Target Milestone: --- Created attachment 48892 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48892&action=edit The full log file Successfully build gcc-11-20200705 and gcc-11-20200712 without --disable-shared or with --enabled-shared. Failed to build gcc-11-20200705 and gcc-11-20200712 with --disable-shared. My system is Ubuntu 20.10. Host gcc is gcc9.3 . The configure command is: ../gcc-11-20200712/configure -v --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,lto --prefix=/home/ig/temp2 --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- (--disable-shared or --enabled-shared) --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,amdgcn-amdhsa,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Part of the error log: /usr/bin/x86_64-linux-gnu-ld: /home/ig/temp/x86_64-linux-gnu/libstdc++-v3/src/.libs/libstdc++.a(eh_aux_runtime.o): relocation R_X86_64_PC32 against symbol `_ZTISt8bad_cast' can not be used when making a shared object; recompile with -fPIC /usr/bin/x86_64-linux-gnu-ld: final link failed: bad value make[9]: Nothing to be done for 'all'. make[9]: Leaving directory '/home/ig/temp/x86_64-linux-gnu/32/libstdc++-v3/src/c++11' Making all in c++17 collect2: error: ld returned 1 exit status make[3]: *** [Makefile:561: libcc1.la] Error 1 The full error log see the attachment I uploaded.