8323008: filter out harmful -std* flags added by autoconf from CXX
Reviewed-by: erikj, clanger, ihse
This commit is contained in:
parent
7dc9dd6fdf
commit
68c4286026
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -389,6 +389,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
|
|||||||
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
|
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
|
||||||
CFLAGS="$ORG_CFLAGS"
|
CFLAGS="$ORG_CFLAGS"
|
||||||
CXXFLAGS="$ORG_CXXFLAGS"
|
CXXFLAGS="$ORG_CXXFLAGS"
|
||||||
|
|
||||||
|
# filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72
|
||||||
|
UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11)
|
||||||
|
CXX="$cxx_filtered"
|
||||||
])
|
])
|
||||||
|
|
||||||
# Check if a compiler is of the toolchain type we expect, and save the version
|
# Check if a compiler is of the toolchain type we expect, and save the version
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
@ -199,7 +199,7 @@ AC_DEFUN([UTIL_GET_NON_MATCHING_VALUES],
|
|||||||
if test -z "$legal_values"; then
|
if test -z "$legal_values"; then
|
||||||
$1="$2"
|
$1="$2"
|
||||||
else
|
else
|
||||||
result=`$GREP -Fvx "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
result=`$GREP -Fvx -- "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
||||||
$1=${result//$'\n'/ }
|
$1=${result//$'\n'/ }
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
@ -226,7 +226,7 @@ AC_DEFUN([UTIL_GET_MATCHING_VALUES],
|
|||||||
if test -z "$illegal_values"; then
|
if test -z "$illegal_values"; then
|
||||||
$1=""
|
$1=""
|
||||||
else
|
else
|
||||||
result=`$GREP -Fx "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
result=`$GREP -Fx -- "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
||||||
$1=${result//$'\n'/ }
|
$1=${result//$'\n'/ }
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user