google / amber

Amber is a multi-API shader test framework
Apache License 2.0
197 stars 65 forks source link

Ubuntu bot swiftshader build #754

Closed dj2 closed 4 years ago

dj2 commented 4 years ago

The Ubuntu clang bot currently uses clang-5.0 to build which doesn't seem to like swiftshader.

third_party/spirv-tools/source/opt/libSPIRV-Tools-opt.a third_party/swiftshader/libllvm.a -ldl third_party/spirv-tools/source/libSPIRV-Tools.a /usr/lib/x86_64-linux-gnu/librt.so && cd /tmpfs/src/github/amber/build/third_party/swiftshader && /usr/local/bin/cmake -E make_directory /tmpfs/src/github/amber/build/third_party/swiftshader/translator && /usr/local/bin/cmake -E copy /tmpfs/src/github/amber/build/third_party/swiftshader/libvk_swiftshader.so /tmpfs/src/github/amber/build/third_party/swiftshader/translator/lib64Vulkan_translator.so && /usr/local/bin/cmake -E make_directory /tmpfs/src/github/amber/build/Linux/ && /usr/local/bin/cmake -E copy /tmpfs/src/github/amber/build/third_party/swiftshader/libvk_swiftshader.so /tmpfs/src/github/amber/build/Linux/
/usr/bin/ld: third_party/swiftshader/CMakeFiles/vk_swiftshader.dir/src/Vulkan/VkDevice.cpp.o: relocation R_X86_64_PC32 against protected symbol `_ZTSN4marl9Allocator7DeleterE' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If/When the bot is updated to have a later clang, enable swiftshader integration tests on the bot.

jrprice commented 4 years ago

I hit this same issue with the Clspv + clvk + SwiftShader bot. There seems to be a known issue with the particular version of GNU ld on those images. I managed to workaround it by using gold instead of GNU ld: https://github.com/google/clspv/blob/master/kokoro/scripts/linux/build-clvk.sh#L113-L116