When using the clang USE flag, portage will strip out -unwindlib=libunwind which causes linking error ld.lld: error: undefined symbol: _Unwind_Resume. Default behavior outputs the following in the build log: -- <<< Gentoo configuration >>> Build type RelWithDebInfo Install path /usr Compiler flags: C -march=native -O2 -pipe -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections C++ -march=native -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -fdiagnostics-color Linker flags: Executable -fuse-ld=lld -rtlib=compiler-rt -Wl,--color-diagnostics Module -fuse-ld=lld -rtlib=compiler-rt -Wl,-z,nodelete -Wl,--color-diagnostics Shared -fuse-ld=lld -rtlib=compiler-rt -Wl,-z,defs -Wl,-z,nodelete -Wl,--color-diagnostics Adding _FLAG_O_MATIC_ECLASS=1 to workaround the issue shows: -- <<< Gentoo configuration >>> Build type RelWithDebInfo Install path /usr Compiler flags: C -march=native -O2 -pipe -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections C++ -march=native -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -fdiagnostics-color Linker flags: Executable -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--color-diagnostics Module -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,-z,nodelete -Wl,--color-diagnostics Shared -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,-z,defs -Wl,-z,nodelete -Wl,--color-diagnostics Reproducible: Always Steps to Reproduce: 1. Compile the LLVM toolchain 2. Build libcxxabi with the clang USE flag and LDFLAGS="-rtlib=compiler-rt -unwindlib=libunwind" 3. Portage strips -unwindlib=libunwind Actual Results: In LLVM 15.0.2 resulted in failure with unresolved symbols to GCC's unwinder but I can't reproduce the failure since I bootstrapped the toolchain circa 15.0.2. Expected Results: Success with resolved symbols to LLVM's unwinder Behavior still persists, but no build failures since bootstrapping. I'm assuming an initial LLVM built by GCC and then attempt to bootstrap would retain the link time failure.
Created attachment 838007 [details] libcxxabi example stripping flags Portage strips -unwindlib=libunwind and libcxxabi fails to build.
Created attachment 838009 [details] libcxxabi example bypassing flag stripping Bypassing the stripping results in a proper build with -unwindlib=libunwind intact.