[arch-commits] Commit in glibc/trunk (2 files)

Allan McRae allan at archlinux.org
Mon Oct 31 12:21:41 UTC 2016


    Date: Monday, October 31, 2016 @ 12:21:41
  Author: allan
Revision: 279526

prepare PIE enabled toolchain

Added:
  glibc/trunk/0001-Revert-Avoid-an-extra-branch-to-PLT-for-z-now.patch
Modified:
  glibc/trunk/PKGBUILD

----------------------------------------------------------+
 0001-Revert-Avoid-an-extra-branch-to-PLT-for-z-now.patch |   99 +++++++++++++
 PKGBUILD                                                 |   31 ++--
 2 files changed, 120 insertions(+), 10 deletions(-)

Added: 0001-Revert-Avoid-an-extra-branch-to-PLT-for-z-now.patch
===================================================================
--- 0001-Revert-Avoid-an-extra-branch-to-PLT-for-z-now.patch	                        (rev 0)
+++ 0001-Revert-Avoid-an-extra-branch-to-PLT-for-z-now.patch	2016-10-31 12:21:41 UTC (rev 279526)
@@ -0,0 +1,99 @@
+From c903d7992134802ada495c137a4f1a2ac85af86e Mon Sep 17 00:00:00 2001
+From: Allan McRae <allan at archlinux.org>
+Date: Mon, 31 Oct 2016 15:10:23 +1000
+Subject: [PATCH] Revert "Avoid an extra branch to PLT for -z now"
+
+This reverts commit 6901def689b5c77465d34f07822989ec67e80c1e.
+---
+ ChangeLog               | 8 --------
+ config.h.in             | 3 ---
+ configure               | 4 ----
+ configure.ac            | 3 ---
+ sysdeps/x86_64/sysdep.h | 8 ++------
+ 5 files changed, 2 insertions(+), 24 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index b2f6372..e2119a3 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -2806,14 +2806,6 @@
+ 	(huge): Remove variable.
+ 	(__ceill): Do not force "inexact" exception.
+ 
+-2016-05-24  H.J. Lu  <hongjiu.lu at intel.com>
+-
+-	* config.h.in (BIND_NOW): New.
+-	* configure.ac (BIND_NOW): New.  Defined for --enable-bind-now.
+-	* configure: Regenerated.
+-	* sysdeps/x86_64/sysdep.h (JUMPTARGET)[BIND_NOW]: Defined to
+-	indirect branch via the GOT slot.
+-
+ 2016-05-24  Stefan Liebler  <stli at linux.vnet.ibm.com>
+ 
+ 	[BZ #19765]
+diff --git a/config.h.in b/config.h.in
+index 856ef6a..b96a4ce 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -91,9 +91,6 @@
+    include/libc-symbols.h that avoid PLT slots in the shared objects.  */
+ #undef	NO_HIDDEN
+ 
+-/* Define this to disable lazy relocations in DSOs.  */
+-#undef	BIND_NOW
+-
+ /* AArch64 big endian ABI */
+ #undef HAVE_AARCH64_BE
+ 
+diff --git a/configure b/configure
+index 17625e1..5cad071 100755
+--- a/configure
++++ b/configure
+@@ -3417,10 +3417,6 @@ else
+ fi
+ 
+ 
+-if test "x$bindnow" = xyes; then
+-  $as_echo "#define BIND_NOW 1" >>confdefs.h
+-
+-fi
+ 
+ # Check whether --enable-static-nss was given.
+ if test "${enable_static_nss+set}" = set; then :
+diff --git a/configure.ac b/configure.ac
+index 33bcd62..33701fa 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -231,9 +231,6 @@ AC_ARG_ENABLE([bind-now],
+ 	      [bindnow=$enableval],
+ 	      [bindnow=no])
+ AC_SUBST(bindnow)
+-if test "x$bindnow" = xyes; then
+-  AC_DEFINE(BIND_NOW)
+-fi
+ 
+ dnl On some platforms we cannot use dynamic loading.  We must provide
+ dnl static NSS modules.
+diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
+index 75ac747..fbe3560 100644
+--- a/sysdeps/x86_64/sysdep.h
++++ b/sysdeps/x86_64/sysdep.h
+@@ -90,13 +90,9 @@ lose:									      \
+ 
+ #undef JUMPTARGET
+ #ifdef PIC
+-# ifdef BIND_NOW
+-#  define JUMPTARGET(name)	*name##@GOTPCREL(%rip)
+-# else
+-#  define JUMPTARGET(name)	name##@PLT
+-# endif
++#define JUMPTARGET(name)	name##@PLT
+ #else
+-# define JUMPTARGET(name)	name
++#define JUMPTARGET(name)	name
+ #endif
+ 
+ /* Local label name for asm code. */
+-- 
+2.10.1
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-10-31 12:14:46 UTC (rev 279525)
+++ PKGBUILD	2016-10-31 12:21:41 UTC (rev 279526)
@@ -6,7 +6,7 @@
 
 pkgname=glibc
 pkgver=2.24
-pkgrel=2
+pkgrel=2.90
 _commit=fdfc9260
 pkgdesc="GNU C Library"
 arch=('i686' 'x86_64')
@@ -22,13 +22,20 @@
 install=glibc.install
 source=(git://sourceware.org/git/glibc.git#commit=${_commit}
         locale.gen.txt
-        locale-gen)
+        locale-gen
+        0001-Revert-Avoid-an-extra-branch-to-PLT-for-z-now.patch)
 md5sums=('SKIP'
          '07ac979b6ab5eeb778d55f041529d623'
-         '476e9113489f93b348b21e144b6a8fcf')
+         '476e9113489f93b348b21e144b6a8fcf'
+         'aa0c0742ea5de00c25dfae8868c1bc9b')
 
 prepare() {
   mkdir glibc-build
+  
+  cd glibc
+  # build fails with PIE enabled toolchain
+  # https://sourceware.org/bugzilla/show_bug.cgi?id=20621
+  patch -p1 -i $srcdir/0001-Revert-Avoid-an-extra-branch-to-PLT-for-z-now.patch
 }
 
 build() {
@@ -46,17 +53,20 @@
   echo "rootsbindir=/usr/bin" >> configparms
 
   # remove hardening options for building libraries
+  CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
   CFLAGS=${CFLAGS/-fstack-protector-strong/}
-  CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
 
-  ../${pkgname}/configure --prefix=/usr \
-      --libdir=/usr/lib --libexecdir=/usr/lib \
+  ../${pkgname}/configure \
+      --prefix=/usr \
+      --libdir=/usr/lib \
+      --libexecdir=/usr/lib \
       --with-headers=/usr/include \
       --with-bugurl=https://bugs.archlinux.org/ \
       --enable-add-ons \
       --enable-obsolete-rpc \
       --enable-kernel=2.6.32 \
-      --enable-bind-now --disable-profile \
+      --enable-bind-now \
+      --disable-profile \
       --enable-stackguard-randomization \
       --enable-lock-elision \
       --enable-multi-arch \
@@ -68,17 +78,18 @@
 
   # re-enable hardening for programs
   sed -i "/build-programs=/s#no#yes#" configparms
+
   echo "CC += -fstack-protector-strong -D_FORTIFY_SOURCE=2" >> configparms
   echo "CXX += -fstack-protector-strong -D_FORTIFY_SOURCE=2" >> configparms
   make
-
-  # remove harding in preparation to run test-suite
-  sed -i '/FORTIFY/d' configparms
 }
 
 check() {
   cd glibc-build
 
+  # remove harding in preparation to run test-suite
+  sed -i '/FORTIFY/d' configparms
+
   # some failures are "expected"
   make check || true
 }



More information about the arch-commits mailing list