public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Latest libiberty update - Intel CET?
@ 2020-04-29 17:03 Simon Marchi
  2020-04-29 21:27 ` [PATCH] Sync config and libiberty with GCC H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2020-04-29 17:03 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils, gdb-patches

Hi Nick,

Since commit 56b1e56d2c2fa ("Rebase libiberty source with latest changes from gcc."), I get
this when libiberty gets configured:

  checking for CET support... configure: error: Intel CET must be enabled on Intel CET enabled host

Is it expected?  I don't really know what that means, but hopefully we don't have to pass
--enable-cet to every build.

In any case, something's not right, because the GCC_CET_HOST_FLAGS macro is not defined in
the binutils-gdb repo.  So when I `autoreconf -vf` libiberty, the configure script does
not get re-generated correctly.

Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] Sync config and libiberty with GCC
@ 2020-05-13  1:37 H.J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2020-05-13  1:37 UTC (permalink / raw)
  To: binutils

config/

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

libiberty/

	PR bootstrap/94998
	* configure: Regenerated.
---
 config/ChangeLog    |  9 +++++++++
 config/cet.m4       | 18 ++++++++++++------
 libiberty/ChangeLog |  5 +++++
 libiberty/configure | 12 +++++++++---
 4 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/config/ChangeLog b/config/ChangeLog
index ece21f28fb..de8c327b54 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,12 @@
+2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	Sync with GCC
+	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-29  H.J. Lu  <hongjiu.lu@intel.com>
 
 	Sync with GCC
diff --git a/config/cet.m4 b/config/cet.m4
index ea616b728a..d9608699cd 100644
--- a/config/cet.m4
+++ b/config/cet.m4
@@ -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"
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a757715850..f5691180e4 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -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
diff --git a/libiberty/configure b/libiberty/configure
index bb76cf1b82..3f82c5bb86 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -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"
-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-13  1:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 17:03 Latest libiberty update - Intel CET? Simon Marchi
2020-04-29 21:27 ` [PATCH] Sync config and libiberty with GCC H.J. Lu
2020-04-30  7:25   ` Nick Clifton
2020-05-13  1:37 H.J. Lu

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).