Toolchain: Set CMAKE_NM for Clang and GNU toolchain files

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.
This commit is contained in:
Andrew Kaster 2022-02-19 12:51:19 -07:00 committed by Andreas Kling
parent 7dcfb82e16
commit 7b0f3b6811
Notes: sideshowbarker 2024-07-17 18:31:14 +09:00
2 changed files with 6 additions and 4 deletions

View File

@ -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")

View File

@ -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_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(CMAKE_AR ${TOOLCHAIN_PREFIX}gcc-ar)
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
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")