Skip to content

Enable PIC before descending into src/arch/${CMAKE_SYSTEM_PROCESSOR}

Simon McVittie requested to merge smcv/syscall-intercept:i386-port into i386-port

We're relying on having set CMAKE_POSITION_INDEPENDENT_CODE to ON before adding any libraries, but src/arch/${CMAKE_SYSTEM_PROCESSOR}/CMakeLists.txt adds a library, so we had better not descend into that subdirectory until after we have selected PIC.

Otherwise the x86_64 build will fail with:

/usr/bin/ld: syscall_intercept_scoped.o: relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
syscall_intercept_scoped.o: could not read symbols: Bad value

on systems that do not already default to PIC or PIE.

Signed-off-by: Simon McVittie smcv@collabora.com Fixes: 4ea95df6 "Move syscall_formats to arch specific directory"

Merge request reports