Commit a2d14f6
COMP: Enable position-independent code for src/ executables
Modern GCC on Ubuntu 22.04+ defaults to building PIE (position-
independent executables). When the ITK shared libraries are compiled
with -fPIC but the executables are not built with -fPIE, the typeinfo
for itk::ExceptionObject cannot be resolved at link time:
undefined reference to typeinfo for itk::ExceptionObject
warning: creating DT_TEXTREL in a PIE
Setting CMAKE_POSITION_INDEPENDENT_CODE=ON in src/CMakeLists.txt
ensures compatible code generation between the executables and the
ITK shared libraries they link against.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9dcea5e commit a2d14f6
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
0 commit comments