@@ -107,17 +107,9 @@ string(REPLACE "#include \"openssl/ms/applink.c\"" "" FILE_CONTENTS "${FILE_CONT
107107file (WRITE ${BOOTGEN_SOURCE} /main.cpp "${FILE_CONTENTS} " )
108108
109109add_library (bootgen-lib STATIC ${libsources} )
110- # Force PIE/PIC explicitly rather than inheriting whatever the top-level
111- # project's global flags happen to be: bootgen has no dependency on
112- # MLIR/LLVM, but it's configured as part of the same CMake invocation, so it
113- # silently inherits global compiler/linker defaults set by
114- # find_package(MLIR)/include(HandleLLVMOptions) upstream. When those global
115- # defaults produce a non-PIE bootgen executable that still declares dynamic
116- # NEEDED libs and an RPATH, auditwheel repair's patchelf-based RPATH rewrite
117- # has been observed to corrupt the binary (jumps into the non-executable
118- # DYNAMIC segment at runtime -- SIGSEGV/SEGV_ACCERR before main() even
119- # runs). Pinning PIE here keeps bootgen's ELF layout the standard one
120- # patchelf actually exercises, independent of what MLIR/LLVM sets globally.
110+ # bootgen must be compiled with PIE/PIC, irrespective of the remainder of
111+ # the project, because auditwheel repair's patchelf-based RPATH rewrite
112+ # corrupts the non-PIE binary
121113set_target_properties (bootgen-lib PROPERTIES POSITION_INDEPENDENT_CODE ON )
122114if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" )
123115 set (bootgen_warning_ignores
0 commit comments