Can't compile thunks on Arch Linux: undefined reference In Asahi Linux with a 4K page kernel, I installed the following dependencies with pacman: ``` git cmake ninja clang lld sdl2 libepoxy squashfs-tools squashfuse ``` I then attempted to build FEX with cmake options `-DBUILD_THUNKS=True` and `-DBUILD_TESTS=False` (if I omit `-DBUILD_THUNKS=True`, the build succeeds) with the following error: ``` FAILED: Bin/thunkgen : && /usr/bin/clang++ -flto=thin -fPIE -pie ThunkLibs/Generator/CMakeFiles/thunkgen.dir/main.cpp.o -o Bin/thunkgen ThunkLibs/Generator/libthunkgenlib.a -lclangTooling /usr/lib/libcrypto.so && : /usr/bin/ld: cannot find -lclangTooling: No such file or directory ``` If I place a symlink to libclang-cpp.so in /usr/lib named libclangTooling.so, I get the following error: ``` FAILED: Bin/thunkgen : && /usr/bin/clang++ -flto=thin -fPIE -pie ThunkLibs/Generator/CMakeFiles/thunkgen.dir/main.cpp.o -o Bin/thunkgen ThunkLibs/Generator/libthunkgenlib.a -lclangTooling /usr/lib/libcrypto.so && : /usr/bin/ld: /tmp/lto-llvm-004eb0.o: undefined reference to symbol '_ZN4llvm3vfs17getRealFileSystemEv@@LLVM_13' /usr/bin/ld: /usr/lib/libLLVM-13.so: error adding symbols: DSO missing from command line clang-13: error: linker command failed with exit code 1 (use -v to see invocation) ``` Using lld with `-DENABLE_LLD=True` yields a similar error: ``` FAILED: Bin/thunkgen : && /usr/bin/clang++ -flto=thin -fuse-ld=lld -fPIE -pie ThunkLibs/Generator/CMakeFiles/thunkgen.dir/main.cpp.o -o Bin/thunkgen ThunkLibs/Generator/libthunkgenlib.a -lclangTooling /usr/lib/libcrypto.so && : ld.lld: error: undefined symbol: llvm::vfs::getRealFileSystem() >>> referenced by main.cpp >>> lto.tmp:(main) ld.lld: error: undefined symbol: llvm::deallocate_buffer(void*, unsigned long, unsigned long) >>> referenced by main.cpp >>> lto.tmp:(llvm::MallocAllocator::Deallocate(void const*, unsigned long, unsigned long)) ld.lld: error: undefined symbol: llvm::SmallVectorBase::grow_pod(void*, unsigned long, unsigned long) >>> referenced by gen.cpp >>> lto.tmp:(llvm::SmallVectorTemplateCommon, llvm::PointerIntPairInfo > >, void>::grow_pod(unsigned long, unsigned long)) >>> referenced by gen.cpp >>> lto.tmp:(llvm::SmallVectorTemplateCommon, void>::grow_pod(unsigned long, unsigned long)) >>> referenced by gen.cpp >>> lto.tmp:(llvm::SmallVectorTemplateCommon::grow_pod(unsigned long, unsigned long)) ld.lld: error: undefined symbol: llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) >>> referenced by gen.cpp >>> lto.tmp:(clang::FunctionProtoType::getExceptionSpecSize(clang::ExceptionSpecificationType, unsigned int)) >>> referenced by gen.cpp >>> lto.tmp:(clang::RecursiveASTVisitor::TraverseAttr(clang::Attr*)) ld.lld: error: undefined symbol: llvm::allocate_buffer(unsigned long, unsigned long) >>> referenced by gen.cpp >>> lto.tmp:(llvm::MallocAllocator::Allocate(unsigned long, unsigned long)) ld.lld: error: undefined symbol: llvm::APInt::APInt(unsigned int, unsigned int, unsigned long const*) >>> referenced by gen.cpp >>> lto.tmp:(clang::APNumericStorage::getIntValue() const) ld.lld: error: undefined symbol: llvm::APInt::initSlowCase(unsigned long, bool) >>> referenced by gen.cpp >>> lto.tmp:(llvm::APInt::APInt(unsigned int, unsigned long, bool)) ld.lld: error: undefined symbol: llvm::APInt::countLeadingZerosSlowCase() const >>> referenced by gen.cpp >>> lto.tmp:(llvm::APInt::countLeadingZeros() const) clang-13: error: linker command failed with exit code 1 (use -v to see invocation) ```