Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 916312

Summary: media-libs/shaderc-2023.6 fails to compile 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>>*
Product: Gentoo Linux Reporter: Denis Strizhkin <strdenis02>
Component: Current packagesAssignee: Nick Sarnie <sarnex>
Status: RESOLVED WORKSFORME    
Severity: normal CC: jstein, sarnex, strdenis02
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: default LDFLAGS and -flto=thin
emerge --info
Wl,--undefined-version and -flto=thin
Wl,--undefined-version and no flto
gcc fallback also fails

Description Denis Strizhkin 2023-10-26 22:57:06 UTC
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)
Comment 1 Denis Strizhkin 2023-10-26 22:57:35 UTC
Created attachment 873503 [details]
emerge --info
Comment 2 Denis Strizhkin 2023-10-26 22:59:05 UTC
Created attachment 873504 [details]
Wl,--undefined-version and -flto=thin
Comment 3 Denis Strizhkin 2023-10-26 23:00:03 UTC
Created attachment 873505 [details]
Wl,--undefined-version and no flto
Comment 4 Denis Strizhkin 2023-10-26 23:01:00 UTC
Created attachment 873506 [details]
gcc fallback also fails
Comment 5 Denis Strizhkin 2023-10-27 00:24:42 UTC
Was able to compile by compiling both dev-util/spriv-tools and dev-util/glslang without lto
Comment 6 Nick Sarnie gentoo-dev 2023-10-30 01:16:11 UTC
If it's an LTO issue, can you please report this upstream? Thanks
Comment 7 Nick Sarnie gentoo-dev 2024-01-19 03:09:33 UTC
Is this still reproducible?
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-19 05:28:07 UTC
IIRC from discussion on irc, i got the impression that libstdc++/libc++ had been mixed, but this was a while ago