in liburing,
https://github.com/axboe/liburing/commit/
75cad68b953fe0fabbc4b1ced1ab4ba0ed5da18e
partially reverts
https://github.com/axboe/liburing/commit/
4e360f71131918c36774f51688e5c65dea8d43f2,
which builds liburing.a with -fPIC.
so we need to pass -fPIC by ourselves. otherwise we'd have
/usr/bin/ld: ../../liburing/src/liburing.a(setup.ol): relocation R_X86_64_PC32 against symbol `io_uring_queue_mmap' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
src/test/fio/CMakeFiles/fio_ceph_objectstore.dir/build.make:154: recipe for target 'lib/libfio_ceph_objectstore.so' failed
Signed-off-by: Kefu Chai <kchai@redhat.com>
ExternalProject_Add(liburing_ext
${source_dir_args}
CONFIGURE_COMMAND <SOURCE_DIR>/configure
- BUILD_COMMAND env CC=${CMAKE_C_COMPILER} ${make_cmd} -C src -s
+ BUILD_COMMAND env CC=${CMAKE_C_COMPILER} "CFLAGS=${CMAKE_C_FLAGS} -fPIC" ${make_cmd} -C src -s
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS "<SOURCE_DIR>/src/liburing.a"
INSTALL_COMMAND "")