Description:
The output from e.g "mysql_config --cflags" is based on compiler options used to build
server, server and client libs.
Some options is washed or removed as 3rd party software might not be as strict as MySQL
regarding errors and warnings.
For example we removed -Werror, -Wall, -O2 and -O3.
Newer gcc versions has added -Werror=format-security, this option is only valid if used
together with -O1 or higher. As we remove any -Ox format, we must remove
-Werror=format-security too. In fact it seems most safe to remove any option
on the format -Werror=foo.
How to repeat:
Configure build with e.g.
cmake ..
-DCMAKE_C_FLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic"
-DCMAKE_CXX_FLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic"
on Fedora 21 (vitro47) with gcc 4.9.2
Try to compile test app with resulting mysql_config like this:
gcc -o foo $(mysql_config --cflags) foo.c
Bonus:
write a mtr or other test to actual test that created mysql_config outputs valid gcc options.