Skip to content

Commit

Permalink
Use bfd as linker for Linux ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
kneth committed Mar 4, 2024
1 parent c76524e commit 33146b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/realm/bindgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ if(DEFINED CMAKE_JS_VERSION)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
if(NODE_ARCH STREQUAL "arm")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/realm-core/tools/cmake/armv7-linux-gnueabihf.toolchain.cmake")
add_link_options(-fuse-ld=bfd)
# due to how multiarch works in debian this is needed to link to the correct system libraries
set(CMAKE_IGNORE_PATH "/usr/lib/x86_64-linux-gnu")
elseif(NODE_ARCH STREQUAL "arm64")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/realm-core/tools/cmake/aarch64-linux-gnu.toolchain.cmake")
set(CMAKE_IGNORE_PATH "/usr/lib/x86_64-linux-gnu")
add_link_options(-fuse-ld=gold)
elseif(NODE_ARCH STREQUAL "x64")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/realm-core/tools/cmake/x86_64-linux-gnu.toolchain.cmake")
add_link_options(-fuse-ld=gold)
endif()
add_link_options(-fuse-ld=gold)
add_link_options(-Wl,-z,noexecstack)
add_link_options(-Wl,--warn-execstack)
endif()
Expand Down

0 comments on commit 33146b3

Please sign in to comment.