diff options
author | costan <costan@google.com> | 2019-01-08 13:49:13 -0800 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2019-01-08 13:58:52 -0800 |
commit | b70493ca8586285b49e9888e2b528f71806bdc6e (patch) | |
tree | 23dcd893c28e53d8022661590a2475ad39d179fc /util | |
parent | af7abf06ea061222c2c34d98e1995c5a901f374f (diff) | |
download | leveldb-b70493ca8586285b49e9888e2b528f71806bdc6e.tar.gz |
Fix fdatasync() feature detection in opensource build.
The CMake feature-detection code used check_symbol_exists(), which
invokes the C compiler. However, some glibc versions don't expose the
fdatasync() declaration when compiled with -std=c11, but do expose it
when compiled with -std=c++11. This most likely comes down to how
_POSIX_SOURCE is defined -- it needs to be >= 201112L for <unistd.h> to
expose fdatasync().
This CL switches to check_cxx_symbol_exists(), which uses the C++
compiler. Asides from fixing the problem above, this is the right thing
to do, because we use <unistd.h> in env_posix.cc, which is compiled with
the C++ compiler.
This CL also fixes a previously introduced inconsistency, where the
macro indicating the fdatasync() feature detection result was referred
to as HAVE_FDATASYNC and HAVE_FUNC_FDATASYNC. The former appears to be
used in other libraries, so this CL switches all our references to
HAVE_FDATASYNC.
Fixes https://github.com/google/leveldb/issues/629
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=228392612
Diffstat (limited to 'util')
0 files changed, 0 insertions, 0 deletions