mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-16 04:47:32 +00:00
![Ryan Houdek](/assets/img/avatar_default.png)
While the ENABLE_LLD and ENABLE_MOLD options are nice, they don't handle the case when the linker of `lld` or `mold` doesn't match the compiler. This particularly crops up when overriding the C compiler to a new version of clang but the globally installed `ld.lld` is still the old clang version. This then causes clang to fail with unusual errors when upstream breaks compatibility with itself. Easy enough to use by passing the linker to cmake: `-DUSE_LINKER=/usr/bin/ld.lld-15` This also removes the ENABLE_LLD and ENABLE_MOLD options to use USE_LINKER directly. - ldd: `-DUSE_LINKER=lld` - mold: `-DUSE_LINKER=mold` Example of compiler failure when built with clang-15 but attempting to link with ld.lld 14: ```bash ld.lld-14: error: unittests/APITests/CMakeFiles/Filesystem.dir/Filesystem.cpp.o: Opaque pointers are only supported in -opaque-pointers mode (Producer: 'LLVM15.0.7' Reader: 'LLVM 14.0.6') ```