If _FORTIFY_SOURCE=2 is defined in the compilation environment, the WiredTiger sources fail to compile:
In file included from src/third_party/wiredtiger/src/async/async_op.c:9: In file included from src/third_party/wiredtiger/src/include/wt_internal.h:379: src/third_party/wiredtiger/src/include/os_fstream.i:55:14: error: no member named '__printf_chk' in 'struct __wt_fstream' return (fs->printf(session, fs, fmt, ap)); ~~ ^ /usr/include/x86_64-linux-gnu/bits/stdio2.h:108:3: note: expanded from macro 'printf' __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__) ^ In file included from src/third_party/wiredtiger/src/async/async_worker.c:9: In file included from src/third_party/wiredtiger/src/include/wt_internal.h:379: src/third_party/wiredtiger/src/include/os_fstream.i:55:14: error: no member named '__printf_chk' in 'struct __wt_fstream' return (fs->printf(session, fs, fmt, ap)); ~~ ^ /usr/include/x86_64-linux-gnu/bits/stdio2.h:108:3: note: expanded from macro 'printf' __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__) ^ 1 error generated.
This happens because when _FORTIFY_SOURCE is defined on a glibc environment, printf becomes a macro.
Note that this is legal under the standard, see http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html
The names of all library types, macros, variables and functions that come from the ISO C standard are reserved unconditionally.
- is depended on by
-
SERVER-23911 Add _FORTIFY_SOURCE=2 when building on glibc platforms
- Closed
- links to