* [PATCH] configure: Account CXXFLAGS in gcc-plugin.m4.
@ 2021-12-10 23:23 Iain Sandoe
2021-12-14 21:59 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Iain Sandoe @ 2021-12-10 23:23 UTC (permalink / raw)
To: gcc-patches
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(+)
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
index 8f278719118..7ee342fe5fe 100644
--- a/config/gcc-plugin.m4
+++ b/config/gcc-plugin.m4
@@ -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
diff --git a/gcc/configure b/gcc/configure
index de20e5d2629..5470987b62f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -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
diff --git a/libcc1/configure b/libcc1/configure
index b198b0b9074..01cfb2806da 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -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
--
2.24.3 (Apple Git-128)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] configure: Account CXXFLAGS in gcc-plugin.m4.
2021-12-10 23:23 [PATCH] configure: Account CXXFLAGS in gcc-plugin.m4 Iain Sandoe
@ 2021-12-14 21:59 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2021-12-14 21:59 UTC (permalink / raw)
To: iain, gcc-patches; +Cc: Iain Sandoe
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-14 21:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 23:23 [PATCH] configure: Account CXXFLAGS in gcc-plugin.m4 Iain Sandoe
2021-12-14 21:59 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).