Skip to content

Commit

Permalink
build: allow specifying custom linker flags
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
leoetlino committed Mar 29, 2024
1 parent f62a726 commit 00568fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions toolchain/ToolchainNX64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 00568fb

Please sign in to comment.