From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72435 invoked by alias); 3 Dec 2019 19:43:39 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 72372 invoked by uid 9299); 3 Dec 2019 19:43:39 -0000 Date: Tue, 03 Dec 2019 19:43:00 -0000 Message-ID: <20191203194339.72370.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.30/master] x86: Assume --enable-cet if GCC defaults to CET [BZ #25225] X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/release/2.30/master X-Git-Oldrev: 5a08bdb1e73e87afc1ada7b7b95d43ae470ce7e1 X-Git-Newrev: 761452f12781f2d15a50f2dcd9f40c53bc0ff040 X-SW-Source: 2019-q4/txt/msg00527.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=761452f12781f2d15a50f2dcd9f40c53bc0ff040 commit 761452f12781f2d15a50f2dcd9f40c53bc0ff040 Author: Florian Weimer Date: Tue Dec 3 20:26:28 2019 +0100 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. Diff: --- NEWS | 1 + configure | 23 ++++++++++++++++++++++- configure.ac | 9 ++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1f60f3e..a02fa10 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ The following bugs are resolved with this release: [25189] Don't use a custom wrapper macro around __has_include [25203] libio: Disable vtable validation for pre-2.1 interposed handles [25204] Ignore LD_PREFER_MAP_32BIT_EXEC for SUID programs + [25225] ld.so fails to link on x86 if GCC defaults to -fcf-protection Version 2.30 diff --git a/configure b/configure index c773c48..6d26b82 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 598ba6c..7436485 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