configure: Account CXXFLAGS in gcc-plugin.m4.
Commit Message
While doing tests of the PCH changes, I noticed that all the
plugin tests were being omitted from m32 Darwin under some
permutations of flags. It turned out to be a broken config
test - it was not removing -mdynamic-no-pic properly.
We now use a C++ compiler so that we need to process CXXFLAGS
as well as CFLAGS in the gcc-plugin config fragment.
Tested on i686, x86_64-darwin, x86_64, powerpc64le-linux
OK for master?
backports?
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
config/ChangeLog:
* gcc-plugin.m4: Save and process CXXFLAGS.
gcc/ChangeLog:
* configure: Regenerate.
libcc1/ChangeLog:
* configure: Regenerate.
---
config/gcc-plugin.m4 | 5 +++++
gcc/configure | 5 +++++
libcc1/configure | 5 +++++
3 files changed, 15 insertions(+)
Comments
On 12/10/2021 4:23 PM, Iain Sandoe via Gcc-patches wrote:
> While doing tests of the PCH changes, I noticed that all the
> plugin tests were being omitted from m32 Darwin under some
> permutations of flags. It turned out to be a broken config
> test - it was not removing -mdynamic-no-pic properly.
>
> We now use a C++ compiler so that we need to process CXXFLAGS
> as well as CFLAGS in the gcc-plugin config fragment.
>
> Tested on i686, x86_64-darwin, x86_64, powerpc64le-linux
> OK for master?
> backports?
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
>
> config/ChangeLog:
>
> * gcc-plugin.m4: Save and process CXXFLAGS.
>
> gcc/ChangeLog:
>
> * configure: Regenerate.
>
> libcc1/ChangeLog:
>
> * configure: Regenerate.
OK
jeff
@@ -91,14 +91,18 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
# Check that we can build shared objects with -fPIC -shared
saved_LDFLAGS="$LDFLAGS"
saved_CFLAGS="$CFLAGS"
+ saved_CXXFLAGS="$CXXFLAGS"
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
CFLAGS="$CFLAGS -fPIC"
+ CXXFLAGS=`echo $CXXFLAGS | sed s/-mdynamic-no-pic//g`
+ CXXFLAGS="$CXXFLAGS -fPIC"
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
;;
*)
CFLAGS="$CFLAGS -fPIC"
+ CXXFLAGS="$CXXFLAGS -fPIC"
LDFLAGS="$LDFLAGS -fPIC -shared"
;;
esac
@@ -113,6 +117,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
fi
LDFLAGS="$saved_LDFLAGS"
CFLAGS="$saved_CFLAGS"
+ CXXFLAGS="$saved_CXXFLAGS"
# If plugin support had been requested but not available, fail.
if test x"$enable_plugin" = x"no" ; then
@@ -32038,14 +32038,18 @@ fi
# Check that we can build shared objects with -fPIC -shared
saved_LDFLAGS="$LDFLAGS"
saved_CFLAGS="$CFLAGS"
+ saved_CXXFLAGS="$CXXFLAGS"
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
CFLAGS="$CFLAGS -fPIC"
+ CXXFLAGS=`echo $CXXFLAGS | sed s/-mdynamic-no-pic//g`
+ CXXFLAGS="$CXXFLAGS -fPIC"
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
;;
*)
CFLAGS="$CFLAGS -fPIC"
+ CXXFLAGS="$CXXFLAGS -fPIC"
LDFLAGS="$LDFLAGS -fPIC -shared"
;;
esac
@@ -32077,6 +32081,7 @@ rm -f core conftest.err conftest.$ac_objext \
fi
LDFLAGS="$saved_LDFLAGS"
CFLAGS="$saved_CFLAGS"
+ CXXFLAGS="$saved_CXXFLAGS"
# If plugin support had been requested but not available, fail.
if test x"$enable_plugin" = x"no" ; then
@@ -15141,14 +15141,18 @@ fi
# Check that we can build shared objects with -fPIC -shared
saved_LDFLAGS="$LDFLAGS"
saved_CFLAGS="$CFLAGS"
+ saved_CXXFLAGS="$CXXFLAGS"
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
CFLAGS="$CFLAGS -fPIC"
+ CXXFLAGS=`echo $CXXFLAGS | sed s/-mdynamic-no-pic//g`
+ CXXFLAGS="$CXXFLAGS -fPIC"
LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
;;
*)
CFLAGS="$CFLAGS -fPIC"
+ CXXFLAGS="$CXXFLAGS -fPIC"
LDFLAGS="$LDFLAGS -fPIC -shared"
;;
esac
@@ -15180,6 +15184,7 @@ rm -f core conftest.err conftest.$ac_objext \
fi
LDFLAGS="$saved_LDFLAGS"
CFLAGS="$saved_CFLAGS"
+ CXXFLAGS="$saved_CXXFLAGS"
# If plugin support had been requested but not available, fail.
if test x"$enable_plugin" = x"no" ; then