Skip to content

Commit 2de0aab

Browse files
jgmelberandrej
andauthored
Update tools/bootgen/CMakeLists.txt
Co-authored-by: André Rösti <an.roesti@gmail.com>
1 parent c803ce5 commit 2de0aab

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

tools/bootgen/CMakeLists.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,9 @@ string(REPLACE "#include \"openssl/ms/applink.c\"" "" FILE_CONTENTS "${FILE_CONT
107107
file(WRITE ${BOOTGEN_SOURCE}/main.cpp "${FILE_CONTENTS}")
108108

109109
add_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
121113
set_target_properties(bootgen-lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
122114
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
123115
set(bootgen_warning_ignores

0 commit comments

Comments
 (0)