Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIRV and GLSLANG linker errors for examples #59

Closed
jopadan opened this issue Nov 19, 2023 · 7 comments
Closed

SPIRV and GLSLANG linker errors for examples #59

jopadan opened this issue Nov 19, 2023 · 7 comments

Comments

@jopadan
Copy link
Contributor

jopadan commented Nov 19, 2023

[ 98%] Linking CXX executable Island-Asterisks
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(shaderc.cc.o): in function `shaderc_compilation_result_spv_binary::~shaderc_compilation_result_spv_binary()':
(.text._ZN37shaderc_compilation_result_spv_binaryD2Ev[_ZN37shaderc_compilation_result_spv_binaryD5Ev]+0x13): undefined reference to `spvBinaryDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(shaderc.cc.o): in function `shaderc_compilation_result_spv_binary::~shaderc_compilation_result_spv_binary()':
(.text._ZN37shaderc_compilation_result_spv_binaryD0Ev[_ZN37shaderc_compilation_result_spv_binaryD5Ev]+0x13): undefined reference to `spvBinaryDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(spirv_tools_wrapper.cc.o): in function `shaderc_util::SpirvToolsDisassemble(shaderc_util::Compiler::TargetEnv, shaderc_util::Compiler::TargetEnvVersion, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
(.text+0x1e8): undefined reference to `spvtools::SpirvTools::SpirvTools(spv_target_env)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x35a): undefined reference to `spvtools::SpirvTools::SetMessageConsumer(std::function<void (spv_message_level_t, char const*, spv_position_t const&, char const*)>)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x388): undefined reference to `spvtools::SpirvTools::Disassemble(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned int) const'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x51c): undefined reference to `spvtools::SpirvTools::~SpirvTools()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(spirv_tools_wrapper.cc.o): in function `shaderc_util::SpirvToolsAssemble(shaderc_util::Compiler::TargetEnv, shaderc_util::Compiler::TargetEnvVersion, shaderc_util::string_piece, spv_binary_t**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
(.text+0x6cd): undefined reference to `spvContextCreate'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x70c): undefined reference to `spvTextToBinary'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xa75): undefined reference to `spvDiagnosticDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xa7f): undefined reference to `spvContextDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(spirv_tools_wrapper.cc.o): in function `shaderc_util::SpirvToolsOptimize(shaderc_util::Compiler::TargetEnv, shaderc_util::Compiler::TargetEnvVersion, std::vector<shaderc_util::PassId, std::allocator<shaderc_util::PassId> > const&, spvtools::OptimizerOptions&, std::vector<unsigned int, std::allocator<unsigned int> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
(.text+0xcd2): undefined reference to `spvValidatorOptionsCreate'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xce7): undefined reference to `spvValidatorOptionsSetSkipBlockLayout'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xcf4): undefined reference to `spvValidatorOptionsSetRelaxLogicalPointer'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xd01): undefined reference to `spvValidatorOptionsSetBeforeHlslLegalization'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xd11): undefined reference to `spvOptimizerOptionsSetValidatorOptions'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xd23): undefined reference to `spvOptimizerOptionsSetRunValidator'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xd50): undefined reference to `spvtools::Optimizer::Optimizer(spv_target_env)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xef9): undefined reference to `spvtools::Optimizer::SetMessageConsumer(std::function<void (spv_message_level_t, char const*, spv_position_t const&, char const*)>)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xf49): undefined reference to `spvtools::CreateCompactIdsPass()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xf56): undefined reference to `spvtools::Optimizer::RegisterPass(spvtools::Optimizer::PassToken&&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xf5e): undefined reference to `spvtools::Optimizer::PassToken::~PassToken()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0xf94): undefined reference to `spvtools::Optimizer::Run(unsigned int const*, unsigned long, std::vector<unsigned int, std::allocator<unsigned int> >*, spv_optimizer_options_t*) const'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x1062): undefined reference to `spvtools::Optimizer::~Optimizer()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x106c): undefined reference to `spvValidatorOptionsDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x10a6): undefined reference to `spvtools::Optimizer::RegisterPerformancePasses()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x10b6): undefined reference to `spvtools::Optimizer::RegisterLegalizationPasses()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x10c9): undefined reference to `spvtools::CreateStripDebugInfoPass()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x10d6): undefined reference to `spvtools::Optimizer::RegisterPass(spvtools::Optimizer::PassToken&&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x10e6): undefined reference to `spvtools::Optimizer::RegisterSizePasses()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(spirv_tools_wrapper.cc.o): in function `shaderc_util::SpirvToolsDisassemble(shaderc_util::Compiler::TargetEnv, shaderc_util::Compiler::TargetEnvVersion, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) [clone .cold]':
(.text.unlikely+0x78): undefined reference to `spvtools::SpirvTools::~SpirvTools()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(spirv_tools_wrapper.cc.o): in function `shaderc_util::SpirvToolsOptimize(shaderc_util::Compiler::TargetEnv, shaderc_util::Compiler::TargetEnvVersion, std::vector<shaderc_util::PassId, std::allocator<shaderc_util::PassId> > const&, spvtools::OptimizerOptions&, std::vector<unsigned int, std::allocator<unsigned int> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) [clone .cold]':
(.text.unlikely+0x1c6): undefined reference to `spvtools::Optimizer::~Optimizer()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text.unlikely+0x1d0): undefined reference to `spvValidatorOptionsDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text.unlikely+0x1fb): undefined reference to `spvtools::Optimizer::PassToken::~PassToken()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(compiler.cc.o): in function `shaderc_util::GlslangInitializer::GlslangInitializer()':
(.text+0x4a): undefined reference to `glslang::InitializeProcess()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(compiler.cc.o): in function `shaderc_util::GlslangInitializer::~GlslangInitializer()':
(.text+0xd9): undefined reference to `glslang::FinalizeProcess()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(compiler.cc.o): in function `shaderc_util::Compiler::PreprocessShader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, shaderc_util::string_piece const&, shaderc_util::string_piece const&, shaderc_util::CountingIncluder&) const':
(.text+0x66ca): undefined reference to `glslang::TShader::TShader(EShLanguage)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x670f): undefined reference to `glslang::TShader::setStringsWithLengthsAndNames(char const* const*, int const*, char const* const*, int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x6771): undefined reference to `glslang::TShader::setInvertY(bool)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x6780): undefined reference to `glslang::TShader::setNanMinMaxClamp(bool)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x683d): undefined reference to `glslang::TShader::preprocess(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, glslang::TShader::Includer&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x6851): undefined reference to `glslang::TShader::getInfoLog()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x6991): undefined reference to `glslang::TShader::getInfoLog()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x6a56): undefined reference to `glslang::TShader::~TShader()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(compiler.cc.o): in function `shaderc_util::Compiler::Compile(shaderc_util::string_piece const&, EShLanguage, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*, std::function<EShLanguage (std::ostream*, shaderc_util::string_piece const&)> const&, shaderc_util::CountingIncluder&, shaderc_util::Compiler::OutputType, std::ostream*, unsigned long*, unsigned long*) const':
(.text+0x768a): undefined reference to `glslang::TShader::TShader(EShLanguage)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x76dc): undefined reference to `glslang::TShader::setStringsWithLengthsAndNames(char const* const*, int const*, char const* const*, int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x76f9): undefined reference to `glslang::TShader::setEntryPoint(char const*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7709): undefined reference to `glslang::TShader::setAutoMapBindings(bool)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7727): undefined reference to `glslang::TShader::setAutoMapLocations(bool)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7742): undefined reference to `glslang::TShader::setShiftImageBinding(unsigned int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7756): undefined reference to `glslang::TShader::setShiftSamplerBinding(unsigned int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x776a): undefined reference to `glslang::TShader::setShiftTextureBinding(unsigned int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x777e): undefined reference to `glslang::TShader::setShiftUboBinding(unsigned int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7792): undefined reference to `glslang::TShader::setShiftSsboBinding(unsigned int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x77a6): undefined reference to `glslang::TShader::setShiftUavBinding(unsigned int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x77b6): undefined reference to `glslang::TShader::setHlslIoMapping(bool)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x77ca): undefined reference to `glslang::TShader::setResourceSetBinding(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_s
, std::allocator<char> > > > const&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x77f8): undefined reference to `glslang::TShader::setInvertY(bool)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7808): undefined reference to `glslang::TShader::setNanMinMaxClamp(bool)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x78a3): undefined reference to `glslang::TShader::parse(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x78b2): undefined reference to `glslang::TShader::getInfoLog()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7925): undefined reference to `glslang::TProgram::TProgram()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7967): undefined reference to `glslang::TProgram::link(EShMessages)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x797e): undefined reference to `glslang::TProgram::getInfoLog()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7a2e): undefined reference to `glslang::GlslangToSpv(glslang::TIntermediate const&, std::vector<unsigned int, std::allocator<unsigned int> >&, glslang::SpvOptions*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7ad1): undefined reference to `glslang::TProgram::~TProgram()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x7ad9): undefined reference to `glslang::TShader::~TShader()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x8159): undefined reference to `glslang::TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x84b0): undefined reference to `spvOptimizerOptionsCreate'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x84c7): undefined reference to `spvOptimizerOptionsSetPreserveBindings'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x858f): undefined reference to `spvOptimizerOptionsDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x8623): undefined reference to `glslang::TProgram::mapIO(glslang::TIoMapResolver*, glslang::TIoMapper*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x870b): undefined reference to `spvOptimizerOptionsDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(compiler.cc.o): in function `shaderc_util::Compiler::PreprocessShader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, shaderc_util::string_piece const&, shaderc_util::string_piece const&, shaderc_util::CountingIncluder&) const [clone .cold]':
(.text.unlikely+0x47b): undefined reference to `glslang::TShader::~TShader()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libshaderc_combined.a(compiler.cc.o): in function `shaderc_util::Compiler::Compile(shaderc_util::string_piece const&, EShLanguage, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*, std::function<EShLanguage (std::ostream*, shaderc_util::string_piece const&)> const&, shaderc_util::CountingIncluder&, shaderc_util::Compiler::OutputType, std::ostream*, unsigned long*, unsigned long*) const [clone .cold]':
(.text.unlikely+0x52e): undefined reference to `spvOptimizerOptionsDestroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text.unlikely+0x555): undefined reference to `glslang::TProgram::~TProgram()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: (.text.unlikely+0x567): undefined reference to `glslang::TShader::~TShader()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/Island-Asterisks.dir/build.make:115: Island-Asterisks] Error 1
make[1]: *** [CMakeFiles/Makefile2:399: CMakeFiles/Island-Asterisks.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
@tgfrerer
Copy link
Owner

Hmm, it looks like an issue with shaderc - could it be that the locally available version of shaderc might be out-of-date?

Which flavour of Linux (and version) are you working with? In case it's Arch Linux, it might be that the shaderc package is installed separately, and needs updating.

@jopadan
Copy link
Contributor Author

jopadan commented Nov 20, 2023

uname -a
6.6.1-gentoo #1 SMP PREEMPT_DYNAMIC Thu Nov  9 05:40:10 CET 2023 x86_64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz GenuineIntel GNU/Linux
shaderc -v
shaderc, bgfx shader compiler tool, version 1.18.118.
shaderc-2023.7

glslc --version
dev-util/spirv-tools-1.3.268
dev-util/glslang-1.3.268-r2
Target: SPIR-V 1.0

libtool --version
libtool (GNU libtool) 2.4.7
ld --version
GNU ld (Gentoo 2.41 p2) 2.41.0
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/13/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-13.2.1_p20231118/work/gcc-13-20231118/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/13 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/13/python --enable-objc-gc --enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada,m2 --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 13.2.1_p20231118 p10' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --enable-vtable-verify --with-zstd --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp --with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20231118 (Gentoo 13.2.1_p20231118 p10) 

@tgfrerer
Copy link
Owner

Oh nice, Gentoo! :)

the only thing that looks a bit strange is the output of shaderc ... on my system i don't have a separate shaderc executable, and shaderc is a tool that was originally developed by google and then became part of the Vulkan SDK, while bgfx is its own engine...

I see from the bgfx docs that it provides a tool called shaderc, and that, when globally installed on your system, might perhaps be clashing with the Vulkan shaderc library of the same name...

@simsilver
Copy link

change shaderc_combined to shaderc_shared in modules/le_shader_compiler/CMakeLists.txt fix this on fedora

@tgfrerer
Copy link
Owner

tgfrerer commented Dec 7, 2023

@simsilver that could be a workaround if a system does not provide shaderc_combined ...

Note that an Island application that was compiled against shaderc_shared will need to be bundled with libshaderc_shared.so in case it is not provided on the target system. Ideally, static Release builds are as self-contained as possible.

@simsilver
Copy link

simsilver commented Dec 8, 2023

Hmm, I have installed the shaderc_combined static lib, tried that if link with shaderc_combined, I need append "SPIRV MachineIndependent GenericCodeGen OGLCompiler OSDependent SPIRV-Tools SPIRV-Tools-opt" after shaderc_combined too on fedora, and the first 5 static lib from glslang-devel, last 2 shared lib from spirv-tools-libs

@tgfrerer
Copy link
Owner

tgfrerer commented Dec 8, 2023

@simsilver huh, looks like the shaderc_combined library is somehow different to what i have on ubuntu - or windows, for that matter... ideally, it shouldn't have to be this cumbersome to set it up. Could it be that your install is using a Fedora rpm package for shaderc, and not the version of shaderc that is provided with the Vulkan SDK tarball?

It's good to find out about these subtle differences between linux flavours, and installs... I think the default option should be to somehow find the local Vulkan SDK install, and use shaderc from there. I'm all ears for ideas of how this could be achieved more reliably :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants