From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QZBI7-0004hz-RP for garchives@archives.gentoo.org; Wed, 22 Jun 2011 00:27:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9F3AF1C00B; Wed, 22 Jun 2011 00:27:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 50D581C00B for ; Wed, 22 Jun 2011 00:27:25 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ABE541B4018 for ; Wed, 22 Jun 2011 00:27:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D99338003C for ; Wed, 22 Jun 2011 00:27:23 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <64e6e9c8d2e7ad024b0defdf9f1698e1b7ec09f5.zorry@gentoo> Subject: [gentoo-commits] proj/hardened-gccpatchset:master commit in: upstream/ X-VCS-Repository: proj/hardened-gccpatchset X-VCS-Files: upstream/configure.ac.patch X-VCS-Directories: upstream/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 64e6e9c8d2e7ad024b0defdf9f1698e1b7ec09f5 Date: Wed, 22 Jun 2011 00:27:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: aa385e73afe79300049fc73839cd3cab commit: 64e6e9c8d2e7ad024b0defdf9f1698e1b7ec09f5 Author: Magnus Granberg gentoo org> AuthorDate: Wed Jun 22 00:27:03 2011 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Wed Jun 22 00:27:03 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/hardened-gccp= atchset.git;a=3Dcommit;h=3D64e6e9c8 Updated configure.ac patch for upstreem --- upstream/configure.ac.patch | 138 +++++++++++++++++++++++++++++++++++++= +++++- 1 files changed, 137 insertions(+), 1 deletions(-) diff --git a/upstream/configure.ac.patch b/upstream/configure.ac.patch index cfee97f..54cd876 100644 --- a/upstream/configure.ac.patch +++ b/upstream/configure.ac.patch @@ -1,7 +1,9 @@ -2011-04-27 Magnus Granberg +2011-06-22 Magnus Granberg =20 * configure Add --enable-espf. Add -fno-stack-protector to stage1_cflags. + * gcc/configure.ac Add --enable-espf and checks for it. + --- a/configure.ac 2011-04-18 23:27:00.000000000 +0200 +++ b/configure.ac 2011-04-27 12:47:11.351473240 +0200 @@ -419,6 +419,25 @@ @@ -41,3 +43,137 @@ # This is aimed to mimic bootstrap with a non-GCC compiler to catch pro= blems. if test "$GCC" =3D yes -a "$ENABLE_BUILD_WITH_CXX" !=3D yes; then saved_CFLAGS=3D"$CFLAGS" +--- a/gcc/configure.ac 2011-04-13 19:12:53.000000000 +0200 ++++ b/gcc/configure.ac 2011-06-21 02:51:23.602374686 +0200 +@@ -4515,6 +4515,131 @@ + AC_SUBST(MAINT)dnl +=20 + # -------------- ++# Espf checks ++# -------------- ++ ++# Check whether --enable-espf was given and target have the support. ++AC_ARG_ENABLE([espf], ++[AS_HELP_STRING([--enable-espf], ++ [Enable Stack protector, Position independent executable and ++ Fortify_sources as default if we have suppot for it when compiling ++ and link with -z relro and -z now as default. ++ Linux targets supported x86_64])], ++ [case $espf in ++ yes | no) ;; ++ *) AC_MSG_ERROR(['$espf' is an invalid value for --enable-espf. ++Valid choices are 'yes' and 'no'.]) ;; ++ esac], ++ [set_espf_enable=3D"$espf"]) ++if test $set_enable_espf =3D yes ; then ++ AC_MSG_CHECKING(if $target support espf) ++if test $set_enable_espf =3D yes ; then ++ case "$target" in ++ ?86-*-linux* | x86_64-*-linux*) ++ enable_espf=3Dyes ++ AC_DEFINE(ENABLE_ESPF, 1, ++ [Define if your target support espf and you have enable it.]) ++ ;; ++ *) ++ enable_espf=3Dno ++ ;; ++ esac ++else ++ enable_espf=3Dno ++fi ++AC_MSG_RESULT($enable_espf) ++fi ++AC_SUBST([enable_espf]) ++if test $enable_espf =3D yes ; then ++ ++ AC_CACHE_CHECK(linker -z relro support, ++ gcc_cv_ld_relro, ++ [gcc_cv_ld_relro=3Dno ++ if test $in_tree_ld =3D yes ; then ++ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_ver= sion" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ ++ && test $in_tree_ld_is_elf =3D yes; then ++ gcc_cv_ld_relro=3Dyes ++ fi ++ elif test x$gcc_cv_ld !=3D x; then ++ # Check if linker supports -z relro options ++ if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then ++ gcc_cv_ld_relro=3Dyes ++ fi ++ fi ++ ]) ++ ++ AC_CACHE_CHECK(linker -z now support, ++ gcc_cv_ld_now, ++ [gcc_cv_ld_now=3Dno ++ if test $in_tree_ld =3D yes ; then ++ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_ver= sion" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ ++ && test $in_tree_ld_is_elf =3D yes; then ++ gcc_cv_ld_now=3Dyes ++ fi ++ elif test x$gcc_cv_ld !=3D x; then ++ # Check if linker supports -z now options ++ if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then ++ gcc_cv_ld_now=3Dyes ++ fi ++ fi ++ ]) ++ ++ # Check for -D_FORTIFY_SOURCES support in target C library ++ AC_CHECK_FUNC(__fortify_fail,[gcc_cv_libc_provides_fortify=3Dyes], ++ [gcc_cv_libc_provides_fortify=3Dno]) ++ ++ AC_MSG_CHECKING(if the compiler default to use -fPIE and link with -p= ie) ++ if test $set_enable_espf =3D yes && test x"$gcc_cv_ld_pie" =3D xyes; = then ++ enable_espf_pie=3Dyes ++ AC_DEFINE(ENABLE_ESPF_PIE, 1, ++ [Define if your compiler will default to use -fPIE and link with = -pie.]) ++ else ++ enable_espf_pie=3Dno ++ fi ++ AC_MSG_RESULT($enable_espf_pie) ++AC_MSG_CHECKING(if the compiler default to use -fstack-protector) ++ if test $set_enable_espf =3D yes && test x$gcc_cv_libc_provides_ssp =3D= xyes \ ++ && test $set_have_as_tls =3D yes ; then ++ enable_espf_pie=3Dyes ++ AC_DEFINE(ENABLE_ESPF_SSP, 1, ++ [Define if your compiler will default to use -fstack-protector.]) ++ else ++ enable_espf_pie=3Dno ++ fi ++ AC_MSG_RESULT($enable_espf_ssp) ++ ++AC_MSG_CHECKING(if the compiler default to use -D_FORTIFY_SOURCES=3D2) ++ if test $set_enable_espf =3D yes && test x$gcc_cv_libc_provides_forti= fy =3D xyes; then ++ enable_espf_fortify=3Dyes ++ AC_DEFINE(ENABLE_ESPF_FORTIFY, 1, ++ [Define if your compiler will default to use -D_FORTIFY_SOURCES=3D= 2.]) ++ else ++ enable_espf_fortify=3Dno ++ fi ++ AC_MSG_RESULT($enable_espf_fortify) ++ ++ AC_MSG_CHECKING(if the compiler will pass -z relro to the linker) ++ if test $set_enable_espf =3D yes && test x$gcc_cv_ld_relro =3D xyes= ; then ++ enable_espf_relro=3Dyes ++ AC_DEFINE(ENABLE_ESPF_RELRO, 1, ++ [Define if your compiler will pass -z relro to the linker.]) ++ else ++ enable_espf_relro=3Dno ++ fi ++ AC_MSG_RESULT($enable_espf_relro) ++ ++ AC_MSG_CHECKING(if the compiler will pass -z now to the linker) ++ if test $set_enable_espf =3D yes && test x$gcc_cv_ld_now =3D xyes; = then ++ enable_espf_now=3Dyes ++ AC_DEFINE(ENABLE_ESPF_NOW, 1, ++ [Define if your compiler will pass -z now to the linker.]) ++ else ++ enable_espf_now=3Dno ++ fi ++ AC_MSG_RESULT($enable_espf_now) ++fi ++ ++# -------------- + # Language hooks + # -------------- +=20 \ No newline at end of file