summaryrefslogtreecommitdiff
path: root/packages/glibc
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2020-01-31 08:57:45 (GMT)
committerAlexey Neyman <stilor@att.net>2020-02-04 00:12:38 (GMT)
commitd35d2672782e682e8ef56e0e3a8f2bd5d9728fa5 (patch)
tree85044186b65e96821c7e5c01d7be0b0fada06fd3 /packages/glibc
parente503877f8a3cbbb56eeae3ba121aedd227bd67fc (diff)
Upstrean fix for CET-enabled compiler with no --enable-cet
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'packages/glibc')
-rw-r--r--packages/glibc/2.28/0001-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch82
-rw-r--r--packages/glibc/2.29/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch82
-rw-r--r--packages/glibc/2.30/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch80
3 files changed, 244 insertions, 0 deletions
diff --git a/packages/glibc/2.28/0001-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch b/packages/glibc/2.28/0001-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch
new file mode 100644
index 0000000..b3c82e1
--- /dev/null
+++ b/packages/glibc/2.28/0001-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch
@@ -0,0 +1,82 @@
+From 9f917f7b411c307c34eb1bae85d72ffe26167523 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 3 Dec 2019 21:11:32 +0100
+Subject: [PATCH] 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)
+---
+ NEWS | 1 +
+ configure | 23 ++++++++++++++++++++++-
+ configure.ac | 9 ++++++++-
+ 3 files changed, 31 insertions(+), 2 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
+
+
+diff --git a/configure.ac b/configure.ac
+index 014e09a5d5..139554b94a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -464,11 +464,18 @@ AC_ARG_ENABLE([mathvec],
+ [build_mathvec=$enableval],
+ [build_mathvec=notset])
+
++AC_TRY_COMPILE([], [
++#ifndef __CET__
++# error no CET compiler support
++#endif],
++ [libc_cv_compiler_default_cet=yes],
++ [libc_cv_compiler_default_cet=no])
++
+ AC_ARG_ENABLE([cet],
+ AC_HELP_STRING([--enable-cet],
+ [enable Intel Control-flow Enforcement Technology (CET), x86 only]),
+ [enable_cet=$enableval],
+- [enable_cet=no])
++ [enable_cet=$libc_cv_compiler_default_cet])
+
+ # We keep the original values in `$config_*' and never modify them, so we
+ # can write them unchanged into config.make. Everything else uses
+--
+2.20.1
+
diff --git a/packages/glibc/2.29/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch b/packages/glibc/2.29/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch
new file mode 100644
index 0000000..e188dd0
--- /dev/null
+++ b/packages/glibc/2.29/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch
@@ -0,0 +1,82 @@
+From 0b4c3e1e0b8656149d4556d2f81a2958426ebc94 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 3 Dec 2019 21:08:49 +0100
+Subject: [PATCH] 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)
+---
+ NEWS | 1 +
+ configure | 23 ++++++++++++++++++++++-
+ configure.ac | 9 ++++++++-
+ 3 files changed, 31 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 101dfddf37..6a2df7c2be 100755
+--- a/configure
++++ b/configure
+@@ -3777,11 +3777,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
+
+
+diff --git a/configure.ac b/configure.ac
+index 46a74687a6..f483afdc2e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -472,11 +472,18 @@ AC_ARG_ENABLE([mathvec],
+ [build_mathvec=$enableval],
+ [build_mathvec=notset])
+
++AC_TRY_COMPILE([], [
++#ifndef __CET__
++# error no CET compiler support
++#endif],
++ [libc_cv_compiler_default_cet=yes],
++ [libc_cv_compiler_default_cet=no])
++
+ AC_ARG_ENABLE([cet],
+ AC_HELP_STRING([--enable-cet],
+ [enable Intel Control-flow Enforcement Technology (CET), x86 only]),
+ [enable_cet=$enableval],
+- [enable_cet=no])
++ [enable_cet=$libc_cv_compiler_default_cet])
+
+ # We keep the original values in `$config_*' and never modify them, so we
+ # can write them unchanged into config.make. Everything else uses
+--
+2.20.1
+
diff --git a/packages/glibc/2.30/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch b/packages/glibc/2.30/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch
new file mode 100644
index 0000000..6f5dbc3
--- /dev/null
+++ b/packages/glibc/2.30/0002-x86-Assume-enable-cet-if-GCC-defaults-to-CET-BZ-2522.patch
@@ -0,0 +1,80 @@
+From 761452f12781f2d15a50f2dcd9f40c53bc0ff040 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 3 Dec 2019 20:26:28 +0100
+Subject: [PATCH] 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.
+---
+ NEWS | 1 +
+ configure | 23 ++++++++++++++++++++++-
+ configure.ac | 9 ++++++++-
+ 3 files changed, 31 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index c773c487b5..6d26b8246f 100755
+--- a/configure
++++ b/configure
+@@ -3777,11 +3777,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
+
+
+diff --git a/configure.ac b/configure.ac
+index 598ba6c4ae..7436485419 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -472,11 +472,18 @@ AC_ARG_ENABLE([mathvec],
+ [build_mathvec=$enableval],
+ [build_mathvec=notset])
+
++AC_TRY_COMPILE([], [
++#ifndef __CET__
++# error no CET compiler support
++#endif],
++ [libc_cv_compiler_default_cet=yes],
++ [libc_cv_compiler_default_cet=no])
++
+ AC_ARG_ENABLE([cet],
+ AC_HELP_STRING([--enable-cet],
+ [enable Intel Control-flow Enforcement Technology (CET), x86 only]),
+ [enable_cet=$enableval],
+- [enable_cet=no])
++ [enable_cet=$libc_cv_compiler_default_cet])
+
+ # We keep the original values in `$config_*' and never modify them, so we
+ # can write them unchanged into config.make. Everything else uses
+--
+2.20.1
+