Bug #83949 USE WHITELIST INSTEAD OF FILTER FOR MYSQL_CONFIG COMPILE OPTIONS
Submitted: 24 Nov 2016 10:49 Modified: 13 Jan 2017 9:08
Reporter: Terje Røsten Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.17 OS:Any
Assigned to: CPU Architecture:Any

[24 Nov 2016 10:49] Terje Røsten
Description:
GCC and clang keep adding more and more compiler options we need to filter 
away for usage in mysql_config.

New, unwanted flags includes:

  -fasynchronous-unwind-tables
  -std=gnu++03
  -ffp-contract=off
  -fdebug-prefix-map=/build/mysql-5.7-Qw1sUd/mysql-5.7-5.7.15=.

not washing these flags makes mysql_config wrong and in some cases useless
as non-valid options is generated.

How to repeat:
Build server with flags above -DCMAKE_C_FLAGS= and -DCMAKE_CXX_FLAGS=" and
check contents of scripts/mysql_config.

For example:

cmake .. -DCMAKE_C_FLAGS=-ffp-contract=off -DCMAKE_CXX_FLAGS=-ffp-contract=off

and then run mysql_config from build tree:

scripts/mysql_config

and consider output (there are no need to build or "make install" to verify).

Suggested fix:
Accept only whitelist of good compiler options.
[13 Jan 2017 9:08] Terje Røsten
Fixed by:

commit 5ed9c1c52c93b3fb48bd1367b24f40a8fcef9dc3
Author: Tor Didriksen <tor.didriksen@oracle.com>
Date:   Wed Nov 16 14:01:42 2016 +0100

    Bug#25040566 USE WHITELIST INSTEAD OF FILTER FOR MYSQL_CONFIG COMPILE OPTIONS
    
    Remove blacklist of options entirely.
    Add (mostly empty) whitelist of options to pass to mysql_config
[13 Jan 2017 9:17] Terje Røsten
Fixed in 5.7.18.