RFR: JDK-8323008: filter out any -std* flags added by autoconf from CC/CXX
Christoph Langer
clanger at openjdk.org
Thu Jan 11 11:08:23 UTC 2024
On Tue, 9 Jan 2024 16:18:08 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> Strange, I noticed that for some reason the UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11) seems not to remove the flags as expected, did I misinterpret how UTIL_GET_NON_MATCHING_VALUES works ? Any ideas ? An `CXX=`echo $CXX | cut -d ' ' -f1`` extracted what we want (not sure if we want to do it that way, in case we have blanks in the CXX value ?
Hi Matthias,
I believe that I've figured out the problem with UTIL_GET_NON_MATCHING_VALUES. The string `-std=c++11` is interpreted as an option to GREP. This can be fixed by changing from `$GREP -Fvx "$legal_values" <<< "$values_to_check"` to
`$GREP -Fvx -- "$legal_values" <<< "$values_to_check"` in [this place in util.m4](https://github.com/openjdk/jdk/blob/b922f8d45951250b7c39cb179b9bc1a8a6256a9e/make/autoconf/util.m4#L202C5-L202C79). Note the `--` which marks the end of arguments and signals that `$legal_values` is the pattern.
I verified that it works.
Cheers
Christoph
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17301#issuecomment-1886889156
More information about the build-dev
mailing list