From 00568fbbabef0f9b4f227b7e3d513b3a1878a23e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 29 Mar 2024 20:23:40 +0000 Subject: [PATCH] build: allow specifying custom linker flags This is useful for people who want to link using recent versions of mold which are smart enough to e.g. optimise GOT loads; we need to pass --no-relax to disable those optimisations in order to get matching instructions. --- toolchain/ToolchainNX64.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toolchain/ToolchainNX64.cmake b/toolchain/ToolchainNX64.cmake index cbf6f1196..c518b2db7 100644 --- a/toolchain/ToolchainNX64.cmake +++ b/toolchain/ToolchainNX64.cmake @@ -41,6 +41,9 @@ add_link_options(-fPIC -Wl,-Bsymbolic-functions -shared) if (DEFINED UKING_LINKER) message(STATUS "Using custom linker: ${UKING_LINKER}") add_link_options(-fuse-ld=${UKING_LINKER}) + if (DEFINED UKING_LINKER_FLAGS) + add_link_options(${UKING_LINKER_FLAGS}) + endif() else() # Use lld for performance reasons (and because we don't want a dependency on GNU tools) add_link_options(-fuse-ld=lld)