Bug #1316
closedHAVE_SYNCFS, acconfig.h, #define HAVE_SYNCFS 1
0%
Description
While compile from source, i ran into the folowing Problem:
localhost ceph-0.31 # find -type f -name '*.h' -exec grep -iH 'syncfs' {} \; ./src/acconfig.h:/* Define to 1 if you have the `syncfs' function. */ ./src/acconfig.h:#define HAVE_SYNCFS 1 ./src/acconfig.h:/* we have syncfs */ ./src/acconfig.h:#define HAVE_SYS_SYNCFS 1 ./src/common/sync_filesystem.h: /* On Linux, newer versions of glibc have a function called syncfs that ./src/common/sync_filesystem.h:#ifdef HAVE_SYS_SYNCFS ./src/common/sync_filesystem.h: return syncfs(fd); /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -Wall -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -rdynamic -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -fno-strict-aliasing -Wnon-virtual-dtor -Wno-invalid-offsetof -Wstrict-null-sentinel -g -O2 -MT MonitorStore.lo -MD -MP -MF .deps/MonitorStore.Tpo -c -o MonitorStore.lo `test -f 'mon/MonitorStore.cc' || echo './'`mon/MonitorStore.cc g++ -DHAVE_CONFIG_H -I. -Wall -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -rdynamic -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -fno-strict-aliasing -Wnon-virtual-dtor -Wno-invalid-offsetof -Wstrict-null-sentinel -g -O2 -MT MonitorStore.lo -MD -MP -MF .deps/MonitorStore.Tpo -c mon/MonitorStore.cc -fPIC -DPIC -o .libs/MonitorStore.o In file included from mon/MonitorStore.cc:23: ./common/sync_filesystem.h: In function 'int sync_filesystem(int)': ./common/sync_filesystem.h:27: error: 'syncfs' was not declared in this scope make[3]: *** [MonitorStore.lo] Error 1 make[3]: Leaving directory `/usr/src/ceph-0.31/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/ceph-0.31/src' make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/src/ceph-0.31/src' make: *** [all-recursive] Error 1
To Build ceph, i removed the SYNC-FS Part from ./src/common/sync_filesystem.h
This should be corrected.
Installed glib-2.28.8 and glibc-2.14
Updated by Sage Weil over 12 years ago
- Translation missing: en.field_position set to 12
Updated by Sage Weil over 12 years ago
- Status changed from New to 4
Does it work if you
#define _GNU_SOURCE
#include <unistd.h>
?
Updated by Sage Weil over 12 years ago
- Status changed from 4 to Resolved
going to assume this is fixed unless i hear otherwise!
Updated by Michael Rack over 12 years ago
I added #define _GNU_SOURCE to ./src/common/sync_filesystem.h before #include <unistd.h> on line 35 - but this wont work for me.
Updated by Sage Weil over 12 years ago
- Status changed from Resolved to In Progress
weird. it looks like configure successfully links w/ syncfs, but there's no prototype. maybe your libc and -dev package versions don't match up? what os version are you running?
can you grep -r syncfs /usr/include?
Updated by Michael Rack over 12 years ago
grep does not find anything:
localhost ~ # grep -r syncfs /usr/include
localhost ~ #
OS: Gentoo Base System release 2.0.2
But i've compiled anything from source. I do not use portage.
I've installed the last version of libc (glibc-2.14.tar.gz).
In the glibc-2.14 source-code tree i've found the file ./posix/unistd.h containing "extern int syncfs (int __fd) __THROW;".
Ahhhhh: Now i traced down the problem:
I run "make install" again on the source-tree and saw, that the install prefix was "/", so anything is installed in /include.
localhost build1 # grep -r syncfs /include
/include/gnu/stubs-64.h:#define __stub_syncfs
/include/unistd.h:extern int syncfs (int __fd) __THROW;
So the problem results from a bad libc installation?
Updated by Sage Weil over 12 years ago
Sounds like it to me. If you install with /usr prefix does everything behave?
Updated by Sage Weil over 12 years ago
- Status changed from In Progress to Rejected
broken libc header install