about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-12-03 21:11:32 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-12-03 21:11:32 +0100
commit9f917f7b411c307c34eb1bae85d72ffe26167523 (patch)
treec2717141667df8e757b9a792e9a75ffa164d74c0 /configure
parentf55e312bcd6582b5ff68fdcc1781c7017796dc91 (diff)
downloadglibc-9f917f7b411c307c34eb1bae85d72ffe26167523.tar.gz
glibc-9f917f7b411c307c34eb1bae85d72ffe26167523.tar.xz
glibc-9f917f7b411c307c34eb1bae85d72ffe26167523.zip
x86: Assume --enable-cet if GCC defaults to CET [BZ #25225]
This links in CET support if GCC defaults to CET.  Otherwise, __CET__
is defined, yet CET functionality is not compiled and linked into the
dynamic loader, resulting in a linker failure due to undefined
references to _dl_cet_check and _dl_open_check.

(cherry picked from commit 9fb8139079ef0bb1aa33a4ae418cbb113b9b9da7)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure23
1 files changed, 22 insertions, 1 deletions
diff --git a/configure b/configure
index fde57d63fe..c02753c0fe 100755
--- a/configure
+++ b/configure
@@ -3762,11 +3762,32 @@ else
 fi
 
 
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#ifndef __CET__
+#error no CET compiler support
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libc_cv_compiler_default_cet=yes
+else
+  libc_cv_compiler_default_cet=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 # Check whether --enable-cet was given.
 if test "${enable_cet+set}" = set; then :
   enableval=$enable_cet; enable_cet=$enableval
 else
-  enable_cet=no
+  enable_cet=$libc_cv_compiler_default_cet
 fi