Skip to content

Commit

Permalink
rocksdb: Define _GNU_SOURCE during fallocate CMake probe
Browse files Browse the repository at this point in the history
The glibc headers declare fallocate only if _GNU_SOURCE is defined.
Without this change, the probe fails with C compilers which do not
support implicit function declarations even if the system does in
fact support the fallocate function.

Upstream rocksdb does not need this because the probe is run with the
C++ compiler, and current g++ versions define _GNU_SOURCE
automatically.
  • Loading branch information
fweimer-rh committed Apr 11, 2023
1 parent 320a4b5 commit 50c034d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions storage/rocksdb/build_rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ option(WITH_FALLOCATE "build with fallocate" ON)
if(WITH_FALLOCATE AND UNIX)
include(CheckCSourceCompiles)
CHECK_C_SOURCE_COMPILES("
#define _GNU_SOURCE
#include <fcntl.h>
#include <linux/falloc.h>
int main() {
Expand Down

0 comments on commit 50c034d

Please sign in to comment.