Skip to content

Commit

Permalink
Toolchain: Set CMAKE_NM for Clang and GNU toolchain files
Browse files Browse the repository at this point in the history
Make sure that we set CMAKE_NM, it's possible that some version of
CMake could choose a host nm binary instead of the ones we just built.

It's unlikely that host nm will understand our .dyn.relr segments unless
it's from binutils 2.38 or higher, so it might complain.
  • Loading branch information
ADKaster authored and awesomekling committed Feb 19, 2022
1 parent 7dcfb82 commit 7b0f3b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Toolchain/CMake/ClangToolchain.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ set(CMAKE_CXX_COMPILER_TARGET ${triple})
set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PATH}/clang)
set(CMAKE_ASM_COMPILER_TARGET ${triple})
set(CMAKE_LINKER ${TOOLCHAIN_PATH}/ld.lld)
set(CMAKE_AR ${TOOLCHAIN_PATH}/llvm-ar)
set(CMAKE_NM ${TOOLCHAIN_PATH}/llvm-nm)
set(CMAKE_OBJCOPY ${TOOLCHAIN_PATH}/llvm-objcopy)
set(CMAKE_RANLIB ${TOOLCHAIN_PATH}/llvm-ranlib)
set(CMAKE_STRIP ${TOOLCHAIN_PATH}/llvm-strip)
set(CMAKE_AR ${TOOLCHAIN_PATH}/llvm-ar)
set(SERENITY_CXXFILT ${TOOLCHAIN_PATH}/llvm-cxxfilt)
set(CMAKE_OBJCOPY ${TOOLCHAIN_PATH}/llvm-objcopy)

set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--hash-style=gnu,-z,relro,-z,now,-z,noexecstack,-z,max-page-size=0x1000,-z,separate-code")

Expand Down
5 changes: 3 additions & 2 deletions Toolchain/CMake/GNUToolchain.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}ld)
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}gcc-ranlib)
set(CMAKE_STRIP ${TOOLCHAIN_PREFIX}strip)
set(CMAKE_AR ${TOOLCHAIN_PREFIX}gcc-ar)
set(CMAKE_NM ${TOOLCHAIN_PREFIX}gcc-nm)
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}gcc-ranlib)
set(CMAKE_STRIP ${TOOLCHAIN_PREFIX}strip)
set(SERENITY_CXXFILT ${TOOLCHAIN_PREFIX}c++filt)

set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--hash-style=gnu,-z,relro,-z,now,-z,noexecstack,-z,max-page-size=0x1000,-z,separate-code")
Expand Down

0 comments on commit 7b0f3b6

Please sign in to comment.