bkaradzic / bgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
https://bkaradzic.github.io/bgfx/overview.html
BSD 2-Clause "Simplified" License
15.11k stars 1.95k forks source link

Error linking shaderc #3366

Closed rncar closed 1 month ago

rncar commented 1 month ago

Describe the bug Error linking shaderc

Linking shaderc
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optRelease.a(name_mapper.o): in function `std::_Function_handler<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (unsigned int), spvtools::GetTrivialNameMapper[abi:cxx11]()::{lambda(unsigned int)#1}>::_M_invoke(std::_Any_data const&, unsigned int&&)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:34:(.text+0x19): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optRelease.a(name_mapper.o): in function `spvtools::FriendlyNameMapper::NameForId[abi:cxx11](unsigned int)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:53:(.text+0x624): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optRelease.a(name_mapper.o): in function `spvtools::FriendlyNameMapper::NameForEnumOperand[abi:cxx11](spv_operand_type_t, unsigned int)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:324:(.text+0xaf0): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optRelease.a(name_mapper.o): in function `spvtools::FriendlyNameMapper::SaveName(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:84:(.text+0x113f): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optRelease.a(name_mapper.o): in function `spvtools::FriendlyNameMapper::ParseInstruction(spv_parsed_instruction_t const&)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:286:(.text+0x2f77): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optRelease.a(name_mapper.o):/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:233: more undefined references to `spvtools::to_string[abi:cxx11](unsigned int)' follow
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optDebug.a(name_mapper.o): in function `spvtools::GetTrivialNameMapper[abi:cxx11]()::{lambda(unsigned int)#1}::operator()(unsigned int) const':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:34:(.text+0x31): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optDebug.a(name_mapper.o): in function `spvtools::FriendlyNameMapper::NameForId[abi:cxx11](unsigned int)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:53:(.text+0x1de): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optDebug.a(name_mapper.o): in function `spvtools::FriendlyNameMapper::SaveName(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:84:(.text+0x4d1): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optDebug.a(name_mapper.o): in function `spvtools::FriendlyNameMapper::ParseInstruction(spv_parsed_instruction_t const&)':
/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:203:(.text+0x1da7): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: /home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:224:(.text+0x2016): undefined reference to `spvtools::to_string[abi:cxx11](unsigned int)'
/usr/bin/ld: ../../linux64_gcc/bin/libspirv-optDebug.a(name_mapper.o):/home/vito/3ros/libs/bgfx/bgfx/.build/projects/gmake-linux/../../../3rdparty/spirv-tools/source/name_mapper.cpp:229: more undefined references to `spvtools::to_string[abi:cxx11](unsigned int)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [shaderc.make:323: ../../linux64_gcc/bin/shadercRelease] Error 1
make[1]: *** [Makefile:81: shaderc] Error 2

To Reproduce

../bx/tools/bin/linux/genie --with-tools --with-shared-lib --os=linux --gcc=linux-clang gmake
make -j12 build-linux
make -j12 tools

Additional context Linux archlinux 6.11.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Oct 2024 20:11:06 +0000 x86_64 GNU/Linux

git rev-parse HEAD
a183cf28c87fdad31f497603fc9c064b75d6252e
bkaradzic commented 1 month ago

Fixed: https://github.com/bkaradzic/bgfx/commit/76dde5d0b26e551296e55464c00a02f06aef7af8

Sorry about that.