Skip to content
Snippets Groups Projects
Commit 3fae0e2d authored by Allan McRae's avatar Allan McRae :speech_balloon:
Browse files

prepare PIE enabled toolchain

parent 8e8efa3b
No related branches found
No related tags found
No related merge requests found
From c903d7992134802ada495c137a4f1a2ac85af86e Mon Sep 17 00:00:00 2001
From: Allan McRae <allan@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@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@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
......@@ -5,7 +5,7 @@
pkgname=glibc
pkgver=2.24
pkgrel=2
pkgrel=2.90
_commit=fdfc9260
pkgdesc="GNU C Library"
arch=('i686' 'x86_64')
......@@ -21,13 +21,20 @@ options=('!strip' 'staticlibs')
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() {
......@@ -45,17 +52,20 @@ build() {
echo "rootsbindir=/usr/bin" >> configparms
# remove hardening options for building libraries
CFLAGS=${CFLAGS/-fstack-protector-strong/}
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
CFLAGS=${CFLAGS/-fstack-protector-strong/}
../${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 \
......@@ -67,17 +77,18 @@ build() {
# 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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment