Notes |
|
(0024773)
|
David Cole
|
2011-01-17 12:26
|
|
Brad,
I can reproduce this, but I'm not 100% certain about what's going wrong yet... Is this just a short-coming of CheckFunctionExists, or is this a real problem that needs fixing? |
|
|
(0024774)
|
Brad King
|
2011-01-17 12:50
|
|
The effective test source file used by the try_compile is:
$ cat test.c
char fdatasync();
int main(void) {
fdatasync();
return 0;
}
which does compile:
$ gcc test.c
The CheckSymbolExists module is better because it actually ensures there is a declaration in the header file. |
|
|
(0024775)
|
Brad King
|
2011-01-17 12:51
|
|
$ nm /usr/lib/libSystem.B.dylib |grep fdatasync
00000000000b46f0 t ___fdatasync
00000000000b46f0 T _fdatasync |
|
|
(0024776)
|
Brad King
|
2011-01-17 12:52
|
|
$ grep fdatasync /usr/include/* /usr/include/sys/*
/usr/include/sys/syscall.h:#define SYS_fdatasync 187 |
|
|
(0024784)
|
Brad King
|
2011-01-17 14:08
|
|
I clarified the documentation of the module to state exactly what is checked:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=114c3224 [^]
In that sense this is "fixed".
Use CheckSymbolExists to verify that a declaration is available too. Use CheckCSourceCompiles to try compiling and linking an actual call to the function. |
|