Commit c803ce5
Force PIE on bootgen to fix non-deterministic PDI-generation segfault
bootgen has no dependency on MLIR/LLVM (it only links OpenSSL::SSL and
its own bootgen-lib), but it's configured as part of the same CMake
invocation as the rest of mlir-aie, so it silently inherits whatever
global compiler/linker defaults find_package(MLIR)/
include(HandleLLVMOptions) set for that run.
Building against the ROCm-built MLIR wheel (see the rocm-mlir-distro
migration) flips bootgen from a PIE executable to a non-PIE one, while
it still declares dynamic NEEDED libs and an RPATH. auditwheel repair's
patchelf-based RPATH rewrite (needed to point at vendored/renamed
OpenSSL libs) then corrupts that non-standard layout: the resulting
binary SIGSEGVs (SEGV_ACCERR) jumping into its own non-executable
DYNAMIC segment before main() even runs, on real Ryzen AI hardware, not
just in a sandbox. This broke PDI/xclbin generation for nearly every
programming_examples/*.lit test in
#3323.
Pin POSITION_INDEPENDENT_CODE ON directly on bootgen-lib and bootgen so
their ELF layout no longer depends on whatever the MLIR/LLVM package
happens to set globally. Verified locally: before the fix, `bootgen
-help` segfaults immediately (even under LD_TRACE_LOADED_OBJECTS=1,
i.e. before bootgen's own code runs); after, it links as a normal PIE
executable and runs correctly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 696ba5a commit c803ce5
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| |||
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| 169 | + | |
157 | 170 | | |
158 | 171 | | |
159 | 172 | | |
| |||
0 commit comments