fix(build): link the Linux library tests as PIE
The Linux loader takes the unnamed main image for guest code, as the relinker's ET_DYN output is. Fedora's GCC does not default to PIE, so the test executables were ET_EXEC and three loader tests failed.
This commit is contained in:
parent
57f96fd2b3
commit
c2a159bab7
|
|
@ -3,6 +3,12 @@ if(NOT WIN32)
|
|||
string(STRIP "${CMAKE_EXE_LINKER_FLAGS}" CMAKE_EXE_LINKER_FLAGS)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
include(CheckPIESupported)
|
||||
check_pie_supported(LANGUAGES C CXX)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
add_executable(nid_patcher
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nid/src/Sha1.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nid/src/NidCompute.cpp
|
||||
|
|
|
|||
Loading…
Reference in New Issue