summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kryczka <ajkr@users.noreply.github.com>2024-04-11 12:46:15 -0700
committerAndrew Kryczka <andrew.kryczka2@gmail.com>2024-04-16 16:35:17 -0700
commitbcf88d48ce8aa8b536aee4dd305533b3b83cf435 (patch)
treefe238bea667245b45cf21157a19452899075f4a0
parentf6d01f0f6e31a8be6a52592760345557e980a270 (diff)
Skip io_uring feature test when building with fbcode (#12525)v9.1.0
Summary: Previously when building with fbcode and having a system install of liburing, it would link liburing from fbcode statically as well as the system library dynamically. That led to the following error: ``` ./db_stress: error while loading shared libraries: liburing.so.1: cannot open shared object file: No such file or directory ``` The fix is to skip the feature test for system liburing when `FBCODE_BUILD=true`. Pull Request resolved: https://github.com/facebook/rocksdb/pull/12525 Test Plan: - `make clean && make ROCKSDB_NO_FBCODE=1 V=1 -j56 db_stress && ./db_stress` - `make clean && make V=1 -j56 db_stress && ./db_stress` Reviewed By: anand1976 Differential Revision: D55997335 Pulled By: ajkr fbshipit-source-id: 17d8561100f41c6c9ae382a80c6cddc14f050bdc
-rwxr-xr-xbuild_tools/build_detect_platform36
1 files changed, 18 insertions, 18 deletions
diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform
index 72983c188..2e6d7bc20 100755
--- a/build_tools/build_detect_platform
+++ b/build_tools/build_detect_platform
@@ -163,24 +163,6 @@ case "$TARGET_OS" in
PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -latomic"
fi
PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lpthread -lrt -ldl"
- if test -z "$ROCKSDB_USE_IO_URING"; then
- ROCKSDB_USE_IO_URING=1
- fi
- if test "$ROCKSDB_USE_IO_URING" -ne 0; then
- # check for liburing
- $CXX $PLATFORM_CXXFLAGS -x c++ - -luring -o test.o 2>/dev/null <<EOF
- #include <liburing.h>
- int main() {
- struct io_uring ring;
- io_uring_queue_init(1, &ring, 0);
- return 0;
- }
-EOF
- if [ "$?" = 0 ]; then
- PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -luring"
- COMMON_FLAGS="$COMMON_FLAGS -DROCKSDB_IOURING_PRESENT"
- fi
- fi
# PORT_FILES=port/linux/linux_specific.cc
;;
SunOS)
@@ -614,6 +596,24 @@ EOF
fi
fi
+ if test -z "$ROCKSDB_USE_IO_URING"; then
+ ROCKSDB_USE_IO_URING=1
+ fi
+ if [ "$ROCKSDB_USE_IO_URING" -ne 0 -a "$PLATFORM" = OS_LINUX ]; then
+ # check for liburing
+ $CXX $PLATFORM_CXXFLAGS -x c++ - -luring -o test.o 2>/dev/null <<EOF
+ #include <liburing.h>
+ int main() {
+ struct io_uring ring;
+ io_uring_queue_init(1, &ring, 0);
+ return 0;
+ }
+EOF
+ if [ "$?" = 0 ]; then
+ PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -luring"
+ COMMON_FLAGS="$COMMON_FLAGS -DROCKSDB_IOURING_PRESENT"
+ fi
+ fi
fi
# TODO(tec): Fix -Wshorten-64-to-32 errors on FreeBSD and enable the warning.