]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Enable CET in cross compiler if possible
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 12 May 2020 17:39:42 +0000 (10:39 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 12 May 2020 17:39:54 +0000 (10:39 -0700)
Don't perform CET run-time check for host when cross compiling.  Instead,
enable CET in cross compiler if possible so that it will run on both CET
and non-CET hosts.

config/

PR bootstrap/94998
* cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if
possible.

libiberty/

PR bootstrap/94998
* configure: Regenerated.

lto-plugin/

PR bootstrap/94998
* configure: Regenerated.

config/ChangeLog
config/cet.m4
libiberty/ChangeLog
libiberty/configure
lto-plugin/ChangeLog
lto-plugin/configure

index 5ab14d97559e0692c1c94bd6f034561d6d84ba1c..8a8b2cbc89a3b52535fecb2b2af13d1c3f6cfe5d 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR bootstrap/94998
+       * cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if
+       possible.
+
 2020-04-28  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR bootstrap/94739
index ea616b728a99095a08e4818e6f047d653e61e21f..d9608699cd521a72e38a1e6184ffbd1862b4622b 100644 (file)
@@ -111,7 +111,8 @@ if test x$may_have_cet = xyes; then
 fi
 
 if test x$may_have_cet = xyes; then
-  AC_TRY_RUN([
+  if test x$cross_compiling = xno; then
+    AC_TRY_RUN([
 static void
 foo (void)
 {
@@ -137,12 +138,17 @@ main ()
   bar ();
   return 0;
 }
-  ],
-  [have_cet=no],
-  [have_cet=yes])
-  if test x$enable_cet = xno -a x$have_cet = xyes; then
-    AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
+    ],
+    [have_cet=no],
+    [have_cet=yes])
+    if test x$enable_cet = xno -a x$have_cet = xyes; then
+      AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
+    fi
   fi
+else
+  # Enable CET in cross compiler if possible so that it will run on both
+  # CET and non-CET hosts.
+  have_cet=yes
 fi
 if test x$enable_cet = xyes; then
   $1="-fcf-protection"
index a757715850999f44dc2e620db428ec6c66444bd2..f5691180e4004a9bd2fdd30f4768e677bc8fbc63 100644 (file)
@@ -1,3 +1,8 @@
+2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR bootstrap/94998
+       * configure: Regenerated.
+
 2020-04-28  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR bootstrap/94739
index bb76cf1b823c104314d1af4ea2d11304b9e212f8..3f82c5bb865cb09edd605138a8e7bf98c32f3f45 100755 (executable)
@@ -5375,7 +5375,8 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 
 if test x$may_have_cet = xyes; then
-  if test "$cross_compiling" = yes; then :
+  if test x$cross_compiling = xno; then
+    if test "$cross_compiling" = yes; then :
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run test program while cross compiling
@@ -5420,9 +5421,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-  if test x$enable_cet = xno -a x$have_cet = xyes; then
-    as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+    if test x$enable_cet = xno -a x$have_cet = xyes; then
+      as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+    fi
   fi
+else
+  # Enable CET in cross compiler if possible so that it will run on both
+  # CET and non-CET hosts.
+  have_cet=yes
 fi
 if test x$enable_cet = xyes; then
   CET_HOST_FLAGS="-fcf-protection"
index 9ce708dfb30702b9c5223c8814a795a9524a1535..7be98a1a12e786d7efb40f50dcabefc483107959 100644 (file)
@@ -1,3 +1,8 @@
+2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR bootstrap/94998
+       * configure: Regenerated.
+
 2020-05-05  Eric Botcazou  <ebotcazou@adacore.com>
 
        * lto-plugin.c: Document -linker-output-auto-notlo-rel option.
index 1baf6cc70b852efbee76804d862daecf01a2b53e..36c6ecc5875ddf13b4bcd85f7f2317f7a99690f7 100755 (executable)
@@ -5768,7 +5768,8 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 
 if test x$may_have_cet = xyes; then
-  if test "$cross_compiling" = yes; then :
+  if test x$cross_compiling = xno; then
+    if test "$cross_compiling" = yes; then :
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run test program while cross compiling
@@ -5813,9 +5814,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-  if test x$enable_cet = xno -a x$have_cet = xyes; then
-    as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+    if test x$enable_cet = xno -a x$have_cet = xyes; then
+      as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+    fi
   fi
+else
+  # Enable CET in cross compiler if possible so that it will run on both
+  # CET and non-CET hosts.
+  have_cet=yes
 fi
 if test x$enable_cet = xyes; then
   CET_HOST_FLAGS="-fcf-protection"
@@ -11941,7 +11947,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11944 "configure"
+#line 11950 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12047,7 +12053,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12050 "configure"
+#line 12056 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H