Commit c36f800
Force PIE on bootgen with explicit compiler/linker flags, not just the CMake property
Same fix as #3333 (against main), carried forward here since this branch
replaces bootgen's CMakeLists.txt with the 2026.1 upstream-source layout.
The POSITION_INDEPENDENT_CODE property set on bootgen-lib/bootgen doesn't
actually force PIE: this project never calls check_pie_supported(), which
CMake's CMP0083 needs to turn that property into real -fPIE/-pie flags for
an executable target. Confirmed via readelf + strace that the wheel built
from #3327's own commit (main's earlier attempt at this) still ships a
non-PIE `bootgen` and segfaults (SIGSEGV/SEGV_ACCERR jumping into its own
non-executable DYNAMIC segment) once auditwheel repair patches in an RPATH
for vendored OpenSSL -- manylinux_2_28's gcc-toolset doesn't default to
PIE the way a distro's system gcc does.
Pass -fPIC/-fPIE/-pie explicitly, last, so they win over any inherited
-fno-pie/-fno-PIC via ordinary last-flag-wins compiler semantics. Verified
locally under a forced -fno-pie -fno-PIC -no-pie global configuration that
this reliably produces a true PIE (ET_DYN) bootgen, unlike the
property-only approach.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 980215d commit c36f800
1 file changed
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
143 | | - | |
144 | | - | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
182 | 196 | | |
183 | 197 | | |
184 | 198 | | |
| |||
203 | 217 | | |
204 | 218 | | |
205 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
206 | 229 | | |
207 | 230 | | |
208 | 231 | | |
| |||
0 commit comments