summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-03-14 08:19:42 +0000
committerMike Frysinger <vapier@gentoo.org>2015-03-14 08:19:42 +0000
commit5a253f472c9374273634bc935be66c0e6d31235c (patch)
treee62eab9b43c68be50713b2553587ce8a90261fcc /sys-libs/glibc
parentMove old ebuilds to toolchain overlay. (diff)
downloadgentoo-2-5a253f472c9374273634bc935be66c0e6d31235c.tar.gz
gentoo-2-5a253f472c9374273634bc935be66c0e6d31235c.tar.bz2
gentoo-2-5a253f472c9374273634bc935be66c0e6d31235c.zip
Move old ebuilds to toolchain overlay.
(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'sys-libs/glibc')
-rw-r--r--sys-libs/glibc/ChangeLog18
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch168
-rw-r--r--sys-libs/glibc/files/2.11/glibc-2.11-hardened-pie.patch40
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch68
-rw-r--r--sys-libs/glibc/files/2.5/glibc-2.5-gentoo-stack_chk_fail.c311
-rw-r--r--sys-libs/glibc/files/2.5/glibc-2.5-hardened-configure-picdefault.patch29
-rw-r--r--sys-libs/glibc/files/2.5/glibc-2.5-hardened-inittls-nosysenter.patch283
-rw-r--r--sys-libs/glibc/files/2.5/glibc-2.5-hardened-pie.patch39
-rw-r--r--sys-libs/glibc/files/2.6/glibc-2.6-hardened-inittls-nosysenter.patch273
-rw-r--r--sys-libs/glibc/files/2.7/glibc-2.7-hardened-inittls-nosysenter.patch273
-rw-r--r--sys-libs/glibc/glibc-2.10.1-r1.ebuild203
-rw-r--r--sys-libs/glibc/glibc-2.11.3.ebuild206
-rw-r--r--sys-libs/glibc/glibc-2.12.1-r3.ebuild220
-rw-r--r--sys-libs/glibc/glibc-2.12.2.ebuild220
-rw-r--r--sys-libs/glibc/glibc-2.13-r2.ebuild218
-rw-r--r--sys-libs/glibc/glibc-2.14.1-r2.ebuild246
-rw-r--r--sys-libs/glibc/glibc-2.14.ebuild242
-rw-r--r--sys-libs/glibc/glibc-2.15-r1.ebuild233
-rw-r--r--sys-libs/glibc/glibc-2.15-r2.ebuild225
-rw-r--r--sys-libs/glibc/glibc-2.9_p20081201-r3.ebuild193
20 files changed, 17 insertions, 3691 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog
index b1a643a2c407..f54b004cdc37 100644
--- a/sys-libs/glibc/ChangeLog
+++ b/sys-libs/glibc/ChangeLog
@@ -1,6 +1,22 @@
# ChangeLog for sys-libs/glibc
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.1040 2015/02/17 08:13:13 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.1041 2015/03/14 08:19:41 vapier Exp $
+
+ 14 Mar 2015; Mike Frysinger <vapier@gentoo.org>
+ -files/2.10/glibc-2.10-hardened-ssp-compat.patch,
+ -files/2.11/glibc-2.11-hardened-pie.patch,
+ -files/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch,
+ -files/2.5/glibc-2.5-gentoo-stack_chk_fail.c,
+ -files/2.5/glibc-2.5-hardened-configure-picdefault.patch,
+ -files/2.5/glibc-2.5-hardened-inittls-nosysenter.patch,
+ -files/2.5/glibc-2.5-hardened-pie.patch,
+ -files/2.6/glibc-2.6-hardened-inittls-nosysenter.patch,
+ -files/2.7/glibc-2.7-hardened-inittls-nosysenter.patch,
+ -glibc-2.10.1-r1.ebuild, -glibc-2.11.3.ebuild, -glibc-2.12.1-r3.ebuild,
+ -glibc-2.12.2.ebuild, -glibc-2.13-r2.ebuild, -glibc-2.14.1-r2.ebuild,
+ -glibc-2.14.ebuild, -glibc-2.15-r1.ebuild, -glibc-2.15-r2.ebuild,
+ -glibc-2.9_p20081201-r3.ebuild:
+ Move old ebuilds to toolchain overlay.
*glibc-2.20-r2 (17 Feb 2015)
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch
deleted file mode 100644
index a1c9eef6a920..000000000000
--- a/sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-Add backwards compat support for gcc-3.x ssp ... older ssp versions
-used __guard and __stack_smash_handler symbols while gcc-4.1 and newer
-uses __stack_chk_guard and __stack_chk_fail.
-
---- config.h.in
-+++ config.h.in
-@@ -42,6 +42,9 @@
- assembler instructions per line. Default is `;' */
- #undef ASM_LINE_SEP
-
-+/* Define if we want to enable support for old ssp symbols */
-+#undef ENABLE_OLD_SSP_COMPAT
-+
- /* Define if not using ELF, but `.init' and `.fini' sections are available. */
- #undef HAVE_INITFINI
-
---- configure
-+++ configure
-@@ -1378,6 +1378,9 @@ Optional Features:
- --enable-kernel=VERSION compile for compatibility with kernel not older than
- VERSION
- --enable-all-warnings enable all useful warnings gcc can issue
-+ --disable-old-ssp-compat
-+ enable support for older ssp symbols
-+ [default=no]
- --enable-multi-arch enable single DSO with optimizations for multiple
- architectures
- --enable-experimental-malloc
-@@ -6462,6 +6465,20 @@ fi
- $as_echo "$libc_cv_ssp" >&6; }
-
-
-+# Check whether --enable-old-ssp-compat or --disable-old-ssp-compat was given.
-+if test "${enable_old_ssp_compat+set}" = set; then
-+ enableval="$enable_old_ssp_compat"
-+ enable_old_ssp_compat=$enableval
-+else
-+ enable_old_ssp_compat=no
-+fi;
-+if test "x$enable_old_ssp_compat" = "xyes"; then
-+ cat >>confdefs.h <<\_ACEOF
-+#define ENABLE_OLD_SSP_COMPAT 1
-+_ACEOF
-+
-+fi
-+
- { $as_echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5
- $as_echo_n "checking for -fgnu89-inline... " >&6; }
- if test "${libc_cv_gnu89_inline+set}" = set; then
---- configure.in
-+++ configure.in
-@@ -1641,6 +1641,15 @@ fi
- rm -f conftest*])
- AC_SUBST(libc_cv_ssp)
-
-+AC_ARG_ENABLE([old-ssp-compat],
-+ AC_HELP_STRING([--enable-old-ssp-compat],
-+ [enable support for older ssp symbols @<:@default=no@:>@]),
-+ [enable_old_ssp_compat=$enableval],
-+ [enable_old_ssp_compat=no])
-+if test "x$enable_old_ssp_compat" = "xyes"; then
-+ AC_DEFINE(ENABLE_OLD_SSP_COMPAT)
-+fi
-+
- AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
- cat > conftest.c <<EOF
- int foo;
---- csu/libc-start.c
-+++ csu/libc-start.c
-@@ -37,6 +37,9 @@ extern void __pthread_initialize_minimal
- uintptr_t __stack_chk_guard attribute_relro;
- # endif
- #endif
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+uintptr_t __guard attribute_relro;
-+#endif
-
- #ifdef HAVE_PTR_NTHREADS
- /* We need atomic operations. */
-@@ -141,6 +145,9 @@ LIBC_START_MAIN (int (*main) (int, char
-
- /* Set up the stack checker's canary. */
- uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+ __guard = stack_chk_guard;
-+#endif
- # ifdef THREAD_SET_STACK_GUARD
- THREAD_SET_STACK_GUARD (stack_chk_guard);
- # else
---- csu/Versions
-+++ csu/Versions
-@@ -17,6 +17,12 @@ libc {
- # New special glibc functions.
- gnu_get_libc_release; gnu_get_libc_version;
- }
-+ GLIBC_2.3.2 {
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ # global objects and functions for the old propolice patch in gcc
-+ __guard;
-+%endif
-+ }
- GLIBC_PRIVATE {
- %if HAVE___THREAD
- # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
---- debug/Versions
-+++ debug/Versions
-@@ -10,6 +10,12 @@ libc {
- # These are to support some gcc features.
- __cyg_profile_func_enter; __cyg_profile_func_exit;
- }
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ GLIBC_2.3.2 {
-+ # backwards ssp compat support; alias to __stack_chk_fail
-+ __stack_smash_handler;
-+ }
-+%endif
- GLIBC_2.3.4 {
- __chk_fail;
- __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk; __stpcpy_chk;
---- elf/rtld.c
-+++ elf/rtld.c
-@@ -89,6 +89,9 @@ INTDEF(_dl_argv)
- in thread local area. */
- uintptr_t __stack_chk_guard attribute_relro;
- #endif
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+uintptr_t __guard attribute_relro;
-+#endif
-
- /* Only exported for architectures that don't store the pointer guard
- value in thread local area. */
-@@ -1817,6 +1821,9 @@ ERROR: ld.so: object '%s' cannot be load
-
- /* Set up the stack checker's canary. */
- uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
-+#ifdef ENABLE_OLD_SSP_COMPAT
-+ __guard = stack_chk_guard;
-+#endif
- #ifdef THREAD_SET_STACK_GUARD
- THREAD_SET_STACK_GUARD (stack_chk_guard);
- #else
---- elf/Versions
-+++ elf/Versions
-@@ -43,6 +43,12 @@ ld {
- # runtime interface to TLS
- __tls_get_addr;
- }
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ GLIBC_2.3.2 {
-+ # backwards ssp compat support
-+ __guard;
-+ }
-+%endif
- GLIBC_2.4 {
- # stack canary
- __stack_chk_guard;
---- Versions.def
-+++ Versions.def
-@@ -109,6 +109,9 @@ ld {
- GLIBC_2.0
- GLIBC_2.1
- GLIBC_2.3
-+%ifdef ENABLE_OLD_SSP_COMPAT
-+ GLIBC_2.3.2
-+%endif
- GLIBC_2.4
- GLIBC_PRIVATE
- }
diff --git a/sys-libs/glibc/files/2.11/glibc-2.11-hardened-pie.patch b/sys-libs/glibc/files/2.11/glibc-2.11-hardened-pie.patch
deleted file mode 100644
index df7292f41536..000000000000
--- a/sys-libs/glibc/files/2.11/glibc-2.11-hardened-pie.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-http://bugs.gentoo.org/292139
-
-2009-11-08 Magnus Granberg <zorry@ume.nu>
-
- * Makeconfig (+link): Set to +link-pie.
- (+link-static): Change $(static-start-installed-name) to
- S$(static-start-installed-name).
- (+prector): Set to +prectorS.
- (+postctor): Set to +postctorS.
-
---- libc/Makeconfig
-+++ libc/Makeconfig
-@@ -447,11 +447,12 @@
- $(common-objpfx)libc% $(+postinit),$^) \
- $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
- endif
-++link = $(+link-pie)
- # Command for statically linking programs with the C library.
- ifndef +link-static
- +link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
- $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
-- $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
-+ $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
- $(+preinit) $(+prector) \
- $(filter-out $(addprefix $(csu-objpfx),start.o \
- $(start-installed-name))\
-@@ -549,11 +550,10 @@
- ifeq ($(elf),yes)
- +preinit = $(addprefix $(csu-objpfx),crti.o)
- +postinit = $(addprefix $(csu-objpfx),crtn.o)
--+prector = `$(CC) --print-file-name=crtbegin.o`
--+postctor = `$(CC) --print-file-name=crtend.o`
--# Variants of the two previous definitions for linking PIE programs.
- +prectorS = `$(CC) --print-file-name=crtbeginS.o`
- +postctorS = `$(CC) --print-file-name=crtendS.o`
-++prector = $(+prectorS)
-++postctor = $(+postctorS)
- +interp = $(addprefix $(elf-objpfx),interp.os)
- endif
- csu-objpfx = $(common-objpfx)csu/
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch
deleted file mode 100644
index 7c4399f84542..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-#! /bin/sh -e
-
-# DP: Description: Fix localedef segfault when run under exec-shield,
-# PaX or similar. (#231438, #198099)
-# DP: Dpatch Author: James Troup <james@nocrew.org>
-# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
-# DP: Upstream status: Unknown
-# DP: Status Details: Unknown
-# DP: Date: 2004-03-16
-
-if [ $# -ne 2 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
- -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-esac
-exit 0
-
---- glibc-2.3.3-net/locale/programs/3level.h 16 Jun 2003 07:19:09 -0000 1.1.1.5
-+++ glibc-2.3.3-redhat/locale/programs/3level.h 16 Jun 2003 09:32:40 -0000 1.4
-@@ -204,6 +204,42 @@ CONCAT(TABLE,_iterate) (struct TABLE *t,
- }
- }
- }
-+
-+/* GCC ATM seems to do a poor job with pointers to nested functions passed
-+ to inlined functions. Help it a little bit with this hack. */
-+#define wchead_table_iterate(tp, fn) \
-+do \
-+ { \
-+ struct wchead_table *t = (tp); \
-+ uint32_t index1; \
-+ for (index1 = 0; index1 < t->level1_size; index1++) \
-+ { \
-+ uint32_t lookup1 = t->level1[index1]; \
-+ if (lookup1 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup1_shifted = lookup1 << t->q; \
-+ uint32_t index2; \
-+ for (index2 = 0; index2 < (1 << t->q); index2++) \
-+ { \
-+ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
-+ if (lookup2 != ((uint32_t) ~0)) \
-+ { \
-+ uint32_t lookup2_shifted = lookup2 << t->p; \
-+ uint32_t index3; \
-+ for (index3 = 0; index3 < (1 << t->p); index3++) \
-+ { \
-+ struct element_t *lookup3 \
-+ = t->level3[index3 + lookup2_shifted]; \
-+ if (lookup3 != NULL) \
-+ fn ((((index1 << t->q) + index2) << t->p) + index3, \
-+ lookup3); \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } \
-+ } while (0)
-+
- #endif
-
- #ifndef NO_FINALIZE
diff --git a/sys-libs/glibc/files/2.5/glibc-2.5-gentoo-stack_chk_fail.c b/sys-libs/glibc/files/2.5/glibc-2.5-gentoo-stack_chk_fail.c
deleted file mode 100644
index e30444000346..000000000000
--- a/sys-libs/glibc/files/2.5/glibc-2.5-gentoo-stack_chk_fail.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Copyright (C) 2006 Gentoo Foundation Inc.
- * License terms as above.
- *
- * Hardened Gentoo SSP handler
- *
- * An SSP failure handler that does not use functions from the rest of
- * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures
- * no possibility of recursion into the handler.
- *
- * Direct all bug reports to http://bugs.gentoo.org/
- *
- * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
- * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
- *
- * The following people contributed to the glibc-2.3 Hardened
- * Gentoo SSP handler, from which this implementation draws much:
- *
- * Ned Ludd - <solar[@]gentoo.org>
- * Alexander Gabert - <pappy[@]gentoo.org>
- * The PaX Team - <pageexec[@]freemail.hu>
- * Peter S. Mazinger - <ps.m[@]gmx.net>
- * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
- * Robert Connolly - <robert[@]linuxfromscratch.org>
- * Cory Visi <cory[@]visi.name>
- * Mike Frysinger <vapier[@]gentoo.org>
- */
-
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-
-#include <sys/types.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-#include <kernel-features.h>
-
-#include <alloca.h>
-/* from sysdeps */
-#include <socketcall.h>
-/* for the stuff in bits/socket.h */
-#include <sys/socket.h>
-#include <sys/un.h>
-
-
-/* Sanity check on SYSCALL macro names - force compilation
- * failure if the names used here do not exist
- */
-#if !defined __NR_socketcall && !defined __NR_socket
-# error Cannot do syscall socket or socketcall
-#endif
-#if !defined __NR_socketcall && !defined __NR_connect
-# error Cannot do syscall connect or socketcall
-#endif
-#ifndef __NR_write
-# error Cannot do syscall write
-#endif
-#ifndef __NR_close
-# error Cannot do syscall close
-#endif
-#ifndef __NR_getpid
-# error Cannot do syscall getpid
-#endif
-#ifndef __NR_kill
-# error Cannot do syscall kill
-#endif
-#ifndef __NR_exit
-# error Cannot do syscall exit
-#endif
-#ifdef SSP_SMASH_DUMPS_CORE
-# if !defined _KERNEL_NSIG && !defined _NSIG
-# error No _NSIG or _KERNEL_NSIG for rt_sigaction
-# endif
-# if !defined __NR_sigation && !defined __NR_rt_sigaction
-# error Cannot do syscall sigaction or rt_sigaction
-# endif
-#endif
-
-
-
-/* Define DO_SOCKET/DO_CONNECT macros to deal with socketcall vs socket/connect */
-#ifdef __NR_socketcall
-
-# define DO_SOCKET(result,domain,type,protocol) \
- {socketargs[0] = domain; \
- socketargs[1] = type; \
- socketargs[2] = protocol; \
- socketargs[3] = 0; \
- result = INLINE_SYSCALL(socketcall,2,SOCKOP_socket,socketargs);}
-
-# define DO_CONNECT(result,sockfd,serv_addr,addrlen) \
- {socketargs[0] = sockfd; \
- socketargs[1] = (unsigned long int)serv_addr; \
- socketargs[2] = addrlen; \
- socketargs[3] = 0; \
- result = INLINE_SYSCALL(socketcall,2,SOCKOP_connect,socketargs);}
-
-#else
-
-# define DO_SOCKET(result,domain,type,protocol) \
- {result = INLINE_SYSCALL(socket,3,domain,type,protocol);}
-
-# define DO_CONNECT(result,sockfd,serv_addr,addrlen) \
- {result = INLINE_SYSCALL(connect,3,sockfd,serv_addr,addrlen);}
-
-#endif
-/* __NR_socketcall */
-
-
-#ifndef _PATH_LOG
-# define _PATH_LOG "/dev/log"
-#endif
-
-static const char path_log[]=_PATH_LOG;
-
-/* For building glibc with SSP switched on, define __progname to a
- * constant if building for the run-time loader, to avoid pulling
- * in more of libc.so into ld.so
- */
-#ifdef IS_IN_rtld
-static char *__progname = "<rtld>";
-#else
-extern char *__progname;
-#endif
-
-
-/* Common handler code, used by stack_chk_fail and __stack_smash_handler
- * Inlined to ensure no self-references to the handler within itself.
- * Data static to avoid putting more than necessary on the stack,
- * to aid core debugging.
- */
-static inline void
-__attribute__ ((__noreturn__ , __always_inline__))
-__hardened_gentoo_stack_chk_fail (char func[], int damaged)
-{
-#define MESSAGE_BUFSIZ 256
- static pid_t pid;
- static int plen, i;
- static char message[MESSAGE_BUFSIZ];
- static const char msg_ssa[]=": stack smashing attack";
- static const char msg_inf[]=" in function ";
- static const char msg_ssd[]="*** stack smashing detected ***: ";
- static const char msg_terminated[]=" - terminated\n";
- static const char msg_report[]="Report to http://bugs.gentoo.org/\n";
- static const char msg_unknown[]="<unknown>";
-#ifdef SSP_SMASH_DUMPS_CORE
- static struct sigaction default_abort_act;
-#endif
- static int log_socket, connect_result;
- static struct sockaddr_un sock;
-#ifdef __NR_socketcall
- static unsigned long int socketargs[4];
-#endif
-
- /* Build socket address
- */
- sock.sun_family = AF_UNIX;
- i=0;
- while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1)))
- {
- sock.sun_path[i]=path_log[i];
- i++;
- }
- sock.sun_path[i]='\0';
-
- /* Try SOCK_DGRAM connection to syslog */
- connect_result=-1;
- DO_SOCKET(log_socket,AF_UNIX,SOCK_DGRAM,0);
- if (log_socket != -1)
- DO_CONNECT(connect_result,log_socket,(&sock),(sizeof(sock)));
- if (connect_result == -1)
- {
- if (log_socket != -1)
- INLINE_SYSCALL(close,1,log_socket);
- /* Try SOCK_STREAM connection to syslog */
- DO_SOCKET(log_socket,AF_UNIX,SOCK_STREAM,0);
- if (log_socket != -1)
- DO_CONNECT(connect_result,log_socket,(&sock),(sizeof(sock)));
- }
-
- /* Build message. Messages are generated both in the old style and new style,
- * so that log watchers that are configured for the old-style message continue
- * to work.
- */
-#define strconcat(str) \
- {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
- {\
- message[plen+i]=str[i];\
- i++;\
- }\
- plen+=i;}
-
- /* R.Henderson post-gcc-4 style message */
- plen=0;
- strconcat(msg_ssd);
- if (__progname != (char *)0)
- strconcat(__progname)
- else
- strconcat(msg_unknown);
- strconcat(msg_terminated);
-
- /* Write out error message to STDERR, to syslog if open */
- INLINE_SYSCALL(write,3,STDERR_FILENO,message,plen);
- if (connect_result != -1)
- INLINE_SYSCALL(write,3,log_socket,message,plen);
-
- /* Dr. Etoh pre-gcc-4 style message */
- plen=0;
- if (__progname != (char *)0)
- strconcat(__progname)
- else
- strconcat(msg_unknown);
- strconcat(msg_ssa);
- strconcat(msg_inf);
- if (func!=NULL)
- strconcat(func)
- else
- strconcat(msg_unknown);
- strconcat(msg_terminated);
- /* Write out error message to STDERR, to syslog if open */
- INLINE_SYSCALL(write,3,STDERR_FILENO,message,plen);
- if (connect_result != -1)
- INLINE_SYSCALL(write,3,log_socket,message,plen);
-
- /* Direct reports to bugs.gentoo.org */
- plen=0;
- strconcat(msg_report);
- message[plen++]='\0';
-
- /* Write out error message to STDERR, to syslog if open */
- INLINE_SYSCALL(write,3,STDERR_FILENO,message,plen);
- if (connect_result != -1)
- INLINE_SYSCALL(write,3,log_socket,message,plen);
-
- if (log_socket != -1)
- INLINE_SYSCALL(close,1,log_socket);
-
- /* Suicide */
- pid=INLINE_SYSCALL(getpid,0);
-#ifdef SSP_SMASH_DUMPS_CORE
- /* Remove any user-supplied handler for SIGABRT, before using it */
- default_abort_act.sa_handler = SIG_DFL;
- default_abort_act.sa_sigaction = NULL;
- __sigfillset(&default_abort_act.sa_mask);
- default_abort_act.sa_flags = 0;
- /* sigaction doesn't exist on amd64; however rt_sigaction seems to
- * exist everywhere. rt_sigaction has an extra parameter - the
- * size of sigset_t.
- */
-# ifdef __NR_sigation
- if (INLINE_SYSCALL(sigaction,3,SIGABRT,&default_abort_act,NULL) == 0)
-# else
- /* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
- * of the _kernel_ sigset_t which is not the same as the user sigset_t.
- * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
- * some reason.
- */
-# ifdef _KERNEL_NSIG
- if (INLINE_SYSCALL(rt_sigaction,4,SIGABRT,&default_abort_act,NULL,_KERNEL_NSIG/8) == 0)
-# else
- if (INLINE_SYSCALL(rt_sigaction,4,SIGABRT,&default_abort_act,NULL,_NSIG/8) == 0)
-# endif
-# endif
- INLINE_SYSCALL(kill,2,pid,SIGABRT);
-#endif
- /* Note; actions cannot be added to SIGKILL */
- INLINE_SYSCALL(kill,2,pid,SIGKILL);
-
- /* In case the kill didn't work, exit anyway
- * The loop prevents gcc thinking this routine returns
- */
- while (1) INLINE_SYSCALL(exit,0);
-}
-
-void
-__attribute__ ((__noreturn__))
- __stack_chk_fail (void)
-{
- __hardened_gentoo_stack_chk_fail(NULL,0);
-}
-
-#ifdef ENABLE_OLD_SSP_COMPAT
-void
-__attribute__ ((__noreturn__))
-__stack_smash_handler(char func[], int damaged)
-{
- __hardened_gentoo_stack_chk_fail(func,damaged);
-}
-#endif
-
diff --git a/sys-libs/glibc/files/2.5/glibc-2.5-hardened-configure-picdefault.patch b/sys-libs/glibc/files/2.5/glibc-2.5-hardened-configure-picdefault.patch
deleted file mode 100644
index 253a61bb6d1d..000000000000
--- a/sys-libs/glibc/files/2.5/glibc-2.5-hardened-configure-picdefault.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Prevent default-fPIE from confusing configure into thinking
-PIC code is default. This causes glibc to build both PIC and
-non-PIC code as normal, which on the hardened compiler generates
-PIC and PIE.
-
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
-
---- configure.in
-+++ configure.in
-@@ -2145,7 +2145,7 @@
- # error PIC is default.
- #endif
- EOF
--if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
-+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
- pic_default=no
- fi
- rm -f conftest.*])
---- configure
-+++ configure
-@@ -7698,7 +7698,7 @@
- # error PIC is default.
- #endif
- EOF
--if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
-+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
- pic_default=no
- fi
- rm -f conftest.*
diff --git a/sys-libs/glibc/files/2.5/glibc-2.5-hardened-inittls-nosysenter.patch b/sys-libs/glibc/files/2.5/glibc-2.5-hardened-inittls-nosysenter.patch
deleted file mode 100644
index 420e6fdd9890..000000000000
--- a/sys-libs/glibc/files/2.5/glibc-2.5-hardened-inittls-nosysenter.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-When building glibc PIE (which is not something upstream support),
-several modifications are necessary to the glibc build process.
-
-First, any syscalls in PIEs must be of the PIC variant, otherwise
-textrels ensue. Then, any syscalls made before the initialisation
-of the TLS will fail on i386, as the sysenter variant on i386 uses
-the TLS, giving rise to a chicken-and-egg situation. This patch
-defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
-version is normally used, and uses the non-sysenter version for the brk
-syscall that is performed by the TLS initialisation. Further, the TLS
-initialisation is moved in this case prior to the initialisation of
-dl_osversion, as that requires further syscalls.
-
-csu/libc-start.c: Move initial TLS initialization to before the
-initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
-
-csu/libc-tls.c: Use the no-sysenter version of sbrk when
-INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
-version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-misc/brk.c: Define a no-sysenter version of brk if
-INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
-Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
-
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
-
---- csu/libc-start.c.orig 2007-01-21 11:51:06.000000000 +0100
-+++ csu/libc-start.c 2007-01-21 11:55:57.000000000 +0100
-@@ -28,6 +28,7 @@
- extern int __libc_multiple_libcs;
-
- #include <tls.h>
-+#include <sysdep.h>
- #ifndef SHARED
- # include <dl-osinfo.h>
- extern void __pthread_initialize_minimal (void)
-@@ -133,6 +134,14 @@
- # endif
- _dl_aux_init (auxvec);
- # endif
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ /* Do the initial TLS initialization before _dl_osversion,
-+ since the latter uses the uname syscall. */
-+# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
-+ if (__pthread_initialize_minimal)
-+# endif
-+ __pthread_initialize_minimal ();
-+# endif
- # ifdef DL_SYSDEP_OSCHECK
- if (!__libc_multiple_libcs)
- {
-@@ -142,15 +151,17 @@
- }
- # endif
-
-+# ifndef INTERNAL_SYSCALL_NOSYSENTER
- /* Initialize the thread library at least a bit since the libgcc
- functions are using thread functions if these are available and
- we need to setup errno. If there is no thread library and we
- handle TLS the function is defined in the libc to initialized the
- TLS handling. */
--# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
-+# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
- if (__pthread_initialize_minimal)
--# endif
-+# endif
- __pthread_initialize_minimal ();
-+# endif
- #endif
-
- # ifndef SHARED
---- csu/libc-tls.c.orig 2007-01-21 11:37:02.000000000 +0100
-+++ csu/libc-tls.c 2007-01-21 12:09:33.000000000 +0100
-@@ -23,6 +23,7 @@
- #include <unistd.h>
- #include <stdio.h>
- #include <sys/param.h>
-+#include <sysdep.h>
-
-
- #ifdef SHARED
-@@ -30,6 +31,9 @@
- #endif
-
- #ifdef USE_TLS
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+extern void *__sbrk_nosysenter (intptr_t __delta);
-+# endif
- extern ElfW(Phdr) *_dl_phdr;
- extern size_t _dl_phnum;
-
-@@ -142,14 +146,26 @@
-
- The initialized value of _dl_tls_static_size is provided by dl-open.c
- to request some surplus that permits dynamic loading of modules with
-- IE-model TLS. */
-+ IE-model TLS.
-+
-+ Where the normal sbrk would use a syscall that needs the TLS (i386)
-+ use the special non-sysenter version instead. */
- # if TLS_TCB_AT_TP
- tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
-+# else
- tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
-+# endif
- # elif TLS_DTV_AT_TP
- tcb_offset = roundup (tcbsize, align ?: 1);
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
-+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
-+# else
- tlsblock = __sbrk (tcb_offset + memsz + max_align
- + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
-+# endif
- tlsblock += TLS_PRE_TCB_SIZE;
- # else
- /* In case a model with a different layout for the TCB and DTV
---- misc/sbrk.c.orig 2007-01-21 11:38:27.000000000 +0100
-+++ misc/sbrk.c 2007-01-21 12:07:29.000000000 +0100
-@@ -18,6 +18,7 @@
-
- #include <unistd.h>
- #include <errno.h>
-+#include <sysdep.h>
-
- /* Defined in brk.c. */
- extern void *__curbrk;
-@@ -29,6 +30,35 @@
- /* Extend the process's data space by INCREMENT.
- If INCREMENT is negative, shrink data space by - INCREMENT.
- Return start of new space allocated, or -1 for errors. */
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
-+ if the SYSENTER version requires the TLS (which it does on i386).
-+ Obviously using the TLS before it is initialised is broken. */
-+extern int __brk_nosysenter (void *addr);
-+void *
-+__sbrk_nosysenter (intptr_t increment)
-+{
-+ void *oldbrk;
-+
-+ /* If this is not part of the dynamic library or the library is used
-+ via dynamic loading in a statically linked program update
-+ __curbrk from the kernel's brk value. That way two separate
-+ instances of __brk and __sbrk can share the heap, returning
-+ interleaved pieces of it. */
-+ if (__curbrk == NULL || __libc_multiple_libcs)
-+ if (__brk_nosysenter (0) < 0) /* Initialize the break. */
-+ return (void *) -1;
-+
-+ if (increment == 0)
-+ return __curbrk;
-+
-+ oldbrk = __curbrk;
-+ if (__brk_nosysenter (oldbrk + increment) < 0)
-+ return (void *) -1;
-+
-+ return oldbrk;
-+}
-+#endif
- void *
- __sbrk (intptr_t increment)
- {
---- sysdeps/unix/sysv/linux/i386/brk.c.orig 2007-01-21 11:39:16.000000000 +0100
-+++ sysdeps/unix/sysv/linux/i386/brk.c 2007-01-21 11:44:01.000000000 +0100
-@@ -31,6 +31,30 @@
- linker. */
- weak_alias (__curbrk, ___brk_addr)
-
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
-+ * if the SYSENTER version requires the TLS (which it does on i386).
-+ * Obviously using the TLS before it is initialised is broken. */
-+int
-+__brk_nosysenter (void *addr)
-+{
-+ void *__unbounded newbrk;
-+
-+ INTERNAL_SYSCALL_DECL (err);
-+ newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
-+ __ptrvalue (addr));
-+
-+ __curbrk = newbrk;
-+
-+ if (newbrk < addr)
-+ {
-+ __set_errno (ENOMEM);
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+#endif
- int
- __brk (void *addr)
- {
---- sysdeps/unix/sysv/linux/i386/sysdep.h.orig 2007-01-21 13:08:00.000000000 +0100
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h 2007-01-21 13:19:10.000000000 +0100
-@@ -187,7 +187,7 @@
- /* The original calling convention for system calls on Linux/i386 is
- to use int $0x80. */
- #ifdef I386_USE_SYSENTER
--# ifdef SHARED
-+# if defined SHARED || defined __PIC__
- # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
- # else
- # define ENTER_KERNEL call *_dl_sysinfo
-@@ -358,7 +358,7 @@
- possible to use more than four parameters. */
- #undef INTERNAL_SYSCALL
- #ifdef I386_USE_SYSENTER
--# ifdef SHARED
-+# if defined SHARED || defined __PIC__
- # define INTERNAL_SYSCALL(name, err, nr, args...) \
- ({ \
- register unsigned int resultvar; \
-@@ -384,6 +384,18 @@
- : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
- ASMFMT_##nr(args) : "memory", "cc"); \
- (int) resultvar; })
-+# define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
-+ ({ \
-+ register unsigned int resultvar; \
-+ EXTRAVAR_##nr \
-+ asm volatile ( \
-+ LOADARGS_NOSYSENTER_##nr \
-+ "movl %1, %%eax\n\t" \
-+ "int $0x80\n\t" \
-+ RESTOREARGS_NOSYSENTER_##nr \
-+ : "=a" (resultvar) \
-+ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
-+ (int) resultvar; })
- # else
- # define INTERNAL_SYSCALL(name, err, nr, args...) \
- ({ \
-@@ -447,12 +459,20 @@
-
- #define LOADARGS_0
- #ifdef __PIC__
--# if defined I386_USE_SYSENTER && defined SHARED
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
- # define LOADARGS_1 \
- "bpushl .L__X'%k3, %k3\n\t"
- # define LOADARGS_5 \
- "movl %%ebx, %4\n\t" \
- "movl %3, %%ebx\n\t"
-+# define LOADARGS_NOSYSENTER_1 \
-+ "bpushl .L__X'%k2, %k2\n\t"
-+# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1
-+# define LOADARGS_NOSYSENTER_3 LOADARGS_3
-+# define LOADARGS_NOSYSENTER_4 LOADARGS_3
-+# define LOADARGS_NOSYSENTER_5 \
-+ "movl %%ebx, %3\n\t" \
-+ "movl %2, %%ebx\n\t"
- # else
- # define LOADARGS_1 \
- "bpushl .L__X'%k2, %k2\n\t"
-@@ -474,11 +495,18 @@
-
- #define RESTOREARGS_0
- #ifdef __PIC__
--# if defined I386_USE_SYSENTER && defined SHARED
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
- # define RESTOREARGS_1 \
- "bpopl .L__X'%k3, %k3\n\t"
- # define RESTOREARGS_5 \
- "movl %4, %%ebx"
-+# define RESTOREARGS_NOSYSENTER_1 \
-+ "bpopl .L__X'%k2, %k2\n\t"
-+# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1
-+# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3
-+# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3
-+# define RESTOREARGS_NOSYSENTER_5 \
-+ "movl %3, %%ebx"
- # else
- # define RESTOREARGS_1 \
- "bpopl .L__X'%k2, %k2\n\t"
diff --git a/sys-libs/glibc/files/2.5/glibc-2.5-hardened-pie.patch b/sys-libs/glibc/files/2.5/glibc-2.5-hardened-pie.patch
deleted file mode 100644
index 46f3de4f7875..000000000000
--- a/sys-libs/glibc/files/2.5/glibc-2.5-hardened-pie.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Change link commands for glibc executables to build PIEs
-
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
-
---- Makeconfig
-+++ Makeconfig
-@@ -415,10 +415,10 @@
-
- # Command for linking programs with the C library.
- ifndef +link
--+link = $(CC) -nostdlib -nostartfiles -o $@ \
-++link = $(CC) -nostdlib -nostartfiles -fPIE -pie -o $@ \
- $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
- $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
-- $(addprefix $(csu-objpfx),$(start-installed-name)) \
-+ $(addprefix $(csu-objpfx),S$(start-installed-name)) \
- $(+preinit) $(+prector) \
- $(filter-out $(addprefix $(csu-objpfx),start.o \
- $(start-installed-name))\
-@@ -429,7 +429,7 @@
- ifndef +link-static
- +link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
- $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
-- $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
-+ $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
- $(+preinit) $(+prector) \
- $(filter-out $(addprefix $(csu-objpfx),start.o \
- $(start-installed-name))\
-@@ -528,8 +528,8 @@
- ifeq ($(elf),yes)
- +preinit = $(addprefix $(csu-objpfx),crti.o)
- +postinit = $(addprefix $(csu-objpfx),crtn.o)
--+prector = `$(CC) --print-file-name=crtbegin.o`
--+postctor = `$(CC) --print-file-name=crtend.o`
-++prector = `$(CC) --print-file-name=crtbeginS.o`
-++postctor = `$(CC) --print-file-name=crtendS.o`
- +interp = $(addprefix $(elf-objpfx),interp.os)
- endif
- csu-objpfx = $(common-objpfx)csu/
diff --git a/sys-libs/glibc/files/2.6/glibc-2.6-hardened-inittls-nosysenter.patch b/sys-libs/glibc/files/2.6/glibc-2.6-hardened-inittls-nosysenter.patch
deleted file mode 100644
index be8ca1963cb9..000000000000
--- a/sys-libs/glibc/files/2.6/glibc-2.6-hardened-inittls-nosysenter.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-When building glibc PIE (which is not something upstream support),
-several modifications are necessary to the glibc build process.
-
-First, any syscalls in PIEs must be of the PIC variant, otherwise
-textrels ensue. Then, any syscalls made before the initialisation
-of the TLS will fail on i386, as the sysenter variant on i386 uses
-the TLS, giving rise to a chicken-and-egg situation. This patch
-defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
-version is normally used, and uses the non-sysenter version for the brk
-syscall that is performed by the TLS initialisation. Further, the TLS
-initialisation is moved in this case prior to the initialisation of
-dl_osversion, as that requires further syscalls.
-
-csu/libc-start.c: Move initial TLS initialization to before the
-initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
-
-csu/libc-tls.c: Use the no-sysenter version of sbrk when
-INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
-version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-misc/brk.c: Define a no-sysenter version of brk if
-INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
-Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
-
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
-
---- csu/libc-start.c
-+++ csu/libc-start.c
-@@ -28,6 +28,7 @@
- extern int __libc_multiple_libcs;
-
- #include <tls.h>
-+#include <sysdep.h>
- #ifndef SHARED
- # include <dl-osinfo.h>
- extern void __pthread_initialize_minimal (void);
-@@ -129,6 +130,11 @@
- # endif
- _dl_aux_init (auxvec);
- # endif
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ /* Do the initial TLS initialization before _dl_osversion,
-+ since the latter uses the uname syscall. */
-+ __pthread_initialize_minimal ();
-+# endif
- # ifdef DL_SYSDEP_OSCHECK
- if (!__libc_multiple_libcs)
- {
-@@ -138,10 +144,12 @@
- }
- # endif
-
-+# ifndef INTERNAL_SYSCALL_NOSYSENTER
- /* Initialize the thread library at least a bit since the libgcc
- functions are using thread functions if these are available and
- we need to setup errno. */
- __pthread_initialize_minimal ();
-+# endif
- #endif
-
- # ifndef SHARED
---- csu/libc-tls.c
-+++ csu/libc-tls.c
-@@ -23,6 +23,7 @@
- #include <unistd.h>
- #include <stdio.h>
- #include <sys/param.h>
-+#include <sysdep.h>
-
-
- #ifdef SHARED
-@@ -29,6 +30,9 @@
- #error makefile bug, this file is for static only
- #endif
-
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+extern void *__sbrk_nosysenter (intptr_t __delta);
-+#endif
- extern ElfW(Phdr) *_dl_phdr;
- extern size_t _dl_phnum;
-
-@@ -141,14 +145,26 @@
-
- The initialized value of _dl_tls_static_size is provided by dl-open.c
- to request some surplus that permits dynamic loading of modules with
-- IE-model TLS. */
-+ IE-model TLS.
-+
-+ Where the normal sbrk would use a syscall that needs the TLS (i386)
-+ use the special non-sysenter version instead. */
- #if TLS_TCB_AT_TP
- tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
-+# else
- tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
-+# endif
- #elif TLS_DTV_AT_TP
- tcb_offset = roundup (tcbsize, align ?: 1);
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
-+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
-+# else
- tlsblock = __sbrk (tcb_offset + memsz + max_align
- + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
-+# endif
- tlsblock += TLS_PRE_TCB_SIZE;
- #else
- /* In case a model with a different layout for the TCB and DTV
---- misc/sbrk.c
-+++ misc/sbrk.c
-@@ -18,6 +18,7 @@
-
- #include <unistd.h>
- #include <errno.h>
-+#include <sysdep.h>
-
- /* Defined in brk.c. */
- extern void *__curbrk;
-@@ -29,6 +30,35 @@
- /* Extend the process's data space by INCREMENT.
- If INCREMENT is negative, shrink data space by - INCREMENT.
- Return start of new space allocated, or -1 for errors. */
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
-+ if the SYSENTER version requires the TLS (which it does on i386).
-+ Obviously using the TLS before it is initialised is broken. */
-+extern int __brk_nosysenter (void *addr);
-+void *
-+__sbrk_nosysenter (intptr_t increment)
-+{
-+ void *oldbrk;
-+
-+ /* If this is not part of the dynamic library or the library is used
-+ via dynamic loading in a statically linked program update
-+ __curbrk from the kernel's brk value. That way two separate
-+ instances of __brk and __sbrk can share the heap, returning
-+ interleaved pieces of it. */
-+ if (__curbrk == NULL || __libc_multiple_libcs)
-+ if (__brk_nosysenter (0) < 0) /* Initialize the break. */
-+ return (void *) -1;
-+
-+ if (increment == 0)
-+ return __curbrk;
-+
-+ oldbrk = __curbrk;
-+ if (__brk_nosysenter (oldbrk + increment) < 0)
-+ return (void *) -1;
-+
-+ return oldbrk;
-+}
-+#endif
- void *
- __sbrk (intptr_t increment)
- {
---- sysdeps/unix/sysv/linux/i386/brk.c
-+++ sysdeps/unix/sysv/linux/i386/brk.c
-@@ -31,6 +31,30 @@
- linker. */
- weak_alias (__curbrk, ___brk_addr)
-
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
-+ * if the SYSENTER version requires the TLS (which it does on i386).
-+ * Obviously using the TLS before it is initialised is broken. */
-+int
-+__brk_nosysenter (void *addr)
-+{
-+ void *__unbounded newbrk;
-+
-+ INTERNAL_SYSCALL_DECL (err);
-+ newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
-+ __ptrvalue (addr));
-+
-+ __curbrk = newbrk;
-+
-+ if (newbrk < addr)
-+ {
-+ __set_errno (ENOMEM);
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+#endif
- int
- __brk (void *addr)
- {
---- sysdeps/unix/sysv/linux/i386/sysdep.h
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h
-@@ -187,7 +187,7 @@
- /* The original calling convention for system calls on Linux/i386 is
- to use int $0x80. */
- #ifdef I386_USE_SYSENTER
--# ifdef SHARED
-+# if defined SHARED || defined __PIC__
- # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
- # else
- # define ENTER_KERNEL call *_dl_sysinfo
-@@ -358,7 +358,7 @@
- possible to use more than four parameters. */
- #undef INTERNAL_SYSCALL
- #ifdef I386_USE_SYSENTER
--# ifdef SHARED
-+# if defined SHARED || defined __PIC__
- # define INTERNAL_SYSCALL(name, err, nr, args...) \
- ({ \
- register unsigned int resultvar; \
-@@ -384,6 +384,18 @@
- : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
- ASMFMT_##nr(args) : "memory", "cc"); \
- (int) resultvar; })
-+# define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
-+ ({ \
-+ register unsigned int resultvar; \
-+ EXTRAVAR_##nr \
-+ asm volatile ( \
-+ LOADARGS_NOSYSENTER_##nr \
-+ "movl %1, %%eax\n\t" \
-+ "int $0x80\n\t" \
-+ RESTOREARGS_NOSYSENTER_##nr \
-+ : "=a" (resultvar) \
-+ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
-+ (int) resultvar; })
- # else
- # define INTERNAL_SYSCALL(name, err, nr, args...) \
- ({ \
-@@ -447,12 +459,20 @@
-
- #define LOADARGS_0
- #ifdef __PIC__
--# if defined I386_USE_SYSENTER && defined SHARED
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
- # define LOADARGS_1 \
- "bpushl .L__X'%k3, %k3\n\t"
- # define LOADARGS_5 \
- "movl %%ebx, %4\n\t" \
- "movl %3, %%ebx\n\t"
-+# define LOADARGS_NOSYSENTER_1 \
-+ "bpushl .L__X'%k2, %k2\n\t"
-+# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1
-+# define LOADARGS_NOSYSENTER_3 LOADARGS_3
-+# define LOADARGS_NOSYSENTER_4 LOADARGS_3
-+# define LOADARGS_NOSYSENTER_5 \
-+ "movl %%ebx, %3\n\t" \
-+ "movl %2, %%ebx\n\t"
- # else
- # define LOADARGS_1 \
- "bpushl .L__X'%k2, %k2\n\t"
-@@ -474,11 +495,18 @@
-
- #define RESTOREARGS_0
- #ifdef __PIC__
--# if defined I386_USE_SYSENTER && defined SHARED
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
- # define RESTOREARGS_1 \
- "bpopl .L__X'%k3, %k3\n\t"
- # define RESTOREARGS_5 \
- "movl %4, %%ebx"
-+# define RESTOREARGS_NOSYSENTER_1 \
-+ "bpopl .L__X'%k2, %k2\n\t"
-+# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1
-+# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3
-+# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3
-+# define RESTOREARGS_NOSYSENTER_5 \
-+ "movl %3, %%ebx"
- # else
- # define RESTOREARGS_1 \
- "bpopl .L__X'%k2, %k2\n\t"
diff --git a/sys-libs/glibc/files/2.7/glibc-2.7-hardened-inittls-nosysenter.patch b/sys-libs/glibc/files/2.7/glibc-2.7-hardened-inittls-nosysenter.patch
deleted file mode 100644
index ecf57a911b0f..000000000000
--- a/sys-libs/glibc/files/2.7/glibc-2.7-hardened-inittls-nosysenter.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-When building glibc PIE (which is not something upstream support),
-several modifications are necessary to the glibc build process.
-
-First, any syscalls in PIEs must be of the PIC variant, otherwise
-textrels ensue. Then, any syscalls made before the initialisation
-of the TLS will fail on i386, as the sysenter variant on i386 uses
-the TLS, giving rise to a chicken-and-egg situation. This patch
-defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
-version is normally used, and uses the non-sysenter version for the brk
-syscall that is performed by the TLS initialisation. Further, the TLS
-initialisation is moved in this case prior to the initialisation of
-dl_osversion, as that requires further syscalls.
-
-csu/libc-start.c: Move initial TLS initialization to before the
-initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
-
-csu/libc-tls.c: Use the no-sysenter version of sbrk when
-INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
-version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-misc/brk.c: Define a no-sysenter version of brk if
-INTERNAL_SYSCALL_NOSYSENTER is defined.
-
-sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
-Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
-
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
-
---- csu/libc-start.c
-+++ csu/libc-start.c
-@@ -28,6 +28,7 @@
- extern int __libc_multiple_libcs;
-
- #include <tls.h>
-+#include <sysdep.h>
- #ifndef SHARED
- # include <dl-osinfo.h>
- extern void __pthread_initialize_minimal (void);
-@@ -129,6 +130,11 @@
- # endif
- _dl_aux_init (auxvec);
- # endif
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ /* Do the initial TLS initialization before _dl_osversion,
-+ since the latter uses the uname syscall. */
-+ __pthread_initialize_minimal ();
-+# endif
- # ifdef DL_SYSDEP_OSCHECK
- if (!__libc_multiple_libcs)
- {
-@@ -138,10 +144,12 @@
- }
- # endif
-
-+# ifndef INTERNAL_SYSCALL_NOSYSENTER
- /* Initialize the thread library at least a bit since the libgcc
- functions are using thread functions if these are available and
- we need to setup errno. */
- __pthread_initialize_minimal ();
-+# endif
-
- /* Set up the stack checker's canary. */
- uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
---- csu/libc-tls.c
-+++ csu/libc-tls.c
-@@ -23,6 +23,7 @@
- #include <unistd.h>
- #include <stdio.h>
- #include <sys/param.h>
-+#include <sysdep.h>
-
-
- #ifdef SHARED
-@@ -29,6 +30,9 @@
- #error makefile bug, this file is for static only
- #endif
-
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+extern void *__sbrk_nosysenter (intptr_t __delta);
-+#endif
- extern ElfW(Phdr) *_dl_phdr;
- extern size_t _dl_phnum;
-
-@@ -141,14 +145,26 @@
-
- The initialized value of _dl_tls_static_size is provided by dl-open.c
- to request some surplus that permits dynamic loading of modules with
-- IE-model TLS. */
-+ IE-model TLS.
-+
-+ Where the normal sbrk would use a syscall that needs the TLS (i386)
-+ use the special non-sysenter version instead. */
- #if TLS_TCB_AT_TP
- tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
-+# else
- tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
-+# endif
- #elif TLS_DTV_AT_TP
- tcb_offset = roundup (tcbsize, align ?: 1);
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
-+ tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
-+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
-+# else
- tlsblock = __sbrk (tcb_offset + memsz + max_align
- + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
-+# endif
- tlsblock += TLS_PRE_TCB_SIZE;
- #else
- /* In case a model with a different layout for the TCB and DTV
---- misc/sbrk.c
-+++ misc/sbrk.c
-@@ -18,6 +18,7 @@
-
- #include <unistd.h>
- #include <errno.h>
-+#include <sysdep.h>
-
- /* Defined in brk.c. */
- extern void *__curbrk;
-@@ -29,6 +30,35 @@
- /* Extend the process's data space by INCREMENT.
- If INCREMENT is negative, shrink data space by - INCREMENT.
- Return start of new space allocated, or -1 for errors. */
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
-+ if the SYSENTER version requires the TLS (which it does on i386).
-+ Obviously using the TLS before it is initialised is broken. */
-+extern int __brk_nosysenter (void *addr);
-+void *
-+__sbrk_nosysenter (intptr_t increment)
-+{
-+ void *oldbrk;
-+
-+ /* If this is not part of the dynamic library or the library is used
-+ via dynamic loading in a statically linked program update
-+ __curbrk from the kernel's brk value. That way two separate
-+ instances of __brk and __sbrk can share the heap, returning
-+ interleaved pieces of it. */
-+ if (__curbrk == NULL || __libc_multiple_libcs)
-+ if (__brk_nosysenter (0) < 0) /* Initialize the break. */
-+ return (void *) -1;
-+
-+ if (increment == 0)
-+ return __curbrk;
-+
-+ oldbrk = __curbrk;
-+ if (__brk_nosysenter (oldbrk + increment) < 0)
-+ return (void *) -1;
-+
-+ return oldbrk;
-+}
-+#endif
- void *
- __sbrk (intptr_t increment)
- {
---- sysdeps/unix/sysv/linux/i386/brk.c
-+++ sysdeps/unix/sysv/linux/i386/brk.c
-@@ -31,6 +31,30 @@
- linker. */
- weak_alias (__curbrk, ___brk_addr)
-
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
-+ * if the SYSENTER version requires the TLS (which it does on i386).
-+ * Obviously using the TLS before it is initialised is broken. */
-+int
-+__brk_nosysenter (void *addr)
-+{
-+ void *__unbounded newbrk;
-+
-+ INTERNAL_SYSCALL_DECL (err);
-+ newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
-+ __ptrvalue (addr));
-+
-+ __curbrk = newbrk;
-+
-+ if (newbrk < addr)
-+ {
-+ __set_errno (ENOMEM);
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+#endif
- int
- __brk (void *addr)
- {
---- sysdeps/unix/sysv/linux/i386/sysdep.h
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h
-@@ -187,7 +187,7 @@
- /* The original calling convention for system calls on Linux/i386 is
- to use int $0x80. */
- #ifdef I386_USE_SYSENTER
--# ifdef SHARED
-+# if defined SHARED || defined __PIC__
- # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
- # else
- # define ENTER_KERNEL call *_dl_sysinfo
-@@ -358,7 +358,7 @@
- possible to use more than four parameters. */
- #undef INTERNAL_SYSCALL
- #ifdef I386_USE_SYSENTER
--# ifdef SHARED
-+# if defined SHARED || defined __PIC__
- # define INTERNAL_SYSCALL(name, err, nr, args...) \
- ({ \
- register unsigned int resultvar; \
-@@ -384,6 +384,18 @@
- : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
- ASMFMT_##nr(args) : "memory", "cc"); \
- (int) resultvar; })
-+# define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
-+ ({ \
-+ register unsigned int resultvar; \
-+ EXTRAVAR_##nr \
-+ asm volatile ( \
-+ LOADARGS_NOSYSENTER_##nr \
-+ "movl %1, %%eax\n\t" \
-+ "int $0x80\n\t" \
-+ RESTOREARGS_NOSYSENTER_##nr \
-+ : "=a" (resultvar) \
-+ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
-+ (int) resultvar; })
- # else
- # define INTERNAL_SYSCALL(name, err, nr, args...) \
- ({ \
-@@ -447,12 +459,20 @@
-
- #define LOADARGS_0
- #ifdef __PIC__
--# if defined I386_USE_SYSENTER && defined SHARED
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
- # define LOADARGS_1 \
- "bpushl .L__X'%k3, %k3\n\t"
- # define LOADARGS_5 \
- "movl %%ebx, %4\n\t" \
- "movl %3, %%ebx\n\t"
-+# define LOADARGS_NOSYSENTER_1 \
-+ "bpushl .L__X'%k2, %k2\n\t"
-+# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1
-+# define LOADARGS_NOSYSENTER_3 LOADARGS_3
-+# define LOADARGS_NOSYSENTER_4 LOADARGS_3
-+# define LOADARGS_NOSYSENTER_5 \
-+ "movl %%ebx, %3\n\t" \
-+ "movl %2, %%ebx\n\t"
- # else
- # define LOADARGS_1 \
- "bpushl .L__X'%k2, %k2\n\t"
-@@ -474,11 +495,18 @@
-
- #define RESTOREARGS_0
- #ifdef __PIC__
--# if defined I386_USE_SYSENTER && defined SHARED
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
- # define RESTOREARGS_1 \
- "bpopl .L__X'%k3, %k3\n\t"
- # define RESTOREARGS_5 \
- "movl %4, %%ebx"
-+# define RESTOREARGS_NOSYSENTER_1 \
-+ "bpopl .L__X'%k2, %k2\n\t"
-+# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1
-+# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3
-+# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3
-+# define RESTOREARGS_NOSYSENTER_5 \
-+ "movl %3, %%ebx"
- # else
- # define RESTOREARGS_1 \
- "bpopl .L__X'%k2, %k2\n\t"
diff --git a/sys-libs/glibc/glibc-2.10.1-r1.ebuild b/sys-libs/glibc/glibc-2.10.1-r1.ebuild
deleted file mode 100644
index 75b70808849c..000000000000
--- a/sys-libs/glibc/glibc-2.10.1-r1.ebuild
+++ /dev/null
@@ -1,203 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.10.1-r1.ebuild,v 1.30 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-if [[ ${PV} == *_p* ]] ; then
-RELEASE_VER=${PV%_p*}
-BRANCH_UPDATE=""
-SNAP_VER=${PV#*_p}
-LIBIDN_VER=""
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-LIBIDN_VER=${RELEASE_VER}
-fi
-PATCH_VER="7" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} >=sys-libs/timezone-data-2007c"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- else
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.5/glibc-2.5-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Patching Glibc to support older SSP __guard"
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-ssp-compat.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.11.3.ebuild b/sys-libs/glibc/glibc-2.11.3.ebuild
deleted file mode 100644
index 21fe3b61b820..000000000000
--- a/sys-libs/glibc/glibc-2.11.3.ebuild
+++ /dev/null
@@ -1,206 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.11.3.ebuild,v 1.22 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 sh sparc x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-if [[ ${PV} == *_p* ]] ; then
-RELEASE_VER=${PV%_p*}
-BRANCH_UPDATE=""
-SNAP_VER=${PV#*_p}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="3" # Gentoo patchset
-PORTS_VER=${RELEASE_VER%.?} # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- else
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.11/glibc-2.11-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Patching Glibc to support older SSP __guard"
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-ssp-compat.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.12.1-r3.ebuild b/sys-libs/glibc/glibc-2.12.1-r3.ebuild
deleted file mode 100644
index 366ce7c37de4..000000000000
--- a/sys-libs/glibc/glibc-2.12.1-r3.ebuild
+++ /dev/null
@@ -1,220 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.12.1-r3.ebuild,v 1.19 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="~amd64 ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-if [[ ${PV} == *_p* ]] ; then
-RELEASE_VER=${PV%_p*}
-BRANCH_UPDATE=""
-SNAP_VER=${PV#*_p}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="8" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- else
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-pkg_setup() {
- eblit-run pkg_setup
-
- # Static binary sanity check #332927
- if [[ ${ROOT} == "/" ]] && \
- has_version "<${CATEGORY}/${P}" && \
- built_with_use sys-apps/coreutils static
- then
- eerror "Please rebuild coreutils with USE=-static, then install"
- eerror "glibc, then you may rebuild coreutils with USE=static."
- die "Avoiding system meltdown #332927"
- fi
-}
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Patching Glibc to support older SSP __guard"
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-ssp-compat.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.12.2.ebuild b/sys-libs/glibc/glibc-2.12.2.ebuild
deleted file mode 100644
index 6f00618c3fb3..000000000000
--- a/sys-libs/glibc/glibc-2.12.2.ebuild
+++ /dev/null
@@ -1,220 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.12.2.ebuild,v 1.25 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="amd64 arm hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-if [[ ${PV} == *_p* ]] ; then
-RELEASE_VER=${PV%_p*}
-BRANCH_UPDATE=""
-SNAP_VER=${PV#*_p}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="4" # Gentoo patchset
-PORTS_VER="2.12.1" # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- else
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-pkg_setup() {
- eblit-run pkg_setup
-
- # Static binary sanity check #332927
- if [[ ${ROOT} == "/" ]] && \
- has_version "<${CATEGORY}/${P}" && \
- built_with_use sys-apps/coreutils static
- then
- eerror "Please rebuild coreutils with USE=-static, then install"
- eerror "glibc, then you may rebuild coreutils with USE=static."
- die "Avoiding system meltdown #332927"
- fi
-}
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Patching Glibc to support older SSP __guard"
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-ssp-compat.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.13-r2.ebuild b/sys-libs/glibc/glibc-2.13-r2.ebuild
deleted file mode 100644
index 7be3ac0a1525..000000000000
--- a/sys-libs/glibc/glibc-2.13-r2.ebuild
+++ /dev/null
@@ -1,218 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.13-r2.ebuild,v 1.20 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-if [[ ${PV} == *_p* ]] ; then
-RELEASE_VER=${PV%_p*}
-BRANCH_UPDATE=""
-SNAP_VER=${PV#*_p}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="6" # Gentoo patchset
-PORTS_VER="2.13" # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- !<sys-devel/patch-2.6
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- else
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-pkg_setup() {
- eblit-run pkg_setup
-
- # Static binary sanity check #332927
- if [[ ${ROOT} == "/" ]] && \
- has_version "<${CATEGORY}/${P}" && \
- built_with_use sys-apps/coreutils static
- then
- eerror "Please rebuild coreutils with USE=-static, then install"
- eerror "glibc, then you may rebuild coreutils with USE=static."
- die "Avoiding system meltdown #332927"
- fi
-}
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.14.1-r2.ebuild b/sys-libs/glibc/glibc-2.14.1-r2.ebuild
deleted file mode 100644
index 792e207eaa04..000000000000
--- a/sys-libs/glibc/glibc-2.14.1-r2.ebuild
+++ /dev/null
@@ -1,246 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.14.1-r2.ebuild,v 1.18 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-RELEASE_VER=""
-BRANCH_UPDATE=""
-SNAP_VER=""
-case ${PV} in
-9999*)
- EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
- EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
- inherit git-2
- ;;
-*_p*)
- RELEASE_VER=${PV%_p*}
- SNAP_VER=${PV#*_p}
- ;;
-*)
- RELEASE_VER=${PV}
- ;;
-esac
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="5" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- !<sys-devel/patch-2.6
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- elif [[ -z ${EGIT_REPO_URIS} ]] ; then
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-pkg_setup() {
- eblit-run pkg_setup
-
- # Static binary sanity check #332927
- if [[ ${ROOT} == "/" ]] && \
- has_version "<${CATEGORY}/${P}" && \
- built_with_use sys-apps/coreutils static
- then
- eerror "Please rebuild coreutils with USE=-static, then install"
- eerror "glibc, then you may rebuild coreutils with USE=static."
- die "Avoiding system meltdown #332927"
- fi
-}
-
-eblit-src_unpack-pre() {
- GLIBC_PATCH_EXCLUDE+=" 1200_all_glibc-${PV}-x32.patch"
-}
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
-
-eblit-pkg_preinst-post() {
- if [[ ${CTARGET} == arm* ]] ; then
- # Backwards compat support for renaming hardfp ldsos #417287
- local oldso='/lib/ld-linux.so.3'
- local nldso='/lib/ld-linux-armhf.so.3'
- if [[ -e ${D}${nldso} ]] ; then
- if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
- ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
- ewarn "Please rebuild all packages using this old ldso as compat"
- ewarn "support will be dropped in the future."
- ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
- fi
- fi
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.14.ebuild b/sys-libs/glibc/glibc-2.14.ebuild
deleted file mode 100644
index cf6a1b69d8a7..000000000000
--- a/sys-libs/glibc/glibc-2.14.ebuild
+++ /dev/null
@@ -1,242 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.14.ebuild,v 1.25 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-RELEASE_VER=""
-BRANCH_UPDATE=""
-SNAP_VER=""
-case ${PV} in
-9999*)
- EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
- EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
- inherit git-2
- ;;
-*_p*)
- RELEASE_VER=${PV%_p*}
- SNAP_VER=${PV#*_p}
- ;;
-*)
- RELEASE_VER=${PV}
- ;;
-esac
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="7" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- !<sys-devel/patch-2.6
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- elif [[ -z ${EGIT_REPO_URIS} ]] ; then
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-pkg_setup() {
- eblit-run pkg_setup
-
- # Static binary sanity check #332927
- if [[ ${ROOT} == "/" ]] && \
- has_version "<${CATEGORY}/${P}" && \
- built_with_use sys-apps/coreutils static
- then
- eerror "Please rebuild coreutils with USE=-static, then install"
- eerror "glibc, then you may rebuild coreutils with USE=static."
- die "Avoiding system meltdown #332927"
- fi
-}
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
-
-eblit-pkg_preinst-post() {
- if [[ ${CTARGET} == arm* ]] ; then
- # Backwards compat support for renaming hardfp ldsos #417287
- local oldso='/lib/ld-linux.so.3'
- local nldso='/lib/ld-linux-armhf.so.3'
- if [[ -e ${D}${nldso} ]] ; then
- if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
- ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
- ewarn "Please rebuild all packages using this old ldso as compat"
- ewarn "support will be dropped in the future."
- ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
- fi
- fi
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.15-r1.ebuild b/sys-libs/glibc/glibc-2.15-r1.ebuild
deleted file mode 100644
index a2a4927ed86f..000000000000
--- a/sys-libs/glibc/glibc-2.15-r1.ebuild
+++ /dev/null
@@ -1,233 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.15-r1.ebuild,v 1.18 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="~amd64 -hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-RELEASE_VER=""
-BRANCH_UPDATE=""
-SNAP_VER=""
-case ${PV} in
-9999*)
- EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
- EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
- inherit git-2
- ;;
-*_p*)
- RELEASE_VER=${PV%_p*}
- SNAP_VER=${PV#*_p}
- ;;
-*)
- RELEASE_VER=${PV}
- ;;
-esac
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="13" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- !<sys-devel/patch-2.6
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )
- !sys-libs/nss-db"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- elif [[ -z ${EGIT_REPO_URIS} ]] ; then
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.xz
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.xz
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-eblit-src_unpack-pre() {
- GLIBC_PATCH_EXCLUDE+=" 1200_all_glibc-${PV}-x32.patch"
-}
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
-
-eblit-pkg_preinst-post() {
- if [[ ${CTARGET} == arm* ]] ; then
- # Backwards compat support for renaming hardfp ldsos #417287
- local oldso='/lib/ld-linux.so.3'
- local nldso='/lib/ld-linux-armhf.so.3'
- if [[ -e ${D}${nldso} ]] ; then
- if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
- ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
- ewarn "Please rebuild all packages using this old ldso as compat"
- ewarn "support will be dropped in the future."
- ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
- fi
- fi
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.15-r2.ebuild b/sys-libs/glibc/glibc-2.15-r2.ebuild
deleted file mode 100644
index 1ea369612106..000000000000
--- a/sys-libs/glibc/glibc-2.15-r2.ebuild
+++ /dev/null
@@ -1,225 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.15-r2.ebuild,v 1.31 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="alpha amd64 arm -hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-RELEASE_VER=""
-BRANCH_UPDATE=""
-SNAP_VER=""
-case ${PV} in
-9999*)
- EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
- EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
- inherit git-2
- ;;
-*_p*)
- RELEASE_VER=${PV%_p*}
- SNAP_VER=${PV#*_p}
- ;;
-*)
- RELEASE_VER=${PV}
- ;;
-esac
-LIBIDN_VER="" # it's integrated into the main tarball now
-PATCH_VER="21" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only"
-[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- x86? ( >=sys-devel/gcc-4.3 )
- amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- !<sys-devel/patch-2.6
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )
- !sys-libs/nss-db"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
- RDEPEND="${RDEPEND}
- vanilla? ( !sys-libs/timezone-data )
- !vanilla? ( sys-libs/timezone-data )"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- elif [[ -z ${EGIT_REPO_URIS} ]] ; then
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.xz
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.xz
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
- cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
- debug/chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug fortify handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}
-
-eblit-pkg_preinst-post() {
- if [[ ${CTARGET} == arm* ]] ; then
- # Backwards compat support for renaming hardfp ldsos #417287
- local oldso='/lib/ld-linux.so.3'
- local nldso='/lib/ld-linux-armhf.so.3'
- if [[ -e ${D}${nldso} ]] ; then
- if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
- ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
- ewarn "Please rebuild all packages using this old ldso as compat"
- ewarn "support will be dropped in the future."
- ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
- fi
- fi
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.9_p20081201-r3.ebuild b/sys-libs/glibc/glibc-2.9_p20081201-r3.ebuild
deleted file mode 100644
index 4619bfb0ac6e..000000000000
--- a/sys-libs/glibc/glibc-2.9_p20081201-r3.ebuild
+++ /dev/null
@@ -1,193 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.9_p20081201-r3.ebuild,v 1.23 2014/03/14 09:11:35 vapier Exp $
-
-inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2.1+ BSD HPND inner-net"
-KEYWORDS="alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-if [[ ${PV} == *_p* ]] ; then
-RELEASE_VER=${PV%_p*}
-BRANCH_UPDATE=""
-SNAP_VER=${PV#*_p}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-PATCH_VER="8" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
-LIBIDN_VER="" # version of libidn addon
-LT_VER="" # version of linuxthreads addon
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
-
-IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
-S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER+-${SNAP_VER}}
-
-# Here's how the cross-compile logic breaks down ...
-# CTARGET - machine that will target the binaries
-# CHOST - machine that will host the binaries
-# CBUILD - machine that will build the binaries
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
-# CBUILD = CHOST = CTARGET - native build/install
-# CBUILD != (CHOST = CTARGET) - cross-compile a native build
-# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
-# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
-# For install paths:
-# CHOST = CTARGET - install into /
-# CHOST != CTARGET - install into /usr/CTARGET/
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# Why SLOT 2.2 you ask yourself while sippin your tea ?
-# Everyone knows 2.2 > 0, duh.
-SLOT="2.2"
-
-# General: We need a new-enough binutils for as-needed
-# arch: we need to make sure our binutils/gcc supports TLS
-DEPEND=">=sys-devel/gcc-3.4.4
- arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
- ppc? ( >=sys-devel/gcc-4.1.0 )
- ppc64? ( >=sys-devel/gcc-4.1.0 )
- >=sys-devel/binutils-2.15.94
- ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- !<sys-apps/sandbox-1.2.18.1-r2
- !<sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="!sys-kernel/ps3-sources
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY} == cross-* ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
- [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
-else
- DEPEND="${DEPEND} >=sys-libs/timezone-data-2007c"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-SRC_URI=$(
- upstream_uris() {
- echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
- }
- gentoo_uris() {
- local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
- devspace=${devspace//HTTP/http://dev.gentoo.org/}
- echo mirror://gentoo/$1 ${devspace//URI/$1}
- }
-
- TARNAME=${PN}
- if [[ -n ${SNAP_VER} ]] ; then
- TARNAME="${PN}-${RELEASE_VER}"
- [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
- upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
- else
- upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
- fi
- [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
- [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
- [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-eblit-src_unpack-post() {
- if use hardened ; then
- cd "${S}"
- einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
- gcc-specs-pie && epatch "${FILESDIR}"/2.5/glibc-2.5-hardened-pie.patch
- epatch "${FILESDIR}"/2.5/glibc-2.5-hardened-configure-picdefault.patch
- epatch "${FILESDIR}"/2.7/glibc-2.7-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP handler"
- cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
- debug/stack_chk_fail.c || die
-
- if use debug ; then
- # When using Hardened Gentoo stack handler, have smashes dump core for
- # analysis - debug only, as core could be an information leak
- # (paranoia).
- sed -i \
- -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
- debug/Makefile \
- || die "Failed to modify debug/Makefile for debug stack handler"
- fi
-
- # Build nscd with ssp-all
- sed -i \
- -e 's:-fstack-protector$:-fstack-protector-all:' \
- nscd/Makefile \
- || die "Failed to ensure nscd builds with ssp-all"
- fi
-}