summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/glibc/files/2.17')
-rw-r--r--sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch42
-rw-r--r--sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch162
-rw-r--r--sys-libs/glibc/files/2.17/glibc-2.17-shadow-prefix.patch33
-rw-r--r--sys-libs/glibc/files/2.17/locale-gen_prefix.patch77
-rw-r--r--sys-libs/glibc/files/2.17/vdso-disable.patch34
-rw-r--r--sys-libs/glibc/files/2.17/vdso.patch17
6 files changed, 365 insertions, 0 deletions
diff --git a/sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch b/sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch
new file mode 100644
index 0000000..da4fb82
--- /dev/null
+++ b/sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch
@@ -0,0 +1,42 @@
+2012-11-11 Magnus Granberg <zorry@gentoo.org>
+
+ #442712
+ * Makeconfig (+link): Set to +link-pie.
+ (+link-static-before-libc): 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-before-libc = $(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) $(+prectorT) \
+ $(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) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
+-+postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
+-# Variants of the two previous definitions for linking PIE programs.
+ +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
+ +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
+++prector = $(+prectorS)
+++postctor = $(+postctorS)
+ # Variants of the two previous definitions for statically linking programs.
+ +prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
+ +postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
+ +interp = $(addprefix $(elf-objpfx),interp.os)
+ endif
+ csu-objpfx = $(common-objpfx)csu/
diff --git a/sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch b/sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch
new file mode 100644
index 0000000..8fc683d
--- /dev/null
+++ b/sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch
@@ -0,0 +1,162 @@
+Index: glibc-2.19/sysdeps/generic/paths.h
+===================================================================
+--- glibc-2.19.orig/sysdeps/generic/paths.h
++++ glibc-2.19/sysdeps/generic/paths.h
+@@ -33,43 +33,43 @@
+ #define _PATHS_H_
+
+ /* Default search path. */
+-#define _PATH_DEFPATH "/usr/bin:/bin"
++#define _PATH_DEFPATH "@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin"
+ /* All standard utilities path. */
+ #define _PATH_STDPATH \
+- "/usr/bin:/bin:/usr/sbin:/sbin"
++ "@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/sbin"
+
+-#define _PATH_BSHELL "/bin/sh"
++#define _PATH_BSHELL "@GENTOO_PORTAGE_EPREFIX@/bin/sh"
+ #define _PATH_CONSOLE "/dev/console"
+-#define _PATH_CSHELL "/bin/csh"
+-#define _PATH_DEVDB "/var/run/dev.db"
++#define _PATH_CSHELL "@GENTOO_PORTAGE_EPREFIX@/bin/csh"
++#define _PATH_DEVDB "@GENTOO_PORTAGE_EPREFIX@/var/run/dev.db"
+ #define _PATH_DEVNULL "/dev/null"
+ #define _PATH_DRUM "/dev/drum"
+-#define _PATH_GSHADOW "/etc/gshadow"
++#define _PATH_GSHADOW "@GENTOO_PORTAGE_EPREFIX@/etc/gshadow"
+ #define _PATH_KMEM "/dev/kmem"
+-#define _PATH_LASTLOG "/var/log/lastlog"
++#define _PATH_LASTLOG "@GENTOO_PORTAGE_EPREFIX@/var/log/lastlog"
+ #define _PATH_MAILDIR "/var/mail"
+-#define _PATH_MAN "/usr/share/man"
++#define _PATH_MAN "@GENTOO_PORTAGE_EPREFIX@/usr/share/man"
+ #define _PATH_MEM "/dev/mem"
+-#define _PATH_MNTTAB "/etc/fstab"
+-#define _PATH_MOUNTED "/var/run/mtab"
+-#define _PATH_NOLOGIN "/etc/nologin"
+-#define _PATH_PRESERVE "/var/lib"
+-#define _PATH_RWHODIR "/var/spool/rwho"
+-#define _PATH_SENDMAIL "/usr/sbin/sendmail"
+-#define _PATH_SHADOW "/etc/shadow"
+-#define _PATH_SHELLS "/etc/shells"
++#define _PATH_MNTTAB "@GENTOO_PORTAGE_EPREFIX@/etc/fstab"
++#define _PATH_MOUNTED "@GENTOO_PORTAGE_EPREFIX@/var/run/mtab"
++#define _PATH_NOLOGIN "@GENTOO_PORTAGE_EPREFIX@/etc/nologin"
++#define _PATH_PRESERVE "@GENTOO_PORTAGE_EPREFIX@/var/lib"
++#define _PATH_RWHODIR "@GENTOO_PORTAGE_EPREFIX@/var/spool/rwho"
++#define _PATH_SENDMAIL "@GENTOO_PORTAGE_EPREFIX@/usr/sbin/sendmail"
++#define _PATH_SHADOW "@GENTOO_PORTAGE_EPREFIX@/etc/shadow"
++#define _PATH_SHELLS "@GENTOO_PORTAGE_EPREFIX@/etc/shells"
+ #define _PATH_TTY "/dev/tty"
+ #define _PATH_UNIX "/vmunix"
+-#define _PATH_UTMP "/var/run/utmp"
+-#define _PATH_UTMP_DB "/var/run/utmp.db"
+-#define _PATH_VI "/usr/bin/vi"
++#define _PATH_UTMP "@GENTOO_PORTAGE_EPREFIX@/var/run/utmp"
++#define _PATH_UTMP_DB "@GENTOO_PORTAGE_EPREFIX@/var/run/utmp.db"
++#define _PATH_VI "@GENTOO_PORTAGE_EPREFIX@/usr/bin/vi"
+ #define _PATH_WTMP "/var/log/wtmp"
+
+ /* Provide trailing slash, since mostly used for building pathnames. */
+ #define _PATH_DEV "/dev/"
+ #define _PATH_TMP "/tmp/"
+-#define _PATH_VARDB "/var/db/"
+-#define _PATH_VARRUN "/var/run/"
++#define _PATH_VARDB "@GENTOO_PORTAGE_EPREFIX@/var/db/"
++#define _PATH_VARRUN "@GENTOO_PORTAGE_EPREFIX@/var/run/"
+ #define _PATH_VARTMP "/var/tmp/"
+
+ #endif /* !_PATHS_H_ */
+Index: glibc-2.19/sysdeps/unix/sysv/linux/paths.h
+===================================================================
+--- glibc-2.19.orig/sysdeps/unix/sysv/linux/paths.h
++++ glibc-2.19/sysdeps/unix/sysv/linux/paths.h
+@@ -33,43 +33,43 @@
+ #define _PATHS_H_
+
+ /* Default search path. */
+-#define _PATH_DEFPATH "/usr/bin:/bin"
++#define _PATH_DEFPATH "@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin"
+ /* All standard utilities path. */
+ #define _PATH_STDPATH \
+- "/usr/bin:/bin:/usr/sbin:/sbin"
++ "@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/sbin"
+
+-#define _PATH_BSHELL "/bin/sh"
++#define _PATH_BSHELL "@GENTOO_PORTAGE_EPREFIX@/bin/sh"
+ #define _PATH_CONSOLE "/dev/console"
+-#define _PATH_CSHELL "/bin/csh"
+-#define _PATH_DEVDB "/var/run/dev.db"
++#define _PATH_CSHELL "@GENTOO_PORTAGE_EPREFIX@/bin/csh"
++#define _PATH_DEVDB "@GENTOO_PORTAGE_EPREFIX@/var/run/dev.db"
+ #define _PATH_DEVNULL "/dev/null"
+ #define _PATH_DRUM "/dev/drum"
+-#define _PATH_GSHADOW "/etc/gshadow"
++#define _PATH_GSHADOW "@GENTOO_PORTAGE_EPREFIX@/etc/gshadow"
+ #define _PATH_KLOG "/proc/kmsg"
+ #define _PATH_KMEM "/dev/kmem"
+ #define _PATH_LASTLOG "/var/log/lastlog"
+ #define _PATH_MAILDIR "/var/mail"
+-#define _PATH_MAN "/usr/share/man"
++#define _PATH_MAN "@GENTOO_PORTAGE_EPREFIX@/usr/share/man"
+ #define _PATH_MEM "/dev/mem"
+-#define _PATH_MNTTAB "/etc/fstab"
+-#define _PATH_MOUNTED "/etc/mtab"
+-#define _PATH_NOLOGIN "/etc/nologin"
+-#define _PATH_PRESERVE "/var/lib"
+-#define _PATH_RWHODIR "/var/spool/rwho"
+-#define _PATH_SENDMAIL "/usr/sbin/sendmail"
+-#define _PATH_SHADOW "/etc/shadow"
+-#define _PATH_SHELLS "/etc/shells"
++#define _PATH_MNTTAB "@GENTOO_PORTAGE_EPREFIX@/etc/fstab"
++#define _PATH_MOUNTED "@GENTOO_PORTAGE_EPREFIX@/etc/mtab"
++#define _PATH_NOLOGIN "@GENTOO_PORTAGE_EPREFIX@/etc/nologin"
++#define _PATH_PRESERVE "@GENTOO_PORTAGE_EPREFIX@/var/lib"
++#define _PATH_RWHODIR "@GENTOO_PORTAGE_EPREFIX@/var/spool/rwho"
++#define _PATH_SENDMAIL "@GENTOO_PORTAGE_EPREFIX@/usr/sbin/sendmail"
++#define _PATH_SHADOW "@GENTOO_PORTAGE_EPREFIX@/etc/shadow"
++#define _PATH_SHELLS "@GENTOO_PORTAGE_EPREFIX@/etc/shells"
+ #define _PATH_TTY "/dev/tty"
+ #define _PATH_UNIX "/boot/vmlinux"
+-#define _PATH_UTMP "/var/run/utmp"
+-#define _PATH_VI "/usr/bin/vi"
++#define _PATH_UTMP "@GENTOO_PORTAGE_EPREFIX@/var/run/utmp"
++#define _PATH_VI "@GENTOO_PORTAGE_EPREFIX@/usr/bin/vi"
+ #define _PATH_WTMP "/var/log/wtmp"
+
+ /* Provide trailing slash, since mostly used for building pathnames. */
+ #define _PATH_DEV "/dev/"
+ #define _PATH_TMP "/tmp/"
+-#define _PATH_VARDB "/var/db/"
+-#define _PATH_VARRUN "/var/run/"
++#define _PATH_VARDB "@GENTOO_PORTAGE_EPREFIX@/var/db/"
++#define _PATH_VARRUN "@GENTOO_PORTAGE_EPREFIX@/var/run/"
+ #define _PATH_VARTMP "/var/tmp/"
+
+ #endif /* !_PATHS_H_ */
+Index: glibc-2.19/sysdeps/posix/system.c
+===================================================================
+--- glibc-2.19.orig/sysdeps/posix/system.c
++++ glibc-2.19/sysdeps/posix/system.c
+@@ -26,7 +26,7 @@
+ #include <sysdep-cancel.h>
+
+
+-#define SHELL_PATH "/bin/sh" /* Path of the shell. */
++#define SHELL_PATH "@GENTOO_PORTAGE_EPREFIX@/bin/sh" /* Path of the shell. */
+ #define SHELL_NAME "sh" /* Name to give it. */
+
+
+Index: glibc-2.19/libio/iopopen.c
+===================================================================
+--- glibc-2.19.orig/libio/iopopen.c
++++ glibc-2.19/libio/iopopen.c
+@@ -222,7 +222,7 @@ _IO_new_proc_open (fp, command, mode)
+ _IO_close (fd);
+ }
+
+- _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
++ _IO_execl ("@GENTOO_PORTAGE_EPREFIX@/bin/sh", "sh", "-c", command, (char *) 0);
+ _IO__exit (127);
+ }
+ _IO_close (child_end);
diff --git a/sys-libs/glibc/files/2.17/glibc-2.17-shadow-prefix.patch b/sys-libs/glibc/files/2.17/glibc-2.17-shadow-prefix.patch
new file mode 100644
index 0000000..0e3979c
--- /dev/null
+++ b/sys-libs/glibc/files/2.17/glibc-2.17-shadow-prefix.patch
@@ -0,0 +1,33 @@
+Index: shadow/Makefile
+===================================================================
+--- shadow/Makefile.orig
++++ shadow/Makefile
+@@ -20,6 +20,8 @@
+ #
+ subdir := shadow
+
++include ../Makeconfig
++
+ headers = shadow.h
+ routines = getspent getspnam sgetspent fgetspent putspent \
+ getspent_r getspnam_r sgetspent_r fgetspent_r \
+@@ -34,5 +36,6 @@ CFLAGS-fgetspent_r.c = -fexceptions $(li
+ CFLAGS-putspent.c = -fexceptions $(libio-mtsafe)
+ CFLAGS-getspnam.c = -fexceptions
+ CFLAGS-getspnam_r.c = -fexceptions
++CPPFLAGS-lckpwdf.c = -DSYSCONFDIR='"$(sysconfdir)"'
+
+ include ../Rules
+Index: shadow/lckpwdf.c
+===================================================================
+--- shadow/lckpwdf.c.orig
++++ shadow/lckpwdf.c
+@@ -29,7 +29,7 @@
+
+
+ /* Name of the lock file. */
+-#define PWD_LOCKFILE "/etc/.pwd.lock"
++#define PWD_LOCKFILE SYSCONFDIR "/.pwd.lock"
+
+ /* How long to wait for getting the lock before returning with an
+ error. */
diff --git a/sys-libs/glibc/files/2.17/locale-gen_prefix.patch b/sys-libs/glibc/files/2.17/locale-gen_prefix.patch
new file mode 100644
index 0000000..f378605
--- /dev/null
+++ b/sys-libs/glibc/files/2.17/locale-gen_prefix.patch
@@ -0,0 +1,77 @@
+bug #473484
+Index: work/extra/locale/locale-gen
+===================================================================
+--- work.orig/extra/locale/locale-gen
++++ work/extra/locale/locale-gen
+@@ -8,7 +8,13 @@ unset POSIXLY_CORRECT IFS
+ umask 0022
+
+ argv0=${0##*/}
+-source /etc/init.d/functions.sh || {
++
++EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
++if [[ ${EPREFIX} == "@"GENTOO_PORTAGE_EPREFIX"@" ]] ; then
++ EPREFIX=""
++fi
++
++source "${EPREFIX}"/etc/init.d/functions.sh || {
+ echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2
+ exit 1
+ }
+@@ -97,13 +103,14 @@ if [[ -n ${DESTDIR} ]] && [[ ${ROOT} !=
+ eerror "DESTDIR and ROOT are mutually exclusive options"
+ exit 1
+ fi
+-if [[ ${ROOT} != "/" ]] ; then
+- einfo "Using locale.gen from ROOT ${ROOT}etc/"
++: ${EROOT:="${ROOT%/}${EPREFIX}/"}
++if [[ ${EROOT} != "/" ]] ; then
++ einfo "Using locale.gen from ROOT ${EROOT}etc/"
+ fi
+ if [[ -n ${DESTDIR} ]] ; then
+ einfo "Building locales in DESTDIR '${DESTDIR}'"
+ else
+- DESTDIR=${ROOT}
++ DESTDIR=${EROOT}
+ fi
+
+ # XXX: should fix this ...
+@@ -112,7 +119,7 @@ if [[ ${ROOT} != "/" ]] ; then
+ exit 0
+ fi
+
+-: ${CONFIG:=${ROOT}etc/locale.gen}
++: ${CONFIG:=${EROOT}etc/locale.gen}
+ LOCALES=${DESTDIR}usr/share/i18n/locales
+ CHARMAPS=${DESTDIR}usr/share/i18n/charmaps
+ SUPPORTED=${DESTDIR}usr/share/i18n/SUPPORTED
+@@ -150,7 +157,10 @@ fi
+
+ # Extract the location of the locale dir on the fly as `localedef --help` has:
+ # locale path : /usr/lib64/locale:/usr/share/i18n
+-LOCALEDIR=${DESTDIR}$(LC_ALL="C" "${DESTDIR}"usr/bin/localedef --help | sed -n -e '/locale path/{s|.* : ||;s|:.*||;p}')
++# For long paths, the line may get wrapped into two, in which case space (' ') is replaced
++# by newline (\n).
++LOCALEDIR=$(LC_ALL="C" "${DESTDIR}"usr/bin/localedef --help | sed -n -r '/locale path/{N;s|.*:[ \n](.*):/.*|\1|;p}')
++LOCALEDIR="${DESTDIR}${LOCALEDIR#${EPREFIX}}"
+ if [[ $? -ne 0 ]] || [[ -z ${LOCALEDIR} ]] || [[ ${LOCALEDIR} != ${DESTDIR}/usr/lib*/locale ]] ; then
+ eerror "Unable to parse the output of your localedef utility." 1>&2
+ eerror "File a bug about this issue and include the output of 'localedef --help'." 1>&2
+@@ -160,7 +170,7 @@ fi
+
+
+ if [[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \
+- [[ -e ${ROOT}etc/locales.build ]]
++ [[ -e ${EROOT}etc/locales.build ]]
+ then
+ ewarn "You should upgrade your /etc/locales.build to /etc/locale.gen"
+ ewarn "and then remove /etc/locales.build when you're done.\n"
+@@ -280,7 +290,7 @@ generate_locale() {
+ -i "${input}" \
+ -f "${charmap}" \
+ -A "${ALIAS}" \
+- --prefix "${DESTDIR}" \
++ --prefix "${DESTDIR%${EPREFIX}/}/" \
+ "${locale}" 2>&1
+ ret=$?
+ [[ -n ${output} ]] && eend ${ret}
diff --git a/sys-libs/glibc/files/2.17/vdso-disable.patch b/sys-libs/glibc/files/2.17/vdso-disable.patch
new file mode 100644
index 0000000..0354ae9
--- /dev/null
+++ b/sys-libs/glibc/files/2.17/vdso-disable.patch
@@ -0,0 +1,34 @@
+Index: work/glibc-2.17/elf/dl-support.c
+===================================================================
+--- work.orig/glibc-2.17/elf/dl-support.c
++++ work/glibc-2.17/elf/dl-support.c
+@@ -212,16 +212,6 @@ _dl_aux_init (ElfW(auxv_t) *av)
+ case AT_HWCAP:
+ GLRO(dl_hwcap) = (unsigned long int) av->a_un.a_val;
+ break;
+-#ifdef NEED_DL_SYSINFO
+- case AT_SYSINFO:
+- GL(dl_sysinfo) = av->a_un.a_val;
+- break;
+-#endif
+-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+- case AT_SYSINFO_EHDR:
+- GL(dl_sysinfo_dso) = (void *) av->a_un.a_val;
+- break;
+-#endif
+ case AT_UID:
+ uid ^= av->a_un.a_val;
+ seen |= 1;
+Index: work/glibc-2.17/elf/setup-vdso.h
+===================================================================
+--- work.orig/glibc-2.17/elf/setup-vdso.h
++++ work/glibc-2.17/elf/setup-vdso.h
+@@ -20,7 +20,7 @@ static inline void __attribute__ ((alway
+ setup_vdso (struct link_map *main_map __attribute__ ((unused)),
+ struct link_map ***first_preload __attribute__ ((unused)))
+ {
+-#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
++#if 0
+ if (GLRO(dl_sysinfo_dso) == NULL)
+ return;
+
diff --git a/sys-libs/glibc/files/2.17/vdso.patch b/sys-libs/glibc/files/2.17/vdso.patch
new file mode 100644
index 0000000..eb9a492
--- /dev/null
+++ b/sys-libs/glibc/files/2.17/vdso.patch
@@ -0,0 +1,17 @@
+Index: glibc-2.17/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+===================================================================
+--- glibc-2.17.orig/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
++++ glibc-2.17/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+@@ -28,11 +28,7 @@ void *gettimeofday_ifunc (void) __asm__
+ void *
+ gettimeofday_ifunc (void)
+ {
+- PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
+-
+- /* If the vDSO is not available we fall back on the old vsyscall. */
+- return (_dl_vdso_vsym ("__vdso_gettimeofday", &linux26)
+- ?: (void *) VSYSCALL_ADDR_vgettimeofday);
++ return (void *) VSYSCALL_ADDR_vgettimeofday;
+ }
+ asm (".type __gettimeofday, %gnu_indirect_function");
+