Created attachment 873502 [details] default LDFLAGS and -flto=thin media-libs/shaderc fails to build on llvm system FAILED: glslc/glslc : && /usr/lib/llvm/17/bin/clang++ -O3 -pipe -flto=thin -Wimplicit-fallthrough -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed glslc/CMakeFiles/glslc_exe.dir/src/main.cc.o -o glslc/glslc glslc/libglslc.a libshaderc_util/libshaderc_util.a libshaderc/libshaderc.a libshaderc_util/libshaderc_util.a -lSPIRV-Tools-opt -lSPIRV-Tools -lHLSL -lglslang -lOSDependent -lOGLCompiler -lglslang -lOSDependent -lOGLCompiler -lSPIRV && : ld.lld: error: undefined symbol: glslang::TShader::preprocess(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, glslang::TShader::Includer&) >>> referenced by compiler.cc >>> lto.tmp:(shaderc_util::Compiler::Compile(shaderc_util::string_piece const&, EShLanguage, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, char const*, std::__1::function<EShLanguage (std::__1::basic_ostream<char, std::__1::char_traits<char>>*, shaderc_util::string_piece const&)> const&, shaderc_util::CountingIncluder&, shaderc_util::Compiler::OutputType, std::__1::basic_ostream<char, std::__1::char_traits<char>>*, unsigned long*, unsigned long*) const) ld.lld: error: undefined symbol: glslang::TShader::setResourceSetBinding(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) >>> referenced by compiler.cc >>> lto.tmp:(shaderc_util::Compiler::Compile(shaderc_util::string_piece const&, EShLanguage, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, char const*, std::__1::function<EShLanguage (std::__1::basic_ostream<char, std::__1::char_traits<char>>*, shaderc_util::string_piece const&)> const&, shaderc_util::CountingIncluder&, shaderc_util::Compiler::OutputType, std::__1::basic_ostream<char, std::__1::char_traits<char>>*, unsigned long*, unsigned long*) const) ld.lld: error: undefined symbol: glslang::GlslangToSpv(glslang::TIntermediate const&, std::__1::vector<unsigned int, std::__1::allocator<unsigned int>>&, glslang::SpvOptions*) >>> referenced by compiler.cc >>> lto.tmp:(shaderc_util::Compiler::Compile(shaderc_util::string_piece const&, EShLanguage, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, char const*, std::__1::function<EShLanguage (std::__1::basic_ostream<char, std::__1::char_traits<char>>*, shaderc_util::string_piece const&)> const&, shaderc_util::CountingIncluder&, shaderc_util::Compiler::OutputType, std::__1::basic_ostream<char, std::__1::char_traits<char>>*, unsigned long*, unsigned long*) const) clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Created attachment 873503 [details] emerge --info
Created attachment 873504 [details] Wl,--undefined-version and -flto=thin
Created attachment 873505 [details] Wl,--undefined-version and no flto
Created attachment 873506 [details] gcc fallback also fails
Was able to compile by compiling both dev-util/spriv-tools and dev-util/glslang without lto
If it's an LTO issue, can you please report this upstream? Thanks
Is this still reproducible?
IIRC from discussion on irc, i got the impression that libstdc++/libc++ had been mixed, but this was a while ago