Add support for using custom linker (e.g. mold)

This commit is contained in:
Léo Lam 2021-12-30 16:55:17 +01:00
parent 1ecd2959cb
commit 99e1bbf423
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741

View File

@ -38,5 +38,10 @@ add_definitions(-D MATCHING_HACK_NX_CLANG)
add_link_options(-stdlib=libc++ -nostdlib) add_link_options(-stdlib=libc++ -nostdlib)
add_link_options(-fPIC -Wl,-Bsymbolic-functions -shared) add_link_options(-fPIC -Wl,-Bsymbolic-functions -shared)
# Use lld for performance reasons (and because we don't want a dependency on GNU tools) if (DEFINED UKING_LINKER)
add_link_options(-fuse-ld=lld) message(STATUS "Using custom linker: ${UKING_LINKER}")
add_link_options(-fuse-ld=${UKING_LINKER})
else()
# Use lld for performance reasons (and because we don't want a dependency on GNU tools)
add_link_options(-fuse-ld=lld)
endif()