summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-05-29 12:23:33 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-05-29 12:56:40 -0700
commit9051b548274bffef9f41e720e1894d12cf68a47c (patch)
tree5b382dcf5ffd2a24dbdb58ebec70bfe0beac215c /config
parentPR fortran/95090 - ICE: identifier overflow (diff)
downloadgcc-9051b548274bffef9f41e720e1894d12cf68a47c.tar.gz
gcc-9051b548274bffef9f41e720e1894d12cf68a47c.tar.bz2
gcc-9051b548274bffef9f41e720e1894d12cf68a47c.tar.xz
Avoid nested save_CFLAGS and save_LDFLAGS
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4. config/ PR bootstrap/95413 * cet.m4: Replace save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS. gcc/ PR bootstrap/95413 * configure: Regenerated. libatomic/ PR bootstrap/95413 * configure: Regenerated. libbacktrace/ PR bootstrap/95413 * configure: Regenerated. libcc1/ PR bootstrap/95413 * configure: Regenerated. libcpp/ PR bootstrap/95413 * configure: Regenerated. libdecnumber/ PR bootstrap/95413 * configure: Regenerated. libgcc/ PR bootstrap/95413 * configure: Regenerated. libgfortran/ PR bootstrap/95413 * configure: Regenerated. libgomp/ PR bootstrap/95413 * configure: Regenerated. libiberty/ PR bootstrap/95413 * configure: Regenerated. libitm/ PR bootstrap/95413 * configure: Regenerated. libobjc/ PR bootstrap/95413 * configure: Regenerated. libphobos/ PR bootstrap/95413 * configure: Regenerated. libquadmath/ PR bootstrap/95413 * configure: Regenerated. libsanitizer/ PR bootstrap/95413 * configure: Regenerated. libssp/ PR bootstrap/95413 * configure: Regenerated. libstdc++-v3/ PR bootstrap/95413 * configure: Regenerated. libvtv/ PR bootstrap/95413 * configure: Regenerated. lto-plugin/ PR bootstrap/95413 * configure: Regenerated. zlib/ PR bootstrap/95413 * configure: Regenerated.
Diffstat (limited to 'config')
-rw-r--r--config/cet.m417
1 files changed, 9 insertions, 8 deletions
diff --git a/config/cet.m4 b/config/cet.m4
index 2bb2c8a95ac..911fbd46475 100644
--- a/config/cet.m4
+++ b/config/cet.m4
@@ -7,13 +7,14 @@ GCC_ENABLE(cet, auto, ,[enable Intel CET in target libraries],
7 permit yes|no|auto) 7 permit yes|no|auto)
8AC_MSG_CHECKING([for CET support]) 8AC_MSG_CHECKING([for CET support])
9 9
10# NB: Avoid nested save_CFLAGS and save_LDFLAGS.
10case "$host" in 11case "$host" in
11 i[[34567]]86-*-linux* | x86_64-*-linux*) 12 i[[34567]]86-*-linux* | x86_64-*-linux*)
12 case "$enable_cet" in 13 case "$enable_cet" in
13 auto) 14 auto)
14 # Check if target supports multi-byte NOPs 15 # Check if target supports multi-byte NOPs
15 # and if assembler supports CET insn. 16 # and if assembler supports CET insn.
16 save_CFLAGS="$CFLAGS" 17 cet_save_CFLAGS="$CFLAGS"
17 CFLAGS="$CFLAGS -fcf-protection" 18 CFLAGS="$CFLAGS -fcf-protection"
18 AC_COMPILE_IFELSE( 19 AC_COMPILE_IFELSE(
19 [AC_LANG_PROGRAM( 20 [AC_LANG_PROGRAM(
@@ -27,7 +28,7 @@ asm ("setssbsy");
27 ])], 28 ])],
28 [enable_cet=yes], 29 [enable_cet=yes],
29 [enable_cet=no]) 30 [enable_cet=no])
30 CFLAGS="$save_CFLAGS" 31 CFLAGS="$cet_save_CFLAGS"
31 ;; 32 ;;
32 yes) 33 yes)
33 # Check if assembler supports CET. 34 # Check if assembler supports CET.
@@ -64,7 +65,7 @@ AC_MSG_CHECKING([for CET support])
64case "$host" in 65case "$host" in
65 i[[34567]]86-*-linux* | x86_64-*-linux*) 66 i[[34567]]86-*-linux* | x86_64-*-linux*)
66 may_have_cet=yes 67 may_have_cet=yes
67 save_CFLAGS="$CFLAGS" 68 cet_save_CFLAGS="$CFLAGS"
68 CFLAGS="$CFLAGS -fcf-protection" 69 CFLAGS="$CFLAGS -fcf-protection"
69 case "$enable_cet" in 70 case "$enable_cet" in
70 auto) 71 auto)
@@ -93,7 +94,7 @@ asm ("setssbsy");
93 [AC_MSG_ERROR([assembler with CET support is required for --enable-cet])]) 94 [AC_MSG_ERROR([assembler with CET support is required for --enable-cet])])
94 ;; 95 ;;
95 esac 96 esac
96 CFLAGS="$save_CFLAGS" 97 CFLAGS="$cet_save_CFLAGS"
97 ;; 98 ;;
98 *) 99 *)
99 may_have_cet=no 100 may_have_cet=no
@@ -101,9 +102,9 @@ asm ("setssbsy");
101 ;; 102 ;;
102esac 103esac
103 104
104save_CFLAGS="$CFLAGS" 105cet_save_CFLAGS="$CFLAGS"
105CFLAGS="$CFLAGS -fcf-protection=none" 106CFLAGS="$CFLAGS -fcf-protection=none"
106save_LDFLAGS="$LDFLAGS" 107cet_save_LDFLAGS="$LDFLAGS"
107LDFLAGS="$LDFLAGS -Wl,-z,ibt,-z,shstk" 108LDFLAGS="$LDFLAGS -Wl,-z,ibt,-z,shstk"
108if test x$may_have_cet = xyes; then 109if test x$may_have_cet = xyes; then
109 # Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work. 110 # Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work.
@@ -159,6 +160,6 @@ if test x$enable_cet = xyes; then
159else 160else
160 AC_MSG_RESULT([no]) 161 AC_MSG_RESULT([no])
161fi 162fi
162CFLAGS="$save_CFLAGS" 163CFLAGS="$cet_save_CFLAGS"
163LDFLAGS="$save_LDFLAGS" 164LDFLAGS="$cet_save_LDFLAGS"
164]) 165])