https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96217
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to LE GARREC Vincent from comment #0) > Created attachment 48880 [details] > glibc-build.zip > > I work on Gentoo. I compiled gcc with -O0 and I was able to complete the > build (I didn't executed tests). > > But I try to compile glibc with gcc built with -O0. The log says : > > /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ > ld.bfd: /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/32/libgcc.a(_divdi3.o): in > function `__divdi3': > /var/tmp/portage/sys-devel/gcc-10.1.0-r2/work/gcc-10.1.0/libgcc/libgcc2.c: > 1246: undefined reference to `_Unwind_Resume' > /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ > ld.bfd: > /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/32/libgcc.a(_divdi3.o):(.data.rel. > local.DW.ref.__gcc_personality_v0[DW.ref.__gcc_personality_v0]+0x0): > undefined reference to `__gcc_personality_v0' > /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ > ld.bfd: /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/32/libgcc.a(_moddi3.o): in > function `__moddi3': > /var/tmp/portage/sys-devel/gcc-10.1.0-r2/work/gcc-10.1.0/libgcc/libgcc2.c: > 1269: undefined reference to `_Unwind_Resume' > > A simple test case is really hard because gcc successfully built small other > packages and I have no idea why I have this "undefined reference". > > I was able to compiling gcc with -O2 (with gcc built with -O0) then to build > glibc successfully. > > Please find enclosed the build.log of glibc. How did you build GCC with -O0? I never have any problems glibc build using GCC built with -O0. I configure GCC -O0 build with CC="gcc" CXX="g++" BOOT_CFLAGS="-O0 -g" CFLAGS="-O0 -g" BOOT_CXXFLAGS="-g" CXXFLAGS="-g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" /export/gnu/import/git/sources/gcc/configure --disable-bootstrap