Bug #80879 Allow '.' and '+' in compiler flags when generating mysql_config
Submitted: 29 Mar 2016 11:01 Modified: 15 Dec 2016 12:57
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6, 5.7, 5.7.11 OS:Any
Assigned to: CPU Architecture:Any

[29 Mar 2016 11:01] Alexey Kopytov
Description:
mysql_config is generated by CMake from the mysql_config.sh template. In
particular, CMake replaces @CFLAGS@ and @CXXFLAGS@ placeholders with
compiler flags used to build the server. CMake also prevents certain
compiler flags from appearing in mysql_config, see REPLACE_REGEX_OPTIONS
in scripts/CMakeLists.txt.

The problem is that the regexps used to remove -march=..., -mcpu=... and
-mtune=... options are incomplete, they assume those options to have
only alphanumerical symbols and dashes in their values.

On AArch64 (and perhaps some other architectures) GCC supports values
containing the plus sign in -mcpu, and dots in -mcpu, -mtune and
-march. When such values are specified, the mysql_config script
generated and installed by CMake is broken, i.e. reports invalid values
for --cflags and --cxxflags.

How to repeat:
Look at REPLACE_REGEX_OPTIONS in scripts/CMakeLists.txt.
Compare with possible -march, -mtune and -mcpu values here:
https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
[29 Mar 2016 11:19] MySQL Verification Team
Hello Alexey,

Thank you for the report.

Thanks,
Umesh
[30 Mar 2016 0:33] OCA Admin
Contribution submitted via Github - Bug #80879: Allow '.' and '+' in compiler flags when generating mysql_config 
(*) Contribution by Alexey Kopytov (Github akopytov, mysql-server/pull/64#issuecomment-202847280): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_64449497.txt (text/plain), 916 bytes.

[21 Nov 2016 11:03] Tor Didriksen
Posted by developer:
 
This is fixed in 5.7.16 by the patch for internal bug:

    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 and pkg-config.
[15 Dec 2016 12:57] Erlend Dahl
Fixed in 5.7.18, 8.0.1 under the heading of

Bug#25040566 USE WHITELIST INSTEAD OF FILTER FOR MYSQL_CONFIG COMPILE OPTIONS