From c2a159bab7d8ce4672ae29ee471eceb4234036c2 Mon Sep 17 00:00:00 2001 From: ThatsLeo Date: Sat, 10 Oct 2026 15:57:34 +0200 Subject: [PATCH] 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. --- core/libs/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/libs/CMakeLists.txt b/core/libs/CMakeLists.txt index 32eb46fa5..91c9262aa 100644 --- a/core/libs/CMakeLists.txt +++ b/core/libs/CMakeLists.txt @@ -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