summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-12-14 14:44:12 +0000
committerMike Frysinger <vapier@gentoo.org>2009-12-14 14:44:12 +0000
commit68835eae02757818c654d11eede39e01601bbb04 (patch)
treebcbaf0ec1df1db0d90ec10d8ad88925dc47d3c03 /sys-libs/glibc
parentFix QA warnings (missing IUSE) (diff)
downloadgentoo-2-68835eae02757818c654d11eede39e01601bbb04.tar.gz
gentoo-2-68835eae02757818c654d11eede39e01601bbb04.tar.bz2
gentoo-2-68835eae02757818c654d11eede39e01601bbb04.zip
old
(Portage version: 2.2_rc55/cvs/Linux x86_64)
Diffstat (limited to 'sys-libs/glibc')
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc-2.3.1-ctype-compat-v3.patch66
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc-2.3.1-fpu-cw-mips.patch12
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc-2.3.1-libc_wait-compat.patch32
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc-2.3.1-libgcc-compat-mips.patch173
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc-2.3.1-librt-mips.patch15
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc-2.3.1-stack_end-compat.patch22
-rw-r--r--sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch81
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-crti.patch10
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-pwrite.patch13
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-sysdeps.patch24
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-amd64-nomultilib.patch11
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-arm-bus-defines.patch11
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-armformat.patch11
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-assert.patch44
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-cispeed-cospeed-fix.patch67
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-decc-compaq.patch28
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl-reloc-calc-fix.patch44
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl_execstack-PaX-support.patch59
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-fix-omitted-operand-in-mathinline_h.patch17
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-framestate-USING_SJLJ_EXCEPTIONS.patch14
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-frandom-detect.patch52
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-gcc33-sscanf.patch21
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-got-fix.diff22
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch96
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-iconvconfig-name_insert.patch78
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-ipv6-bytestring-fix.patch112
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch153
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch20
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch132
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-nested-entend-pairs.patch21
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch137
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-nptl-fix-include.patch10
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-owl-malloc-unlink-sanity-check.diff29
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v2.patch144
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v3.patch43
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions.patch144
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-pt_pax.diff29
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-linuxthreads-fixes.patch58
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-nptl-fixes.patch25
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-rtld-assert-fix.patch23
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-s390-deprecated-ustat-fixup.patch149
-rw-r--r--sys-libs/glibc/files/2.3.2/glibc-2.3.2-signal-ssp.diff40
-rw-r--r--sys-libs/glibc/files/2.3.2/posix_fadvise64.c90
-rw-r--r--sys-libs/glibc/files/2.3.2/ssp.c160
-rw-r--r--sys-libs/glibc/files/2.3.2/sysmacros.h69
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch43
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch70
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-frandom-detect.patch52
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-addabi.diff52
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-nolib3264.diff32
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-semtimedop.diff12
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-syscall.h.diff30
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-sysify.diff52
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-owl-malloc-unlink-sanity-check.diff29
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3-tempfile.patch53
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-got-fix.diff22
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-pt_pax.diff29
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-signal-ssp.diff40
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-dl-machine-calls.diff39
-rw-r--r--sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-incl-sgidefs.diff252
-rw-r--r--sys-libs/glibc/files/2.3.3/ssp.c166
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.3-mdns-resolver2.diff460
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-arm-ioperm.patch81
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-dl_execstack-PaX-support.patch50
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-features-header-fix.patch11
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-force-nontls.patch57
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-libnoversion.patch70
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-nomalloccheck.patch11
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-fix-_dl_next_tls_modid-assert.patch268
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-getcontext.patch358
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch11
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch69
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch60
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-mdns-resolver-20041102.diff463
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-add-missing-sgidefs_h.patch36
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-generate-syscall_h.patch254
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-prot_grows-undefined.patch32
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-rtld_deepbind-undefined.patch31
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-sysdep-cancel.diff54
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-update-__throw.patch44
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-altivec.patch229
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch96
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4-res_init.patch120
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-2.3.4.20040808-i386-got-fix.diff129
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-gentoo-libdir.patch36
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc-sec-hotfix-20040916.patch95
-rw-r--r--sys-libs/glibc/files/2.3.4/glibc234-alpha-xstat.patch231
-rw-r--r--sys-libs/glibc/files/2.3.4/host.conf33
-rw-r--r--sys-libs/glibc/files/2.3.4/hppa-no-pie.patch44
-rw-r--r--sys-libs/glibc/files/2.3.5/glibc-2.3.5-frandom-detect.patch102
-rw-r--r--sys-libs/glibc/files/2.3.5/glibc-2.3.5-propolice-guard-functions.patch138
-rw-r--r--sys-libs/glibc/files/2.3.5/ssp.c155
-rw-r--r--sys-libs/glibc/files/2.3.6/glibc-2.3.6-propolice-guard-functions.patch138
-rw-r--r--sys-libs/glibc/files/2.3.6/host.conf24
-rw-r--r--sys-libs/glibc/files/2.4/glibc-gentoo-libdir.patch28
-rw-r--r--sys-libs/glibc/files/2.4/ssp_simple.c25
-rw-r--r--sys-libs/glibc/files/fix-sysctl_h.patch13
-rw-r--r--sys-libs/glibc/files/glibc-2.2.2-test-lfs-timeout.patch11
-rw-r--r--sys-libs/glibc/files/glibc-sec-hotfix-20040804.patch128
-rw-r--r--sys-libs/glibc/files/glibc-sec-hotfix-20040916.patch95
-rw-r--r--sys-libs/glibc/files/locales.build25
-rw-r--r--sys-libs/glibc/files/nscd.conf45
-rw-r--r--sys-libs/glibc/files/test-__thread.c7
-rw-r--r--sys-libs/glibc/files/test-sysctl_h.c7
-rw-r--r--sys-libs/glibc/glibc-2.3.2-r12.ebuild726
-rw-r--r--sys-libs/glibc/glibc-2.3.5-r3.ebuild1285
-rw-r--r--sys-libs/glibc/glibc-2.3.6-r4.ebuild1225
-rw-r--r--sys-libs/glibc/glibc-2.3.6-r5.ebuild1230
-rw-r--r--sys-libs/glibc/glibc-2.4-r4.ebuild1267
-rw-r--r--sys-libs/glibc/glibc-2.5-r2.ebuild1250
-rw-r--r--sys-libs/glibc/glibc-2.5-r3.ebuild1250
-rw-r--r--sys-libs/glibc/glibc-2.6.ebuild1273
-rw-r--r--sys-libs/glibc/glibc-2.8_p20080602.ebuild378
-rw-r--r--sys-libs/glibc/glibc-2.9_p20081201-r1.ebuild378
-rw-r--r--sys-libs/glibc/glibc-2.9_p20081201.ebuild375
115 files changed, 0 insertions, 18595 deletions
diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-ctype-compat-v3.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-ctype-compat-v3.patch
deleted file mode 100644
index edf03e901307..000000000000
--- a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-ctype-compat-v3.patch
+++ /dev/null
@@ -1,66 +0,0 @@
---- glibc-2.3.1/ctype/ctype-info.c.orig 2002-11-07 15:58:39.000000000 +0200
-+++ glibc-2.3.1/ctype/ctype-info.c 2002-11-07 16:01:24.000000000 +0200
-@@ -48,6 +48,7 @@
-
- #define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o)
-
-+#if 0
- const unsigned short int *__ctype_b = b (unsigned short int, class, 128);
- const __uint32_t *__ctype32_b = b (__uint32_t, class32, 0);
- const __int32_t *__ctype_tolower = b (__int32_t, tolower, 128);
-@@ -61,5 +62,23 @@
- compat_symbol (libc, __ctype32_b, __ctype32_b, GLIBC_2_0);
- compat_symbol (libc, __ctype32_tolower, __ctype32_tolower, GLIBC_2_2);
- compat_symbol (libc, __ctype32_toupper, __ctype32_toupper, GLIBC_2_2);
-+#endif
-
- #endif
-+
-+/* Temporarily exported until all .a libraries are recompiled. */
-+#undef b
-+#define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o)
-+
-+extern const char _nl_C_LC_CTYPE_class[] attribute_hidden;
-+extern const char _nl_C_LC_CTYPE_class32[] attribute_hidden;
-+extern const char _nl_C_LC_CTYPE_toupper[] attribute_hidden;
-+extern const char _nl_C_LC_CTYPE_tolower[] attribute_hidden;
-+
-+const unsigned short int *__ctype_b = b (unsigned short int, class, 128);
-+const __uint32_t *__ctype32_b = b (__uint32_t, class32, 0);
-+const __int32_t *__ctype_tolower = b (__int32_t, tolower, 128);
-+const __int32_t *__ctype_toupper = b (__int32_t, toupper, 128);
-+const __uint32_t *__ctype32_tolower = b (__uint32_t, tolower, 128);
-+const __uint32_t *__ctype32_toupper = b (__uint32_t, toupper, 128);
-+
---- glibc-2.3.1/locale/lc-ctype.c.orig 2002-12-30 11:43:39.000000000 +0200
-+++ glibc-2.3.1/locale/lc-ctype.c 2002-12-30 11:48:22.000000000 +0200
-@@ -75,6 +75,7 @@
- We need those relocations so that a versioned definition with a COPY
- reloc in an executable will override the libc.so definition. */
-
-+#if 0
- compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0);
- compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0);
- compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0);
-@@ -89,4 +90,21 @@
- __ctype32_toupper = current (uint32_t, TOUPPER32, 0);
- __ctype32_tolower = current (uint32_t, TOLOWER32, 0);
- #endif
-+
-+#endif
-+
-+ /* Temporary. */
-+ extern __const unsigned short int *__ctype_b; /* Characteristics. */
-+ extern __const __int32_t *__ctype_tolower; /* Case conversions. */
-+ extern __const __int32_t *__ctype_toupper; /* Case conversions. */
-+ extern const uint32_t *__ctype32_b;
-+ extern const uint32_t *__ctype32_toupper;
-+ extern const uint32_t *__ctype32_tolower;
-+
-+ __ctype_b = current (uint16_t, CLASS, 128);
-+ __ctype_toupper = current (uint32_t, TOUPPER, 128);
-+ __ctype_tolower = current (uint32_t, TOLOWER, 128);
-+ __ctype32_b = current (uint32_t, CLASS32, 0);
-+ __ctype32_toupper = current (uint32_t, TOUPPER32, 0);
-+ __ctype32_tolower = current (uint32_t, TOLOWER32, 0);
- }
diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-fpu-cw-mips.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-fpu-cw-mips.patch
deleted file mode 100644
index 392b11648c72..000000000000
--- a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-fpu-cw-mips.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -u -r1.6 fpu_control.h
---- libc/sysdeps/mips/fpu_control.h 6 Jul 2001 04:56:00 -0000 1.6
-+++ libc/sysdeps/mips/fpu_control.h 19 Oct 2002 16:03:35 -0000
-@@ -74,7 +74,7 @@
- #define _FPU_RC_UP 0x2
- #define _FPU_RC_DOWN 0x3
-
--#define _FPU_RESERVED 0xfe3c0000 /* Reserved bits in cw */
-+#define _FPU_RESERVED 0xfebc0000 /* Reserved bits in cw */
-
-
- /* The fdlibm code requires strict IEEE double precision arithmetic,
diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-libc_wait-compat.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-libc_wait-compat.patch
deleted file mode 100644
index d6f8bf51ab7b..000000000000
--- a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-libc_wait-compat.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- glibc-20020408/posix/Versions.bak 2002-02-04 12:42:40.000000000 +0100
-+++ glibc-20020408/posix/Versions 2002-04-19 01:01:00.000000000 +0200
-@@ -3,6 +3,9 @@
- # functions with special/multiple interfaces
- __bsd_getpgrp; __setpgid; __getpgid;
-
-+ # This will be GLIBC_PRIVATE, just give Sun JDK some time to catch up
-+ __libc_wait; __libc_waitpid;
-+
- # functions with required interface outside normal name space
- _exit;
-
-@@ -83,6 +86,9 @@
- GLIBC_2.1.2 {
- # functions used in other libraries
- __vfork;
-+
-+ # This will be GLIBC_PRIVATE, just give wine some time to catch up
-+ __libc_fork;
- }
- GLIBC_2.2 {
- # p*
-@@ -109,6 +115,7 @@
- GLIBC_PRIVATE {
- # functions which have an additional interface since they are
- # are cancelable.
-- __libc_wait; __libc_waitpid; __libc_pause; __libc_nanosleep; __libc_fork;
-+ # __libc_wait; __libc_waitpid;
-+ __libc_pause; __libc_nanosleep; # __libc_fork;
- __libc_pread; __libc_pread64; __libc_pwrite; __libc_pwrite64;
- __waitid; __pselect;
- }
diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-libgcc-compat-mips.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-libgcc-compat-mips.patch
deleted file mode 100644
index cc8fabbb89cb..000000000000
--- a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-libgcc-compat-mips.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-# DP: Description: libgcc-compat symbols for mips
-# DP: Author: Guido Guenther
-# DP: thanks to Jack Howarth for explanations and help
-# DP: Upstream status: Not submitted
-# DP: Date: 2002-10-13, updated 2002-10-20
-
---- libc/sysdeps/mips/Makefile.orig Sun Oct 13 14:45:56 2002
-+++ libc/sysdeps/mips/Makefile Sun Oct 13 14:51:20 2002
-@@ -6,3 +6,15 @@
- ifeq ($(subdir),setjmp)
- sysdep_routines += setjmp_aux
- endif
-+
-+ifeq ($(subdir),csu)
-+ifeq (yes,$(build-shared))
-+# Compatibility
-+ifeq (yes,$(have-protected))
-+CPPFLAGS-divdi3.c = -DHAVE_DOT_HIDDEN
-+CPPFLAGS-libgcc-compat.c = -DHAVE_DOT_HIDDEN
-+endif
-+sysdep_routines += libgcc-compat
-+shared-only-routines += libgcc-compat
-+endif
-+endif
---- libc/sysdeps/mips/Dist.orig Sun Oct 13 15:07:31 2002
-+++ libc/sysdeps/mips/Dist Sun Oct 13 15:07:41 2002
-@@ -1,3 +1,5 @@
-+divdi3.c
-+libgcc-compat.c
- setjmp_aux.c
- regdef.h
- sgidefs.h
---- /dev/null Sat Mar 16 18:32:44 2002
-+++ libc/sysdeps/mips/divdi3.c Sun Oct 13 14:44:34 2002
-@@ -0,0 +1,43 @@
-+/* 64-bit multiplication and division libgcc routines for 32-bit mips
-+ Copyright (C) 2002 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. */
-+
-+#define _DIVDI3_C
-+#include <sysdeps/wordsize-32/divdi3.c>
-+
-+INTDEF (__udivdi3);
-+INTDEF (__moddi3);
-+INTDEF (__umoddi3);
-+
-+#ifdef HAVE_DOT_HIDDEN
-+asm (".hidden __divdi3");
-+asm (".hidden __udivdi3");
-+asm (".hidden __moddi3");
-+asm (".hidden __umoddi3");
-+#endif
-+
-+#include <shlib-compat.h>
-+
-+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
-+
-+symbol_version (INTUSE (__divdi3), __divdi3, GLIBC_2.0);
-+symbol_version (INTUSE (__udivdi3), __udivdi3, GLIBC_2.0);
-+symbol_version (INTUSE (__moddi3), __moddi3, GLIBC_2.0);
-+symbol_version (INTUSE (__umoddi3), __umoddi3, GLIBC_2.0);
-+
-+#endif
---- /dev/null Sat Mar 16 18:32:44 2002
-+++ libc/sysdeps/mips/libgcc-compat.c Sun Oct 20 17:11:59 2002
-@@ -0,0 +1,81 @@
-+/* pre-.hidden libgcc compatibility
-+ Copyright (C) 2002 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. */
-+
-+
-+#include <stdint.h>
-+#include <shlib-compat.h>
-+
-+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
-+
-+extern int32_t __cmpdi2 (int64_t, int64_t);
-+int32_t __cmpdi2_internal (int64_t u, int64_t v)
-+{
-+ return __cmpdi2 (u, v);
-+}
-+symbol_version (__cmpdi2_internal, __cmpdi2, GLIBC_2.0);
-+
-+
-+extern int32_t __ucmpdi2 (int64_t, int64_t);
-+int32_t __ucmpdi2_internal (int64_t u, int64_t v)
-+{
-+ return __ucmpdi2 (u, v);
-+}
-+symbol_version (__ucmpdi2_internal, __ucmpdi2, GLIBC_2.0);
-+
-+
-+extern int64_t __fixdfdi (double);
-+int64_t __fixdfdi_internal (double d)
-+{
-+ return __fixdfdi (d);
-+}
-+symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
-+
-+
-+extern int64_t __fixsfdi (float);
-+int64_t __fixsfdi_internal (float d)
-+{
-+ return __fixsfdi (d);
-+}
-+symbol_version (__fixsfdi_internal, __fixsfdi, GLIBC_2.0);
-+
-+
-+extern int64_t __fixunsdfdi (double);
-+int64_t __fixunsdfdi_internal (double d)
-+{
-+ return __fixunsdfdi (d);
-+}
-+symbol_version (__fixunsdfdi_internal, __fixunsdfdi, GLIBC_2.0);
-+
-+
-+extern double __floatdidf (int64_t);
-+double __floatdidf_internal (int64_t u)
-+{
-+ return __floatdidf (u);
-+}
-+symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
-+
-+
-+floatdisf (int64_t);
-+float __floatdisf_internal (int64_t u)
-+{
-+ return __floatdisf (u);
-+}
-+symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
-+
-+#endif
---- /dev/null Sat Mar 16 18:32:44 2002
-+++ libc/sysdeps/mips/Versions Sun Oct 20 17:12:00 2002
-@@ -0,0 +1,8 @@
-+libc {
-+ GLIBC_2.0 {
-+ # Functions from libgcc.
-+ __cmpdi2; __ucmpdi2;
-+ __divdi3; __moddi3; __udivdi3; __umoddi3;
-+ __fixdfdi; __fixsfdi; __fixunsdfdi; __floatdidf; __floatdisf;
-+ }
-+}
diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-librt-mips.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-librt-mips.patch
deleted file mode 100644
index 08fcc2ac6864..000000000000
--- a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-librt-mips.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-# DP: add clock_{get,set}time@@GLIBC_2.0
-# DP: although it should actually be @@GLIBC_2.2
-
---- libc/sysdeps/unix/sysv/linux/mips/Versions.orig Tue Sep 24 15:56:55 2002
-+++ libc/sysdeps/unix/sysv/linux/mips/Versions Tue Sep 24 15:49:27 2002
-@@ -34,3 +34,9 @@
- _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
- }
- }
-+librt {
-+ GLIBC_2.0 {
-+ # c*
-+ clock_gettime; clock_settime;
-+ }
-+}
diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-stack_end-compat.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-stack_end-compat.patch
deleted file mode 100644
index ad68ed7c5d5b..000000000000
--- a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-stack_end-compat.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- glibc-2.3.1/elf/Versions.orig 2002-11-07 17:04:54.000000000 +0200
-+++ glibc-2.3.1/elf/Versions 2002-11-07 17:06:56.000000000 +0200
-@@ -32,6 +32,10 @@
- _r_debug;
- }
- GLIBC_2.1 {
-+ # This will be GLIBC_PRIVATE, just to give folks some time
-+ # to fix their stuff
-+ __libc_stack_end;
-+
- # functions used in other libraries
- _dl_mcount;
- }
-@@ -41,7 +45,7 @@
- }
- GLIBC_PRIVATE {
- # Those are in the dynamic linker, but used by libc.so.
-- __libc_enable_secure; __libc_stack_end;
-+ __libc_enable_secure; # __libc_stack_end;
- _dl_argv; _dl_catch_error; _dl_check_map_versions;
- _dl_debug_printf; _dl_debug_state; _dl_dst_count;
- _dl_dst_substitute; _dl_init; _dl_lookup_symbol; _dl_lookup_symbol_skip;
diff --git a/sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch b/sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch
deleted file mode 100644
index ef7b556df18d..000000000000
--- a/sys-libs/glibc/files/2.3.1/glibc23-07-hppa-atomicity.dpatch
+++ /dev/null
@@ -1,81 +0,0 @@
-#! /bin/sh -e
-
-# DP: Description: atomicity.h placeholder for HPPA
-# DP: Author: Carlos O'Donell <carlos@baldric.uwo.ca>
-# DP: Upstream status: Not submitted upstream
-# DP: Status Details: --
-# DP: Date: November 16, 2002
-
-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
-
-# append the patch here and adjust the -p? flag in the patch calls.
-diff -urN glibc-2.3.1.orig/sysdeps/hppa/atomicity.h glibc-2.3.1/sysdeps/hppa/atomicity.h
---- glibc-2.3.1.orig/sysdeps/hppa/atomicity.h 1969-12-31 19:00:00.000000000 -0500
-+++ glibc-2.3.1/sysdeps/hppa/atomicity.h 2002-11-07 08:35:55.000000000 -0500
-@@ -0,0 +1,55 @@
-+/* Low-level functions for atomic operations. HP-PARISC version.
-+ Copyright (C) 1997,2001 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. */
-+
-+#ifndef _ATOMICITY_H
-+#define _ATOMICITY_H 1
-+
-+#include <inttypes.h>
-+
-+#warning stub atomicity functions are not atomic
-+#warning CAO This will get implemented soon
-+
-+static inline int
-+__attribute__ ((unused))
-+exchange_and_add (volatile uint32_t *mem, int val)
-+{
-+ int result = *mem;
-+ *mem += val;
-+ return result;
-+}
-+
-+static inline void
-+__attribute__ ((unused))
-+atomic_add (volatile uint32_t *mem, int val)
-+{
-+ *mem += val;
-+}
-+
-+static inline int
-+__attribute__ ((unused))
-+compare_and_swap (volatile long int *p, long int oldval, long int newval)
-+{
-+ if (*p != oldval)
-+ return 0;
-+
-+ *p = newval;
-+ return 1;
-+}
-+
-+#endif /* atomicity.h */
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-crti.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-crti.patch
deleted file mode 100644
index 2ec179099bb7..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-crti.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- glibc-2.3.2/linuxthreads/sysdeps/alpha/elf/pt-initfini.c.old 2003-11-01 17:55:51.000000000 -0500
-+++ glibc-2.3.2/linuxthreads/sysdeps/alpha/elf/pt-initfini.c 2003-11-01 20:17:04.000000000 -0500
-@@ -75,7 +75,6 @@
- subq $30, 16, $30 \n\
- stq $26, 0($30) \n\
- stq $29, 8($30) \n\
-- .prologue 1 \n\
- .align 3 \n\
- /*@_fini_PROLOG_ENDS*/ \n\
- \n\
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-pwrite.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-pwrite.patch
deleted file mode 100644
index ab563aae6e13..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-pwrite.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- glibc-2.3.2/sysdeps/unix/sysv/linux/alpha/syscalls.list.old 2003-11-01 19:21:19.000000000 -0500
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/alpha/syscalls.list 2003-11-01 19:21:25.000000000 -0500
-@@ -22,8 +22,8 @@
- llseek EXTRA lseek C:3 __libc_lseek __lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64
- lseek llseek -
- posix_fadvise64 - fadvise64 Vi:iiii posix_fadvise64 posix_fadvise
--pread - pread64 C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64
--pwrite - pwrite64 C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
-+pread - pread C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64
-+pwrite - pwrite C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
- fstatfs - fstatfs i:ip __fstatfs fstatfs __fstatfs64 fstatfs64
- statfs - statfs i:sp __statfs statfs statfs64
- getrlimit - getrlimit 2 __getrlimit getrlimit getrlimit64
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-sysdeps.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-sysdeps.patch
deleted file mode 100644
index f03dac68ed75..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-alpha-sysdeps.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h,v
-retrieving revision 1.16
-retrieving revision 1.17
-diff -u -r1.16 -r1.17
---- libc/sysdeps/unix/sysv/linux/alpha/sysdep.h 2003/06/20 16:24:36 1.16
-+++ libc/sysdeps/unix/sysv/linux/alpha/sysdep.h 2004/03/23 23:31:47 1.17
-@@ -65,6 +65,16 @@
- # define __NR_semtimedop 423
- #endif
-
-+/* This is a kludge to make syscalls.list find these under the names
-+ pread and pwrite, since some kernel headers define those names
-+ and some define the *64 names for the same system calls. */
-+#if !defined __NR_pread && defined __NR_pread64
-+# define __NR_pread __NR_pread64
-+#endif
-+#if !defined __NR_pwrite && defined __NR_pwrite64
-+# define __NR_pwrite __NR_pwrite64
-+#endif
-+
- /*
- * In order to get the hidden arguments for rt_sigaction set up
- * properly, we need to call the assembly version. This shouldn't
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-amd64-nomultilib.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-amd64-nomultilib.patch
deleted file mode 100644
index 119c8bc15c00..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-amd64-nomultilib.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- sysdeps/unix/sysv/linux/configure.orig 2003-06-28 01:51:12.000000000 +0000
-+++ sysdeps/unix/sysv/linux/configure 2003-06-28 01:51:23.000000000 +0000
-@@ -224,7 +224,7 @@
- /usr | /usr/)
- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
- case $machine in
-- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
-+ sparc/sparc64 | powerpc/powerpc64 | s390/s390-64 | \
- mips/mips64/n64/* )
- libc_cv_slibdir="/lib64"
- if test "$libdir" = '${exec_prefix}/lib'; then
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-arm-bus-defines.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-arm-bus-defines.patch
deleted file mode 100644
index f1f20224916f..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-arm-bus-defines.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- sysdeps/unix/sysv/linux/arm/ioperm.c.orig Tue Apr 27 00:30:01 2004
-+++ sysdeps/unix/sysv/linux/arm/ioperm.c Tue Apr 27 00:29:57 2004
-@@ -41,6 +41,8 @@
- #include <string.h>
- #include <unistd.h>
-
-+#include <linux/input.h>
-+
- #include <sys/types.h>
- #include <sys/mman.h>
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-armformat.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-armformat.patch
deleted file mode 100644
index a3d51c654f4d..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-armformat.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- glibc-2.3.2-200304020432/scripts/output-format.sed.armformat 2003-07-19 09:47:39.000000000 -0400
-+++ glibc-2.3.2-200304020432/scripts/output-format.sed 2003-07-19 09:48:00.000000000 -0400
-@@ -5,7 +5,7 @@
- }
- t o
- : o
--s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
-+s/^.*OUTPUT_FORMAT(\([^,]*\), .*, \1).*$/OUTPUT_FORMAT(\1)/
- t q
- s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\2,\3/
- t s
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-assert.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-assert.patch
deleted file mode 100644
index e779e99b1753..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-assert.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Index: assert/assert.h
-===================================================================
-RCS file: /cvs/glibc/libc/assert/assert.h,v
-retrieving revision 1.25
-retrieving revision 1.26
-diff -u -r1.25 -r1.26
---- assert/assert.h 15 Aug 2003 17:54:31 -0000 1.25
-+++ assert/assert.h 4 Oct 2004 07:45:23 -0000 1.26
-@@ -84,33 +84,16 @@
-
- __END_DECLS
-
--/* For the macro definition we use gcc's __builtin_expect if possible
-- to generate good code for the non-error case. gcc 3.0 is a good
-- enough estimate for when the feature became available. */
--# if __GNUC_PREREQ (3, 0)
--# define assert(expr) \
-- (__ASSERT_VOID_CAST (__builtin_expect (!!(expr), 1) ? 0 : \
-- (__assert_fail (__STRING(expr), __FILE__, __LINE__, \
-- __ASSERT_FUNCTION), 0)))
--# else
--# define assert(expr) \
-+# define assert(expr) \
- (__ASSERT_VOID_CAST ((expr) ? 0 : \
- (__assert_fail (__STRING(expr), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
--# endif
-
- # ifdef __USE_GNU
--# if __GNUC_PREREQ (3, 0)
--# define assert_perror(errnum) \
-- (__ASSERT_VOID_CAST (__builtin_expect (!(errnum), 1) ? 0 : \
-- (__assert_perror_fail ((errnum), __FILE__, __LINE__, \
-- __ASSERT_FUNCTION), 0)))
--# else
--# define assert_perror(errnum) \
-+# define assert_perror(errnum) \
- (__ASSERT_VOID_CAST (!(errnum) ? 0 : \
- (__assert_perror_fail ((errnum), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
--# endif
- # endif
-
- /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-cispeed-cospeed-fix.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-cispeed-cospeed-fix.patch
deleted file mode 100644
index a99f60cc6437..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-cispeed-cospeed-fix.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- glibc-2.3.2-200309061641/sysdeps/unix/sysv/linux/speed.c.orig Sat Sep 6 05:52:52 2003
-+++ glibc-2.3.2-200309061641/sysdeps/unix/sysv/linux/speed.c Wed Sep 10 21:50:15 2003
-@@ -66,8 +66,9 @@
- __set_errno (EINVAL);
- return -1;
- }
--
-+#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED
- termios_p->c_ospeed = speed;
-+#endif
- termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
- termios_p->c_cflag |= speed;
-
-@@ -91,8 +92,9 @@
- __set_errno (EINVAL);
- return -1;
- }
--
-+#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED
- termios_p->c_ispeed = speed;
-+#endif
- if (speed == 0)
- termios_p->c_iflag |= IBAUD0;
- else
-diff -ur -x objdir glibc-2.3.2/sysdeps/unix/sysv/linux/tcgetattr.c glibc-2.3.2.work/sysdeps/unix/sysv/linux/tcgetattr.c
---- glibc-2.3.2/sysdeps/unix/sysv/linux/tcgetattr.c 2003-09-10 12:41:08.000000000 -0400
-+++ glibc-2.3.2.work/sysdeps/unix/sysv/linux/tcgetattr.c 2003-09-10 11:56:37.000000000 -0400
-@@ -45,16 +45,20 @@
- termios_p->c_cflag = k_termios.c_cflag;
- termios_p->c_lflag = k_termios.c_lflag;
- termios_p->c_line = k_termios.c_line;
-+#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED
- #ifdef _HAVE_C_ISPEED
- termios_p->c_ispeed = k_termios.c_ispeed;
- #else
- termios_p->c_ispeed = k_termios.c_cflag & (CBAUD | CBAUDEX);
- #endif
-+#endif
-+#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED
- #ifdef _HAVE_C_OSPEED
- termios_p->c_ospeed = k_termios.c_ospeed;
- #else
- termios_p->c_ospeed = k_termios.c_cflag & (CBAUD | CBAUDEX);
- #endif
-+#endif
- if (sizeof (cc_t) == 1 || _POSIX_VDISABLE == 0
- || (unsigned char) _POSIX_VDISABLE == (unsigned char) -1)
- memset (__mempcpy (&termios_p->c_cc[0], &k_termios.c_cc[0],
-diff -ur -x objdir glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c glibc-2.3.2.work/sysdeps/unix/sysv/linux/tcsetattr.c
---- glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c 2003-09-10 12:41:08.000000000 -0400
-+++ glibc-2.3.2.work/sysdeps/unix/sysv/linux/tcsetattr.c 2003-09-10 11:56:42.000000000 -0400
-@@ -71,12 +71,16 @@
- k_termios.c_cflag = termios_p->c_cflag;
- k_termios.c_lflag = termios_p->c_lflag;
- k_termios.c_line = termios_p->c_line;
-+#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED
- #ifdef _HAVE_C_ISPEED
- k_termios.c_ispeed = termios_p->c_ispeed;
- #endif
-+#endif
-+#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED
- #ifdef _HAVE_C_OSPEED
- k_termios.c_ospeed = termios_p->c_ospeed;
- #endif
-+#endif
- memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0],
- __KERNEL_NCCS * sizeof (cc_t));
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-decc-compaq.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-decc-compaq.patch
deleted file mode 100644
index b0660b645473..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-decc-compaq.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -ruN glibc-2.3.2.orig/include/features.h glibc-2.3.2/include/features.h
---- glibc-2.3.2.orig/include/features.h 2003-06-14 00:28:23.000000000 +0100
-+++ glibc-2.3.2/include/features.h 2003-06-14 00:58:57.000000000 +0100
-@@ -285,7 +285,8 @@
- #if defined __GNUC__ \
- || (defined __PGI && defined __i386__ ) \
- || (defined __INTEL_COMPILER && (defined __i386__ || defined __ia64__)) \
-- || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
-+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) \
-+ && !(defined(__DECC) || defined(__DECCXX))
- # define __GLIBC_HAVE_LONG_LONG 1
- #endif
-
-diff -ruN glibc-2.3.2.orig/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h glibc-2.3.2/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h
---- glibc-2.3.2.orig/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h 2003-06-14 00:28:24.000000000 +0100
-+++ glibc-2.3.2/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h 2003-06-14 00:57:16.000000000 +0100
-@@ -64,9 +64,11 @@
- {
- struct _pthread_fastlock __c_lock; /* Protect against concurrent access */
- _pthread_descr __c_waiting; /* Threads waiting on this condition */
-+#if !(defined(__DECC) || defined(__DECCXX)) /* hide this from DEC CC/CXX */
- char __padding[48 - sizeof (struct _pthread_fastlock)
- - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)];
- __pthread_cond_align_t __align;
-+#endif /* __DECC */
- } pthread_cond_t;
-
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl-reloc-calc-fix.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl-reloc-calc-fix.patch
deleted file mode 100644
index f7456821f477..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl-reloc-calc-fix.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-===================================================================
-RCS file: /cvs/glibc/libc/elf/dl-reloc.c,v
-retrieving revision 1.82
-retrieving revision 1.83
-diff -u -r1.82 -r1.83
---- libc/elf/dl-reloc.c 2003/01/30 17:36:11 1.82
-+++ libc/elf/dl-reloc.c 2003/03/01 22:31:52 1.83
-@@ -44,23 +44,31 @@
- static void __attribute_noinline__
- allocate_static_tls (struct link_map *map)
- {
-- size_t offset = roundup (GL(dl_tls_static_used), map->l_tls_align);
-- if (offset + map->l_tls_blocksize
-+ size_t offset, used, check;
-+
- # if TLS_TCB_AT_TP
-- + TLS_TCB_SIZE
-+ offset = roundup (GL(dl_tls_static_used) + map->l_tls_blocksize,
-+ map->l_tls_align);
-+ used = offset;
-+ check = offset + TLS_TCB_SIZE;
- # elif TLS_DTV_AT_TP
-+ offset = roundup (GL(dl_tls_static_used), map->l_tls_align);
-+ used = offset + map->l_tls_blocksize;
-+ check = used;
- /* dl_tls_static_used includes the TCB at the beginning. */
- # else
- # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
- # endif
-- > GL(dl_tls_static_size))
-+
-+ if (check > GL(dl_tls_static_size))
- {
- const char *errstring = N_("\
- shared object cannot be dlopen()ed: static TLS memory too small");
- INTUSE(_dl_signal_error) (0, (map)->l_name, NULL, errstring);
- }
-+
- map->l_tls_offset = offset;
-- GL(dl_tls_static_used) = offset + map->l_tls_blocksize;
-+ GL(dl_tls_static_used) = used;
- }
- #endif
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl_execstack-PaX-support.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl_execstack-PaX-support.patch
deleted file mode 100644
index 4e081ef9c847..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-dl_execstack-PaX-support.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-Index: sysdeps/unix/sysv/linux/dl-execstack.c
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/dl-execstack.c,v
-retrieving revision 1.3
-diff -u -p -r1.3 dl-execstack.c
---- sysdeps/unix/sysv/linux/dl-execstack.c 25 Sep 2003 23:04:12 -0000 1.3
-+++ sysdeps/unix/sysv/linux/dl-execstack.c 8 Nov 2003 00:34:33 -0000
-@@ -41,8 +41,11 @@ _dl_make_stack_executable (void)
- if (__mprotect ((void *) page, GL(dl_pagesize),
- PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) == 0)
- return 0;
-- if (errno != EINVAL)
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != EINVAL) {
- return errno;
-+ }
- no_growsdown = true;
- }
- # endif
-@@ -64,8 +67,11 @@ _dl_make_stack_executable (void)
- page -= size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
- return errno;
-+ }
-
- if (size == GL(dl_pagesize))
- /* We just tried to mprotect the top hole page and failed.
-@@ -92,8 +98,11 @@ _dl_make_stack_executable (void)
- if (__mprotect ((void *) page, GL(dl_pagesize),
- PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSUP) == 0)
- return 0;
-- if (errno != EINVAL)
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != EINVAL) {
- return errno;
-+ }
- no_growsup = true;
- }
- # endif
-@@ -114,8 +123,11 @@ _dl_make_stack_executable (void)
- page += size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
- return errno;
-+ }
-
- if (size == GL(dl_pagesize))
- /* We just tried to mprotect the lowest hole page and failed.
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-fix-omitted-operand-in-mathinline_h.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-fix-omitted-operand-in-mathinline_h.patch
deleted file mode 100644
index 6518ff2b5c26..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-fix-omitted-operand-in-mathinline_h.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-2000-05-22 Jakub Jelinek <jakub@redhat.com>
-
- * sysdeps/i386/fpu/bits/mathinline.h (__expm1_code): Avoid using ?:
- with omitted middle operand.
-
---- libc/sysdeps/i386/fpu/bits/mathinline.h 4 Jun 2003 22:17:35 -0000 1.1.1.13
-+++ libc/sysdeps/i386/fpu/bits/mathinline.h 4 Jun 2003 22:22:36 -0000 1.11
-@@ -381,7 +381,8 @@ __sincosl (long double __x, long double
- ("fscale # 2^int(x * log2(e))\n\t" \
- : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \
- __temp -= 1.0; \
-- return __temp + __value ?: __x
-+ __temp += __value; \
-+ return __temp ? __temp : __x
- __inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)
-
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-framestate-USING_SJLJ_EXCEPTIONS.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-framestate-USING_SJLJ_EXCEPTIONS.patch
deleted file mode 100644
index 0c42b15c1777..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-framestate-USING_SJLJ_EXCEPTIONS.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- sysdeps/generic/framestate.c.orig Fri Apr 23 23:59:52 2004
-+++ sysdeps/generic/framestate.c Sat Apr 24 00:00:13 2004
-@@ -42,7 +42,11 @@
- if (handle == NULL
- || (frame_state_for
- = (framesf) __libc_dlsym (handle, "__frame_state_for")) == NULL)
-+#ifndef __USING_SJLJ_EXCEPTIONS__
- frame_state_for = fallback_frame_state_for;
-+#else
-+ frame_state_for = abort;
-+#endif
- }
-
- return frame_state_for (pc, frame_state);
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-frandom-detect.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-frandom-detect.patch
deleted file mode 100644
index f1dbe7be8a61..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-frandom-detect.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff -Naur glibc-2.3.2-orig/config.h.in glibc-2.3.2/config.h.in
---- glibc-2.3.2-orig/config.h.in 2004-05-11 21:44:51.000000000 -0400
-+++ glibc-2.3.2/config.h.in 2004-05-11 22:41:34.903935791 -0400
-@@ -208,6 +208,9 @@
- /* Defined of libidn is available. */
- #undef HAVE_LIBIDN
-
-+/* Defined if economical random device is available. */
-+#undef HAVE_DEV_ERANDOM
-+
- /*
- */
-
-diff -Naur glibc-2.3.2-orig/configure.in glibc-2.3.2/configure.in
---- glibc-2.3.2-orig/configure.in 2004-05-11 21:44:51.000000000 -0400
-+++ glibc-2.3.2/configure.in 2004-05-11 22:32:57.999546229 -0400
-@@ -289,6 +289,13 @@
- [])
- AC_SUBST(all_warnings)
-
-+dnl See whether the user wants to disable checking for /dev/erandom
-+AC_ARG_ENABLE([dev-erandom],
-+ AC_HELP_STRING([--disable-dev-erandom],
-+ [disable testing for /dev/erandom]),
-+ [try_dev_erandom=$enableval],
-+ [try_dev_erandom=yes])
-+
- AC_CANONICAL_HOST
-
- # The way shlib-versions is used to generate soversions.mk uses a
-@@ -1911,6 +1918,21 @@
- sizeof_long_double=$ac_cv_sizeof_long_double
- AC_SUBST(sizeof_long_double)
-
-+dnl check whether we have an economical random device
-+if test "$try_dev_erandom" = yes ; then
-+ AC_CACHE_CHECK(for economical random device, ac_cv_have_dev_random,
-+ [if test -r "/dev/erandom" ; then
-+ ac_cv_have_dev_erandom=yes; else ac_cv_have_dev_erandom=no; fi])
-+ if test "$ac_cv_have_dev_erandom" = yes; then
-+ AC_DEFINE(HAVE_DEV_ERANDOM,1,
-+ [defined if the system supports an economical random device] )
-+ fi
-+else
-+ AC_MSG_CHECKING(for economical random device)
-+ ac_cv_have_dev_erandom=no
-+ AC_MSG_RESULT(has been disabled)
-+fi
-+
- ### End of automated tests.
- ### Now run sysdeps configure fragments.
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-gcc33-sscanf.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-gcc33-sscanf.patch
deleted file mode 100644
index 523b036d9a7d..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-gcc33-sscanf.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- stdio-common/sscanf.c.~1.8.~ 2003-01-16 11:25:20.000000000 +0100
-+++ stdio-common/sscanf.c 2003-03-05 12:07:34.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1991,95,96,98,2002 Free Software Foundation, Inc.
-+/* Copyright (C) 1991,95,96,98,2002, 2003 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
-@@ -27,9 +27,7 @@
- /* Read formatted input from S, according to the format string FORMAT. */
- /* VARARGS2 */
- int
--sscanf (s, format)
-- const char *s;
-- const char *format;
-+sscanf (const char *s, const char *format, ...)
- {
- va_list arg;
- int done;
-
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-got-fix.diff b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-got-fix.diff
deleted file mode 100644
index c0edccd8f38d..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-got-fix.diff
+++ /dev/null
@@ -1,22 +0,0 @@
---- glibc-2.3.2/sysdeps/i386/elf/start.S 2004-02-05 18:14:37.000000000 +0100
-+++ glibc-2.3.2/sysdeps/i386/elf/start.S 2004-02-05 23:32:16.000000000 +0100
-@@ -73,16 +73,13 @@ _start:
- addl $_GLOBAL_OFFSET_TABLE_, %ebx
-
- /* Push address of our own entry points to .fini and .init. */
-- leal __libc_csu_fini@GOTOFF(%ebx), %eax
-- pushl %eax
-- leal __libc_csu_init@GOTOFF(%ebx), %eax
-- pushl %eax
-+ pushl __libc_csu_fini@GOT(%ebx)
-+ pushl __libc_csu_init@GOT(%ebx)
-
- pushl %ecx /* Push second argument: argv. */
- pushl %esi /* Push first argument: argc. */
-
-- leal BP_SYM (main)@GOTOFF(%ebx), %eax
-- pushl %eax
-+ pushl BP_SYM (main)@GOT(%ebx)
-
- /* Call the user's main function, and exit with its value.
- But let the libc call main. */
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch
deleted file mode 100644
index a4f49c29080d..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From libc-alpha-return-13560-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com Wed Sep 24 06:27:22 2003
-Return-Path: <libc-alpha-return-13560-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com>
-Delivered-To: listarch-libc-alpha at sources dot redhat dot com
-Received: (qmail 23856 invoked by alias); 24 Sep 2003 06:27:20 -0000
-Mailing-List: contact libc-alpha-help at sources dot redhat dot com; run by ezmlm
-Precedence: bulk
-List-Subscribe: <mailto:libc-alpha-subscribe at sources dot redhat dot com>
-List-Archive: <http://sources.redhat.com/ml/libc-alpha/>
-List-Post: <mailto:libc-alpha at sources dot redhat dot com>
-List-Help: <mailto:libc-alpha-help at sources dot redhat dot com>, <http://sources dot redhat dot com/ml/#faqs>
-Sender: libc-alpha-owner at sources dot redhat dot com
-Delivered-To: mailing list libc-alpha at sources dot redhat dot com
-Received: (qmail 23847 invoked from network); 24 Sep 2003 06:27:16 -0000
-Received: from unknown (HELO sccrmhc11.comcast.net) (204.127.202.55)
- by sources dot redhat dot com with SMTP; 24 Sep 2003 06:27:16 -0000
-Received: from lucon.org ([12.234.88.5])
- by comcast dot net (sccrmhc11) with ESMTP
- id <2003092406271601100ok1f3e>; Wed, 24 Sep 2003 06:27:16 +0000
-Received: by lucon.org (Postfix, from userid 1000)
- id 6B4D02C828; Tue, 23 Sep 2003 23:27:11 -0700 (PDT)
-Date: Tue, 23 Sep 2003 23:27:11 -0700
-From: "H dot J dot Lu" <hjl at lucon dot org>
-To: Richard Henderson <rth at twiddle dot net>
-Cc: GNU C Library <libc-alpha at sources dot redhat dot com>,
- linux ia64 kernel <linux-ia64 at vger dot kernel dot org>
-Subject: PATCH: Re: Inefficient ia64 system call implementation in glibc
-Message-ID: <20030924062711.GA860@lucon.org>
-References: <20030919163218.GA21480@lucon.org> <20030921210434.GA2280@twiddle.net> <20030922193918.GA1141@lucon.org> <20030922232123.GA17271@twiddle.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-In-Reply-To: <20030922232123 dot GA17271 at twiddle dot net>
-User-Agent: Mutt/1.4.1i
-
-On Mon, Sep 22, 2003 at 04:21:23PM -0700, Richard Henderson wrote:
-> On Mon, Sep 22, 2003 at 12:39:18PM -0700, H. J. Lu wrote:
-> > Can I get char * from char [300]?
->
-> x+0 would work in this case; I'd guess it'd work for most of the
-> cases that syscalls need to handle.
->
-
-This patch works for me.
-
-
-H.J.
----
-2003-09-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * sysdeps/unix/sysv/linux/ia64/sysdep.h (LOAD_ARGS_1): Use
- __typeof ((outX) + 0) instead of long.
- (LOAD_ARGS_2): Likewise.
- (LOAD_ARGS_3): Likewise.
- (LOAD_ARGS_4): Likewise.
- (LOAD_ARGS_5): Likewise.
- (LOAD_ARGS_6): Likewise.
-
---- sysdeps/unix/sysv/linux/ia64/sysdep.h.inline 2003-08-21 07:05:30.000000000 -0700
-+++ sysdeps/unix/sysv/linux/ia64/sysdep.h 2003-09-23 11:04:02.000000000 -0700
-@@ -191,23 +191,23 @@
- #define INTERNAL_SYSCALL_ERRNO(val, err) (val)
-
- #define LOAD_ARGS_0() do { } while (0)
--#define LOAD_ARGS_1(out0) \
-- register long _out0 asm ("out0") = (long) (out0); \
-+#define LOAD_ARGS_1(out0) \
-+ register __typeof ((out0) + 0) _out0 asm ("out0") = (out0); \
- LOAD_ARGS_0 ()
--#define LOAD_ARGS_2(out0, out1) \
-- register long _out1 asm ("out1") = (long) (out1); \
-+#define LOAD_ARGS_2(out0, out1) \
-+ register __typeof ((out1) + 0) _out1 asm ("out1") = (out1); \
- LOAD_ARGS_1 (out0)
--#define LOAD_ARGS_3(out0, out1, out2) \
-- register long _out2 asm ("out2") = (long) (out2); \
-+#define LOAD_ARGS_3(out0, out1, out2) \
-+ register __typeof ((out2) + 0) _out2 asm ("out2") = (out2); \
- LOAD_ARGS_2 (out0, out1)
--#define LOAD_ARGS_4(out0, out1, out2, out3) \
-- register long _out3 asm ("out3") = (long) (out3); \
-+#define LOAD_ARGS_4(out0, out1, out2, out3) \
-+ register __typeof ((out3) + 0) _out3 asm ("out3") = (out3); \
- LOAD_ARGS_3 (out0, out1, out2)
--#define LOAD_ARGS_5(out0, out1, out2, out3, out4) \
-- register long _out4 asm ("out4") = (long) (out4); \
-+#define LOAD_ARGS_5(out0, out1, out2, out3, out4) \
-+ register __typeof ((out4) + 0) _out4 asm ("out4") = (out4); \
- LOAD_ARGS_4 (out0, out1, out2, out3)
--#define LOAD_ARGS_6(out0, out1, out2, out3, out4, out5) \
-- register long _out5 asm ("out5") = (long) (out5); \
-+#define LOAD_ARGS_6(out0, out1, out2, out3, out4, out5) \
-+ register __typeof ((out5) + 0) _out5 asm ("out5") = (out5); \
- LOAD_ARGS_5 (out0, out1, out2, out3, out4)
-
- #define ASM_OUTARGS_0
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-iconvconfig-name_insert.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-iconvconfig-name_insert.patch
deleted file mode 100644
index f1ffdbf40a1c..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-iconvconfig-name_insert.patch
+++ /dev/null
@@ -1,78 +0,0 @@
---- glibc-2.3.2-net/iconv/iconvconfig.c 12 Jun 2003 09:48:20 -0000 1.1.1.10
-+++ glibc-2.3.2-redhat/iconv/iconvconfig.c 12 Jun 2003 09:55:36 -0000 1.14
-@@ -988,6 +988,34 @@ next_prime (uint32_t seed)
- module name offset
- (following last entry with step count 0)
- */
-+
-+static struct hash_entry *hash_table;
-+static size_t hash_size;
-+
-+/* Function to insert the names. */
-+static void name_insert (const void *nodep, VISIT value, int level)
-+{
-+ struct name *name;
-+ unsigned int idx;
-+ unsigned int hval2;
-+
-+ if (value != leaf && value != postorder)
-+ return;
-+
-+ name = *(struct name **) nodep;
-+ idx = name->hashval % hash_size;
-+ hval2 = 1 + name->hashval % (hash_size - 2);
-+
-+ while (hash_table[idx].string_offset != 0)
-+ if ((idx += hval2) >= hash_size)
-+ idx -= hash_size;
-+
-+ hash_table[idx].string_offset = strtaboffset (name->strent);
-+
-+ assert (name->module_idx != -1);
-+ hash_table[idx].module_idx = name->module_idx;
-+}
-+
- static int
- write_output (void)
- {
-@@ -995,8 +1023,6 @@ write_output (void)
- char *string_table;
- size_t string_table_size;
- struct gconvcache_header header;
-- struct hash_entry *hash_table;
-- size_t hash_size;
- struct module_entry *module_table;
- char *extra_table;
- char *cur_extra_table;
-@@ -1008,30 +1034,6 @@ write_output (void)
- char tmpfname[prefix_len + sizeof (GCONV_MODULES_CACHE)
- + strlen (".XXXXXX")];
- char finalname[prefix_len + sizeof (GCONV_MODULES_CACHE)];
--
-- /* Function to insert the names. */
-- static void name_insert (const void *nodep, VISIT value, int level)
-- {
-- struct name *name;
-- unsigned int idx;
-- unsigned int hval2;
--
-- if (value != leaf && value != postorder)
-- return;
--
-- name = *(struct name **) nodep;
-- idx = name->hashval % hash_size;
-- hval2 = 1 + name->hashval % (hash_size - 2);
--
-- while (hash_table[idx].string_offset != 0)
-- if ((idx += hval2) >= hash_size)
-- idx -= hash_size;
--
-- hash_table[idx].string_offset = strtaboffset (name->strent);
--
-- assert (name->module_idx != -1);
-- hash_table[idx].module_idx = name->module_idx;
-- }
-
- /* Open the output file. */
- assert (GCONV_MODULES_CACHE[0] == '/');
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ipv6-bytestring-fix.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ipv6-bytestring-fix.patch
deleted file mode 100644
index fc7ded5d6e32..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ipv6-bytestring-fix.patch
+++ /dev/null
@@ -1,112 +0,0 @@
---- libc/resolv/nss_dns/dns-host.c 2003/10/26 08:33:27 1.38
-+++ libc/resolv/nss_dns/dns-host.c 2004/01/15 09:45:57 1.39
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1996-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-+/* Copyright (C) 1996-2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996.
-
-@@ -298,6 +298,8 @@
- return NSS_STATUS_UNAVAIL;
- }
-
-+ host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
-+
- switch (af)
- {
- case AF_INET:
-@@ -305,29 +307,38 @@
- (uaddr[2] & 0xff), (uaddr[1] & 0xff), (uaddr[0] & 0xff));
- break;
- case AF_INET6:
-- /* XXX Maybe we need an option to select whether to use the nibble
-- or the bitfield form. The RFC requires the bitfield form so
-- we use it. */
-+ /* Only lookup with the byte string format if the user wants it. */
-+ if (__builtin_expect (_res.options & RES_USEBSTRING, 0))
-+ {
-+ qp = stpcpy (qbuf, "\\[x");
-+ for (n = 0; n < IN6ADDRSZ; ++n)
-+ qp += sprintf (qp, "%02hhx", uaddr[n]);
-+ strcpy (qp, "].ip6.arpa");
-+ n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR,
-+ host_buffer.buf->buf, 1024, &host_buffer.ptr);
-+ if (n >= 0)
-+ goto got_it_already;
-+ }
- qp = qbuf;
-- qp = stpcpy (qbuf, "\\[x");
-- for (n = 0; n < IN6ADDRSZ; ++n)
-- qp += sprintf (qp, "%02hhx", uaddr[n]);
-- strcpy (qp, "].ip6.arpa");
-+ for (n = IN6ADDRSZ - 1; n >= 0; n--)
-+ {
-+ static const char nibblechar[16] = "0123456789abcdef";
-+ *qp++ = nibblechar[uaddr[n] & 0xf];
-+ *qp++ = '.';
-+ *qp++ = nibblechar[(uaddr[n] >> 4) & 0xf];
-+ *qp++ = '.';
-+ }
-+ strcpy(qp, "ip6.arpa");
- break;
- default:
- /* Cannot happen. */
- break;
- }
-
-- host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024);
--
- n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
- 1024, &host_buffer.ptr);
- if (n < 0 && af == AF_INET6)
- {
-- qp = qbuf;
-- for (n = IN6ADDRSZ - 1; n >= 0; n--)
-- qp += sprintf (qp, "%x.%x.", uaddr[n] & 0xf, (uaddr[n] >> 4) & 0xf);
- strcpy (qp, "ip6.int");
- n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
- host_buffer.buf != orig_host_buffer
-@@ -342,6 +353,7 @@
- return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
- }
-
-+ got_it_already:
- status = getanswer_r (host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen,
- errnop, h_errnop, 0 /* XXX */);
- if (host_buffer.buf != orig_host_buffer)
---- libc/resolv/resolv.h 2002/12/15 23:22:50 1.37
-+++ libc/resolv/resolv.h 2004/01/15 09:41:58 1.38
-@@ -199,6 +199,8 @@
- #define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
- #define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
- #define RES_BLAST 0x00020000 /* blast all recursive servers */
-+#define RES_USEBSTRING 0x00040000 /* IPv6 reverse lookup with byte
-+ strings */
-
- #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
-
---- libc/resolv/res_debug.c 2002/08/08 02:01:31 1.28
-+++ libc/resolv/res_debug.c 2004/01/15 09:43:35 1.29
-@@ -572,6 +572,10 @@
- case RES_DNSRCH: return "dnsrch";
- case RES_INSECURE1: return "insecure1";
- case RES_INSECURE2: return "insecure2";
-+ case RES_USE_INET6: return "inet6";
-+ case RES_ROTATE: return "rotate";
-+ case RES_NOCHECKNAME: return "no-check-names";
-+ case RES_USEBSTRING: return "ip6-bytstring";
- /* XXX nonreentrant */
- default: sprintf(nbuf, "?0x%lx?", (u_long)option);
- return (nbuf);
---- libc/resolv/res_init.c 2003/09/04 12:48:52 1.34
-+++ libc/resolv/res_init.c 2004/01/15 09:44:18 1.35
-@@ -489,6 +489,9 @@
- #endif
- } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
- statp->options |= RES_USE_INET6;
-+ } else if (!strncmp(cp, "ip6-bytestring",
-+ sizeof("ip6-bytestring") - 1)) {
-+ statp->options |= RES_USEBSTRING;
- } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) {
- statp->options |= RES_ROTATE;
- } else if (!strncmp(cp, "no-check-names",
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch
deleted file mode 100644
index 5d204c25b83e..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-2003-09-10 Chris Demetriou <cgd@broadcom.com>
-
- * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: New file.
-
-Index: linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
---- /dev/null Wed Sep 10 15:45:19 2003
-+++ linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h Wed Sep 10 15:45:14 2003
-@@ -0,0 +1,145 @@
-+/* Copyright (C) 2003 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Chris Demetriou of Broadcom Corporation,
-+ based on work by Guido Guenther <agx@sigxcpu.org>.
-+
-+ 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. */
-+
-+#include <sysdep.h>
-+#ifndef __ASSEMBLER__
-+# include <linuxthreads/internals.h>
-+#endif
-+#include <sys/asm.h>
-+
-+#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
-+
-+#ifdef __PIC__
-+# undef PSEUDO
-+# define PSEUDO(name, syscall_name, args) \
-+ .align 2; \
-+ 99: \
-+ PTR_LA t9,__syscall_error; \
-+ /* manual cpreturn. */ \
-+ REG_L gp, STKOFF_GP(sp); \
-+ RESTORESTK ; \
-+ jr t9; \
-+ ENTRY (name) \
-+ SAVESTK ; \
-+ .cpsetup t9, STKOFF_GP, name ; \
-+ .set reorder; \
-+ SINGLE_THREAD_P(t0); \
-+ bne zero, t0, L(pseudo_cancel); \
-+ .set noreorder; \
-+ li v0, SYS_ify(syscall_name); \
-+ syscall; \
-+ .set reorder; \
-+ bne a3, zero, SYSCALL_ERROR_LABEL; \
-+ /* manual cpreturn. */ \
-+ REG_L gp, STKOFF_GP(sp); \
-+ RESTORESTK ; \
-+ ret; \
-+ L(pseudo_cancel): \
-+ REG_S ra, STKOFF_RA(sp); \
-+ PUSHARGS_##args; /* save syscall args */ \
-+ CENABLE; \
-+ REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \
-+ POPARGS_##args; /* restore syscall args */ \
-+ .set noreorder; \
-+ li v0, SYS_ify (syscall_name); \
-+ syscall; \
-+ .set reorder; \
-+ REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \
-+ REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \
-+ REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \
-+ CDISABLE; \
-+ REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \
-+ REG_L ra, STKOFF_RA(sp); /* restore return address */ \
-+ REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \
-+ bne a3, zero, SYSCALL_ERROR_LABEL; \
-+ /* manual cpreturn. */ \
-+ REG_L gp, STKOFF_GP(sp); \
-+ RESTORESTK ; \
-+ L(pseudo_end):
-+#endif
-+
-+# define PUSHARGS_0 /* nothing to do */
-+# define PUSHARGS_1 PUSHARGS_0 REG_S a0, STKOFF_A0(sp);
-+# define PUSHARGS_2 PUSHARGS_1 REG_S a1, STKOFF_A1(sp);
-+# define PUSHARGS_3 PUSHARGS_2 REG_S a2, STKOFF_A2(sp);
-+# define PUSHARGS_4 PUSHARGS_3 REG_S a3, STKOFF_A3(sp);
-+# define PUSHARGS_5 PUSHARGS_4 REG_S a4, STKOFF_A4(sp);
-+# define PUSHARGS_6 PUSHARGS_5 REG_S a5, STKOFF_A5(sp);
-+
-+# define POPARGS_0 /* nothing to do */
-+# define POPARGS_1 POPARGS_0 REG_L a0, STKOFF_A0(sp);
-+# define POPARGS_2 POPARGS_1 REG_L a1, STKOFF_A1(sp);
-+# define POPARGS_3 POPARGS_2 REG_L a2, STKOFF_A2(sp);
-+# define POPARGS_4 POPARGS_3 REG_L a3, STKOFF_A3(sp);
-+# define POPARGS_5 POPARGS_4 REG_L a4, STKOFF_A4(sp);
-+# define POPARGS_6 POPARGS_5 REG_L a5, STKOFF_A5(sp);
-+
-+/* Save an even number of slots. Should be 0 if an even number of slots
-+ are used below, or SZREG if an odd number are used. */
-+# define STK_PAD SZREG
-+
-+/* Place values that we are more likely to use later in this sequence, i.e.
-+ closer to the SP at function entry. If you do that, the are more
-+ likely to already be in your d-cache. */
-+# define STKOFF_A5 (STK_PAD)
-+# define STKOFF_A4 (STKOFF_A5 + SZREG)
-+# define STKOFF_A3 (STKOFF_A4 + SZREG)
-+# define STKOFF_A2 (STKOFF_A3 + SZREG) /* MT and more args. */
-+# define STKOFF_A1 (STKOFF_A2 + SZREG) /* MT and 2 args. */
-+# define STKOFF_A0 (STKOFF_A1 + SZREG) /* MT and 1 arg. */
-+# define STKOFF_RA (STKOFF_A0 + SZREG) /* Used if MT. */
-+# define STKOFF_SC_V0 (STKOFF_RA + SZREG) /* Used if MT. */
-+# define STKOFF_SC_ERR (STKOFF_SC_V0 + SZREG) /* Used if MT. */
-+# define STKOFF_SVMSK (STKOFF_SC_ERR + SZREG) /* Used if MT. */
-+# define STKOFF_GP (STKOFF_SVMSK + SZREG) /* Always used. */
-+
-+# define STKSPACE (STKOFF_GP + SZREG)
-+# define SAVESTK PTR_SUBU sp, STKSPACE
-+# define RESTORESTK PTR_ADDU sp, STKSPACE
-+
-+# ifdef IS_IN_libpthread
-+# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9;
-+# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9;
-+# define __local_multiple_threads __pthread_multiple_threads
-+# else
-+# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9;
-+# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9;
-+# define __local_multiple_threads __libc_multiple_threads
-+# endif
-+
-+# if !defined NOT_IN_libc
-+# define __local_multiple_threads __libc_multiple_threads
-+# else
-+# define __local_multiple_threads __pthread_multiple_threads
-+# endif
-+
-+# ifndef __ASSEMBLER__
-+extern int __local_multiple_threads attribute_hidden;
-+# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
-+# else
-+# define SINGLE_THREAD_P(reg) lw reg, __local_multiple_threads
-+#endif
-+
-+#elif !defined __ASSEMBLER__
-+
-+/* This code should never be used but we define it anyhow. */
-+# define SINGLE_THREAD_P (1)
-+
-+#endif
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch
deleted file mode 100644
index 4ed4cd2c3be6..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-2003-07-17 Guido Guenther <agx@sigxcpu.org>
-
- * configure.in: pass $CFLAGS to ld --version-script test
-
-Index: configure.in
-===================================================================
-RCS file: /cvs/glibc/libc/configure.in,v
-retrieving revision 1.401
-diff -u -r1.401 configure.in
---- configure.in 3 Jul 2003 21:03:56 -0000 1.401
-+++ configure.in 16 Jul 2003 18:35:18 -0000
-@@ -1051,7 +1051,7 @@
- global: sym;
- } VERS_1;
- EOF
-- if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
-+ if ${CC-cc} -c $ASFLAGS $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
- if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
- -o conftest.so conftest.o
- -nostartfiles -nostdlib
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch
deleted file mode 100644
index ba186224f789..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-2003-09-10 Chris Demetriou <cgd@broadcom.com>
-
- * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Remove
- "#if 0" surrounding most of contents.
- (SYSCALL_ERROR_LABEL): Define.
- (__SYSCALL_CLOBBERS): Add $10.
- (internal_syscall7): Remove.
- * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise.
-
-
-Index: sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
---- sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Fri Aug 15 19:35:02 2003
-+++ sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Wed Sep 10 11:00:07 2003
-@@ -33,9 +33,16 @@
- # define SYS_ify(syscall_name) __NR_N32_/**/syscall_name
- #endif
-
-+#ifdef __ASSEMBLER__
-
--#ifndef __ASSEMBLER__
--#if 0 /* untested */
-+/* We don't want the label for the error handler to be visible in the symbol
-+ table when we define it here. */
-+#ifdef __PIC__
-+# define SYSCALL_ERROR_LABEL 99b
-+#endif
-+
-+#else /* ! __ASSEMBLER__ */
-+
- /* Define a macro which expands into the inline wrapper code for a system
- call. */
- #undef INLINE_SYSCALL
-@@ -227,37 +234,8 @@
- } \
- _sys_result; \
- })
--
--#define internal_syscall7(name, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
--({ \
-- long _sys_result; \
-- \
-- { \
-- register long long __v0 asm("$2"); \
-- register long long __a0 asm("$4") = (long long) arg1; \
-- register long long __a1 asm("$5") = (long long) arg2; \
-- register long long __a2 asm("$6") = (long long) arg3; \
-- register long long __a3 asm("$7") = (long long) arg4; \
-- register long long __a4 asm("$8") = (long long) arg5; \
-- register long long __a5 asm("$9") = (long long) arg6; \
-- register long long __a6 asm("$10") = (long long) arg7; \
-- __asm__ volatile ( \
-- ".set\tnoreorder\n\t" \
-- "li\t$2, %5\t\t\t# " #name "\n\t" \
-- "syscall\n\t" \
-- ".set\treorder" \
-- : "=r" (__v0), "+r" (__a3) \
-- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
-- "r" (__a4), "r" (__a5), "r" (__a6) \
-- : __SYSCALL_CLOBBERS); \
-- err = __a3; \
-- _sys_result = __v0; \
-- } \
-- _sys_result; \
--})
-
--#define __SYSCALL_CLOBBERS "$1", "$3", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
--#endif /* untested */
-+#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
- #endif /* __ASSEMBLER__ */
-
- #endif /* linux/mips/sysdep.h */
-Index: sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
---- sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Fri Aug 15 19:35:02 2003
-+++ sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Wed Sep 10 11:00:07 2003
-@@ -33,9 +33,16 @@
- # define SYS_ify(syscall_name) __NR_N64_/**/syscall_name
- #endif
-
-+#ifdef __ASSEMBLER__
-
--#ifndef __ASSEMBLER__
--#if 0 /* untested */
-+/* We don't want the label for the error handler to be visible in the symbol
-+ table when we define it here. */
-+#ifdef __PIC__
-+# define SYSCALL_ERROR_LABEL 99b
-+#endif
-+
-+#else /* ! __ASSEMBLER__ */
-+
- /* Define a macro which expands into the inline wrapper code for a system
- call. */
- #undef INLINE_SYSCALL
-@@ -227,37 +234,8 @@
- } \
- _sys_result; \
- })
--
--#define internal_syscall7(name, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
--({ \
-- long _sys_result; \
-- \
-- { \
-- register long __v0 asm("$2"); \
-- register long __a0 asm("$4") = (long) arg1; \
-- register long __a1 asm("$5") = (long) arg2; \
-- register long __a2 asm("$6") = (long) arg3; \
-- register long __a3 asm("$7") = (long) arg4; \
-- register long __a4 asm("$8") = (long) arg5; \
-- register long __a5 asm("$9") = (long) arg6; \
-- register long __a6 asm("$10") = (long) arg7; \
-- __asm__ volatile ( \
-- ".set\tnoreorder\n\t" \
-- "li\t$2, %5\t\t\t# " #name "\n\t" \
-- "syscall\n\t" \
-- ".set\treorder" \
-- : "=r" (__v0), "+r" (__a3) \
-- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
-- "r" (__a4), "r" (__a5), "r" (__a6) \
-- : __SYSCALL_CLOBBERS); \
-- err = __a3; \
-- _sys_result = __v0; \
-- } \
-- _sys_result; \
--})
-
--#define __SYSCALL_CLOBBERS "$1", "$3", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
--#endif /* untested */
-+#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25"
- #endif /* __ASSEMBLER__ */
-
- #endif /* linux/mips/sysdep.h */
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-nested-entend-pairs.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-nested-entend-pairs.patch
deleted file mode 100644
index 03c6a6b1ec4f..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-nested-entend-pairs.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- sysdeps/mips/dl-machine.h.org Thu Apr 15 11:24:26 2004
-+++ sysdeps/mips/dl-machine.h Thu Apr 15 11:38:28 2004
-@@ -474,7 +474,7 @@
- " STRINGXP(PTR_LA) " $25, _dl_start_user\n\
- .globl _dl_start_user\n\
- .type _dl_start_user,@function\n\
-- .ent _dl_start_user\n\
-+ .aent _dl_start_user\n\
- _dl_start_user:\n\
- " STRINGXP(SETUP_GP) "\n\
- " STRINGXV(SETUP_GP64($18,_dl_start_user)) "\n\
-@@ -512,8 +512,7 @@
- " STRINGXP(PTR_LA) " $2, _dl_fini\n\
- # Jump to the user entry point.\n\
- move $25, $17\n\
-- jr $25\n\
-- .end _dl_start_user\n\t"\
-+ jr $25\n\t"\
- _RTLD_EPILOGUE(ENTRY_POINT)\
- ".previous"\
- );
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch
deleted file mode 100644
index cb2d67464b32..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-2003-05-30 Guido Guenther <agx@sigxcpu.org>
-
- * sysdeps/unix/sysv/linux/mips/pread.c: include <stddef.h>
- * sysdeps/unix/sysv/linux/mips/pread.c: handle __NR_N32_pread64,
- __NR_O32_pread64 and __NR__N64_pread64.
- * sysdeps/unix/sysv/linux/mips/pread64.c: likewise.
- * sysdeps/unix/sysv/linux/mips/pwrite.c: handle __NR_N32_pwrite64,
- __NR_O32_pwrite64 and __NR__N64_pwrite64.
- * sysdeps/unix/sysv/linux/mips/pwrite64.c: likewise.
-
-Index: sysdeps/unix/sysv/linux/mips//pread.c
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread.c,v
-retrieving revision 1.11
-diff -u -p -u -r1.11 pread.c
---- sysdeps/unix/sysv/linux/mips//pread.c 30 May 2003 17:41:46 -0000 1.11
-+++ sysdeps/unix/sysv/linux/mips//pread.c 23 Jul 2003 11:49:51 -0000
-@@ -33,6 +34,24 @@
- # error "__NR_pread and __NR_pread64 both defined???"
- # endif
- # define __NR_pread __NR_pread64
-+#endif
-+#ifdef __NR_O32_pread64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_O32_pread
-+# error "__NR_O32_pread and __NR_O32_pread64 both defined???"
-+# endif
-+# define __NR_O32_pread __NR_O32_pread64
-+#endif
-+#ifdef __NR_N32_pread64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N32_pread
-+# error "__NR_N32_pread and __NR_N32_pread64 both defined???"
-+# endif
-+# define __NR_N32_pread __NR_N32_pread64
-+#endif
-+#ifdef __NR_N64_pread64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N64_pread
-+# error "__NR_N64_pread and __NR_N64_pread64 both defined???"
-+# endif
-+# define __NR_N64_pread __NR_N64_pread64
- #endif
-
- #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-Index: sysdeps/unix/sysv/linux/mips//pread64.c
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread64.c,v
-retrieving revision 1.11
-diff -u -p -u -r1.11 pread64.c
---- sysdeps/unix/sysv/linux/mips//pread64.c 30 May 2003 17:41:46 -0000 1.11
-+++ sysdeps/unix/sysv/linux/mips//pread64.c 23 Jul 2003 11:49:51 -0000
-@@ -33,6 +33,24 @@
- # endif
- # define __NR_pread __NR_pread64
- #endif
-+#ifdef __NR_O32_pread64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_O32_pread
-+# error "__NR_O32_pread and __NR_O32_pread64 both defined???"
-+# endif
-+# define __NR_O32_pread __NR_O32_pread64
-+#endif
-+#ifdef __NR_N32_pread64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N32_pread
-+# error "__NR_N32_pread and __NR_N32_pread64 both defined???"
-+# endif
-+# define __NR_N32_pread __NR_N32_pread64
-+#endif
-+#ifdef __NR_N64_pread64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N64_pread
-+# error "__NR_N64_pread and __NR_N64_pread64 both defined???"
-+# endif
-+# define __NR_N64_pread __NR_N64_pread64
-+#endif
-
- #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-Index: sysdeps/unix/sysv/linux/mips//pwrite.c
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite.c,v
-retrieving revision 1.11
-diff -u -p -u -r1.11 pwrite.c
---- sysdeps/unix/sysv/linux/mips//pwrite.c 30 May 2003 17:41:46 -0000 1.11
-+++ sysdeps/unix/sysv/linux/mips//pwrite.c 23 Jul 2003 11:49:51 -0000
-@@ -34,6 +34,24 @@
- # endif
- # define __NR_pwrite __NR_pwrite64
- #endif
-+#ifdef __NR_O32_pwrite64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_O32_pwrite
-+# error "__NR_O32_pwrite and __NR_O32_pwrite64 both defined???"
-+# endif
-+# define __NR_O32_pwrite __NR_O32_pwrite64
-+#endif
-+#ifdef __NR_N32_pwrite64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N32_pwrite
-+# error "__NR_N32_pwrite and __NR_N32_pwrite64 both defined???"
-+# endif
-+# define __NR_N32_pwrite __NR_N32_pwrite64
-+#endif
-+#ifdef __NR_N64_pwrite64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N64_pwrite
-+# error "__NR_N64_pwrite and __NR_N64_pwrite64 both defined???"
-+# endif
-+# define __NR_N64_pwrite __NR_N64_pwrite64
-+#endif
-
- #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-Index: sysdeps/unix/sysv/linux/mips//pwrite64.c
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite64.c,v
-retrieving revision 1.12
-diff -u -p -u -r1.12 pwrite64.c
---- sysdeps/unix/sysv/linux/mips//pwrite64.c 30 May 2003 17:41:46 -0000 1.12
-+++ sysdeps/unix/sysv/linux/mips//pwrite64.c 23 Jul 2003 11:49:51 -0000
-@@ -33,6 +33,24 @@
- # endif
- # define __NR_pwrite __NR_pwrite64
- #endif
-+#ifdef __NR_O32_pwrite64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_O32_pwrite
-+# error "__NR_O32_pwrite and __NR_O32_pwrite64 both defined???"
-+# endif
-+# define __NR_O32_pwrite __NR_O32_pwrite64
-+#endif
-+#ifdef __NR_N32_pwrite64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N32_pwrite
-+# error "__NR_N32_pwrite and __NR_N32_pwrite64 both defined???"
-+# endif
-+# define __NR_N32_pwrite __NR_N32_pwrite64
-+#endif
-+#ifdef __NR_N64_pwrite64 /* Newer kernels renamed but it's the same. */
-+# ifdef __NR_N64_pwrite
-+# error "__NR_N64_pwrite and __NR_N64_pwrite64 both defined???"
-+# endif
-+# define __NR_N64_pwrite __NR_N64_pwrite64
-+#endif
-
- #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-nptl-fix-include.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-nptl-fix-include.patch
deleted file mode 100644
index 19c143a252a1..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-nptl-fix-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- glibc-2.3.2/nptl/unwind.c.orig 2003-05-17 22:11:05.000000000 +0200
-+++ glibc-2.3.2/nptl/unwind.c 2003-05-17 22:08:30.000000000 +0200
-@@ -20,6 +20,7 @@
-
- #include <setjmp.h>
- #include <stdlib.h>
-+#include <unistd.h>
- #include "pthreadP.h"
-
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-owl-malloc-unlink-sanity-check.diff b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-owl-malloc-unlink-sanity-check.diff
deleted file mode 100644
index 1525fa005632..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-owl-malloc-unlink-sanity-check.diff
+++ /dev/null
@@ -1,29 +0,0 @@
---- malloc/malloc.c.orig 2004-01-03 18:36:23.000000000 -0500
-+++ malloc/malloc.c 2004-01-03 18:46:16.000000000 -0500
-@@ -311,6 +311,11 @@ extern "C" {
- #define assert(x) ((void)0)
- #endif
-
-+/* needed for owl-malloc-unlink-sanity-check */
-+#include <abort-instr.h>
-+#ifndef ABORT_INSTRUCTION
-+#define ABORT_INSTRUCTION
-+#endif
-
- /*
- INTERNAL_SIZE_T is the word-size used for internal bookkeeping
-@@ -1951,6 +1956,14 @@ typedef struct malloc_chunk* mbinptr;
- #define unlink(P, BK, FD) { \
- FD = P->fd; \
- BK = P->bk; \
-+ /* owl-malloc-unlink-sanity-check */ \
-+ if (FD->bk != P || BK->fd != P) \
-+ { \
-+ ABORT_INSTRUCTION; \
-+ _exit(127); \
-+ while (1) \
-+ ABORT_INSTRUCTION; \
-+ } \
- FD->bk = BK; \
- BK->fd = FD; \
- }
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v2.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v2.patch
deleted file mode 100644
index 2a230f1d3da5..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v2.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/generic/libc-start.c glibc-2.3.2/sysdeps/generic/libc-start.c
---- glibc-2.3.2.ORIG/sysdeps/generic/libc-start.c 2003-02-14 23:59:15.000000000 +0100
-+++ glibc-2.3.2/sysdeps/generic/libc-start.c 2003-11-08 21:32:03.000000000 +0100
-@@ -184,6 +184,9 @@
- _dl_debug_printf ("\ntransferring control: %s\n\n", argv[0]);
- #endif
-
-+ /* call the __guard_setup to set up the random __guard value */
-+ __guard_setup (); /* pappy@gentoo.org */
-+
- #ifdef HAVE_CLEANUP_JMP_BUF
- /* Memory for the cancellation buffer. */
- struct pthread_unwind_buf unwind_buf;
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Dist glibc-2.3.2/sysdeps/unix/sysv/linux/Dist
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Dist 2003-02-21 07:30:10.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Dist 2003-11-08 21:13:58.000000000 +0100
-@@ -1,3 +1,4 @@
-+ssp.c
- bits/initspin.h
- cmsg_nxthdr.c
- dl-brk.c
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Makefile glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Makefile 2002-12-17 00:36:52.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile 2003-11-08 21:13:58.000000000 +0100
-@@ -1,5 +1,5 @@
- ifeq ($(subdir),csu)
--sysdep_routines += errno-loc
-+sysdep_routines += errno-loc ssp
- endif
-
- ifeq ($(subdir),db2)
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Versions glibc-2.3.2/sysdeps/unix/sysv/linux/Versions
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Versions 2002-12-17 00:28:17.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Versions 2003-11-08 21:13:58.000000000 +0100
-@@ -108,6 +108,8 @@
- GLIBC_2.3.2 {
- # New kernel interfaces.
- epoll_create; epoll_ctl; epoll_wait;
-+ # global objects and functions for the propolice patch in gcc - moved from libgcc by pappy@gentoo.org
-+ __guard; __guard_setup; __stack_smash_handler;
- }
- GLIBC_PRIVATE {
- # needed by libpthread.
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/ssp.c glibc-2.3.2/sysdeps/unix/sysv/linux/ssp.c
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/ssp.c 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/ssp.c 2003-11-08 21:13:58.000000000 +0100
-@@ -0,0 +1,97 @@
-+#include <stdio.h>
-+#include <string.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#ifdef _POSIX_SOURCE
-+#include <signal.h>
-+#endif
-+
-+#if defined(HAVE_SYSLOG)
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <sys/un.h>
-+
-+#include <sys/syslog.h>
-+#ifndef _PATH_LOG
-+#define _PATH_LOG "/dev/log"
-+#endif
-+#endif
-+
-+long __guard[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-+
-+void __guard_setup (void)
-+{
-+ int fd;
-+ if (__guard[0]!=0) return;
-+ fd = open ("/dev/urandom", 0);
-+ if (fd != -1) {
-+ ssize_t size = read (fd, (char*)&__guard, sizeof(__guard));
-+ close (fd) ;
-+ if (size == sizeof(__guard)) return;
-+ }
-+ /* If a random generator can't be used, the protector switches the guard
-+ to the "terminator canary" */
-+ ((char*)__guard)[0] = 0; ((char*)__guard)[1] = 0;
-+ ((char*)__guard)[2] = '\n'; ((char*)__guard)[3] = 255;
-+}
-+
-+void __stack_smash_handler (char func[], int damaged)
-+{
-+#if defined (__GNU_LIBRARY__)
-+ extern char * __progname;
-+#endif
-+ const char message[] = ": stack smashing attack in function ";
-+ int bufsz = 512, len;
-+ char buf[bufsz];
-+#if defined(HAVE_SYSLOG)
-+ int LogFile;
-+ struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */
-+#endif
-+#ifdef _POSIX_SOURCE
-+ {
-+ sigset_t mask;
-+ sigfillset(&mask);
-+ sigdelset(&mask, SIGABRT); /* Block all signal handlers */
-+ sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGABRT */
-+ }
-+#endif
-+
-+ strcpy(buf, "<2>"); len=3; /* send LOG_CRIT */
-+#if defined (__GNU_LIBRARY__)
-+ strncat(buf, __progname, bufsz-len-1); len = strlen(buf);
-+#endif
-+ if (bufsz>len) {strncat(buf, message, bufsz-len-1); len = strlen(buf);}
-+ if (bufsz>len) {strncat(buf, func, bufsz-len-1); len = strlen(buf);}
-+ /* print error message */
-+ write (STDERR_FILENO, buf+3, len-3);
-+#if defined(HAVE_SYSLOG)
-+ if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) != -1) {
-+
-+ /*
-+ * Send "found" message to the "/dev/log" path
-+ */
-+ SyslogAddr.sun_family = AF_UNIX;
-+ (void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
-+ sizeof(SyslogAddr.sun_path) - 1);
-+ SyslogAddr.sun_path[sizeof(SyslogAddr.sun_path) - 1] = '\0';
-+ sendto(LogFile, buf, len, 0, (struct sockaddr *)&SyslogAddr,
-+ sizeof(SyslogAddr));
-+ }
-+#endif
-+
-+#ifdef _POSIX_SOURCE
-+ { /* Make sure the default handler is associated with SIGABRT */
-+ struct sigaction sa;
-+
-+ memset(&sa, 0, sizeof(struct sigaction));
-+ sigfillset(&sa.sa_mask); /* Block all signals */
-+ sa.sa_flags = 0;
-+ sa.sa_handler = SIG_DFL;
-+ sigaction(SIGABRT, &sa, NULL);
-+ (void)kill(getpid(), SIGABRT);
-+ }
-+#endif
-+ _exit(127);
-+}
-+
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v3.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v3.patch
deleted file mode 100644
index c4882afa8f9f..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions-v3.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -Naur glibc-2.3.2-orig/sysdeps/generic/libc-start.c glibc-2.3.2/sysdeps/generic/libc-start.c
---- glibc-2.3.2-orig/sysdeps/generic/libc-start.c 2004-05-10 01:59:09.000000000 -0400
-+++ glibc-2.3.2/sysdeps/generic/libc-start.c 2004-05-10 02:06:00.865611770 -0400
-@@ -188,6 +188,9 @@
- GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
- #endif
-
-+ /* call the __guard_setup to set up the random __guard value */
-+ __guard_setup (); /* pappy@gentoo.org (pappy rules) */
-+
- #ifdef HAVE_CLEANUP_JMP_BUF
- /* Memory for the cancellation buffer. */
- struct pthread_unwind_buf unwind_buf;
-diff -Naur glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Dist glibc-2.3.2/sysdeps/unix/sysv/linux/Dist
---- glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Dist 2004-05-10 01:59:10.000000000 -0400
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Dist 2004-05-10 02:06:54.862038647 -0400
-@@ -1,3 +1,4 @@
-+ssp.c
- bits/initspin.h
- cmsg_nxthdr.c
- dl-brk.c
-diff -Naur glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Makefile glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Makefile 2004-05-10 01:59:10.000000000 -0400
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile 2004-05-10 02:07:50.709582758 -0400
-@@ -1,5 +1,5 @@
- ifeq ($(subdir),csu)
--sysdep_routines += errno-loc
-+sysdep_routines += errno-loc ssp
- endif
-
- ifeq ($(subdir),assert)
-diff -Naur glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Versions glibc-2.3.2/sysdeps/unix/sysv/linux/Versions
---- glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Versions 2004-05-10 01:59:10.000000000 -0400
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Versions 2004-05-10 02:10:30.410716176 -0400
-@@ -108,6 +108,8 @@
- GLIBC_2.3.2 {
- # New kernel interfaces.
- epoll_create; epoll_ctl; epoll_wait;
-+ # global objects and functions for the propolice patch in gcc - moved from libgcc by pappy@gentoo.org
-+ __guard; __guard_setup; __stack_smash_handler;
- }
- GLIBC_2.3.3 {
- gnu_dev_major; gnu_dev_minor; gnu_dev_makedev;
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions.patch
deleted file mode 100644
index deb117dfd033..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-propolice-guard-functions.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/generic/libc-start.c glibc-2.3.2/sysdeps/generic/libc-start.c
---- glibc-2.3.2.ORIG/sysdeps/generic/libc-start.c 2003-02-14 23:59:15.000000000 +0100
-+++ glibc-2.3.2/sysdeps/generic/libc-start.c 2003-11-08 21:32:03.000000000 +0100
-@@ -149,6 +149,9 @@
- {
- /* XXX This is where the try/finally handling must be used. */
-
-+ /* call the __guard_setup to set up the random __guard value */
-+ __guard_setup (); /* pappy@gentoo.org */
-+
- result = main (argc, argv, __environ);
- }
- #ifdef HAVE_CANCELBUF
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Dist glibc-2.3.2/sysdeps/unix/sysv/linux/Dist
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Dist 2003-02-21 07:30:10.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Dist 2003-11-08 21:13:58.000000000 +0100
-@@ -1,3 +1,4 @@
-+ssp.c
- bits/initspin.h
- cmsg_nxthdr.c
- dl-brk.c
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Makefile glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Makefile 2002-12-17 00:36:52.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile 2003-11-08 21:13:58.000000000 +0100
-@@ -1,5 +1,5 @@
- ifeq ($(subdir),csu)
--sysdep_routines += errno-loc
-+sysdep_routines += errno-loc ssp
- endif
-
- ifeq ($(subdir),db2)
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Versions glibc-2.3.2/sysdeps/unix/sysv/linux/Versions
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/Versions 2002-12-17 00:28:17.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Versions 2003-11-08 21:13:58.000000000 +0100
-@@ -108,6 +108,8 @@
- GLIBC_2.3.2 {
- # New kernel interfaces.
- epoll_create; epoll_ctl; epoll_wait;
-+ # global objects and functions for the propolice patch in gcc - moved from libgcc by pappy@gentoo.org
-+ __guard; __guard_setup; __stack_smash_handler;
- }
- GLIBC_PRIVATE {
- # needed by libpthread.
-diff -u -r -N glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/ssp.c glibc-2.3.2/sysdeps/unix/sysv/linux/ssp.c
---- glibc-2.3.2.ORIG/sysdeps/unix/sysv/linux/ssp.c 1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/ssp.c 2003-11-08 21:13:58.000000000 +0100
-@@ -0,0 +1,97 @@
-+#include <stdio.h>
-+#include <string.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#ifdef _POSIX_SOURCE
-+#include <signal.h>
-+#endif
-+
-+#if defined(HAVE_SYSLOG)
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <sys/un.h>
-+
-+#include <sys/syslog.h>
-+#ifndef _PATH_LOG
-+#define _PATH_LOG "/dev/log"
-+#endif
-+#endif
-+
-+long __guard[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-+
-+void __guard_setup (void)
-+{
-+ int fd;
-+ if (__guard[0]!=0) return;
-+ fd = open ("/dev/urandom", 0);
-+ if (fd != -1) {
-+ ssize_t size = read (fd, (char*)&__guard, sizeof(__guard));
-+ close (fd) ;
-+ if (size == sizeof(__guard)) return;
-+ }
-+ /* If a random generator can't be used, the protector switches the guard
-+ to the "terminator canary" */
-+ ((char*)__guard)[0] = 0; ((char*)__guard)[1] = 0;
-+ ((char*)__guard)[2] = '\n'; ((char*)__guard)[3] = 255;
-+}
-+
-+void __stack_smash_handler (char func[], int damaged)
-+{
-+#if defined (__GNU_LIBRARY__)
-+ extern char * __progname;
-+#endif
-+ const char message[] = ": stack smashing attack in function ";
-+ int bufsz = 512, len;
-+ char buf[bufsz];
-+#if defined(HAVE_SYSLOG)
-+ int LogFile;
-+ struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */
-+#endif
-+#ifdef _POSIX_SOURCE
-+ {
-+ sigset_t mask;
-+ sigfillset(&mask);
-+ sigdelset(&mask, SIGABRT); /* Block all signal handlers */
-+ sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGABRT */
-+ }
-+#endif
-+
-+ strcpy(buf, "<2>"); len=3; /* send LOG_CRIT */
-+#if defined (__GNU_LIBRARY__)
-+ strncat(buf, __progname, bufsz-len-1); len = strlen(buf);
-+#endif
-+ if (bufsz>len) {strncat(buf, message, bufsz-len-1); len = strlen(buf);}
-+ if (bufsz>len) {strncat(buf, func, bufsz-len-1); len = strlen(buf);}
-+ /* print error message */
-+ write (STDERR_FILENO, buf+3, len-3);
-+#if defined(HAVE_SYSLOG)
-+ if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) != -1) {
-+
-+ /*
-+ * Send "found" message to the "/dev/log" path
-+ */
-+ SyslogAddr.sun_family = AF_UNIX;
-+ (void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
-+ sizeof(SyslogAddr.sun_path) - 1);
-+ SyslogAddr.sun_path[sizeof(SyslogAddr.sun_path) - 1] = '\0';
-+ sendto(LogFile, buf, len, 0, (struct sockaddr *)&SyslogAddr,
-+ sizeof(SyslogAddr));
-+ }
-+#endif
-+
-+#ifdef _POSIX_SOURCE
-+ { /* Make sure the default handler is associated with SIGABRT */
-+ struct sigaction sa;
-+
-+ memset(&sa, 0, sizeof(struct sigaction));
-+ sigfillset(&sa.sa_mask); /* Block all signals */
-+ sa.sa_flags = 0;
-+ sa.sa_handler = SIG_DFL;
-+ sigaction(SIGABRT, &sa, NULL);
-+ (void)kill(getpid(), SIGABRT);
-+ }
-+#endif
-+ _exit(127);
-+}
-+
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-pt_pax.diff b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-pt_pax.diff
deleted file mode 100644
index fdae6f514e62..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-pt_pax.diff
+++ /dev/null
@@ -1,29 +0,0 @@
---- elf/elf.h.orig 2004-01-26 12:54:15.000000000 -0500
-+++ elf/elf.h 2004-01-26 12:53:23.000000000 -0500
-@@ -568,6 +568,7 @@
- #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
- #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
- #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
- #define PT_LOSUNW 0x6ffffffa
- #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
- #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
-@@ -581,6 +582,18 @@
- #define PF_X (1 << 0) /* Segment is executable */
- #define PF_W (1 << 1) /* Segment is writable */
- #define PF_R (1 << 2) /* Segment is readable */
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
- #define PF_MASKOS 0x0ff00000 /* OS-specific */
- #define PF_MASKPROC 0xf0000000 /* Processor-specific */
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-linuxthreads-fixes.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-linuxthreads-fixes.patch
deleted file mode 100644
index dd9f1436c384..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-linuxthreads-fixes.patch
+++ /dev/null
@@ -1,58 +0,0 @@
---- glibc-2.3.2-net/linuxthreads/Makefile 13 May 2003 19:51:57 -0000 1.1.1.46
-+++ glibc-2.3.2-redhat/linuxthreads/Makefile 13 May 2003 20:07:01 -0000 1.25
-@@ -217,15 +217,18 @@ $(addprefix $(objpfx), \
- $(filter-out $(tests-static) $(tests-reverse) unload, \
- $(tests) $(test-srcs))): $(objpfx)libpthread.so \
- $(objpfx)libpthread_nonshared.a
--# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
-+# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so,
- # since otherwise libpthread.so comes before libc.so when linking.
- $(addprefix $(objpfx), $(tests-reverse)): \
-- $(objpfx)../libc.so $(objpfx)libpthread.so \
-+ $(objpfx)linklibc.so $(objpfx)libpthread.so \
- $(objpfx)libpthread_nonshared.a
- $(objpfx)../libc.so: $(common-objpfx)libc.so ;
- $(addprefix $(objpfx),$(librt-tests)): $(common-objpfx)rt/librt.so
- $(objpfx)unload: $(common-objpfx)dlfcn/libdl.so
- $(objpfx)unload.out: $(objpfx)libpthread.so $(objpfx)libpthread_nonshared.a
-+$(objpfx)linklibc.so: $(common-objpfx)libc.so
-+ ln -s ../libc.so $@
-+generated += libclink.so
- else
- $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
- $(addprefix $(objpfx),$(librt-tests)): $(common-objpfx)rt/librt.a
---- glibc-2.3.2-net/linuxthreads/cancel.c 22 Feb 2003 16:58:54 -0000 1.1.1.15
-+++ glibc-2.3.2-redhat/linuxthreads/cancel.c 23 Feb 2003 21:15:06 -0000 1.10
-@@ -230,5 +230,6 @@ void __pthread_perform_cleanup(char *cur
- }
-
- /* And the TSD which needs special help. */
-+ THREAD_SETMEM (self, p_cancelstate, PTHREAD_CANCEL_DISABLE);
- __libc_thread_freeres ();
- }
---- glibc-2.3.2-net/linuxthreads/lockfile.c 18 Dec 2002 12:43:50 -0000 1.1.1.7
-+++ glibc-2.3.2-redhat/linuxthreads/lockfile.c 18 Dec 2002 12:48:17 -0000 1.8
-@@ -74,7 +74,11 @@ __fresetlockfiles (void)
- __pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-
- for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
-- __pthread_mutex_init (_IO_iter_file(i)->_lock, &attr);
-+ {
-+ _IO_lock_t *_lock = _IO_iter_file(i)->_lock;
-+ if (_lock)
-+ __pthread_mutex_init (_lock, &attr);
-+ }
-
- __pthread_mutexattr_destroy (&attr);
-
---- glibc-2.3.2-net/linuxthreads/semaphore.h 25 Jun 2001 11:31:17 -0000 1.1.1.6
-+++ glibc-2.3.2-redhat/linuxthreads/semaphore.h 5 Apr 2002 10:02:50 -0000 1.2
-@@ -21,6 +21,7 @@
- # define __need_timespec
- # include <time.h>
- #endif
-+#include <bits/pthreadtypes.h>
-
- #ifndef _PTHREAD_DESCR_DEFINED
- /* Thread descriptors. Needed for `sem_t' definition. */
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-nptl-fixes.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-nptl-fixes.patch
deleted file mode 100644
index c25a834b55dc..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-redhat-nptl-fixes.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- glibc-2.3.2-net/nptl/Makefile 15 May 2003 13:07:24 -0000 1.1.1.45
-+++ glibc-2.3.2-redhat/nptl/Makefile 15 May 2003 13:28:12 -0000 1.50
-@@ -330,15 +330,19 @@ $(addprefix $(objpfx), \
- $(tests) $(test-srcs))): $(objpfx)libpthread.so \
- $(objpfx)libpthread_nonshared.a
- $(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so
--# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
-+# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so,
- # since otherwise libpthread.so comes before libc.so when linking.
- $(addprefix $(objpfx), $(tests-reverse)): \
-- $(objpfx)../libc.so $(objpfx)libpthread.so \
-+ $(objpfx)linklibc.so $(objpfx)libpthread.so \
- $(objpfx)libpthread_nonshared.a
- $(objpfx)../libc.so: $(common-objpfx)libc.so ;
- $(addprefix $(objpfx),$(tests-static)): $(objpfx)libpthread.a
-
- $(objpfx)tst-atfork2.out: $(objpfx)tst-atfork2mod.so
-+
-+$(objpfx)linklibc.so: $(common-objpfx)libc.so
-+ ln -s ../libc.so $@
-+generated += libclink.so
- else
- $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
- endif
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-rtld-assert-fix.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-rtld-assert-fix.patch
deleted file mode 100644
index 8f5830e2a3af..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-rtld-assert-fix.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- glibc-2.3.2/elf/rtld.c 2004-02-03 19:52:59.420623568 +0200
-+++ glibc-2.3.2.rtld/elf/rtld.c 2004-02-03 19:53:20.505418192 +0200
-@@ -1280,19 +1280,7 @@ of this helper program; chances are you
- while (GL(dl_loaded)->l_searchlist.r_list[i] != &GL(dl_rtld_map))
- ++i;
- GL(dl_rtld_map).l_prev = GL(dl_loaded)->l_searchlist.r_list[i - 1];
-- if (__builtin_expect (mode, normal) == normal)
-- GL(dl_rtld_map).l_next = (i + 1 < GL(dl_loaded)->l_searchlist.r_nlist
-- ? GL(dl_loaded)->l_searchlist.r_list[i + 1]
-- : NULL);
-- else
-- /* In trace mode there might be an invisible object (which we
-- could not find) after the previous one in the search list.
-- In this case it doesn't matter much where we put the
-- interpreter object, so we just initialize the list pointer so
-- that the assertion below holds. */
-- GL(dl_rtld_map).l_next = GL(dl_rtld_map).l_prev->l_next;
--
-- assert (GL(dl_rtld_map).l_prev->l_next == GL(dl_rtld_map).l_next);
-+ GL(dl_rtld_map).l_next = GL(dl_rtld_map).l_prev->l_next;
- GL(dl_rtld_map).l_prev->l_next = &GL(dl_rtld_map);
- if (GL(dl_rtld_map).l_next != NULL)
- {
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-s390-deprecated-ustat-fixup.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-s390-deprecated-ustat-fixup.patch
deleted file mode 100644
index a5acebe9edf2..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-s390-deprecated-ustat-fixup.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-From bug-glibc-bounces+listarch-bug-glibc=sources dot redhat dot com at gnu dot org Tue Aug 05 19:52:26 2003
-Return-Path: <bug-glibc-bounces+listarch-bug-glibc=sources dot redhat dot com at gnu dot org>
-Delivered-To: listarch-bug-glibc at sources dot redhat dot com
-Received: (qmail 31779 invoked from network); 5 Aug 2003 19:52:26 -0000
-Received: from unknown (HELO monty-python.gnu.org) (199.232.76.173)
- by sources dot redhat dot com with SMTP; 5 Aug 2003 19:52:26 -0000
-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org)
- by monty-python dot gnu dot org with esmtp (Exim 4 dot 20)
- id 19k7hp-0004mC-J0
- for listarch-bug-glibc at sources dot redhat dot com; Tue, 05 Aug 2003 15:42:49 -0400
-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20)
- id 19k7hd-0004lI-No
- for bug-glibc at gnu dot org; Tue, 05 Aug 2003 15:42:37 -0400
-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20)
- id 19k7h7-0004TP-8U
- for bug-glibc at gnu dot org; Tue, 05 Aug 2003 15:42:36 -0400
-Received: from [32.97.182.102] (helo=e2.ny.us.ibm.com)
- by monty-python dot gnu dot org with esmtp (Exim 4 dot 20) id 19k7h6-0004TH-V4
- for bug-glibc at gnu dot org; Tue, 05 Aug 2003 15:42:05 -0400
-Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com
- [9 dot 56 dot 224 dot 150])
- by e2 dot ny dot us dot ibm dot com (8 dot 12 dot 9/8 dot 12 dot 2) with ESMTP id h75Jg3PS037034;
- Tue, 5 Aug 2003 15:42:03 -0400
-Received: from D01ML249.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216])
- by northrelay02 dot pok dot ibm dot com (8 dot 12 dot 9/NCO/VER6 dot 5) with ESMTP id
- h75Jg2vu131828; Tue, 5 Aug 2003 15:42:02 -0400
-Importance: Normal
-MIME-Version: 1.0
-Sensitivity:
-To: schwab at suse dot de, Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
-X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002
-From: William Jay Huie <wjhuie at us dot ibm dot com>
-Message-ID: <OF3D561D81.1A9679A6-ON85256D79.00619378-85256D79.006DAF9F@us.ibm.com>
-Date: Tue, 5 Aug 2003 15:41:56 -0400
-X-MIMETrack: Serialize by Router on D01ML249/01/M/IBM(Release 6.0.1 [IBM]|June
- 10, 2003) at 08/05/2003 15:42:02,
- Serialize complete at 08/05/2003 15:42:02
-Cc: bug-glibc at gnu dot org
-Subject: fixed building gcc-2.3.2 on s390
-X-BeenThere: bug-glibc@gnu.org
-X-Mailman-Version: 2.1.2
-Precedence: list
-List-Id: Bug reports for the GNU standard C library <bug-glibc.gnu.org>
-List-Archive: <http://mail.gnu.org/pipermail/bug-glibc>
-List-Post: <mailto:bug-glibc at gnu dot org>
-List-Help: <mailto:bug-glibc-request at gnu dot org?subject=help>
-List-Subscribe: <http://mail dot gnu dot org/mailman/listinfo/bug-glibc>,
- <mailto:bug-glibc-request at gnu dot org?subject=subscribe>
-Content-Type: multipart/mixed; boundary="===============1920858710=="
-Sender: bug-glibc-bounces+listarch-bug-glibc=sources dot redhat dot com at gnu dot org
-Errors-To: bug-glibc-bounces+listarch-bug-glibc=sources.redhat.com@gnu.org
-
-This is a multipart message in MIME format.
---===============1920858710==
-Content-Type: multipart/alternative;
- boundary="=_alternative 006DAF4085256D79_="
-
-This is a multipart message in MIME format.
---=_alternative 006DAF4085256D79_=
-Content-Type: text/plain; charset="us-ascii"
-
-The problem was related to a file including an obsolete header file.
- Checking /usr/include/sys/ustat.h shows the following comment;
-
- /*
- * This interface is obsolete. Use <sys/statfs.h>
-instead.
- */
-
- Changing the include in the offending file;
-
-osatest2:/usr/src/packages/SOURCES/glibc-2.3.2/sysdeps/unix/sysv/linux #
-diff -u old.ustat.c ustat.c
---- old.ustat.c 2001-07-07 12:21:32.000000000 -0700
-+++ ustat.c 2003-08-05 11:24:20.000000000 -0700
-@@ -18,7 +18,7 @@
- 02111-1307 USA. */
-
- #include <errno.h>
--#include <sys/ustat.h>
-+#include <sys/statfs.h>
- #include <sys/sysmacros.h>
-
- #include <sysdep.h>
-
-
- Things then build correctly,
- This is on a SLES-8 s390 31bit system using glibc levels 2.2.5-92.
- j
-
-Jay Huie
- wjhuie@us.ibm.com
- zSeries Linux System Test
- Phone: 845-435-8164
-
---=_alternative 006DAF4085256D79_=
-Content-Type: text/html; charset="us-ascii"
-
-
-<br><font size=2 face="sans-serif">The problem was related to a file including an obsolete header file.</font>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Checking /usr/include/sys/ustat.h shows the following comment;</font>
-<br>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*</font>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* This interface is obsolete. &nbsp;Use &lt;sys/statfs.h&gt; instead.</font>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</font>
-<br>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Changing the include in the offending file;</font>
-<br>
-<br><font size=2 face="sans-serif">osatest2:/usr/src/packages/SOURCES/glibc-2.3.2/sysdeps/unix/sysv/linux # diff -u old.ustat.c ustat.c</font>
-<br><font size=2 face="sans-serif">--- old.ustat.c 2001-07-07 12:21:32.000000000 -0700</font>
-<br><font size=2 face="sans-serif">+++ ustat.c &nbsp; &nbsp; 2003-08-05 11:24:20.000000000 -0700</font>
-<br><font size=2 face="sans-serif">@@ -18,7 +18,7 @@</font>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; 02111-1307 USA. &nbsp;*/</font>
-<br>
-<br><font size=2 face="sans-serif">&nbsp;#include &lt;errno.h&gt;</font>
-<br><font size=2 face="sans-serif">-#include &lt;sys/ustat.h&gt;</font>
-<br><font size=2 face="sans-serif">+#include &lt;sys/statfs.h&gt;</font>
-<br><font size=2 face="sans-serif">&nbsp;#include &lt;sys/sysmacros.h&gt;</font>
-<br>
-<br><font size=2 face="sans-serif">&nbsp;#include &lt;sysdep.h&gt;<br>
-</font>
-<br>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Things then build correctly,</font>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; This is on a SLES-8 s390 31bit system using glibc levels 2.2.5-92.</font>
-<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; j</font>
-<br><font size=2 face="sans-serif"><br>
-Jay Huie <br>
- &nbsp;wjhuie@us.ibm.com<br>
- &nbsp;zSeries Linux System Test<br>
- &nbsp;Phone: 845-435-8164<br>
-</font>
---=_alternative 006DAF4085256D79_=--
-
-
-
---===============1920858710==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: inline
-
-_______________________________________________
-Bug-glibc mailing list
-Bug-glibc@gnu.org
-http://mail.gnu.org/mailman/listinfo/bug-glibc
-
---===============1920858710==--
-
-
diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-signal-ssp.diff b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-signal-ssp.diff
deleted file mode 100644
index d35b1aa4cb13..000000000000
--- a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-signal-ssp.diff
+++ /dev/null
@@ -1,40 +0,0 @@
---- ./sysdeps/unix/sysv/linux/ssp.c.orig 2004-01-23 19:54:19.000000000 -0500
-+++ ./sysdeps/unix/sysv/linux/ssp.c 2004-01-23 19:56:34.000000000 -0500
-@@ -52,8 +52,8 @@
- {
- sigset_t mask;
- sigfillset(&mask);
-- sigdelset(&mask, SIGABRT); /* Block all signal handlers */
-- sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGABRT */
-+ sigdelset(&mask, SIGSEGV); /* Block all signal handlers */
-+ sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGSEGV */
- }
- #endif
-
-@@ -65,6 +65,7 @@
- if (bufsz>len) {strncat(buf, func, bufsz-len-1); len = strlen(buf);}
- /* print error message */
- write (STDERR_FILENO, buf+3, len-3);
-+ write (STDERR_FILENO, "()\n", 3);
- #if defined(HAVE_SYSLOG)
- if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) != -1) {
-
-@@ -81,15 +82,15 @@
- #endif
-
- #ifdef _POSIX_SOURCE
-- { /* Make sure the default handler is associated with SIGABRT */
-+ { /* Make sure the default handler is associated with SIGSEGV */
- struct sigaction sa;
-
- memset(&sa, 0, sizeof(struct sigaction));
- sigfillset(&sa.sa_mask); /* Block all signals */
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
-- sigaction(SIGABRT, &sa, NULL);
-- (void)kill(getpid(), SIGABRT);
-+ sigaction(SIGSEGV, &sa, NULL);
-+ (void)kill(getpid(), SIGSEGV);
- }
- #endif
- _exit(127);
diff --git a/sys-libs/glibc/files/2.3.2/posix_fadvise64.c b/sys-libs/glibc/files/2.3.2/posix_fadvise64.c
deleted file mode 100644
index 5e96088d8bfd..000000000000
--- a/sys-libs/glibc/files/2.3.2/posix_fadvise64.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Copyright (C) 2003, 2004 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. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-#include <kernel-features.h>
-
-int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
-int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise);
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-struct fadvise64_64_layout
-{
- int fd;
- off64_t offset;
- off64_t len;
- int advise;
-};
-
-int
-__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
-{
-#ifdef __NR_fadvise64_64
- struct fadvise64_64_layout parameters;
- INTERNAL_SYSCALL_DECL (err);
-
- parameters.fd = fd;
- parameters.offset = offset;
- parameters.len = len;
- parameters.advise = advise;
- int ret = INTERNAL_SYSCALL (fadvise64_64, err, 1, &parameters);
- if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
- return 0;
-# ifndef __ASSUME_FADVISE64_64_SYSCALL
- if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS)
-# endif
- return INTERNAL_SYSCALL_ERRNO (ret, err);
-#endif
-#ifndef __ASSUME_FADVISE64_64_SYSCALL
-# ifdef __NR_fadvise64
- if (len != (off_t) len)
- return EOVERFLOW;
-
- INTERNAL_SYSCALL_DECL (err2);
- int ret2 = INTERNAL_SYSCALL (fadvise64, err2, 5, fd,
- __LONG_LONG_PAIR ((long) (offset >> 32),
- (long) offset),
- (off_t) len, advise);
- if (!INTERNAL_SYSCALL_ERROR_P (ret2, err2))
- return 0;
- return INTERNAL_SYSCALL_ERRNO (ret2, err2);
-# else
- return ENOSYS;
-# endif
-#endif
-}
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
-
-int
-__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
-{
- return __posix_fadvise64_l64 (fd, offset, len, advise);
-}
-
-versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
-compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
-#else
-strong_alias (__posix_fadvise64_l64, posix_fadvise64);
-#endif
diff --git a/sys-libs/glibc/files/2.3.2/ssp.c b/sys-libs/glibc/files/2.3.2/ssp.c
deleted file mode 100644
index ecaf24c068b0..000000000000
--- a/sys-libs/glibc/files/2.3.2/ssp.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/2.3.2/ssp.c,v 1.1 2004/06/05 15:54:29 tseng Exp $
- *
- * This is a modified version of Hiroaki Etoh's stack smashing routines
- * implemented for glibc.
- *
- * The following people have contributed input to this code.
- * 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>
- *
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/syslog.h>
-#include <sys/time.h>
-#include <sys/sysctl.h>
-
-#ifndef _PATH_LOG
-#define _PATH_LOG "/dev/log"
-#endif
-
-#ifdef __PROPOLICE_BLOCK_SEGV__
-#define SSP_SIGTYPE SIGSEGV
-#elif __PROPOLICE_BLOCK_KILL__
-#define SSP_SIGTYPE SIGKILL
-#else
-#define SSP_SIGTYPE SIGABRT
-#endif
-
-unsigned long __guard = 0UL;
-
-void
-__guard_setup (void)
-{
- size_t size;
-#ifdef HAVE_DEV_ERANDOM
- int mib[3];
-#endif
-
- if (__guard != 0UL)
- return;
-
-#ifndef __SSP_QUICK_CANARY__
-#ifdef HAVE_DEV_ERANDOM
- /* Random is another depth in Linux, hence an array of 3. */
- mib[0] = CTL_KERN;
- mib[1] = KERN_RANDOM;
- mib[2] = RANDOM_ERANDOM;
-
- size = sizeof (unsigned long);
- if (__sysctl (mib, 3, &__guard, &size, NULL, 0) != (-1))
- if (__guard != 0UL)
- return;
-#endif
- /*
- * Attempt to open kernel pseudo random device if one exists before
- * opening urandom to avoid system entropy depletion.
- */
- {
- int fd;
-#ifdef HAVE_DEV_ERANDOM
- if ((fd = open ("/dev/erandom", O_RDONLY)) == (-1))
-#endif
- fd = open ("/dev/urandom", O_RDONLY);
- if (fd != (-1))
- {
- size = read (fd, (char *) &__guard, sizeof (__guard));
- close (fd);
- if (size == sizeof (__guard))
- return;
- }
- }
-#endif
-
- /* If sysctl was unsuccessful, use the "terminator canary". */
- __guard = 0xFF0A0D00UL;
-
- {
- /* Everything failed? Or we are using a weakened model of the
- * terminator canary */
- struct timeval tv;
-
- gettimeofday (&tv, NULL);
- __guard ^= tv.tv_usec ^ tv.tv_sec;
- }
-}
-
-void
-__stack_smash_handler (char func[], int damaged)
-{
- struct sockaddr_un sock; /* AF_UNIX address of local logger */
- struct sigaction sa;
- const char message[] = ": stack smashing attack in function ";
- int bufsz, len, log;
- char buf[512];
- extern char *__progname;
-
- sigset_t mask;
- sigfillset (&mask);
-
- sigdelset (&mask, SSP_SIGTYPE); /* Block all signal handlers */
- sigprocmask (SIG_BLOCK, &mask, NULL); /* except SIGABRT */
-
- bufsz = sizeof (buf);
- strcpy (buf, "<2>");
- len = 3;
-
- strncat (buf, __progname, sizeof (buf) - 4);
- len = strlen (buf);
-
- if (bufsz > len)
- {
- strncat (buf, message, bufsz - len - 1);
- len = strlen (buf);
- }
- if (bufsz > len)
- {
- strncat (buf, func, bufsz - len - 1);
- len = strlen (buf);
- }
-
- /* print error message */
- write (STDERR_FILENO, buf + 3, len - 3);
- write (STDERR_FILENO, "()\n", 3);
- if ((log = socket (AF_UNIX, SOCK_DGRAM, 0)) != -1)
- {
- /* Send "found" message to the "/dev/log" path */
- sock.sun_family = AF_UNIX;
- (void) strncpy (sock.sun_path, _PATH_LOG, sizeof (sock.sun_path) - 1);
- sock.sun_path[sizeof (sock.sun_path) - 1] = '\0';
- sendto (log, buf, len, 0, (struct sockaddr *) &sock, sizeof (sock));
- }
-
- /* Make sure the default handler is associated with the our signal handler */
-
- memset (&sa, 0, sizeof (struct sigaction));
- sigfillset (&sa.sa_mask); /* Block all signals */
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
- sigaction (SSP_SIGTYPE, &sa, NULL);
- (void) kill (getpid (), SSP_SIGTYPE);
- _exit (127);
-}
diff --git a/sys-libs/glibc/files/2.3.2/sysmacros.h b/sys-libs/glibc/files/2.3.2/sysmacros.h
deleted file mode 100644
index a9bfa78d3ef2..000000000000
--- a/sys-libs/glibc/files/2.3.2/sysmacros.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Definitions of macros to access `dev_t' values.
- Copyright (C) 1996, 1997, 1999, 2003 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. */
-
-#ifndef _SYS_SYSMACROS_H
-#define _SYS_SYSMACROS_H 1
-
-#include <features.h>
-
-/* If the compiler does not know long long it is out of luck. We are
- not going to hack weird hacks to support the dev_t representation
- they need. */
-#ifdef __GLIBC_HAVE_LONG_LONG
-__extension__
-extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
- __THROW;
-__extension__
-extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
- __THROW;
-__extension__
-extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
- unsigned int __minor)
- __THROW;
-
-# if defined __GNUC__ && __GNUC__ >= 2
-__extension__ extern __inline unsigned int
-gnu_dev_major (unsigned long long int __dev) __THROW
-{
- return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
-}
-
-__extension__ extern __inline unsigned int
-gnu_dev_minor (unsigned long long int __dev) __THROW
-{
- return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
-}
-
-__extension__ extern __inline unsigned long long int
-gnu_dev_makedev (unsigned int __major, unsigned int __minor) __THROW
-{
- return ((__minor & 0xff) | ((__major & 0xfff) << 8)
- | (((unsigned long long int) (__minor & ~0xff)) << 12)
- | (((unsigned long long int) (__major & ~0xfff)) << 32));
-}
-# endif
-
-
-/* Access the functions with their traditional names. */
-# define major(dev) gnu_dev_major (dev)
-# define minor(dev) gnu_dev_minor (dev)
-# define makedev(maj, min) gnu_dev_makedev (maj, min)
-#endif
-
-#endif /* sys/sysmacros.h */
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch b/sys-libs/glibc/files/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch
deleted file mode 100644
index c4882afa8f9f..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -Naur glibc-2.3.2-orig/sysdeps/generic/libc-start.c glibc-2.3.2/sysdeps/generic/libc-start.c
---- glibc-2.3.2-orig/sysdeps/generic/libc-start.c 2004-05-10 01:59:09.000000000 -0400
-+++ glibc-2.3.2/sysdeps/generic/libc-start.c 2004-05-10 02:06:00.865611770 -0400
-@@ -188,6 +188,9 @@
- GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
- #endif
-
-+ /* call the __guard_setup to set up the random __guard value */
-+ __guard_setup (); /* pappy@gentoo.org (pappy rules) */
-+
- #ifdef HAVE_CLEANUP_JMP_BUF
- /* Memory for the cancellation buffer. */
- struct pthread_unwind_buf unwind_buf;
-diff -Naur glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Dist glibc-2.3.2/sysdeps/unix/sysv/linux/Dist
---- glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Dist 2004-05-10 01:59:10.000000000 -0400
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Dist 2004-05-10 02:06:54.862038647 -0400
-@@ -1,3 +1,4 @@
-+ssp.c
- bits/initspin.h
- cmsg_nxthdr.c
- dl-brk.c
-diff -Naur glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Makefile glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Makefile 2004-05-10 01:59:10.000000000 -0400
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Makefile 2004-05-10 02:07:50.709582758 -0400
-@@ -1,5 +1,5 @@
- ifeq ($(subdir),csu)
--sysdep_routines += errno-loc
-+sysdep_routines += errno-loc ssp
- endif
-
- ifeq ($(subdir),assert)
-diff -Naur glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Versions glibc-2.3.2/sysdeps/unix/sysv/linux/Versions
---- glibc-2.3.2-orig/sysdeps/unix/sysv/linux/Versions 2004-05-10 01:59:10.000000000 -0400
-+++ glibc-2.3.2/sysdeps/unix/sysv/linux/Versions 2004-05-10 02:10:30.410716176 -0400
-@@ -108,6 +108,8 @@
- GLIBC_2.3.2 {
- # New kernel interfaces.
- epoll_create; epoll_ctl; epoll_wait;
-+ # global objects and functions for the propolice patch in gcc - moved from libgcc by pappy@gentoo.org
-+ __guard; __guard_setup; __stack_smash_handler;
- }
- GLIBC_2.3.3 {
- gnu_dev_major; gnu_dev_minor; gnu_dev_makedev;
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch
deleted file mode 100644
index 55188bd21d85..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch
+++ /dev/null
@@ -1,70 +0,0 @@
---- glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c 2003-12-13 15:42:16.853396224 +0200
-+++ glibc-2.3.3.PaX/sysdeps/unix/sysv/linux/dl-execstack.c 2003-12-13 15:42:25.290113648 +0200
-@@ -47,11 +47,17 @@
- PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) == 0)
- goto return_success;
- # if __ASSUME_PROT_GROWSUPDOWN == 0
-- if (errno == EINVAL)
-+ if (errno == EINVAL) {
- no_growsdown = true;
-- else
-+ } else {
-+# endif
-+ if (errno == EACCES) /* PAX is enabled */
-+ return 0;
-+ else
-+ return errno;
-+# if __ASSUME_PROT_GROWSUPDOWN == 0
-+ }
- # endif
-- return errno;
- }
- # endif
-
-@@ -73,8 +79,11 @@
- page -= size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
- return errno;
-+ }
-
- if (size == GL(dl_pagesize))
- /* We just tried to mprotect the top hole page and failed.
-@@ -105,11 +114,17 @@
- PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSUP) == 0)
- goto return_success;
- # if __ASSUME_PROT_GROWSUPDOWN == 0
-- if (errno == EINVAL)
-+ if (errno == EINVAL) {
- no_growsup = true;
-- else
-+ } else {
-+# endif
-+ if (errno == EACCES) /* PAX is enabled */
-+ return 0;
-+ else
-+ return errno;
-+# if __ASSUME_PROT_GROWSUPDOWN == 0
-+ }
- # endif
-- return errno;
- }
- # endif
-
-@@ -130,8 +145,11 @@
- page += size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
- return errno;
-+ }
-
- if (size == GL(dl_pagesize))
- /* We just tried to mprotect the lowest hole page and failed.
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-frandom-detect.patch b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-frandom-detect.patch
deleted file mode 100644
index f1dbe7be8a61..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-frandom-detect.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff -Naur glibc-2.3.2-orig/config.h.in glibc-2.3.2/config.h.in
---- glibc-2.3.2-orig/config.h.in 2004-05-11 21:44:51.000000000 -0400
-+++ glibc-2.3.2/config.h.in 2004-05-11 22:41:34.903935791 -0400
-@@ -208,6 +208,9 @@
- /* Defined of libidn is available. */
- #undef HAVE_LIBIDN
-
-+/* Defined if economical random device is available. */
-+#undef HAVE_DEV_ERANDOM
-+
- /*
- */
-
-diff -Naur glibc-2.3.2-orig/configure.in glibc-2.3.2/configure.in
---- glibc-2.3.2-orig/configure.in 2004-05-11 21:44:51.000000000 -0400
-+++ glibc-2.3.2/configure.in 2004-05-11 22:32:57.999546229 -0400
-@@ -289,6 +289,13 @@
- [])
- AC_SUBST(all_warnings)
-
-+dnl See whether the user wants to disable checking for /dev/erandom
-+AC_ARG_ENABLE([dev-erandom],
-+ AC_HELP_STRING([--disable-dev-erandom],
-+ [disable testing for /dev/erandom]),
-+ [try_dev_erandom=$enableval],
-+ [try_dev_erandom=yes])
-+
- AC_CANONICAL_HOST
-
- # The way shlib-versions is used to generate soversions.mk uses a
-@@ -1911,6 +1918,21 @@
- sizeof_long_double=$ac_cv_sizeof_long_double
- AC_SUBST(sizeof_long_double)
-
-+dnl check whether we have an economical random device
-+if test "$try_dev_erandom" = yes ; then
-+ AC_CACHE_CHECK(for economical random device, ac_cv_have_dev_random,
-+ [if test -r "/dev/erandom" ; then
-+ ac_cv_have_dev_erandom=yes; else ac_cv_have_dev_erandom=no; fi])
-+ if test "$ac_cv_have_dev_erandom" = yes; then
-+ AC_DEFINE(HAVE_DEV_ERANDOM,1,
-+ [defined if the system supports an economical random device] )
-+ fi
-+else
-+ AC_MSG_CHECKING(for economical random device)
-+ ac_cv_have_dev_erandom=no
-+ AC_MSG_RESULT(has been disabled)
-+fi
-+
- ### End of automated tests.
- ### Now run sysdeps configure fragments.
-
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-addabi.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-addabi.diff
deleted file mode 100644
index 692e0e114985..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-addabi.diff
+++ /dev/null
@@ -1,52 +0,0 @@
-Index: sysdeps/mips/mips64/n32/Makefile
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/mips/mips64/n32/Makefile,v
-retrieving revision 1.2
-diff -u -r1.2 Makefile
---- sysdeps/mips/mips64/n32/Makefile 29 Mar 2003 08:15:28 -0000 1.2
-+++ sysdeps/mips/mips64/n32/Makefile 14 May 2004 05:32:32 -0000
-@@ -2,5 +2,9 @@
- long-double-fcts = yes
-
- ifeq ($(filter -mabi=n32,$(CC)),)
--CC += -mabi=n32
-+CC += -mabi=n32
- endif
-+ifeq ($(filter "-Wl,-m,elf32btsmipn32",$(LD)),)
-+LD += -Wl,-m,elf32btsmipn32
-+endif
-+ABI_FLAG= -Wl,-m,elf32btsmipn32
-Index: sysdeps/mips/mips64/n64/Makefile
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/mips/mips64/n64/Makefile,v
-retrieving revision 1.2
-diff -u -r1.2 Makefile
---- sysdeps/mips/mips64/n64/Makefile 29 Mar 2003 08:15:28 -0000 1.2
-+++ sysdeps/mips/mips64/n64/Makefile 14 May 2004 05:32:32 -0000
-@@ -4,3 +4,10 @@
- ifeq ($(filter -mabi=64,$(CC)),)
- CC += -mabi=64
- endif
-+ifeq ($(filter "-Wl,-m,elf64btsmip",$(LDFLAGS)),)
-+LDFLAGS += -Wl,-m,elf64btsmip
-+endif
-+ifeq ($(filter "-Wl,-m,elf64btsmip",$(ASFLAGS-.os)),)
-+ASFLAGS-.os += -Wl,-m,elf64btsmip
-+endif
-+ABI_FLAG= -Wl,-m,elf64btsmip
-Index: csu/Makefile
-===================================================================
-RCS file: /cvs/glibc/libc/csu/Makefile,v
-retrieving revision 1.73
-diff -u -r1.73 Makefile
---- csu/Makefile 8 Mar 2004 21:28:15 -0000 1.73
-+++ csu/Makefile 14 May 2004 05:32:18 -0000
-@@ -146,7 +147,7 @@
- subdir_lib: $(extra-objs:%=$(objpfx)%)
-
- define link-relocatable
--$(CC) -nostdlib -nostartfiles -r -o $@ $^
-+$(CC) $(ABI_FLAG) -nostdlib -nostartfiles -r -o $@ $^
- endef
-
- ifndef start-installed-name-rule
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-nolib3264.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-nolib3264.diff
deleted file mode 100644
index eb4fed8e656d..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-nolib3264.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-Index: sysdeps/unix/sysv/linux/configure
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/configure,v
-retrieving revision 1.86
-diff -u -r1.86 configure
---- sysdeps/unix/sysv/linux/configure 23 Mar 2003 02:10:04 -0000 1.86
-+++ sysdeps/unix/sysv/linux/configure 1 Jun 2004 04:25:42 -0000
-@@ -224,8 +224,7 @@
- /usr | /usr/)
- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
- case $machine in
-- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
-- mips/mips64/n64/* )
-+ sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 )
- libc_cv_slibdir="/lib64"
- if test "$libdir" = '${exec_prefix}/lib'; then
- libdir='${exec_prefix}/lib64';
-@@ -233,14 +232,6 @@
- libc_cv_localedir='${exec_prefix}/lib/locale'
- fi
- ;;
-- mips/mips64/n32/* )
-- libc_cv_slibdir="/lib32"
-- if test "$libdir" = '${exec_prefix}/lib'; then
-- libdir='${exec_prefix}/lib32';
-- # Locale data can be shared between 32bit and 64bit libraries
-- libc_cv_localedir='${exec_prefix}/lib/locale'
-- fi
-- ;;
- *)
- libc_cv_slibdir="/lib"
- ;;
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-semtimedop.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-semtimedop.diff
deleted file mode 100644
index 47132afd11b8..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-semtimedop.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list,v
-retrieving revision 1.2
-diff -u -r1.2 syscalls.list
---- sysdeps/unix/sysv/linux/mips/mips64/syscalls.list 3 Sep 2003 03:16:25 -0000 1.2
-+++ sysdeps/unix/sysv/linux/mips/mips64/syscalls.list 14 May 2004 05:32:37 -0000
-@@ -18,3 +18,4 @@
- semop - semop i:ipi __semop semop
- semget - semget i:iii __semget semget
- semctl - semctl i:iiii __semctl semctl
-+semtimedop - semtimedop i:ipip semtimedop
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-syscall.h.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-syscall.h.diff
deleted file mode 100644
index fdbd3b9058bc..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-syscall.h.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-This patch actually makes file identical to default implementaion..
-
-Index: sysdeps/unix/sysv/linux/mips/sys/syscall.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/sys/syscall.h,v
-retrieving revision 1.8
-diff -u -r1.8 syscall.h
---- sysdeps/unix/sysv/linux/mips/sys/syscall.h 17 Mar 2003 15:50:05 -0000 1.8
-+++ sysdeps/unix/sysv/linux/mips/sys/syscall.h 14 May 2004 17:03:29 -0000
-@@ -19,17 +19,10 @@
- #ifndef _SYSCALL_H
- #define _SYSCALL_H 1
-
--/* This file should list the numbers of the system the system knows.
-- But instead of duplicating this we use the information available
-- from the kernel sources. */
--#ifdef _LIBC
--/* Since the kernel doesn't define macro names in a way usable for
-- glibc, we preprocess this header, and use it during the glibc build
-- process. */
--# include <asm-unistd.h>
--#else
-+/* This file should list the numbers of the system calls the system
-+ knows. But instead of duplicating this we use the information
-+ available from the kernel sources. */
- # include <asm/unistd.h>
--#endif
-
- #ifndef _LIBC
- /* The Linux kernel header file defines macros `__NR_<name>', but some
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-sysify.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-sysify.diff
deleted file mode 100644
index 09b1adbb6fbc..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-mips-sysify.diff
+++ /dev/null
@@ -1,52 +0,0 @@
-Index: sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h,v
-retrieving revision 1.3
-diff -u -r1.3 sysdep.h
---- sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 1 Oct 2003 06:59:39 -0000 1.3
-+++ sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 14 May 2004 19:01:28 -0000
-@@ -28,9 +28,9 @@
- so we have to redefine the `SYS_ify' macro here. */
- #undef SYS_ify
- #ifdef __STDC__
--# define SYS_ify(syscall_name) __NR_N32_##syscall_name
-+# define SYS_ify(syscall_name) __NR_##syscall_name
- #else
--# define SYS_ify(syscall_name) __NR_N32_/**/syscall_name
-+# define SYS_ify(syscall_name) __NR_/**/syscall_name
- #endif
-
- #ifdef __ASSEMBLER__
-Index: sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h,v
-retrieving revision 1.3
-diff -u -r1.3 sysdep.h
---- sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 1 Oct 2003 06:59:40 -0000 1.3
-+++ sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 14 May 2004 19:01:28 -0000
-@@ -28,9 +28,9 @@
- so we have to redefine the `SYS_ify' macro here. */
- #undef SYS_ify
- #ifdef __STDC__
--# define SYS_ify(syscall_name) __NR_N64_##syscall_name
-+# define SYS_ify(syscall_name) __NR_##syscall_name
- #else
--# define SYS_ify(syscall_name) __NR_N64_/**/syscall_name
-+# define SYS_ify(syscall_name) __NR_/**/syscall_name
- #endif
-
- #ifdef __ASSEMBLER__
---- sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h.orig 2004-05-18 14:51:16.000000000 -0700
-+++ sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h 2004-05-19 15:07:23.000000000 -0700
-@@ -28,9 +28,9 @@
- so we have to redefine the `SYS_ify' macro here. */
- #undef SYS_ify
- #ifdef __STDC__
--# define SYS_ify(syscall_name) __NR_O32_##syscall_name
-+# define SYS_ify(syscall_name) __NR_##syscall_name
- #else
--# define SYS_ify(syscall_name) __NR_O32_/**/syscall_name
-+# define SYS_ify(syscall_name) __NR_/**/syscall_name
- #endif
-
- #endif /* linux/mips/mips32/kern64/sysdep.h */
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-owl-malloc-unlink-sanity-check.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-owl-malloc-unlink-sanity-check.diff
deleted file mode 100644
index 1525fa005632..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-owl-malloc-unlink-sanity-check.diff
+++ /dev/null
@@ -1,29 +0,0 @@
---- malloc/malloc.c.orig 2004-01-03 18:36:23.000000000 -0500
-+++ malloc/malloc.c 2004-01-03 18:46:16.000000000 -0500
-@@ -311,6 +311,11 @@ extern "C" {
- #define assert(x) ((void)0)
- #endif
-
-+/* needed for owl-malloc-unlink-sanity-check */
-+#include <abort-instr.h>
-+#ifndef ABORT_INSTRUCTION
-+#define ABORT_INSTRUCTION
-+#endif
-
- /*
- INTERNAL_SIZE_T is the word-size used for internal bookkeeping
-@@ -1951,6 +1956,14 @@ typedef struct malloc_chunk* mbinptr;
- #define unlink(P, BK, FD) { \
- FD = P->fd; \
- BK = P->bk; \
-+ /* owl-malloc-unlink-sanity-check */ \
-+ if (FD->bk != P || BK->fd != P) \
-+ { \
-+ ABORT_INSTRUCTION; \
-+ _exit(127); \
-+ while (1) \
-+ ABORT_INSTRUCTION; \
-+ } \
- FD->bk = BK; \
- BK->fd = FD; \
- }
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-tempfile.patch b/sys-libs/glibc/files/2.3.3/glibc-2.3.3-tempfile.patch
deleted file mode 100644
index bfca2af527f5..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3-tempfile.patch
+++ /dev/null
@@ -1,53 +0,0 @@
---- glibc-2.3.2.orig/debug/catchsegv.sh 2004-10-05 01:25:30.683814576 -0400
-+++ glibc-2.3.2/debug/catchsegv.sh 2004-10-05 01:26:57.567606232 -0400
-@@ -49,9 +49,7 @@
- esac
- fi
-
--segv_output=`basename "$prog"`.segv.$$
--# Make sure this output file does not exist.
--rm -f "$segv_output"
-+segv_output=`mktemp \`basename "$prog".segv.XXXXXX\`` || exit 1
-
- # Redirect stderr to avoid termination message from shell.
- (exec 3>&2 2>/dev/null
-@@ -64,7 +62,7 @@
- # Check for output. Even if the program terminated correctly it might
- # be that a minor process (clone) failed. Therefore we do not check the
- # exit code.
--if test -f "$segv_output"; then
-+if test -s "$segv_output"; then
- # The program caught a signal. The output is in the file with the
- # name we have in SEGFAULT_OUTPUT_NAME. In the output the names of
- # functions in shared objects are available, but names in the static
-@@ -101,7 +99,7 @@
- ;;
- esac
- done)
-- rm -f "$segv_output"
- fi
-+rm -f "$segv_output"
-
- exit $exval
---- glibc-2.3.2.orig/libio/oldtmpfile.c 2004-10-05 01:25:31.045759552 -0400
-+++ glibc-2.3.2/libio/oldtmpfile.c 2004-10-05 01:27:55.304828840 -0400
-@@ -36,7 +36,7 @@
- int fd;
- FILE *f;
-
-- if (__path_search (buf, FILENAME_MAX, NULL, "tmpf", 0))
-+ if (__path_search (buf, FILENAME_MAX, NULL, "tmpf", 1))
- return NULL;
- fd = __gen_tempname (buf, __GT_FILE);
- if (fd < 0)
---- glibc-2.3.2.orig/sysdeps/generic/tmpfile.c 2004-10-05 01:25:40.103382584 -0400
-+++ glibc-2.3.2/sysdeps/generic/tmpfile.c 2004-10-05 01:28:55.235717960 -0400
-@@ -43,7 +43,7 @@
- int fd;
- FILE *f;
-
-- if (__path_search (buf, FILENAME_MAX, NULL, "tmpf", 0))
-+ if (__path_search (buf, FILENAME_MAX, NULL, "tmpf", 1))
- return NULL;
- fd = __gen_tempname (buf, GEN_THIS);
- if (fd < 0)
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-got-fix.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-got-fix.diff
deleted file mode 100644
index c0edccd8f38d..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-got-fix.diff
+++ /dev/null
@@ -1,22 +0,0 @@
---- glibc-2.3.2/sysdeps/i386/elf/start.S 2004-02-05 18:14:37.000000000 +0100
-+++ glibc-2.3.2/sysdeps/i386/elf/start.S 2004-02-05 23:32:16.000000000 +0100
-@@ -73,16 +73,13 @@ _start:
- addl $_GLOBAL_OFFSET_TABLE_, %ebx
-
- /* Push address of our own entry points to .fini and .init. */
-- leal __libc_csu_fini@GOTOFF(%ebx), %eax
-- pushl %eax
-- leal __libc_csu_init@GOTOFF(%ebx), %eax
-- pushl %eax
-+ pushl __libc_csu_fini@GOT(%ebx)
-+ pushl __libc_csu_init@GOT(%ebx)
-
- pushl %ecx /* Push second argument: argv. */
- pushl %esi /* Push first argument: argc. */
-
-- leal BP_SYM (main)@GOTOFF(%ebx), %eax
-- pushl %eax
-+ pushl BP_SYM (main)@GOT(%ebx)
-
- /* Call the user's main function, and exit with its value.
- But let the libc call main. */
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-pt_pax.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-pt_pax.diff
deleted file mode 100644
index fdae6f514e62..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-pt_pax.diff
+++ /dev/null
@@ -1,29 +0,0 @@
---- elf/elf.h.orig 2004-01-26 12:54:15.000000000 -0500
-+++ elf/elf.h 2004-01-26 12:53:23.000000000 -0500
-@@ -568,6 +568,7 @@
- #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
- #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */
- #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-+#define PT_PAX_FLAGS 0x65041580 /* Indicates PaX flag markings */
- #define PT_LOSUNW 0x6ffffffa
- #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
- #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
-@@ -581,6 +582,18 @@
- #define PF_X (1 << 0) /* Segment is executable */
- #define PF_W (1 << 1) /* Segment is writable */
- #define PF_R (1 << 2) /* Segment is readable */
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
- #define PF_MASKOS 0x0ff00000 /* OS-specific */
- #define PF_MASKPROC 0xf0000000 /* Processor-specific */
-
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-signal-ssp.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-signal-ssp.diff
deleted file mode 100644
index d35b1aa4cb13..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040117-signal-ssp.diff
+++ /dev/null
@@ -1,40 +0,0 @@
---- ./sysdeps/unix/sysv/linux/ssp.c.orig 2004-01-23 19:54:19.000000000 -0500
-+++ ./sysdeps/unix/sysv/linux/ssp.c 2004-01-23 19:56:34.000000000 -0500
-@@ -52,8 +52,8 @@
- {
- sigset_t mask;
- sigfillset(&mask);
-- sigdelset(&mask, SIGABRT); /* Block all signal handlers */
-- sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGABRT */
-+ sigdelset(&mask, SIGSEGV); /* Block all signal handlers */
-+ sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGSEGV */
- }
- #endif
-
-@@ -65,6 +65,7 @@
- if (bufsz>len) {strncat(buf, func, bufsz-len-1); len = strlen(buf);}
- /* print error message */
- write (STDERR_FILENO, buf+3, len-3);
-+ write (STDERR_FILENO, "()\n", 3);
- #if defined(HAVE_SYSLOG)
- if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) != -1) {
-
-@@ -81,15 +82,15 @@
- #endif
-
- #ifdef _POSIX_SOURCE
-- { /* Make sure the default handler is associated with SIGABRT */
-+ { /* Make sure the default handler is associated with SIGSEGV */
- struct sigaction sa;
-
- memset(&sa, 0, sizeof(struct sigaction));
- sigfillset(&sa.sa_mask); /* Block all signals */
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
-- sigaction(SIGABRT, &sa, NULL);
-- (void)kill(getpid(), SIGABRT);
-+ sigaction(SIGSEGV, &sa, NULL);
-+ (void)kill(getpid(), SIGSEGV);
- }
- #endif
- _exit(127);
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-dl-machine-calls.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-dl-machine-calls.diff
deleted file mode 100644
index 852ecd113a9a..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-dl-machine-calls.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-Index: sysdeps/mips/dl-machine.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/mips/dl-machine.h,v
-retrieving revision 1.71
-diff -u -r1.71 dl-machine.h
---- sysdeps/mips/dl-machine.h 15 Apr 2004 14:08:16 -0000 1.71
-+++ sysdeps/mips/dl-machine.h 30 Apr 2004 15:05:23 -0000
-@@ -254,7 +255,7 @@
- }
- }
-
-- INTUSE (_dl_signal_error) (0, NULL, NULL, "cannot find runtime link map");
-+ GLRO(dl_signal_error) (0, NULL, NULL, "cannot find runtime link map");
- return NULL;
- }
-
-@@ -362,17 +363,17 @@
- \
- if (version->hash != 0) \
- { \
-- value = _dl_lookup_versioned_symbol(strtab + sym->st_name, l, \
-+ value = GLRO(dl_lookup_symbol_x)(strtab + sym->st_name, l, \
- &sym, l->l_scope, version,\
-- ELF_RTYPE_CLASS_PLT, 0); \
-+ ELF_RTYPE_CLASS_PLT, 0,NULL); \
- break; \
- } \
- /* Fall through. */ \
- } \
- case 0: \
-- value = _dl_lookup_symbol (strtab + sym->st_name, l, &sym, \
-- l->l_scope, ELF_RTYPE_CLASS_PLT, \
-- DL_LOOKUP_ADD_DEPENDENCY); \
-+ value = GLRO(dl_lookup_symbol_x) (strtab + sym->st_name, l, &sym, \
-+ l->l_scope, NULL, ELF_RTYPE_CLASS_PLT, \
-+ DL_LOOKUP_ADD_DEPENDENCY,NULL); \
- } \
- \
- /* Currently value contains the base load address of the object \
diff --git a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-incl-sgidefs.diff b/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-incl-sgidefs.diff
deleted file mode 100644
index ef445755f27c..000000000000
--- a/sys-libs/glibc/files/2.3.3/glibc-2.3.3_pre20040420-mips-incl-sgidefs.diff
+++ /dev/null
@@ -1,252 +0,0 @@
---- ./sysdeps/mips/bits/setjmp.h.orig 2003-12-12 02:59:09.000000000 +0100
-+++ ./sysdeps/mips/bits/setjmp.h 2003-12-12 03:28:17.000000000 +0100
-@@ -22,6 +22,8 @@
- # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
- #endif
-
-+#include <sgidefs.h>
-+
- typedef struct
- {
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./sysdeps/mips/mips64/setjmp.S.orig 2003-12-12 03:48:28.000000000 +0100
-+++ ./sysdeps/mips/mips64/setjmp.S 2003-12-12 03:48:19.000000000 +0100
-@@ -17,6 +17,7 @@
- 02111-1307 USA. */
-
- #include <sysdep.h>
-+#include <sgidefs.h>
- #include <sys/asm.h>
-
- /* The function __sigsetjmp_aux saves all the registers, but it can't
---- ./sysdeps/mips/mips64/bsd-_setjmp.S.orig 2003-12-12 03:48:06.000000000 +0100
-+++ ./sysdeps/mips/mips64/bsd-_setjmp.S 2003-12-12 03:47:56.000000000 +0100
-@@ -22,6 +22,7 @@
- in setjmp doesn't clobber the state restored by longjmp. */
-
- #include <sysdep.h>
-+#include <sgidefs.h>
- #include <sys/asm.h>
-
- #ifdef __PIC__
---- ./sysdeps/mips/mips64/bsd-setjmp.S.orig 2003-12-12 03:47:41.000000000 +0100
-+++ ./sysdeps/mips/mips64/bsd-setjmp.S 2003-12-12 03:47:30.000000000 +0100
-@@ -22,6 +22,7 @@
- in setjmp doesn't clobber the state restored by longjmp. */
-
- #include <sysdep.h>
-+#include <sgidefs.h>
- #include <sys/asm.h>
-
- #ifdef PIC
---- ./sysdeps/mips/fpu/bits/mathdef.h.orig 2003-12-12 02:59:09.000000000 +0100
-+++ ./sysdeps/mips/fpu/bits/mathdef.h 2003-12-12 03:26:31.000000000 +0100
-@@ -21,6 +21,8 @@
- # error "Never use <bits/mathdef.h> directly; include <math.h> instead"
- #endif
-
-+#include <sgidefs.h>
-+
- #if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
- # define _MATH_H_MATHDEF 1
-
---- ./sysdeps/mips/sys/regdef.h.orig 2003-12-12 02:59:10.000000000 +0100
-+++ ./sysdeps/mips/sys/regdef.h 2003-12-12 03:26:58.000000000 +0100
-@@ -20,6 +20,8 @@
- #ifndef _SYS_REGDEF_H
- #define _SYS_REGDEF_H
-
-+#include <sgidefs.h>
-+
- /*
- * Symbolic register names for 32 bit ABI
- */
---- ./sysdeps/mips/sys/ucontext.h.orig 2003-12-12 02:59:10.000000000 +0100
-+++ ./sysdeps/mips/sys/ucontext.h 2003-12-12 03:29:41.000000000 +0100
-@@ -23,6 +23,7 @@
-
- #include <features.h>
- #include <signal.h>
-+#include <sgidefs.h>
-
- /* Type for general register. */
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./sysdeps/mips/elf/start.S.orig 2003-12-12 03:47:16.000000000 +0100
-+++ ./sysdeps/mips/elf/start.S 2003-12-12 03:47:05.000000000 +0100
-@@ -20,6 +20,7 @@
-
- #define __ASSEMBLY__ 1
- #include <entry.h>
-+#include <sgidefs.h>
- #include <sys/asm.h>
-
- #ifndef ENTRY_POINT
---- ./sysdeps/mips/atomicity.h.orig 2003-12-12 03:46:51.000000000 +0100
-+++ ./sysdeps/mips/atomicity.h 2003-12-12 03:46:43.000000000 +0100
-@@ -21,6 +21,7 @@
- #define _MIPS_ATOMICITY_H 1
-
- #include <inttypes.h>
-+#include <sgidefs.h>
-
- static inline int
- __attribute__ ((unused))
---- ./sysdeps/mips/dl-machine.h.orig 2003-12-12 03:46:33.000000000 +0100
-+++ ./sysdeps/mips/dl-machine.h 2003-12-12 03:46:19.000000000 +0100
-@@ -27,6 +27,7 @@
- #define ELF_MACHINE_NO_PLT
-
- #include <entry.h>
-+#include <sgidefs.h>
-
- #ifndef ENTRY_POINT
- #error ENTRY_POINT needs to be defined for MIPS.
---- ./sysdeps/mips/machine-gmon.h.orig 2003-12-12 03:46:05.000000000 +0100
-+++ ./sysdeps/mips/machine-gmon.h 2003-12-12 03:45:55.000000000 +0100
-@@ -18,6 +18,8 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#include <sgidefs.h>
-+
- #define _MCOUNT_DECL(frompc,selfpc) \
- static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
-
---- ./sysdeps/unix/mips/sysdep.h.orig 2003-12-12 03:45:36.000000000 +0100
-+++ ./sysdeps/unix/mips/sysdep.h 2003-12-12 03:45:23.000000000 +0100
-@@ -19,6 +19,7 @@
- 02111-1307 USA. */
-
- #include <sysdeps/unix/sysdep.h>
-+#include <sgidefs.h>
-
- #ifdef __ASSEMBLER__
-
---- ./sysdeps/unix/sysv/linux/mips/bits/sigcontext.h.orig 2003-12-12 02:59:10.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/bits/sigcontext.h 2003-12-12 03:33:57.000000000 +0100
-@@ -20,6 +20,8 @@
- # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
- #endif
-
-+#include <sgidefs.h>
-+
- #ifndef sigcontext_struct
- /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
- we need sigcontext. */
---- ./sysdeps/unix/sysv/linux/mips/bits/stat.h.orig 2003-12-12 02:59:10.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/bits/stat.h 2003-12-12 03:34:15.000000000 +0100
-@@ -21,6 +21,8 @@
- # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
- #endif
-
-+#include <sgidefs.h>
-+
- /* Versions of the `struct stat' data structure. */
- #define _STAT_VER_LINUX_OLD 1
- #define _STAT_VER_KERNEL 1
---- ./sysdeps/unix/sysv/linux/mips/sigaction.c.orig 2003-12-12 03:43:00.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/sigaction.c 2003-12-12 03:42:49.000000000 +0100
-@@ -21,6 +21,7 @@
- #include <string.h>
-
- #include <sysdep.h>
-+#include <sgidefs.h>
- #include <sys/syscall.h>
-
- #include "kernel-features.h"
---- ./sysdeps/unix/sysv/linux/mips/sys/tas.h.orig 2003-12-12 02:59:10.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/sys/tas.h 2003-12-12 03:36:26.000000000 +0100
-@@ -21,6 +21,7 @@
- #define _SYS_TAS_H 1
-
- #include <features.h>
-+#include <sgidefs.h>
-
- __BEGIN_DECLS
-
---- ./sysdeps/unix/sysv/linux/mips/sys/user.h.orig 2003-12-12 02:59:10.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/sys/user.h 2003-12-12 03:36:35.000000000 +0100
-@@ -19,6 +19,8 @@
- #ifndef _SYS_USER_H
- #define _SYS_USER_H 1
-
-+#include <sgidefs.h>
-+
- /* The whole purpose of this file is for GDB and GDB only. Don't read
- too much into it. Don't use it for anything other than GDB unless
- you know what you are doing. */
---- ./sysdeps/unix/sysv/linux/mips/sys/ucontext.h.orig 2003-12-12 03:45:05.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/sys/ucontext.h 2003-12-12 03:44:55.000000000 +0100
-@@ -22,6 +22,7 @@
- #define _SYS_UCONTEXT_H 1
-
- #include <features.h>
-+#include <sgidefs.h>
- #include <signal.h>
-
- /* We need the signal context definitions even if they are not used
---- ./sysdeps/unix/sysv/linux/mips/kernel_stat.h.orig 2003-12-12 03:44:37.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/kernel_stat.h 2003-12-12 03:44:22.000000000 +0100
-@@ -1,6 +1,9 @@
- /* As tempting as it is to define XSTAT_IS_XSTAT64 for n64, the
- userland data structures are not identical, because of different
- padding. */
-+
-+#include <sgidefs.h>
-+
- /* Definition of `struct stat' used in the kernel. */
- #if _MIPS_SIM != _MIPS_SIM_ABI32
- struct kernel_stat
---- ./sysdeps/unix/sysv/linux/mips/configure.orig 2003-12-12 03:51:49.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/configure 2003-12-12 03:49:46.000000000 +0100
-@@ -41,7 +41,7 @@ echo "$as_me: WARNING: *** asm/unistd.h
- name = $2;
- sub (/_O32_/, "_", name);
- print;
-- print "#if _MIPS_SIM == _MIPS_SIM_ABI32";
-+ print "#if defined _ABIO32 && _MIPS_SIM == _ABIO32";
- print "# define " name " " $2;
- print "#endif";
- next;
---- ./sysdeps/unix/sysv/linux/mips/configure.in.orig 2003-12-12 03:51:35.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/configure.in 2003-12-12 03:49:38.000000000 +0100
-@@ -41,7 +41,7 @@ mips*64*)
- name = $2;
- sub (/_O32_/, "_", name);
- print;
-- print "#if _MIPS_SIM == _MIPS_SIM_ABI32";
-+ print "#if defined _ABIO32 && _MIPS_SIM == _ABIO32";
- print "# define " name " " $2;
- print "#endif";
- next;
---- ./sysdeps/unix/sysv/linux/mips/sigcontextinfo.h.orig 2003-12-12 03:43:32.000000000 +0100
-+++ ./sysdeps/unix/sysv/linux/mips/sigcontextinfo.h 2003-12-12 03:43:16.000000000 +0100
-@@ -17,6 +17,8 @@
- 02111-1307 USA. */
-
-
-+#include <sgidefs.h>
-+
- #if _MIPS_SIM == _MIPS_SIM_ABI32
-
- #define SIGCONTEXT unsigned long _code, struct sigcontext *
---- ./linuxthreads/sysdeps/mips/pspinlock.c.orig 2003-12-12 02:59:09.000000000 +0100
-+++ ./linuxthreads/sysdeps/mips/pspinlock.c 2003-12-12 03:59:27.000000000 +0100
-@@ -19,6 +19,7 @@
-
- #include <errno.h>
- #include <pthread.h>
-+#include <sgidefs.h>
- #include <sys/tas.h>
- #include "internals.h"
-
---- ./linuxthreads/sysdeps/mips/pt-machine.h.orig 2003-12-12 02:59:09.000000000 +0100
-+++ ./linuxthreads/sysdeps/mips/pt-machine.h 2003-12-12 03:59:26.000000000 +0100
-@@ -24,6 +24,7 @@
- #ifndef _PT_MACHINE_H
- #define _PT_MACHINE_H 1
-
-+#include <sgidefs.h>
- #include <sys/tas.h>
-
- #ifndef PT_EI
diff --git a/sys-libs/glibc/files/2.3.3/ssp.c b/sys-libs/glibc/files/2.3.3/ssp.c
deleted file mode 100644
index d288f6fc5c6d..000000000000
--- a/sys-libs/glibc/files/2.3.3/ssp.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/2.3.3/ssp.c,v 1.3 2004/08/07 17:53:20 solar Exp $
- *
- * This is a modified version of Hiroaki Etoh's stack smashing routines
- * implemented for glibc.
- *
- * The following people have contributed input to this code.
- * 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>
- *
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/syslog.h>
-#include <sys/time.h>
-#include <sys/sysctl.h>
-
-#ifndef _PATH_LOG
-#define _PATH_LOG "/dev/log"
-#endif
-
-#ifdef __PROPOLICE_BLOCK_SEGV__
-#define SSP_SIGTYPE SIGSEGV
-#elif __PROPOLICE_BLOCK_KILL__
-#define SSP_SIGTYPE SIGKILL
-#else
-#define SSP_SIGTYPE SIGABRT
-#endif
-
-unsigned long __guard = 0UL;
-
-void
-__guard_setup (void)
-{
- size_t size;
-#ifdef HAVE_DEV_ERANDOM
- int mib[3];
-#endif
-
- if (__guard != 0UL)
- return;
-
-#ifndef __SSP_QUICK_CANARY__
-#ifdef HAVE_DEV_ERANDOM
- /* Random is another depth in Linux, hence an array of 3. */
- mib[0] = CTL_KERN;
- mib[1] = KERN_RANDOM;
- mib[2] = RANDOM_ERANDOM;
-
- size = sizeof (unsigned long);
- if (__sysctl (mib, 3, &__guard, &size, NULL, 0) != (-1))
- if (__guard != 0UL)
- return;
-#endif
- /*
- * Attempt to open kernel pseudo random device if one exists before
- * opening urandom to avoid system entropy depletion.
- */
- {
- int fd;
-#ifdef HAVE_DEV_ERANDOM
- if ((fd = open ("/dev/erandom", O_RDONLY)) == (-1))
-#endif
- fd = open ("/dev/urandom", O_RDONLY);
- if (fd != (-1))
- {
- size = read (fd, (char *) &__guard, sizeof (__guard));
- close (fd);
- if (size == sizeof (__guard))
- return;
- }
- }
-#endif
-
- /* If sysctl was unsuccessful, use the "terminator canary". */
- __guard = 0xFF0A0D00UL;
-
- {
- /* Everything failed? Or we are using a weakened model of the
- * terminator canary */
- struct timeval tv;
-
- gettimeofday (&tv, NULL);
- __guard ^= tv.tv_usec ^ tv.tv_sec;
- }
-}
-
-void
-__stack_smash_handler (char func[], int damaged)
-{
- struct sigaction sa;
- const char message[] = ": stack smashing attack in function ";
- int bufsz, len;
- char buf[512];
-#ifndef __dietlibc__
- struct sockaddr_un sock; /* AF_UNIX address of local logger */
- int log;
- extern char *__progname;
-#else
- static char *__progname = "dietapp";
-#endif
-
- sigset_t mask;
- sigfillset (&mask);
-
- sigdelset (&mask, SSP_SIGTYPE); /* Block all signal handlers */
- sigprocmask (SIG_BLOCK, &mask, NULL); /* except SIGABRT */
-
- bufsz = sizeof (buf);
- strcpy (buf, "<2>");
- len = 3;
-
- strncat (buf, __progname, sizeof (buf) - 4);
- len = strlen (buf);
-
- if (bufsz > len)
- {
- strncat (buf, message, bufsz - len - 1);
- len = strlen (buf);
- }
- if (bufsz > len)
- {
- strncat (buf, func, bufsz - len - 1);
- len = strlen (buf);
- }
-
- /* print error message */
- write (STDERR_FILENO, buf + 3, len - 3);
- write (STDERR_FILENO, "()\n", 3);
-#ifndef __dietlibc__
- if ((log = socket (AF_UNIX, SOCK_DGRAM, 0)) != -1)
- {
- /* Send "found" message to the "/dev/log" path */
- sock.sun_family = AF_UNIX;
- (void) strncpy (sock.sun_path, _PATH_LOG, sizeof (sock.sun_path) - 1);
- sock.sun_path[sizeof (sock.sun_path) - 1] = '\0';
- sendto (log, buf, len, 0, (struct sockaddr *) &sock, sizeof (sock));
- }
-#endif
- /* Make sure the default handler is associated with the our signal handler */
-
- memset (&sa, 0, sizeof (struct sigaction));
- sigfillset (&sa.sa_mask); /* Block all signals */
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
- sigaction (SSP_SIGTYPE, &sa, NULL);
- (void) kill (getpid (), SSP_SIGTYPE);
- _exit (127);
-}
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.3-mdns-resolver2.diff b/sys-libs/glibc/files/2.3.4/glibc-2.3.3-mdns-resolver2.diff
deleted file mode 100644
index b9d8cdb3943e..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.3-mdns-resolver2.diff
+++ /dev/null
@@ -1,460 +0,0 @@
---- resolv/res_hconf.c
-+++ resolv/res_hconf.c 2004/09/21 12:56:54
-@@ -59,6 +59,7 @@
- #define ENV_TRIM_ADD "RESOLV_ADD_TRIM_DOMAINS"
- #define ENV_MULTI "RESOLV_MULTI"
- #define ENV_REORDER "RESOLV_REORDER"
-+#define ENV_MDNS "RESOLV_MDNS"
-
- static const char *arg_service_list (const char *, int, const char *,
- unsigned int);
-@@ -81,7 +82,8 @@
- {"multi", arg_bool, HCONF_FLAG_MULTI},
- {"nospoof", arg_bool, HCONF_FLAG_SPOOF},
- {"spoofalert", arg_bool, HCONF_FLAG_SPOOFALERT},
-- {"reorder", arg_bool, HCONF_FLAG_REORDER}
-+ {"reorder", arg_bool, HCONF_FLAG_REORDER},
-+ {"mdns", arg_bool, HCONF_FLAG_MDNS}
- };
-
- /* Structure containing the state. */
-@@ -431,6 +433,9 @@
-
- memset (&_res_hconf, '\0', sizeof (_res_hconf));
-
-+ /* Default for mdns is "on". */
-+ _res_hconf.flags |= HCONF_FLAG_MDNS;
-+
- hconf_name = getenv (ENV_HOSTCONF);
- if (hconf_name == NULL)
- hconf_name = _PATH_HOSTCONF;
-@@ -483,6 +488,10 @@
- arg_trimdomain_list (ENV_TRIM_OVERR, 1, envval, 0);
- }
-
-+ envval = getenv (ENV_MDNS);
-+ if (envval)
-+ arg_bool (ENV_MDNS, 1, envval, HCONF_FLAG_MDNS);
-+
- _res_hconf.initialized = 1;
- }
-
---- resolv/res_hconf.h
-+++ resolv/res_hconf.h 2004/09/21 12:56:54
-@@ -44,6 +44,7 @@
- # define HCONF_FLAG_SPOOFALERT (1 << 2) /* syslog warning of spoofed */
- # define HCONF_FLAG_REORDER (1 << 3) /* list best address first */
- # define HCONF_FLAG_MULTI (1 << 4) /* see comments for gethtbyname() */
-+# define HCONF_FLAG_MDNS (1 << 5) /* Disable MDNS support */
- };
- extern struct hconf _res_hconf;
-
---- resolv/res_query.c
-+++ resolv/res_query.c 2004/09/21 12:57:59
-@@ -82,6 +82,8 @@
- #include <stdlib.h>
- #include <string.h>
-
-+#include "res_hconf.h"
-+
- /* Options. Leave them on. */
- /* #undef DEBUG */
-
-@@ -278,6 +280,13 @@
- *domain && !done;
- domain++) {
-
-+ if ((_res_hconf.flags & HCONF_FLAG_MDNS) != 0) {
-+ /* don't add "local" domain if query contains a dot */
-+ if (dots && (!__strcasecmp(*domain, "local") ||
-+ !__strcasecmp(*domain, "local.")))
-+ continue;
-+ }
-+
- if (domain[0][0] == '\0' ||
- (domain[0][0] == '.' && domain[0][1] == '\0'))
- root_on_list++;
---- resolv/res_send.c
-+++ resolv/res_send.c 2004/09/21 12:58:14
-@@ -86,6 +86,9 @@
- #include <arpa/nameser.h>
- #include <arpa/inet.h>
- #include <sys/ioctl.h>
-+#if defined(_LIBC) && defined(linux)
-+#include <net/if.h>
-+#endif
-
- #include <errno.h>
- #include <netdb.h>
-@@ -96,6 +99,8 @@
- #include <string.h>
- #include <unistd.h>
-
-+#include "res_hconf.h"
-+
- #if PACKETSZ > 65536
- #define MAXPACKET PACKETSZ
- #else
-@@ -188,6 +193,9 @@
- static int send_dg(res_state, const u_char *, int,
- u_char **, int *, int *, int,
- int *, int *, u_char **);
-+static int send_dg_mdns(res_state, const u_char *, int,
-+ u_char **, int *, int *, struct sockaddr_in6 *,
-+ int *, int *, u_char **);
- #ifdef DEBUG
- static void Aerror(const res_state, FILE *, const char *, int,
- const struct sockaddr *);
-@@ -366,6 +374,35 @@
- u_char *ans, int anssiz, u_char **ansp)
- {
- int gotsomewhere, terrno, try, v_circuit, resplen, ns, n;
-+ int usemdns;
-+ HEADER *qhp = (HEADER *) buf;
-+
-+ usemdns = 0;
-+ if ((_res_hconf.flags & HCONF_FLAG_MDNS) != 0 &&
-+ qhp->qr == 0 && qhp->opcode == QUERY && qhp->qdcount == htons(1)) {
-+ /* got one simple query */
-+ const u_char *bp, *be;
-+ be = buf + buflen;
-+ for (bp = buf + NS_HFIXEDSZ; bp < be; )
-+ if ((*bp & NS_CMPRSFLGS) != 0)
-+ break;
-+ else if (*bp) {
-+ if (*bp == 5 && !strncasecmp(bp, "\005local\000", 7)) {
-+ usemdns = 1;
-+ break;
-+ }
-+ if (*bp == 3 && !strncasecmp(bp, "\003254\003169\007in-addr\004arpa\000", 22)) {
-+ usemdns = 1;
-+ break;
-+ }
-+ if (*bp == 1 && !strncasecmp(bp, "\0010\0018\001e\001f\003ip6\004arpa\000", 18)) {
-+ usemdns = 2;
-+ break;
-+ }
-+ bp += *bp + 1;
-+ } else
-+ break;
-+ }
-
- if (statp->nscount == 0) {
- __set_errno (ESRCH);
-@@ -524,13 +561,28 @@
- */
- for (try = 0; try < statp->retry; try++) {
- #ifdef _LIBC
-- for (ns = 0; ns < MAXNS; ns++)
-+ for (ns = 0; ns < (usemdns ? 1 : MAXNS); ns++)
- #else
- for (ns = 0; ns < statp->nscount; ns++)
- #endif
- {
- #ifdef _LIBC
- struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns];
-+ if (usemdns == 1) {
-+ static struct sockaddr_in mdns4;
-+ mdns4.sin_family = AF_INET;
-+ mdns4.sin_port = htons(5353);
-+ mdns4.sin_addr.s_addr = htonl(0xe00000fb);
-+ nsap = (struct sockaddr_in6 *)&mdns4;
-+ }
-+ if (usemdns == 2) {
-+ static struct sockaddr_in6 mdns6;
-+ mdns6.sin6_family = AF_INET6;
-+ mdns6.sin6_port = htons(5353);
-+ mdns6.sin6_addr.s6_addr32[0] = htonl(0xff020000);
-+ mdns6.sin6_addr.s6_addr32[3] = htonl(0x000000fb);
-+ nsap = &mdns6;
-+ }
-
- if (nsap == NULL)
- goto next_ns;
-@@ -602,8 +654,11 @@
- resplen = n;
- } else {
- /* Use datagrams. */
-- n = send_dg(statp, buf, buflen, &ans, &anssiz, &terrno,
-- ns, &v_circuit, &gotsomewhere, ansp);
-+ if (usemdns)
-+ n = send_dg_mdns(statp, buf, buflen, &ans, &anssiz, &terrno, nsap, &v_circuit, &gotsomewhere, ansp);
-+ else
-+ n = send_dg(statp, buf, buflen, &ans, &anssiz, &terrno,
-+ ns, &v_circuit, &gotsomewhere, ansp);
- if (n < 0)
- return (-1);
- if (n == 0)
-@@ -675,8 +730,15 @@
- if (!v_circuit) {
- if (!gotsomewhere)
- __set_errno (ECONNREFUSED); /* no nameservers found */
-- else
-+ else if (!usemdns) {
- __set_errno (ETIMEDOUT); /* no answer obtained */
-+ } else {
-+ /* treat timeout as host not found */
-+ HEADER *anhp = (HEADER *) ans;
-+ memset(ans, 0, HFIXEDSZ);
-+ anhp->rcode = NXDOMAIN;
-+ return HFIXEDSZ;
-+ }
- } else
- __set_errno (terrno);
- return (-1);
-@@ -1140,6 +1202,255 @@
- return (resplen);
- }
-
-+static int
-+send_dg_mdns(res_state statp,
-+ const u_char *buf, int buflen, u_char **ansp, int *anssizp,
-+ int *terrno, struct sockaddr_in6 *nsap, int *v_circuit, int *gotsomewhere, u_char **anscp)
-+{
-+ const HEADER *hp = (HEADER *) buf;
-+ u_char *ans = *ansp;
-+ int anssiz = *anssizp;
-+ HEADER *anhp = (HEADER *) ans;
-+ struct timespec now, timeout, finish;
-+ struct pollfd pfd[32];
-+ int ptimeout;
-+ int fromlen, resplen, seconds, n, s;
-+ int on = 1;
-+ struct msghdr mhdr;
-+ struct iovec iov;
-+ u_char cmsgbuf[CMSG_SPACE(sizeof(int))];
-+ struct cmsghdr *cmsg;
-+ int ttl;
-+ struct ifconf ifconf;
-+ struct ifreq ifreq[64];
-+ int ifreqn;
-+ int i, j;
-+ int ifidx[32], ifidxn;
-+ struct ip_mreqn mreqn;
-+
-+ s = socket(nsap->sin6_family == AF_INET ? PF_INET : PF_INET6, SOCK_DGRAM, 0);
-+ if (s < 0) {
-+ *terrno = errno;
-+ Perror(statp, stderr, "socket(dg)", errno);
-+ return (-1);
-+ }
-+ ifconf.ifc_len = sizeof(ifreq);
-+ ifconf.ifc_req = ifreq;
-+ ifidxn = 0;
-+ if (ioctl(s, SIOCGIFCONF, &ifconf) == 0) {
-+ ifreqn = ifconf.ifc_len / sizeof(*ifreq);
-+ for (i = 0 ; i < ifreqn; i++) {
-+ if (ioctl(s, SIOCGIFFLAGS, ifreq + i))
-+ continue;
-+ if (!(ifreq[i].ifr_flags & IFF_MULTICAST))
-+ continue;
-+ if (ioctl(s, SIOCGIFINDEX, ifreq + i))
-+ continue;
-+ for (j = 0; j < ifidxn; j++)
-+ if (ifidx[j] == ifreq[i].ifr_ifindex)
-+ break;
-+ if (j < ifidxn)
-+ continue;
-+ ifidx[ifidxn++] = ifreq[i].ifr_ifindex;
-+ if (ifidxn == sizeof(ifidx)/sizeof(*ifidx))
-+ break;
-+ }
-+ }
-+ j = 0;
-+ for (i = 0; i < (ifidxn ? ifidxn : 1); i++) {
-+ if (i) {
-+ s = socket(nsap->sin6_family == AF_INET ? PF_INET : PF_INET6, SOCK_DGRAM, 0);
-+ if (!s)
-+ continue;
-+ }
-+ if (setsockopt(s, SOL_IP, IP_RECVTTL, &on, sizeof(on))) {
-+ *terrno = errno;
-+ Perror(statp, stderr, "IP_RECVTTL(dg)", errno);
-+ close(s);
-+ continue;
-+ }
-+ if (ifidxn) {
-+ memset(&mreqn, 0, sizeof(mreqn));
-+ mreqn.imr_ifindex = ifidx[i];
-+ if (setsockopt(s, SOL_IP, IP_MULTICAST_IF, &mreqn, sizeof(mreqn))) {
-+ *terrno = errno;
-+ Perror(statp, stderr, "IP_MULTICAST_IF", errno);
-+ close(s);
-+ continue;
-+ }
-+ }
-+ if (sendto(s, (char*)buf, buflen, 0,
-+ (struct sockaddr *)nsap, sizeof *nsap) != buflen) {
-+ Aerror(statp, stderr, "sendto", errno, *(struct sockaddr_in *)nsap);
-+ close(s);
-+ continue;
-+ }
-+ pfd[j].fd = s;
-+ pfd[j].events = POLLIN;
-+ j++;
-+ }
-+ /*
-+ * Wait for reply.
-+ */
-+ seconds = statp->retrans;
-+ if (seconds <= 0)
-+ seconds = 1;
-+ evNowTime(&now);
-+ evConsTime(&timeout, seconds, 0);
-+ evAddTime(&finish, &now, &timeout);
-+ wait:
-+ if (j == 0) {
-+ return (0);
-+ }
-+
-+ /* Convert struct timespec in milliseconds. */
-+ ptimeout = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000;
-+ n = __poll (pfd, j, ptimeout);
-+ if (n == 0) {
-+ Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
-+ *gotsomewhere = 1;
-+ for (i = 0; i < j; i++)
-+ close(pfd[i].fd);
-+ return (0);
-+ }
-+ if (n < 0) {
-+ if (errno == EINTR) {
-+ evNowTime(&now);
-+ if (evCmpTime(finish, now) > 0) {
-+ evSubTime(&timeout, &finish, &now);
-+ goto wait;
-+ }
-+ }
-+ Perror(statp, stderr, "select", errno);
-+ for (i = 0; i < j; i++)
-+ close(pfd[i].fd);
-+ res_nclose(statp);
-+ return (0);
-+ }
-+ for (i = 0; i < j - 1; i++)
-+ if (pfd[j].revents == POLLIN)
-+ break;
-+ s = pfd[i].fd;
-+ __set_errno (0);
-+ fromlen = sizeof(struct sockaddr_in6);
-+ if (anssiz < MAXPACKET
-+ && anscp
-+ && (ioctl (s, FIONREAD, &resplen) < 0
-+ || anssiz < resplen)) {
-+ ans = malloc (MAXPACKET);
-+ if (ans == NULL)
-+ ans = *ansp;
-+ else {
-+ anssiz = MAXPACKET;
-+ *anssizp = MAXPACKET;
-+ *ansp = ans;
-+ *anscp = ans;
-+ anhp = (HEADER *) ans;
-+ }
-+ }
-+ iov.iov_base = ans;
-+ iov.iov_len = anssiz;
-+ mhdr.msg_name = 0;
-+ mhdr.msg_namelen = 0;
-+ mhdr.msg_iov = &iov;
-+ mhdr.msg_iovlen = 1;
-+ mhdr.msg_control = cmsgbuf;
-+ mhdr.msg_controllen = sizeof(cmsgbuf);
-+ mhdr.msg_flags = 0;
-+ resplen = recvmsg(s, &mhdr, 0);
-+ if (resplen <= 0) {
-+ if (errno == EAGAIN)
-+ goto wait;
-+ Perror(statp, stderr, "recvfrom", errno);
-+wait2:
-+ close(s);
-+ if (i < j)
-+ memmove(pfd + i, pfd + i + 1, sizeof(*pfd) * (j - i));
-+ j--;
-+ goto wait;
-+ }
-+ cmsg = CMSG_FIRSTHDR(&mhdr);
-+ for (cmsg = CMSG_FIRSTHDR(&mhdr); cmsg; CMSG_NXTHDR(&mhdr, cmsg))
-+ if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_TTL)
-+ break;
-+ if (!cmsg) {
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; no TTL found\n"));
-+ goto wait2;
-+ }
-+ ttl = *(int *)CMSG_DATA(cmsg);
-+ if (ttl != 255) {
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; answer with bad TTL: %d \n", ttl));
-+ goto wait;
-+ }
-+ *gotsomewhere = 1;
-+ if (resplen < HFIXEDSZ) {
-+ /*
-+ * Undersized message.
-+ */
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; undersized: %d\n",
-+ resplen));
-+ *terrno = EMSGSIZE;
-+ goto wait;
-+ }
-+ if (hp->id != anhp->id) {
-+ /*
-+ * response from old query, ignore it.
-+ * XXX - potential security hazard could
-+ * be detected here.
-+ */
-+ DprintQ((statp->options & RES_DEBUG) ||
-+ (statp->pfcode & RES_PRF_REPLY),
-+ (stdout, ";; old answer:\n"),
-+ ans, (resplen > anssiz) ? anssiz : resplen);
-+ goto wait;
-+ }
-+ if (!(statp->options & RES_INSECURE2) &&
-+ !res_queriesmatch(buf, buf + buflen,
-+ ans, ans + anssiz)) {
-+ /*
-+ * response contains wrong query? ignore it.
-+ * XXX - potential security hazard could
-+ * be detected here.
-+ */
-+ DprintQ((statp->options & RES_DEBUG) ||
-+ (statp->pfcode & RES_PRF_REPLY),
-+ (stdout, ";; wrong query name:\n"),
-+ ans, (resplen > anssiz) ? anssiz : resplen);
-+ goto wait;
-+ }
-+ if (anhp->rcode == SERVFAIL ||
-+ anhp->rcode == NOTIMP ||
-+ anhp->rcode == REFUSED) {
-+ DprintQ(statp->options & RES_DEBUG,
-+ (stdout, "server rejected query:\n"),
-+ ans, (resplen > anssiz) ? anssiz : resplen);
-+ goto wait;
-+ }
-+ for (i = 0; i < j; i++)
-+ close(pfd[i].fd);
-+#if 0
-+ if (!(statp->options & RES_IGNTC) && anhp->tc) {
-+ /*
-+ * To get the rest of answer,
-+ * use TCP with same server.
-+ */
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; truncated answer\n"));
-+ *v_circuit = 1;
-+ res_nclose(statp);
-+ return (1);
-+ }
-+#endif
-+ /*
-+ * All is well, or the error is fatal. Signal that the
-+ * next nameserver ought not be tried.
-+ */
-+ return (resplen);
-+}
-+
- #ifdef DEBUG
- static void
- Aerror(const res_state statp, FILE *file, const char *string, int error,
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-arm-ioperm.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-arm-ioperm.patch
deleted file mode 100644
index bc9abf4915d3..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-arm-ioperm.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# Submitted:
-#
-# Robert Schwebel, 2004-01-31 (patch by RSC & Dan Kegel)
-#
-# Error:
-#
-# arm-unknown-linux-gnu-gcc ../sysdeps/unix/sysv/linux/arm/ioperm.c -c
-# -std=gnu99 -O -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g0
-# -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -I../include -I.
-# -I/ptx/work/cvs-rsc/ptxdist/build/glibc-2.3.2-build/mis c -I.. -I../libio
-# -I/ptx/work/cvs-rsc/ptxdist/build/glibc-2.3.2-build -I../sysdeps/arm/elf
-# -I../linuxthreads/sysdeps/unix/sysv/linu x/arm
-# -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread
-# -I../sysdeps/pthread -I../linuxthreads/sysdeps/uni x/sysv
-# -I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/arm
-# -I../sysdeps/unix/sysv/linux/arm -I../sysdeps/unix/sysv/linux
-# -I ../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman
-# -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/arm
-# -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/arm -I../sysdeps/wordsize-32
-# -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-6 4 -I../sysdeps/ieee754 -I../sysdeps/generic/elf
-# -I../sysdeps/generic -nostdinc -isystem
-# /opt/ptxdist/arm-linux-3.3.2/lib/gcc-lib/arm-unknown-linux-gnu/3.3.2/include -isystem
-# /opt/ptxdist/arm-linux-3.3.2/arm-unknown-linux-gnu/include -D_LIBC_REENTRANT -include
-# ../include/libc-symbols.h -o /ptx/work/cvs-rsc/ptxdist/build/glibc-2.3.2-build/misc/ioperm.o
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c: In function `init_iosys':
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: `BUS_ISA' undeclared (first use in this function)
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (Each undeclared identifier is reported only once
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: for each function it appears in.)
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: initializer element is not constant
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (near initialization for `iobase_name[1]')
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: initializer element is not constant
-# ../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: (near initialization for `ioshift_name[1]')
-# make[3]: *** [/ptx/work/cvs-rsc/ptxdist/build/glibc-2.3.2-build/misc/ioperm.o] Error 1
-#
-#
-# Description:
-#
-# Kernel headers have changed to avoid confusion with BUS_ISA in input.h.
-#
-# State:
-#
-# Kernels > 2.4.24 and > 2.6 have a CTL_BUS_ISA definition. Older kernels should not be used anyway :-)
-#
-
-diff -urN glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c glibc-2.3.2-ptx/sysdeps/unix/sysv/linux/arm/ioperm.c
---- glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c 2004-02-02 07:37:24.000000000 +0100
-+++ glibc-2.3.2-ptx/sysdeps/unix/sysv/linux/arm/ioperm.c 2004-02-02 08:15:06.000000000 +0100
-@@ -47,6 +47,12 @@
- #include <asm/page.h>
- #include <sys/sysctl.h>
-
-+/* see http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html */
-+#include <linux/version.h>
-+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
-+#define CTL_BUS_ISA BUS_ISA /* and hope it's not the one from linux/input.h */
-+#endif
-+
- #define PATH_ARM_SYSTYPE "/etc/arm_systype"
- #define PATH_CPUINFO "/proc/cpuinfo"
-
-@@ -80,7 +86,7 @@
- * Initialize I/O system. There are several ways to get the information
- * we need. Each is tried in turn until one succeeds.
- *
-- * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*). This is the preferred method
-+ * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*). This is the preferred method
- * but not all kernels support it.
- *
- * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
-@@ -100,8 +106,8 @@
- {
- char systype[256];
- int i, n;
-- static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
-- static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
-+ static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
-+ static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };
- size_t len = sizeof(io.base);
-
- if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-dl_execstack-PaX-support.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-dl_execstack-PaX-support.patch
deleted file mode 100644
index af8bd31306e0..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-dl_execstack-PaX-support.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -Nru glibc-2.3.3.old/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c
---- glibc-2.3.3.old/sysdeps/unix/sysv/linux/dl-execstack.c 2004-09-24 01:40:02.663710000 -0400
-+++ glibc-2.3.3/sysdeps/unix/sysv/linux/dl-execstack.c 2004-09-24 01:54:55.883919888 -0400
-@@ -56,11 +56,17 @@
- __stack_prot) == 0, 1))
- goto return_success;
- # if __ASSUME_PROT_GROWSUPDOWN == 0
-- if (errno == EINVAL)
-+ if (errno == EINVAL) {
- no_growsupdown = true;
-- else
-+ } else {
-+# endif
-+ if (errno == EACCES) /* PAX is enabled */
-+ return 0;
-+ else
-+ return errno;
-+# if __ASSUME_PROT_GROWSUPDOWN == 0
-+ }
- # endif
-- return errno;
- }
- #endif
-
-@@ -84,8 +90,11 @@
- page -= size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
- return errno;
-+ }
-
- if (size == GLRO(dl_pagesize))
- /* We just tried to mprotect the top hole page and failed.
-@@ -107,8 +116,11 @@
- page += size;
- else
- {
-- if (errno != ENOMEM) /* Unexpected failure mode. */
-+ if (errno == EACCES) { /* PAX is enabled */
-+ return 0;
-+ } else if (errno != ENOMEM) { /* Unexpected failure mode. */
- return errno;
-+ }
-
- if (size == GLRO(dl_pagesize))
- /* We just tried to mprotect the lowest hole page and failed.
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-features-header-fix.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-features-header-fix.patch
deleted file mode 100644
index f4b88fc7f593..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-features-header-fix.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/features.h.orig 2004-11-04 15:42:23.777521424 -0500
-+++ include/features.h 2004-11-04 15:43:16.734470744 -0500
-@@ -262,7 +262,7 @@
- # define __USE_REENTRANT 1
- #endif
-
--#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 \
-+#if (_FORTIFY_SOURCE > 0) && defined(__OPTIMIZE__) \
- && (__GNUC_PREREQ (4, 1) \
- || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
- || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-force-nontls.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-force-nontls.patch
deleted file mode 100644
index ed0c993711f3..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-force-nontls.patch
+++ /dev/null
@@ -1,57 +0,0 @@
---- glibc-2.3.3.old/elf/rtld.c 2004-10-26 21:41:41.989117872 -0400
-+++ glibc-2.3.3/elf/rtld.c 2004-10-26 21:45:15.015732904 -0400
-@@ -1087,53 +1087,6 @@
- ++GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
- ++GL(dl_load_adds);
-
--#if defined(__i386__)
-- /* Force non-TLS libraries for glibc 2.0 binaries
-- or if a buggy binary references non-TLS errno or h_errno. */
-- if (__builtin_expect (main_map->l_info[DT_NUM + DT_THISPROCNUM
-- + DT_VERSIONTAGIDX (DT_VERNEED)]
-- == NULL, 0)
-- && main_map->l_info[DT_DEBUG])
-- GLRO(dl_osversion) = 0x20205;
-- else if ((__builtin_expect (mode, normal) != normal
-- || main_map->l_info[ADDRIDX (DT_GNU_LIBLIST)] == NULL)
-- /* Only binaries have DT_DEBUG dynamic tags... */
-- && main_map->l_info[DT_DEBUG])
-- {
-- /* Workaround for buggy binaries. This doesn't handle buggy
-- libraries. */
-- bool buggy = false;
-- const ElfW(Sym) *symtab = (const void *) D_PTR (main_map,
-- l_info[DT_SYMTAB]);
-- const char *strtab = (const void *) D_PTR (main_map,
-- l_info[DT_STRTAB]);
-- Elf_Symndx symidx;
-- for (symidx = main_map->l_buckets[0x6c994f % main_map->l_nbuckets];
-- symidx != STN_UNDEF;
-- symidx = main_map->l_chain[symidx])
-- {
-- if (__builtin_expect (strcmp (strtab + symtab[symidx].st_name,
-- "errno") == 0, 0)
-- && ELFW(ST_TYPE) (symtab[symidx].st_info) != STT_TLS)
-- buggy = true;
-- }
-- for (symidx = main_map->l_buckets[0xe5c992f % main_map->l_nbuckets];
-- symidx != STN_UNDEF;
-- symidx = main_map->l_chain[symidx])
-- {
-- if (__builtin_expect (strcmp (strtab + symtab[symidx].st_name,
-- "h_errno") == 0, 0)
-- && ELFW(ST_TYPE) (symtab[symidx].st_info) != STT_TLS)
-- buggy = true;
-- }
-- if (__builtin_expect (buggy, false) && GLRO(dl_osversion) > 0x20401)
-- {
-- GLRO(dl_osversion) = 0x20401;
-- _dl_error_printf ("Incorrectly built binary which accesses errno or h_errno directly. Needs to be fixed.\n");
-- }
-- }
--#endif
--
- /* If LD_USE_LOAD_BIAS env variable has not been seen, default
- to not using bias for non-prelinked PIEs and libraries
- and using it for executables or prelinked PIEs or libraries. */
-
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-libnoversion.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-libnoversion.patch
deleted file mode 100644
index 34aed0fa7f96..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-no-libnoversion.patch
+++ /dev/null
@@ -1,70 +0,0 @@
---- glibc-2.3.3.old/elf/rtld.c 2004-10-26 21:41:41.989117872 -0400
-+++ glibc-2.3.3/elf/rtld.c 2004-10-26 21:45:15.015732904 -0400
-@@ -1306,67 +1259,6 @@
- }
- }
-
--
--#if defined(__i386__) || defined(__alpha__) || (defined(__sparc__) && !defined(__arch64__))
-- /*
-- * Modifications by Red Hat Software
-- *
-- * Deal with the broken binaries from the non-versioned ages of glibc.
-- * If a binary does not have version information enabled, we assume that
-- * it is a glibc 2.0 binary and we load a compatibility library to try to
-- * overcome binary incompatibilities.
-- * Blame: gafton@redhat.com
-- */
--#define LIB_NOVERSION "/lib/libNoVersion.so.1"
--
-- if (__builtin_expect (main_map->l_info[DT_NUM + DT_THISPROCNUM
-- + DT_VERSIONTAGIDX (DT_VERNEED)]
-- == NULL, 0)
-- && (main_map->l_info[DT_DEBUG]
-- || !(GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)))
-- {
-- struct stat test_st;
-- int test_fd;
-- int can_load;
--
-- HP_TIMING_NOW (start);
--
--/* _dl_sysdep_message("Loading compatibility library... ", NULL); */
--
-- can_load = 1;
-- test_fd = __open (LIB_NOVERSION, O_RDONLY);
-- if (test_fd < 0) {
-- can_load = 0;
--/* _dl_sysdep_message(" Can't find " LIB_NOVERSION "\n", NULL); */
-- } else {
-- if (__fxstat (_STAT_VER, test_fd, &test_st) < 0 || test_st.st_size == 0) {
-- can_load = 0;
--/* _dl_sysdep_message(" Can't stat " LIB_NOVERSION "\n", NULL); */
-- }
-- }
--
-- if (test_fd >= 0) /* open did no fail.. */
-- __close(test_fd); /* avoid fd leaks */
--
-- if (can_load != 0) {
-- struct link_map *new_map;
-- new_map = _dl_map_object (main_map, LIB_NOVERSION,
-- 1, lt_library, 0, 0, LM_ID_BASE);
-- if (++new_map->l_opencount == 1) {
-- /* It is no duplicate. */
-- ++npreloads;
--/* _dl_sysdep_message(" DONE\n", NULL); */
-- } else {
--/* _dl_sysdep_message(" FAILED\n", NULL); */
-- }
-- }
--
-- HP_TIMING_NOW (stop);
-- HP_TIMING_DIFF (diff, start, stop);
-- HP_TIMING_ACCUM_NT (load_time, diff);
-- }
--#endif
--
- if (__builtin_expect (npreloads, 0) != 0)
- {
- /* Set up PRELOADS with a vector of the preloaded libraries. */
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-nomalloccheck.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-nomalloccheck.patch
deleted file mode 100644
index f163d2c93517..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fedora-branch-nomalloccheck.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- malloc/malloc.c.fedora 2004-11-04 16:45:51.365618552 -0500
-+++ malloc/malloc.c 2004-11-04 16:46:43.132748752 -0500
-@@ -2355,7 +2355,7 @@
- /* ---------------- Error behavior ------------------------------------ */
-
- #ifndef DEFAULT_CHECK_ACTION
--#define DEFAULT_CHECK_ACTION 3
-+#define DEFAULT_CHECK_ACTION 0
- #endif
-
- static int check_action = DEFAULT_CHECK_ACTION;
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fix-_dl_next_tls_modid-assert.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fix-_dl_next_tls_modid-assert.patch
deleted file mode 100644
index 212b2b1fcf00..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-fix-_dl_next_tls_modid-assert.patch
+++ /dev/null
@@ -1,268 +0,0 @@
-Gentoo bug #52374.
-==================
-
-Note, this patch includes both:
-
------
-2005-01-10 Ulrich Drepper <drepper@redhat.com>
-
- * sysdeps/generic/dl-tls.c (_dl_next_tls_modid): Fix assertion and
- recognition of last entry.
------
-
-and:
-
------
-2005-03-15 Jakub Jelinek <jakub@redhat.com>
-
- [BZ#786]
- * sysdeps/generic/dl-tls.c (_dl_next_tls_modid): Handle
- GL(dl_tls_static_nelem) == GL(dl_tls_max_dtv_idx).
- * elf/Makefile: Add rules to build and run tst-tls15.
- * elf/tst-tls15.c: New test.
- * elf/tst-tlsmod15a.c: New file.
- * elf/tst-tlsmod15b.c: New file.
------
-
-================================================================================
-On Sun, Mar 13, 2005 at 09:39:04PM +0200, Martin Schlemmer wrote:
-> Basically the issue above. This is valid for glibc 2.3.[234] if I did
-> not miss anything. Here is a good test case:
->
-> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=219352#msg122
->
-> I came up with attached patch that seems to work and passes all the
-> tests (except for the one or two usual ones). Is this the correct fix,
-> or are the problem deeper?
->
->--- glibc-2.3.4/sysdeps/generic/dl-tls.c.az 2005-03-13 19:26:55.000000000 +0200
->+++ glibc-2.3.4/sysdeps/generic/dl-tls.c 2005-03-13 19:29:14.000000000 +0200
->@@ -69,7 +69,10 @@
-> result = GL(dl_tls_static_nelem) + 1;
-> /* If the following would not be true we mustn't have assumed
-> there is a gap. */
->- assert (result <= GL(dl_tls_max_dtv_idx));
->+ /* The +1 is needed, as we add +1 above, but dl_tls_static_nelem
->+ is only once set as far as I can see in dl_main (elf/rtld.c),
->+ and that is equal to dl_tls_max_dtv_idx ... */
->+ assert (result <= (GL(dl_tls_max_dtv_idx) + 1));
-> do
-> {
-> while (result - disp < runp->len)
->@@ -92,7 +95,8 @@
-> {
-> /* The new index must indeed be exactly one higher than the
-> previous high. */
->- assert (result == GL(dl_tls_max_dtv_idx));
->+ /* Once again +1 for the same reasons as above ... */
->+ assert (result == (GL(dl_tls_max_dtv_idx) + 1));
->
-> /* There is no gap anymore. */
-> GL(dl_tls_dtv_gaps) = false;
->
-
-That patch certainly doesn't apply to neither HEAD nor glibc-2_3-branch,
-see especially:
-2005-01-10 Ulrich Drepper <drepper@redhat.com>
-
- * sysdeps/generic/dl-tls.c (_dl_next_tls_modid): Fix assertion and
- recognition of last entry.
-
-The fix can either be that dl-open.c only sets GL(dl_tls_dtv_gaps)
-to true if GL(dl_tls_static_nelem) < GL(dl_tls_max_dtv_idx)
-(if it is equal, there are certainly no gaps), or handling that case
-in _dl_next_tls_modid. In _dl_next_tls_modid, the choices are either
-to do what the patch below does, i.e. just clear GL(dl_tls_dtv_gaps)
-if that happens, or just change the assert and let the do ... while
-loop run, it shouldn't increment result anyway.
-
-2005-03-15 Jakub Jelinek <jakub@redhat.com>
-
- [BZ#786]
- * sysdeps/generic/dl-tls.c (_dl_next_tls_modid): Handle
- GL(dl_tls_static_nelem) == GL(dl_tls_max_dtv_idx).
- * elf/Makefile: Add rules to build and run tst-tls15.
- * elf/tst-tls15.c: New test.
- * elf/tst-tlsmod15a.c: New file.
- * elf/tst-tlsmod15b.c: New file.
-
-diff -urpN glibc-2.3.4.az/elf/Makefile glibc-2.3.4/elf/Makefile
---- glibc-2.3.4.az/elf/Makefile 2005-03-15 17:38:36.000000000 +0200
-+++ glibc-2.3.4/elf/Makefile 2005-03-15 17:39:07.000000000 +0200
-@@ -152,7 +152,7 @@ tests += loadtest restest1 preloadtest l
- neededtest3 neededtest4 unload2 lateglobal initfirst global \
- restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
- circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
-- tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-align \
-+ tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 tst-align \
- $(tests-execstack-$(have-z-execstack)) tst-dlmodcount \
- tst-dlopenrpath tst-deep1 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3
- # reldep9
-@@ -182,6 +182,7 @@ modules-names = testobj1 testobj2 testob
- tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
- tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
- tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
-+ tst-tlsmod15a tst-tlsmod15b \
- circlemod1 circlemod1a circlemod2 circlemod2a \
- circlemod3 circlemod3a \
- reldep8mod1 reldep8mod2 reldep8mod3 \
-@@ -454,6 +455,7 @@ tst-tlsmod10.so-no-z-defs = yes
- tst-tlsmod12.so-no-z-defs = yes
- tst-tlsmod14a.so-no-z-defs = yes
- tst-tlsmod14b.so-no-z-defs = yes
-+tst-tlsmod15a.so-no-z-defs = yes
- circlemod2.so-no-z-defs = yes
- circlemod3.so-no-z-defs = yes
- circlemod3a.so-no-z-defs = yes
-@@ -664,8 +666,11 @@ $(objpfx)tst-tls12: $(objpfx)tst-tlsmod1
- $(objpfx)tst-tls13: $(libdl)
- $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
-
--$(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl)
--$(objpfx)tst-tls14.out:$(objpfx)tst-tlsmod14b.so
-+$(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl)
-+$(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so
-+
-+$(objpfx)tst-tls15: $(libdl)
-+$(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so
-
- CFLAGS-tst-align.c = $(stack-align-test-flags)
- CFLAGS-tst-alignmod.c = $(stack-align-test-flags)
-diff -urpN glibc-2.3.4.az/elf/tst-tls15.c glibc-2.3.4/elf/tst-tls15.c
---- glibc-2.3.4.az/elf/tst-tls15.c 1970-01-01 02:00:00.000000000 +0200
-+++ glibc-2.3.4/elf/tst-tls15.c 2005-03-15 17:39:07.000000000 +0200
-@@ -0,0 +1,32 @@
-+#include <dlfcn.h>
-+#include <stdio.h>
-+
-+static int
-+do_test (void)
-+{
-+ void *h = dlopen ("tst-tlsmod15a.so", RTLD_NOW);
-+ if (h != NULL)
-+ {
-+ puts ("unexpectedly succeeded to open tst-tlsmod15a.so");
-+ exit (1);
-+ }
-+
-+ h = dlopen ("tst-tlsmod15b.so", RTLD_NOW);
-+ if (h == NULL)
-+ {
-+ puts ("failed to open tst-tlsmod15b.so");
-+ exit (1);
-+ }
-+
-+ int (*fp) (void) = (int (*) (void)) dlsym (h, "in_dso");
-+ if (fp == NULL)
-+ {
-+ puts ("cannot find in_dso");
-+ exit (1);
-+ }
-+
-+ return fp ();
-+}
-+
-+#define TEST_FUNCTION do_test ()
-+#include "../test-skeleton.c"
-diff -urpN glibc-2.3.4.az/elf/tst-tlsmod15a.c glibc-2.3.4/elf/tst-tlsmod15a.c
---- glibc-2.3.4.az/elf/tst-tlsmod15a.c 1970-01-01 02:00:00.000000000 +0200
-+++ glibc-2.3.4/elf/tst-tlsmod15a.c 2005-03-15 17:39:07.000000000 +0200
-@@ -0,0 +1,6 @@
-+extern int nonexistent_dummy_var;
-+int *
-+foo (void)
-+{
-+ return &nonexistent_dummy_var;
-+}
-diff -urpN glibc-2.3.4.az/elf/tst-tlsmod15b.c glibc-2.3.4/elf/tst-tlsmod15b.c
---- glibc-2.3.4.az/elf/tst-tlsmod15b.c 1970-01-01 02:00:00.000000000 +0200
-+++ glibc-2.3.4/elf/tst-tlsmod15b.c 2005-03-15 17:39:07.000000000 +0200
-@@ -0,0 +1,17 @@
-+#include "tst-tls10.h"
-+
-+#ifdef USE_TLS__THREAD
-+__thread int mod15b_var __attribute__((tls_model("initial-exec")));
-+
-+int
-+in_dso (void)
-+{
-+ return mod15b_var;
-+}
-+#else
-+int
-+in_dso (void)
-+{
-+ return 0;
-+}
-+#endif
-diff -urpN glibc-2.3.4.az/sysdeps/generic/dl-tls.c glibc-2.3.4/sysdeps/generic/dl-tls.c
---- glibc-2.3.4.az/sysdeps/generic/dl-tls.c 2005-03-15 17:40:56.000000000 +0200
-+++ glibc-2.3.4/sysdeps/generic/dl-tls.c 2005-03-15 17:39:07.000000000 +0200
-@@ -65,34 +65,35 @@ _dl_next_tls_modid (void)
- /* Note that this branch will never be executed during program
- start since there are no gaps at that time. Therefore it
- does not matter that the dl_tls_dtv_slotinfo is not allocated
-- yet when the function is called for the first times. */
-- result = GL(dl_tls_static_nelem) + 1;
-- /* If the following would not be true we mustn't have assumed
-- there is a gap. */
-- assert (result <= GL(dl_tls_max_dtv_idx));
-- do
-- {
-- while (result - disp < runp->len)
-- {
-- if (runp->slotinfo[result - disp].map == NULL)
-- break;
--
-- ++result;
-- assert (result <= GL(dl_tls_max_dtv_idx) + 1);
-- }
-+ yet when the function is called for the first times.
-
-- if (result - disp < runp->len)
-- break;
--
-- disp += runp->len;
-- }
-- while ((runp = runp->next) != NULL);
-+ NB: the offset +1 is due to the fact that DTV[0] is used
-+ for something else. */
-+ result = GL(dl_tls_static_nelem) + 1;
-+ if (result <= GL(dl_tls_max_dtv_idx))
-+ do
-+ {
-+ while (result - disp < runp->len)
-+ {
-+ if (runp->slotinfo[result - disp].map == NULL)
-+ break;
-+
-+ ++result;
-+ assert (result <= GL(dl_tls_max_dtv_idx) + 1);
-+ }
-+
-+ if (result - disp < runp->len)
-+ break;
-+
-+ disp += runp->len;
-+ }
-+ while ((runp = runp->next) != NULL);
-
-- if (result >= GL(dl_tls_max_dtv_idx))
-+ if (result > GL(dl_tls_max_dtv_idx))
- {
- /* The new index must indeed be exactly one higher than the
- previous high. */
-- assert (result == GL(dl_tls_max_dtv_idx));
-+ assert (result == GL(dl_tls_max_dtv_idx) + 1);
-
- /* There is no gap anymore. */
- GL(dl_tls_dtv_gaps) = false;
-@@ -577,7 +578,7 @@ __tls_get_addr (GET_ADDR_ARGS)
- {
- size_t cnt;
-
-- for (cnt = total = 0 ? 1 : 0; cnt < listp->len; ++cnt)
-+ for (cnt = total == 0 ? 1 : 0; cnt < listp->len; ++cnt)
- {
- size_t gen = listp->slotinfo[cnt].gen;
- struct link_map *map;
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-getcontext.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-getcontext.patch
deleted file mode 100644
index f32abcf636ff..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-getcontext.patch
+++ /dev/null
@@ -1,358 +0,0 @@
-2004-09-02 Steven Munroe <sjmunroe@us.ibm.com>
-
- [BZ #357]
- * stdlib/tst-setcontext.c (test_stack): Added test for stack clobber.
- (main): Call test_stack.
- * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
- (__getcontext): Push stack frame then save parms in local frame.
- Improve instruction scheduling.
- * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
- (__swapcontext): Push stack frame then save parms in local frame.
- Improve instruction scheduling.
-
-
-diff -urN libc23-cvstip-20040830/stdlib/tst-setcontext.c libc23/stdlib/tst-setcontext.c
---- libc23-cvstip-20040830/stdlib/tst-setcontext.c 2002-08-30 22:21:40.000000000 -0500
-+++ libc23/stdlib/tst-setcontext.c 2004-09-02 10:10:28.055274880 -0500
-@@ -72,6 +72,55 @@
- was_in_f2 = 1;
- }
-
-+void
-+test_stack(volatile int a, volatile int b,
-+ volatile int c, volatile int d)
-+{
-+ volatile int e = 5;
-+ volatile int f = 6;
-+ ucontext_t uc;
-+
-+ /* Test for cases where getcontext is clobbering the callers
-+ stack, including parameters. */
-+ getcontext(&uc);
-+
-+ if (a != 1)
-+ {
-+ printf ("%s: getcontext clobbers parm a\n", __FUNCTION__);
-+ exit (1);
-+ }
-+
-+ if (b != 2)
-+ {
-+ printf ("%s: getcontext clobbers parm b\n", __FUNCTION__);
-+ exit (1);
-+ }
-+
-+ if (c != 3)
-+ {
-+ printf ("%s: getcontext clobbers parm c\n", __FUNCTION__);
-+ exit (1);
-+ }
-+
-+ if (d != 4)
-+ {
-+ printf ("%s: getcontext clobbers parm d\n", __FUNCTION__);
-+ exit (1);
-+ }
-+
-+ if (e != 5)
-+ {
-+ printf ("%s: getcontext clobbers varible e\n", __FUNCTION__);
-+ exit (1);
-+ }
-+
-+ if (f != 6)
-+ {
-+ printf ("%s: getcontext clobbers variable f\n", __FUNCTION__);
-+ exit (1);
-+ }
-+}
-+
- volatile int global;
-
- int
-@@ -88,6 +137,8 @@
- printf ("%s: getcontext: %m\n", __FUNCTION__);
- exit (1);
- }
-+
-+ test_stack (1, 2, 3, 4);
-
- /* Play some tricks with this context. */
- if (++global == 1)
-diff -urN libc23-cvstip-20040830/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
---- libc23-cvstip-20040830/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S 2004-06-15 15:02:20.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S 2004-09-02 12:46:16.064221704 -0500
-@@ -27,18 +27,22 @@
-
- .machine "altivec"
- ENTRY(__getcontext)
-+ stwu r1,-16(r1)
-+/* Insure that the _UC_REGS start on a quadword boundary. */
- stw r3,_FRAME_PARM_SAVE1(r1)
- addi r3,r3,_UC_REG_SPACE+12
- clrrwi r3,r3,4
-+
-+/* Save the general purpose registers */
- stw r0,_UC_GREGS+(PT_R0*4)(r3)
- mflr r0
-- stw r1,_UC_GREGS+(PT_R1*4)(r3)
-- stwu r1,-16(r1)
-+ stw r2,_UC_GREGS+(PT_R2*4)(r3)
-+ stw r4,_UC_GREGS+(PT_R4*4)(r3)
-+/* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
-+ return address. */
- stw r0,_UC_GREGS+(PT_LNK*4)(r3)
- stw r0,_UC_GREGS+(PT_NIP*4)(r3)
- stw r0,_FRAME_LR_SAVE+16(r1)
-- stw r2,_UC_GREGS+(PT_R2*4)(r3)
-- stw r4,_UC_GREGS+(PT_R4*4)(r3)
- stw r5,_UC_GREGS+(PT_R5*4)(r3)
- stw r6,_UC_GREGS+(PT_R6*4)(r3)
- stw r7,_UC_GREGS+(PT_R7*4)(r3)
-@@ -66,23 +70,28 @@
- stw r29,_UC_GREGS+(PT_R29*4)(r3)
- stw r30,_UC_GREGS+(PT_R30*4)(r3)
- stw r31,_UC_GREGS+(PT_R31*4)(r3)
-- mfctr r0
-- stw r0,_UC_GREGS+(PT_CTR*4)(r3)
-- mfxer r0
-- stw r0,_UC_GREGS+(PT_XER*4)(r3)
-- mfcr r0
-- stw r0,_UC_GREGS+(PT_CCR*4)(r3)
--
-- /* Set the return value of getcontext to "success". R3 is the only
-- register whose value is not preserved in the saved context. */
-+/* Save the value of R1. We had to push the stack before we
-+ had the address of uc_reg_space. So compute the address of
-+ the callers stack pointer and save it as R1. */
-+ addi r8,r1,16
- li r0,0
-+/* Save the count, exception and condition registers. */
-+ mfctr r11
-+ mfxer r10
-+ mfcr r9
-+ stw r8,_UC_GREGS+(PT_R1*4)(r3)
-+ stw r11,_UC_GREGS+(PT_CTR*4)(r3)
-+ stw r10,_UC_GREGS+(PT_XER*4)(r3)
-+ stw r9,_UC_GREGS+(PT_CCR*4)(r3)
-+/* Set the return value of getcontext to "success". R3 is the only
-+ register whose value is not preserved in the saved context. */
- stw r0,_UC_GREGS+(PT_R3*4)(r3)
-
-- /* Zero fill fields that can't be set in user state. */
-+/* Zero fill fields that can't be set in user state. */
- stw r0,_UC_GREGS+(PT_MSR*4)(r3)
- stw r0,_UC_GREGS+(PT_MQ*4)(r3)
-
-- /* Save the floating-point registers */
-+/* Save the floating-point registers */
- stfd fp0,_UC_FREGS+(0*8)(r3)
- stfd fp1,_UC_FREGS+(1*8)(r3)
- stfd fp2,_UC_FREGS+(2*8)(r3)
-@@ -136,21 +145,31 @@
- lwz r7,_dl_hwcap@l(r7)
- #endif
- andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-- beq L(no_vec)
-
- la r10,(_UC_VREGS)(r3)
- la r9,(_UC_VREGS+16)(r3)
-+
-+ beq L(no_vec)
-+/* address of the combined VSCR/VSAVE quadword. */
-+ la r8,(_UC_VREGS+512)(r3)
-
-+/* Save the vector registers */
- stvx v0,0,r10
- stvx v1,0,r9
- addi r10,r10,32
- addi r9,r9,32
-+/* We need to get the Vector Status and Control Register early to avoid
-+ store order problems later with the VSAVE register that shares the
-+ same quadword. */
-+ mfvscr v0
-
- stvx v2,0,r10
- stvx v3,0,r9
- addi r10,r10,32
- addi r9,r9,32
-
-+ stvx v0,0,r8
-+
- stvx v4,0,r10
- stvx v5,0,r9
- addi r10,r10,32
-@@ -216,20 +235,18 @@
- addi r10,r10,32
- addi r9,r9,32
-
-+ mfspr r0,VRSAVE
- stvx v30,0,r10
- stvx v31,0,r9
-- addi r10,r10,32
-- addi r9,r9,32
-
-- mfvscr v0
-- mfspr r0,VRSAVE
-- stvx v0,0,r10
-- sync
-- stw r0,0(r10)
-+ stw r0,0(r8)
-
- L(no_vec):
--/* Restore ucontext (parm1) from stack. */
-- lwz r12,_FRAME_PARM_SAVE1+16(r1)
-+/* We need to set up parms and call sigprocmask which will clobber
-+ volatile registers. So before the call we need to retrieve the
-+ original ucontext ptr (parm1) from stack and store the UC_REGS_PTR
-+ (current R3). */
-+ lwz r12,_FRAME_PARM_SAVE1(r1)
- li r4,0
- stw r3,_UC_REGS_PTR(r12)
- addi r5,r12,_UC_SIGMASK
-diff -urN libc23-cvstip-20040830/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
---- libc23-cvstip-20040830/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S 2004-06-15 15:02:20.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S 2004-09-02 12:45:43.125302872 -0500
-@@ -27,22 +27,23 @@
-
- .machine "altivec"
- ENTRY(__swapcontext)
-- /* Save the current context */
-+ stwu r1,-16(r1)
-+/* Insure that the _UC_REGS start on a quadword boundary. */
- stw r3,_FRAME_PARM_SAVE1(r1)
- addi r3,r3,_UC_REG_SPACE+12
-+ stw r4,_FRAME_PARM_SAVE2(r1) /* new context pointer */
- clrrwi r3,r3,4
-+
-+/* Save the general purpose registers */
- stw r0,_UC_GREGS+(PT_R0*4)(r3)
-- stw r1,_UC_GREGS+(PT_R1*4)(r3)
- mflr r0
-- stwu r1,-16(r1)
-- stw r0,20(r1)
-- stw r31,12(r1)
-- stw r31,_UC_GREGS+(PT_R31*4)(r3)
-- mr r31,r4 /* new context pointer */
-+ stw r2,_UC_GREGS+(PT_R2*4)(r3)
-+ stw r4,_UC_GREGS+(PT_R4*4)(r3)
-+/* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
-+ return address. */
- stw r0,_UC_GREGS+(PT_LNK*4)(r3)
- stw r0,_UC_GREGS+(PT_NIP*4)(r3)
-- stw r2,_UC_GREGS+(PT_R2*4)(r3)
-- stw r4,_UC_GREGS+(PT_R4*4)(r3)
-+ stw r0,_FRAME_LR_SAVE+16(r1)
- stw r5,_UC_GREGS+(PT_R5*4)(r3)
- stw r6,_UC_GREGS+(PT_R6*4)(r3)
- stw r7,_UC_GREGS+(PT_R7*4)(r3)
-@@ -69,16 +70,23 @@
- stw r28,_UC_GREGS+(PT_R28*4)(r3)
- stw r29,_UC_GREGS+(PT_R29*4)(r3)
- stw r30,_UC_GREGS+(PT_R30*4)(r3)
-- mfctr r0
-- stw r0,_UC_GREGS+(PT_CTR*4)(r3)
-- mfxer r0
-- stw r0,_UC_GREGS+(PT_XER*4)(r3)
-- mfcr r0
-- stw r0,_UC_GREGS+(PT_CCR*4)(r3)
--
-- /* Set the return value of swapcontext to "success". R3 is the only
-- register whose value is not preserved in the saved context. */
-+ stw r31,_UC_GREGS+(PT_R31*4)(r3)
-+
-+/* Save the value of R1. We had to push the stack before we
-+ had the address of uc_reg_space. So compute the address of
-+ the callers stack pointer and save it as R1. */
-+ addi r8,r1,16
- li r0,0
-+/* Save the count, exception and condition registers. */
-+ mfctr r11
-+ mfxer r10
-+ mfcr r9
-+ stw r8,_UC_GREGS+(PT_R1*4)(r3)
-+ stw r11,_UC_GREGS+(PT_CTR*4)(r3)
-+ stw r10,_UC_GREGS+(PT_XER*4)(r3)
-+ stw r9,_UC_GREGS+(PT_CCR*4)(r3)
-+/* Set the return value of getcontext to "success". R3 is the only
-+ register whose value is not preserved in the saved context. */
- stw r0,_UC_GREGS+(PT_R3*4)(r3)
-
- /* Zero fill fields that can't be set in user state. */
-@@ -138,20 +146,30 @@
- lwz r7,_dl_hwcap@l(r7)
- #endif
- andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-- beq L(no_vec)
-
- la r10,(_UC_VREGS)(r3)
- la r9,(_UC_VREGS+16)(r3)
-+
-+ beq L(no_vec)
-+/* address of the combined VSCR/VSAVE quadword. */
-+ la r8,(_UC_VREGS+512)(r3)
-
-+/* Save the vector registers */
- stvx v0,0,r10
- stvx v1,0,r9
- addi r10,r10,32
- addi r9,r9,32
-+/* We need to get the Vector Status and Control Register early to avoid
-+ store order problems later with the VSAVE register that shares the
-+ same quadword. */
-+ mfvscr v0
-
- stvx v2,0,r10
- stvx v3,0,r9
- addi r10,r10,32
- addi r9,r9,32
-+
-+ stvx v0,0,r8
-
- stvx v4,0,r10
- stvx v5,0,r9
-@@ -218,20 +236,15 @@
- addi r10,r10,32
- addi r9,r9,32
-
-+ mfvscr v0
- stvx v30,0,r10
- stvx v31,0,r9
-- addi r10,r10,32
-- addi r9,r9,32
-
-- mfvscr v0
-- mfspr r0,VRSAVE
-- stvx v0,0,r10
-- sync
-- stw r0,0(r10)
-+ stw r0,0(r8)
-
- L(no_vec):
- /* Restore ucontext (parm1) from stack. */
-- lwz r12,_FRAME_PARM_SAVE1+16(r1)
-+ lwz r12,_FRAME_PARM_SAVE1(r1)
- li r4,0
- stw r3,_UC_REGS_PTR(r12)
- addi r5,r12,_UC_SIGMASK
-@@ -251,8 +264,8 @@
- * r0, xer, ctr. We don't restore r2 since it will be used as
- * the TLS pointer.
- */
-- mr r4,r31
-- lwz r31,_UC_REGS_PTR(r31)
-+ lwz r4,_FRAME_PARM_SAVE2(r1)
-+ lwz r31,_UC_REGS_PTR(r4)
- lwz r0,_UC_GREGS+(PT_MSR*4)(r31)
- cmpwi r0,0
- bne L(do_sigret)
-@@ -451,8 +464,7 @@
- bctr
-
- L(error_exit):
-- lwz r31,12(r1)
-- lwz r0,20(r1)
-+ lwz r0,_FRAME_LR_SAVE+16(r1)
- addi r1,r1,16
- mtlr r0
- blr
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch
deleted file mode 100644
index 61058eabacef..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- sysdeps/unix/sysv/linux/i386/sysdep.h.orig 2004-06-13 13:08:49.905902169 -0600
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h 2004-06-13 13:09:16.312954075 -0600
-@@ -401,7 +401,7 @@
-
- #define LOADARGS_0
- #ifdef __PIC__
--# if defined I386_USE_SYSENTER
-+# if defined I386_USE_SYSENTER && defined SHARED
- # define LOADARGS_1 \
- "bpushl .L__X'%k3, %k3\n\t"
- # define LOADARGS_5 \
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch
deleted file mode 100644
index 3f00ea2d87ea..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-diff -u -r -N glibc-2.3.4-hppa/csu/elf-init.c glibc-2.3.4-hppa-hardened/csu/elf-init.c
---- glibc-2.3.4-hppa/csu/elf-init.c 2004-07-22 12:13:09.207029032 +0200
-+++ glibc-2.3.4-hppa-hardened/csu/elf-init.c 2004-07-22 13:24:02.652407048 +0200
-@@ -19,15 +19,14 @@
-
- #include <stddef.h>
-
--#ifdef HAVE_INITFINI_ARRAY
--/* These magic symbols are provided by the linker. */
--extern void (*__preinit_array_start []) (void) attribute_hidden;
--extern void (*__preinit_array_end []) (void) attribute_hidden;
--extern void (*__init_array_start []) (void) attribute_hidden;
--extern void (*__init_array_end []) (void) attribute_hidden;
--extern void (*__fini_array_start []) (void) attribute_hidden;
--extern void (*__fini_array_end []) (void) attribute_hidden;
--#endif
-+/* there is no hppalinux.xd and hppalinux.xdc linker script available */
-+/* this is why __init_array_start|__init_array_end cannot be resolved */
-+/* if we are using hardened with auto PIE, we need to disable startup */
-+/* code for such additional arrays normally found in a PROVIDE script */
-+
-+/* the hppalinux.xd and .xdc scripts can easily be converted from the */
-+/* hppalinux.xc shared linker scripts, using diffs from sparc example */
-+/* however, the ld does not even automatically use these scripts then */
-
- /* These function symbols are provided for the .init/.fini section entry
- points automagically by the linker. */
-@@ -42,41 +41,11 @@
- void
- __libc_csu_init (void)
- {
--#ifdef HAVE_INITFINI_ARRAY
-- /* For dynamically linked executables the preinit array is executed by
-- the dynamic linker (before initializing any shared object. */
--
--# ifndef LIBC_NONSHARED
-- /* For static executables, preinit happens rights before init. */
-- {
-- const size_t size = __preinit_array_end - __preinit_array_start;
-- size_t i;
-- for (i = 0; i < size; i++)
-- (*__preinit_array_start [i]) ();
-- }
--# endif
--#endif
--
- _init ();
--
--#ifdef HAVE_INITFINI_ARRAY
-- {
-- const size_t size = __init_array_end - __init_array_start;
-- size_t i;
-- for (i = 0; i < size; i++)
-- (*__init_array_start [i]) ();
-- }
--#endif
- }
-
- void
- __libc_csu_fini (void)
- {
--#ifdef HAVE_INITFINI_ARRAY
-- size_t i = __fini_array_end - __fini_array_start;
-- while (i-- > 0)
-- (*__fini_array_start [i]) ();
--#endif
--
- _fini ();
- }
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch
deleted file mode 100644
index d1d9a924be8b..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -Nru glibc-2.3.3.old/sysdeps/unix/sysv/linux/dl-sysdep.c glibc-2.3.3/sysdeps/unix/sysv/linux/dl-sysdep.c
---- glibc-2.3.3.old/sysdeps/unix/sysv/linux/dl-sysdep.c 2004-08-16 10:47:10.361264216 -0400
-+++ glibc-2.3.3/sysdeps/unix/sysv/linux/dl-sysdep.c 2004-08-16 10:47:55.068467688 -0400
-@@ -1,5 +1,5 @@
- /* Dynamic linker system dependencies for Linux.
-- Copyright (C) 1995, 1997, 2001 Free Software Foundation, Inc.
-+ Copyright (C) 1995, 1997, 2001, 2004 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
-@@ -21,6 +21,8 @@
- the generic dynamic linker system interface code. */
-
- #include <unistd.h>
-+#include <ldsodefs.h>
-+#include "kernel-features.h"
-
- #define DL_SYSDEP_INIT frob_brk ()
-
-@@ -28,6 +30,27 @@
- frob_brk (void)
- {
- __brk (0); /* Initialize the break. */
-+
-+#if ! __ASSUME_BRK_PAGE_ROUNDED
-+ /* If the dynamic linker was executed as a program, then the break may
-+ start immediately after our data segment. However, dl-minimal.c has
-+ already stolen the remainder of the page for internal allocations.
-+ If we don't adjust the break location recorded by the kernel, the
-+ normal program startup will inquire, find the value at our &_end,
-+ and start allocating its own data there, clobbering dynamic linker
-+ data structures allocated there during startup.
-+
-+ Later Linux kernels have changed this behavior so that the initial
-+ break value is rounded up to the page boundary before we start. */
-+
-+ extern void *__curbrk attribute_hidden;
-+ extern void _end attribute_hidden;
-+ void *const endpage = (void *) 0 + (((__curbrk - (void *) 0)
-+ + GLRO(dl_pagesize) - 1)
-+ & -GLRO(dl_pagesize));
-+ if (__builtin_expect (__curbrk >= &_end && __curbrk < endpage, 0))
-+ __brk (endpage);
-+#endif
- }
-
- #include <sysdeps/generic/dl-sysdep.c>
-diff -Nru glibc-2.3.3.old/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.3.3/sysdeps/unix/sysv/linux/kernel-features.h
---- glibc-2.3.3.old/sysdeps/unix/sysv/linux/kernel-features.h 2004-08-16 10:47:09.458401472 -0400
-+++ glibc-2.3.3/sysdeps/unix/sysv/linux/kernel-features.h 2004-08-16 10:48:02.345361432 -0400
-@@ -400,3 +400,9 @@
- #if __LINUX_KERNEL_VERSION >= 132612
- # define __ASSUME_GETDENTS32_D_TYPE 1
- #endif
-+
-+/* Starting with version 2.5.3, the initial location returned by `brk'
-+ after exec is always rounded up to the next page. */
-+#if __LINUX_KERNEL_VERSION >= 132355
-+# define __ASSUME_BRK_PAGE_ROUNDED 1
-+#endif
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mdns-resolver-20041102.diff b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mdns-resolver-20041102.diff
deleted file mode 100644
index d22e0cbc7e6a..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mdns-resolver-20041102.diff
+++ /dev/null
@@ -1,463 +0,0 @@
-diff -Nru glibc-2.3.3/resolv/res_hconf.c libc-mdns/resolv/res_hconf.c
---- glibc-2.3.3/resolv/res_hconf.c 2004-11-04 15:14:48.265197552 -0500
-+++ libc-mdns/resolv/res_hconf.c 2004-11-04 15:01:40.000000000 -0500
-@@ -59,6 +59,7 @@
- #define ENV_TRIM_ADD "RESOLV_ADD_TRIM_DOMAINS"
- #define ENV_MULTI "RESOLV_MULTI"
- #define ENV_REORDER "RESOLV_REORDER"
-+#define ENV_MDNS "RESOLV_MDNS"
-
- static const char *arg_service_list (const char *, int, const char *,
- unsigned int);
-@@ -81,7 +82,8 @@
- {"multi", arg_bool, HCONF_FLAG_MULTI},
- {"nospoof", arg_bool, HCONF_FLAG_SPOOF},
- {"spoofalert", arg_bool, HCONF_FLAG_SPOOFALERT},
-- {"reorder", arg_bool, HCONF_FLAG_REORDER}
-+ {"reorder", arg_bool, HCONF_FLAG_REORDER},
-+ {"mdns", arg_bool, HCONF_FLAG_MDNS}
- };
-
- /* Structure containing the state. */
-@@ -431,6 +433,9 @@
-
- memset (&_res_hconf, '\0', sizeof (_res_hconf));
-
-+ /* Default for mdns is "on". */
-+ _res_hconf.flags |= HCONF_FLAG_MDNS;
-+
- hconf_name = getenv (ENV_HOSTCONF);
- if (hconf_name == NULL)
- hconf_name = _PATH_HOSTCONF;
-@@ -483,6 +488,10 @@
- arg_trimdomain_list (ENV_TRIM_OVERR, 1, envval, 0);
- }
-
-+ envval = getenv (ENV_MDNS);
-+ if (envval)
-+ arg_bool (ENV_MDNS, 1, envval, HCONF_FLAG_MDNS);
-+
- _res_hconf.initialized = 1;
- }
-
-diff -Nru glibc-2.3.3/resolv/res_hconf.h libc-mdns/resolv/res_hconf.h
---- glibc-2.3.3/resolv/res_hconf.h 2001-07-06 00:55:39.000000000 -0400
-+++ libc-mdns/resolv/res_hconf.h 2004-11-04 15:01:40.000000000 -0500
-@@ -44,6 +44,7 @@
- # define HCONF_FLAG_SPOOFALERT (1 << 2) /* syslog warning of spoofed */
- # define HCONF_FLAG_REORDER (1 << 3) /* list best address first */
- # define HCONF_FLAG_MULTI (1 << 4) /* see comments for gethtbyname() */
-+# define HCONF_FLAG_MDNS (1 << 5) /* Disable MDNS support */
- };
- extern struct hconf _res_hconf;
-
-diff -Nru glibc-2.3.3/resolv/res_query.c libc-mdns/resolv/res_query.c
---- glibc-2.3.3/resolv/res_query.c 2004-11-04 15:14:48.268197096 -0500
-+++ libc-mdns/resolv/res_query.c 2004-11-04 15:01:40.000000000 -0500
-@@ -82,6 +82,8 @@
- #include <stdlib.h>
- #include <string.h>
-
-+#include "res_hconf.h"
-+
- /* Options. Leave them on. */
- /* #undef DEBUG */
-
-@@ -280,6 +282,13 @@
- *domain && !done;
- domain++) {
-
-+ if ((_res_hconf.flags & HCONF_FLAG_MDNS) != 0) {
-+ /* don't add "local" domain if query contains a dot */
-+ if (dots && (!__strcasecmp(*domain, "local") ||
-+ !__strcasecmp(*domain, "local.")))
-+ continue;
-+ }
-+
- if (domain[0][0] == '\0' ||
- (domain[0][0] == '.' && domain[0][1] == '\0'))
- root_on_list++;
-diff -Nru glibc-2.3.3/resolv/res_send.c libc-mdns/resolv/res_send.c
---- glibc-2.3.3/resolv/res_send.c 2004-11-04 15:14:48.269196944 -0500
-+++ libc-mdns/resolv/res_send.c 2004-11-04 15:06:31.000000000 -0500
-@@ -85,6 +85,9 @@
- #include <arpa/nameser.h>
- #include <arpa/inet.h>
- #include <sys/ioctl.h>
-+#if defined(_LIBC) && defined(linux)
-+#include <net/if.h>
-+#endif
-
- #include <errno.h>
- #include <fcntl.h>
-@@ -96,6 +99,8 @@
- #include <string.h>
- #include <unistd.h>
-
-+#include "res_hconf.h"
-+
- #if PACKETSZ > 65536
- #define MAXPACKET PACKETSZ
- #else
-@@ -180,6 +185,9 @@
- static int send_dg(res_state, const u_char *, int,
- u_char **, int *, int *, int,
- int *, int *, u_char **);
-+static int send_dg_mdns(res_state, const u_char *, int,
-+ u_char **, int *, int *, struct sockaddr_in6 *,
-+ int *, int *, u_char **);
- #ifdef DEBUG
- static void Aerror(const res_state, FILE *, const char *, int,
- const struct sockaddr *);
-@@ -332,6 +340,35 @@
- u_char *ans, int anssiz, u_char **ansp)
- {
- int gotsomewhere, terrno, try, v_circuit, resplen, ns, n;
-+ int usemdns;
-+ HEADER *qhp = (HEADER *) buf;
-+
-+ usemdns = 0;
-+ if ((_res_hconf.flags & HCONF_FLAG_MDNS) != 0 &&
-+ qhp->qr == 0 && qhp->opcode == QUERY && qhp->qdcount == htons(1)) {
-+ /* got one simple query */
-+ const u_char *bp, *be;
-+ be = buf + buflen;
-+ for (bp = buf + NS_HFIXEDSZ; bp < be; )
-+ if ((*bp & NS_CMPRSFLGS) != 0)
-+ break;
-+ else if (*bp) {
-+ if (*bp == 5 && !strncasecmp(bp, "\005local\000", 7)) {
-+ usemdns = 1;
-+ break;
-+ }
-+ if (*bp == 3 && !strncasecmp(bp, "\003254\003169\007in-addr\004arpa\000", 22)) {
-+ usemdns = 1;
-+ break;
-+ }
-+ if (*bp == 1 && !strncasecmp(bp, "\0010\0018\001e\001f\003ip6\004arpa\000", 18)) {
-+ usemdns = 2;
-+ break;
-+ }
-+ bp += *bp + 1;
-+ } else
-+ break;
-+ }
-
- if (statp->nscount == 0) {
- __set_errno (ESRCH);
-@@ -465,10 +502,27 @@
- * Send request, RETRY times, or until successful.
- */
- for (try = 0; try < statp->retry; try++) {
-- for (ns = 0; ns < MAXNS; ns++)
-+ for (ns = 0; ns < (usemdns ? 1 : MAXNS); ns++)
- {
- struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns];
-
-+ if (usemdns == 1) {
-+ static struct sockaddr_in mdns4;
-+ mdns4.sin_family = AF_INET;
-+ mdns4.sin_port = htons(5353);
-+ mdns4.sin_addr.s_addr = htonl(0xe00000fb);
-+ nsap = (struct sockaddr_in6 *)&mdns4;
-+ }
-+ if (usemdns == 2) {
-+ static struct sockaddr_in6 mdns6;
-+ mdns6.sin6_family = AF_INET6;
-+ mdns6.sin6_port = htons(5353);
-+ mdns6.sin6_addr.s6_addr32[0] = htonl(0xff020000);
-+ mdns6.sin6_addr.s6_addr32[3] = htonl(0x000000fb);
-+ nsap = &mdns6;
-+ }
-+
-+
- if (nsap == NULL)
- goto next_ns;
- same_ns:
-@@ -525,8 +579,11 @@
- resplen = n;
- } else {
- /* Use datagrams. */
-- n = send_dg(statp, buf, buflen, &ans, &anssiz, &terrno,
-- ns, &v_circuit, &gotsomewhere, ansp);
-+ if (usemdns)
-+ n = send_dg_mdns(statp, buf, buflen, &ans, &anssiz, &terrno, nsap, &v_circuit, &gotsomewhere, ansp);
-+ else
-+ n = send_dg(statp, buf, buflen, &ans, &anssiz, &terrno,
-+ ns, &v_circuit, &gotsomewhere, ansp);
- if (n < 0)
- return (-1);
- if (n == 0)
-@@ -593,8 +650,15 @@
- if (!v_circuit) {
- if (!gotsomewhere)
- __set_errno (ECONNREFUSED); /* no nameservers found */
-- else
-+ else if (!usemdns) {
- __set_errno (ETIMEDOUT); /* no answer obtained */
-+ } else {
-+ /* treat timeout as host not found */
-+ HEADER *anhp = (HEADER *) ans;
-+ memset(ans, 0, HFIXEDSZ);
-+ anhp->rcode = NXDOMAIN;
-+ return HFIXEDSZ;
-+ }
- } else
- __set_errno (terrno);
- return (-1);
-@@ -1035,6 +1099,255 @@
- }
- }
-
-+static int
-+send_dg_mdns(res_state statp,
-+ const u_char *buf, int buflen, u_char **ansp, int *anssizp,
-+ int *terrno, struct sockaddr_in6 *nsap, int *v_circuit, int *gotsomewhere, u_char **anscp)
-+{
-+ const HEADER *hp = (HEADER *) buf;
-+ u_char *ans = *ansp;
-+ int anssiz = *anssizp;
-+ HEADER *anhp = (HEADER *) ans;
-+ struct timespec now, timeout, finish;
-+ struct pollfd pfd[32];
-+ int ptimeout;
-+ int fromlen, resplen, seconds, n, s;
-+ int on = 1;
-+ struct msghdr mhdr;
-+ struct iovec iov;
-+ u_char cmsgbuf[CMSG_SPACE(sizeof(int))];
-+ struct cmsghdr *cmsg;
-+ int ttl;
-+ struct ifconf ifconf;
-+ struct ifreq ifreq[64];
-+ int ifreqn;
-+ int i, j;
-+ int ifidx[32], ifidxn;
-+ struct ip_mreqn mreqn;
-+
-+ s = socket(nsap->sin6_family == AF_INET ? PF_INET : PF_INET6, SOCK_DGRAM, 0);
-+ if (s < 0) {
-+ *terrno = errno;
-+ Perror(statp, stderr, "socket(dg)", errno);
-+ return (-1);
-+ }
-+ ifconf.ifc_len = sizeof(ifreq);
-+ ifconf.ifc_req = ifreq;
-+ ifidxn = 0;
-+ if (ioctl(s, SIOCGIFCONF, &ifconf) == 0) {
-+ ifreqn = ifconf.ifc_len / sizeof(*ifreq);
-+ for (i = 0 ; i < ifreqn; i++) {
-+ if (ioctl(s, SIOCGIFFLAGS, ifreq + i))
-+ continue;
-+ if (!(ifreq[i].ifr_flags & IFF_MULTICAST))
-+ continue;
-+ if (ioctl(s, SIOCGIFINDEX, ifreq + i))
-+ continue;
-+ for (j = 0; j < ifidxn; j++)
-+ if (ifidx[j] == ifreq[i].ifr_ifindex)
-+ break;
-+ if (j < ifidxn)
-+ continue;
-+ ifidx[ifidxn++] = ifreq[i].ifr_ifindex;
-+ if (ifidxn == sizeof(ifidx)/sizeof(*ifidx))
-+ break;
-+ }
-+ }
-+ j = 0;
-+ for (i = 0; i < (ifidxn ? ifidxn : 1); i++) {
-+ if (i) {
-+ s = socket(nsap->sin6_family == AF_INET ? PF_INET : PF_INET6, SOCK_DGRAM, 0);
-+ if (!s)
-+ continue;
-+ }
-+ if (setsockopt(s, SOL_IP, IP_RECVTTL, &on, sizeof(on))) {
-+ *terrno = errno;
-+ Perror(statp, stderr, "IP_RECVTTL(dg)", errno);
-+ close(s);
-+ continue;
-+ }
-+ if (ifidxn) {
-+ memset(&mreqn, 0, sizeof(mreqn));
-+ mreqn.imr_ifindex = ifidx[i];
-+ if (setsockopt(s, SOL_IP, IP_MULTICAST_IF, &mreqn, sizeof(mreqn))) {
-+ *terrno = errno;
-+ Perror(statp, stderr, "IP_MULTICAST_IF", errno);
-+ close(s);
-+ continue;
-+ }
-+ }
-+ if (sendto(s, (char*)buf, buflen, 0,
-+ (struct sockaddr *)nsap, sizeof *nsap) != buflen) {
-+ Aerror(statp, stderr, "sendto", errno, *(struct sockaddr_in *)nsap);
-+ close(s);
-+ continue;
-+ }
-+ pfd[j].fd = s;
-+ pfd[j].events = POLLIN;
-+ j++;
-+ }
-+ /*
-+ * Wait for reply.
-+ */
-+ seconds = statp->retrans;
-+ if (seconds <= 0)
-+ seconds = 1;
-+ evNowTime(&now);
-+ evConsTime(&timeout, seconds, 0);
-+ evAddTime(&finish, &now, &timeout);
-+ wait:
-+ if (j == 0) {
-+ return (0);
-+ }
-+
-+ /* Convert struct timespec in milliseconds. */
-+ ptimeout = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000;
-+ n = __poll (pfd, j, ptimeout);
-+ if (n == 0) {
-+ Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
-+ *gotsomewhere = 1;
-+ for (i = 0; i < j; i++)
-+ close(pfd[i].fd);
-+ return (0);
-+ }
-+ if (n < 0) {
-+ if (errno == EINTR) {
-+ evNowTime(&now);
-+ if (evCmpTime(finish, now) > 0) {
-+ evSubTime(&timeout, &finish, &now);
-+ goto wait;
-+ }
-+ }
-+ Perror(statp, stderr, "select", errno);
-+ for (i = 0; i < j; i++)
-+ close(pfd[i].fd);
-+ res_nclose(statp);
-+ return (0);
-+ }
-+ for (i = 0; i < j - 1; i++)
-+ if (pfd[j].revents == POLLIN)
-+ break;
-+ s = pfd[i].fd;
-+ __set_errno (0);
-+ fromlen = sizeof(struct sockaddr_in6);
-+ if (anssiz < MAXPACKET
-+ && anscp
-+ && (ioctl (s, FIONREAD, &resplen) < 0
-+ || anssiz < resplen)) {
-+ ans = malloc (MAXPACKET);
-+ if (ans == NULL)
-+ ans = *ansp;
-+ else {
-+ anssiz = MAXPACKET;
-+ *anssizp = MAXPACKET;
-+ *ansp = ans;
-+ *anscp = ans;
-+ anhp = (HEADER *) ans;
-+ }
-+ }
-+ iov.iov_base = ans;
-+ iov.iov_len = anssiz;
-+ mhdr.msg_name = 0;
-+ mhdr.msg_namelen = 0;
-+ mhdr.msg_iov = &iov;
-+ mhdr.msg_iovlen = 1;
-+ mhdr.msg_control = cmsgbuf;
-+ mhdr.msg_controllen = sizeof(cmsgbuf);
-+ mhdr.msg_flags = 0;
-+ resplen = recvmsg(s, &mhdr, 0);
-+ if (resplen <= 0) {
-+ if (errno == EAGAIN)
-+ goto wait;
-+ Perror(statp, stderr, "recvfrom", errno);
-+wait2:
-+ close(s);
-+ if (i < j)
-+ memmove(pfd + i, pfd + i + 1, sizeof(*pfd) * (j - i));
-+ j--;
-+ goto wait;
-+ }
-+ cmsg = CMSG_FIRSTHDR(&mhdr);
-+ for (cmsg = CMSG_FIRSTHDR(&mhdr); cmsg; CMSG_NXTHDR(&mhdr, cmsg))
-+ if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_TTL)
-+ break;
-+ if (!cmsg) {
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; no TTL found\n"));
-+ goto wait2;
-+ }
-+ ttl = *(int *)CMSG_DATA(cmsg);
-+ if (ttl != 255) {
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; answer with bad TTL: %d \n", ttl));
-+ goto wait;
-+ }
-+ *gotsomewhere = 1;
-+ if (resplen < HFIXEDSZ) {
-+ /*
-+ * Undersized message.
-+ */
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; undersized: %d\n",
-+ resplen));
-+ *terrno = EMSGSIZE;
-+ goto wait;
-+ }
-+ if (hp->id != anhp->id) {
-+ /*
-+ * response from old query, ignore it.
-+ * XXX - potential security hazard could
-+ * be detected here.
-+ */
-+ DprintQ((statp->options & RES_DEBUG) ||
-+ (statp->pfcode & RES_PRF_REPLY),
-+ (stdout, ";; old answer:\n"),
-+ ans, (resplen > anssiz) ? anssiz : resplen);
-+ goto wait;
-+ }
-+ if (!(statp->options & RES_INSECURE2) &&
-+ !res_queriesmatch(buf, buf + buflen,
-+ ans, ans + anssiz)) {
-+ /*
-+ * response contains wrong query? ignore it.
-+ * XXX - potential security hazard could
-+ * be detected here.
-+ */
-+ DprintQ((statp->options & RES_DEBUG) ||
-+ (statp->pfcode & RES_PRF_REPLY),
-+ (stdout, ";; wrong query name:\n"),
-+ ans, (resplen > anssiz) ? anssiz : resplen);
-+ goto wait;
-+ }
-+ if (anhp->rcode == SERVFAIL ||
-+ anhp->rcode == NOTIMP ||
-+ anhp->rcode == REFUSED) {
-+ DprintQ(statp->options & RES_DEBUG,
-+ (stdout, "server rejected query:\n"),
-+ ans, (resplen > anssiz) ? anssiz : resplen);
-+ goto wait;
-+ }
-+ for (i = 0; i < j; i++)
-+ close(pfd[i].fd);
-+#if 0
-+ if (!(statp->options & RES_IGNTC) && anhp->tc) {
-+ /*
-+ * To get the rest of answer,
-+ * use TCP with same server.
-+ */
-+ Dprint(statp->options & RES_DEBUG,
-+ (stdout, ";; truncated answer\n"));
-+ *v_circuit = 1;
-+ res_nclose(statp);
-+ return (1);
-+ }
-+#endif
-+ /*
-+ * All is well, or the error is fatal. Signal that the
-+ * next nameserver ought not be tried.
-+ */
-+ return (resplen);
-+}
-+
- #ifdef DEBUG
- static void
- Aerror(const res_state statp, FILE *file, const char *string, int error,
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-add-missing-sgidefs_h.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-add-missing-sgidefs_h.patch
deleted file mode 100644
index f146679646f6..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-add-missing-sgidefs_h.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-2004-11-08 Richard Sandiford <rsandifo@redhat.com>
-
- * sysdeps/mips/sys/regdef.h: Include #include <sgidefs.h>
- * sysdeps/mips/sys/ucontext.h: Likewise.
-
-Index: sysdeps/mips/sys/regdef.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/mips/sys/regdef.h,v
-retrieving revision 1.4
-diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.4 regdef.h
---- sysdeps/mips/sys/regdef.h 9 Apr 2003 02:51:04 -0000 1.4
-+++ sysdeps/mips/sys/regdef.h 28 Oct 2004 12:57:20 -0000
-@@ -20,6 +20,8 @@
- #ifndef _SYS_REGDEF_H
- #define _SYS_REGDEF_H
-
-+#include <sgidefs.h>
-+
- /*
- * Symbolic register names for 32 bit ABI
- */
-Index: sysdeps/mips/sys/ucontext.h
-===================================================================
-RCS file: /cvs/glibc/libc/sysdeps/mips/sys/ucontext.h,v
-retrieving revision 1.4
-diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.4 ucontext.h
---- sysdeps/mips/sys/ucontext.h 17 Mar 2003 15:47:12 -0000 1.4
-+++ sysdeps/mips/sys/ucontext.h 28 Oct 2004 12:57:20 -0000
-@@ -23,6 +23,7 @@ #define _SYS_UCONTEXT_H 1
-
- #include <features.h>
- #include <signal.h>
-+#include <sgidefs.h>
-
- /* Type for general register. */
- #if _MIPS_SIM == _MIPS_SIM_ABI32
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-generate-syscall_h.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-generate-syscall_h.patch
deleted file mode 100644
index e9238f7e16a5..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-generate-syscall_h.patch
+++ /dev/null
@@ -1,254 +0,0 @@
---- sysdeps/unix/sysv/linux/mips/configure.in.orig 2004-09-29 23:49:30.000000000 -0400
-+++ sysdeps/unix/sysv/linux/mips/configure.in 2004-09-30 02:04:26.000000000 -0400
-@@ -19,50 +19,62 @@ mips*64*)
- AC_MSG_WARN([*** asm/unistd.h not found, it will not be pre-processed])
- echo '#include <asm/unistd.h>' > asm-unistd.h
- else
-- # The point of this preprocessing is to turn __NR_<syscall> into
-- # __NR_N64_<syscall>, as well as to define __NR_<syscall> to
-- # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined
-- # and <abi> is the compiler-enabled ABI.
-+ # There are two versions of this header. The older form defined
-+ # __NR_foo, __NR_N32_foo, and __NR_O32_foo. The new form defines
-+ # only __NR_foo, but does it based on the current ABI.
-+ # We want to have __NR_O32_foo, __NR_N64_foo, and __NR_N32_foo defined
-+ # always, and __NR_foo defined conditionally. Only the newer form is
-+ # supported.
- cat "$asm_unistd_h" |
-- sed -e 's,__NR_,__NR_N64_,g' \
-- -e 's,__NR_N64_##,__NR_##,g' \
-- -e 's,__NR_N64_O32_,__NR_O32_,g' \
-- -e 's,__NR_N64_N32_,__NR_N32_,g' \
-- -e 's,__NR_N64_N64_,__NR_N64_,g' \
-- | awk > asm-unistd.h '
-+ awk > asm-unistd.h '
- BEGIN { print "#include <sgidefs.h>"; }
--/^#define __NR.*unused/ { print; next; }
--/^#define __NR_N64__exit __NR_N64_exit/ {
-- print "#define __NR__exit __NR_exit";
-- print "#define __NR_O32__exit __NR_O32_exit";
-- print "#define __NR_N32__exit __NR_N32_exit";
-- print; next;
--}
--/^#define __NR_O32_/ {
-- name = $2;
-- sub (/_O32_/, "_", name);
-- print;
-+/^#if _MIPS_SIM == _MIPS_SIM_ABI32/,/^#endif.*_MIPS_SIM_ABI32/ {
-+ if (/^#define __NR_Linux/) { print; next; }
-+ if (/^#define __NR_/) {
-+ line = $0;
-+ gsub (/_NR_/, "_NR_O32_", line);
-+ print "#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */";
-+ print "";
-+ print line;
-+ print "";
- print "#if _MIPS_SIM == _MIPS_SIM_ABI32";
-- print "# define " name " " $2;
-- print "#endif";
-- next;
-+ print; next;
-+ }
-+ print; next;
- }
--/^#define __NR_N32_/ {
-- name = $2;
-- sub (/_N32_/, "_", name);
-- print;
-+/^#if _MIPS_SIM == _MIPS_SIM_NABI32/,/^#endif.*_MIPS_SIM_NABI32/ {
-+ if (/^#define __NR_Linux/) { print; next; }
-+ if (/^#define __NR_/) {
-+ line = $0;
-+ gsub (/_NR_/, "_NR_N32_", line);
-+ print "#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */";
-+ print "";
-+ print line;
-+ print "";
- print "#if _MIPS_SIM == _MIPS_SIM_NABI32";
-- print "# define " name " " $2;
-- print "#endif";
-- next;
-+ print; next;
-+ }
-+ print; next;
- }
--/^#define __NR_N64_/ {
-- name = $2;
-- sub (/_N64_/, "_", name);
-- print;
-+/^#if _MIPS_SIM == _MIPS_SIM_ABI64/,/^#endif.*_MIPS_SIM_ABI64/ {
-+ if (/^#define __NR_Linux/) { print; next; }
-+ if (/^#define __NR_/) {
-+ line = $0;
-+ gsub (/_NR_/, "_NR_N64_", line);
-+ print "#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */";
-+ print "";
-+ print line;
-+ print "";
- print "#if _MIPS_SIM == _MIPS_SIM_ABI64";
-- print "# define " name " " $2;
-- print "#endif";
-+ print; next;
-+ }
-+ print; next;
-+}
-+/^#define __NR_64_/ {
-+ line = $0;
-+ gsub (/_NR_64_/, "_NR_N64_", line);
-+ print;
-+ print line;
- next;
- }
- {
---- sysdeps/unix/sysv/linux/mips/configure.orig 2004-09-29 23:49:30.000000000 -0400
-+++ sysdeps/unix/sysv/linux/mips/configure 2004-09-30 02:06:58.000000000 -0400
-@@ -19,50 +19,62 @@ mips*64*)
- echo "$as_me: WARNING: *** asm/unistd.h not found, it will not be pre-processed" >&2;}
- echo '#include <asm/unistd.h>' > asm-unistd.h
- else
-- # The point of this preprocessing is to turn __NR_<syscall> into
-- # __NR_N64_<syscall>, as well as to define __NR_<syscall> to
-- # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined
-- # and <abi> is the compiler-enabled ABI.
-+ # There are two versions of this header. The older form defined
-+ # __NR_foo, __NR_N32_foo, and __NR_O32_foo. The new form defines
-+ # only __NR_foo, but does it based on the current ABI.
-+ # We want to have __NR_O32_foo, __NR_N64_foo, and __NR_N32_foo defined
-+ # always, and __NR_foo defined conditionally. Only the newer form is
-+ # supported.
- cat "$asm_unistd_h" |
-- sed -e 's,__NR_,__NR_N64_,g' \
-- -e 's,__NR_N64_##,__NR_##,g' \
-- -e 's,__NR_N64_O32_,__NR_O32_,g' \
-- -e 's,__NR_N64_N32_,__NR_N32_,g' \
-- -e 's,__NR_N64_N64_,__NR_N64_,g' \
-- | awk > asm-unistd.h '
-+ awk > asm-unistd.h '
- BEGIN { print "#include <sgidefs.h>"; }
--/^#define __NR.*unused/ { print; next; }
--/^#define __NR_N64__exit __NR_N64_exit/ {
-- print "#define __NR__exit __NR_exit";
-- print "#define __NR_O32__exit __NR_O32_exit";
-- print "#define __NR_N32__exit __NR_N32_exit";
-- print; next;
--}
--/^#define __NR_O32_/ {
-- name = $2;
-- sub (/_O32_/, "_", name);
-- print;
-+/^#if _MIPS_SIM == _MIPS_SIM_ABI32/,/^#endif.*_MIPS_SIM_ABI32/ {
-+ if (/^#define __NR_Linux/) { print; next; }
-+ if (/^#define __NR_/) {
-+ line = $0;
-+ gsub (/_NR_/, "_NR_O32_", line);
-+ print "#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */";
-+ print "";
-+ print line;
-+ print "";
- print "#if _MIPS_SIM == _MIPS_SIM_ABI32";
-- print "# define " name " " $2;
-- print "#endif";
-- next;
-+ print; next;
-+ }
-+ print; next;
- }
--/^#define __NR_N32_/ {
-- name = $2;
-- sub (/_N32_/, "_", name);
-- print;
-+/^#if _MIPS_SIM == _MIPS_SIM_NABI32/,/^#endif.*_MIPS_SIM_NABI32/ {
-+ if (/^#define __NR_Linux/) { print; next; }
-+ if (/^#define __NR_/) {
-+ line = $0;
-+ gsub (/_NR_/, "_NR_N32_", line);
-+ print "#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */";
-+ print "";
-+ print line;
-+ print "";
- print "#if _MIPS_SIM == _MIPS_SIM_NABI32";
-- print "# define " name " " $2;
-- print "#endif";
-- next;
-+ print; next;
-+ }
-+ print; next;
- }
--/^#define __NR_N64_/ {
-- name = $2;
-- sub (/_N64_/, "_", name);
-- print;
-+/^#if _MIPS_SIM == _MIPS_SIM_ABI64/,/^#endif.*_MIPS_SIM_ABI64/ {
-+ if (/^#define __NR_Linux/) { print; next; }
-+ if (/^#define __NR_/) {
-+ line = $0;
-+ gsub (/_NR_/, "_NR_N64_", line);
-+ print "#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */";
-+ print "";
-+ print line;
-+ print "";
- print "#if _MIPS_SIM == _MIPS_SIM_ABI64";
-- print "# define " name " " $2;
-- print "#endif";
-+ print; next;
-+ }
-+ print; next;
-+}
-+/^#define __NR_64_/ {
-+ line = $0;
-+ gsub (/_NR_64_/, "_NR_N64_", line);
-+ print;
-+ print line;
- next;
- }
- {
---- sysdeps/unix/sysv/linux/mips/Makefile.orig 2004-09-29 23:49:30.000000000 -0400
-+++ sysdeps/unix/sysv/linux/mips/Makefile 2004-09-30 02:12:30.000000000 -0400
-@@ -12,7 +12,7 @@ no_syscall_list_h = 1
- # Generate the list of SYS_* macros for the system calls (__NR_* macros).
- # We generate not only SYS_<syscall>, pointing at SYS_<abi>_<syscall> if
- # it exists, but also define SYS_<abi>_<syscall> for all ABIs.
--$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/mips/sys/syscall.h
-+$(objpfx)syscall-list.h $(objpfx)syscall-list.d: $(common-objpfx)asm-unistd.h
- $(make-target-directory)
- { \
- echo '/* Generated at libc build time from kernel syscall list. */';\
-@@ -22,35 +22,9 @@ $(objpfx)syscall-%.h $(objpfx)syscall-%.
- echo '#endif'; \
- echo ''; \
- echo '#include <sgidefs.h>'; \
-- rm -f $(@:.d=.h).newt; \
-- $(CC) -E -MD -MP -MF $(@:.h=.d)-t -MT '$(@:.d=.h) $(@:.h=.d)' \
-- -x c $(+includes) $(sysincludes) $< -D_LIBC -dM | \
-- sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' \
-- > $(@:.d=.h).newt; \
-- if grep SYS_O32_ $(@:.d=.h).newt > /dev/null; then \
-- echo '#if _MIPS_SIM == _MIPS_SIM_NABI32'; \
-- sed -n 's/^\(#define SYS_\)N32_/\1/p' < $(@:.d=.h).newt | \
-- LC_ALL=C sort; \
-- echo '#elif _MIPS_SIM == _MIPS_SIM_ABI64'; \
-- sed -n 's/^\(#define SYS_\)N64_/\1/p' < $(@:.d=.h).newt | \
-- LC_ALL=C sort; \
-- echo '#else'; \
-- sed -n 's/^\(#define SYS_\)O32_/\1/p' < $(@:.d=.h).newt | \
-- LC_ALL=C sort; \
-- echo '#endif'; \
-- sed -n '/^#define SYS_\([ON]32\|N64\)_/p' < $(@:.d=.h).newt | \
-- LC_ALL=C sort +1.8; \
-- else \
-- cat $(@:.d=.h).newt; \
-- fi; \
-- rm $(@:.d=.h).newt; \
-+ grep -E '^#.*(MIPS_SIM|__NR)' $(common-objpfx)asm-unistd.h \
-+ | sed 's/__NR_/SYS_/g' ; \
- } > $(@:.d=.h).new
- mv -f $(@:.d=.h).new $(@:.d=.h)
--ifneq (,$(objpfx))
-- sed $(sed-remove-objpfx) $(@:.h=.d)-t > $(@:.h=.d)-t2
-- rm -f $(@:.h=.d)-t
-- mv -f $(@:.h=.d)-t2 $(@:.h=.d)
--else
-- mv -f $(@:.h=.d)-t $(@:.h=.d)
--endif
-+ echo > $(@:.h=.d)
- endif
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-prot_grows-undefined.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-prot_grows-undefined.patch
deleted file mode 100644
index cba618ca44b8..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-prot_grows-undefined.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-2004-10-18 Maciej W. Rozycki <macro@mips.com>
-
- * sysdeps/unix/sysv/linux/mips/bits/mman.h (PROT_GROWSDOWN):
- Define.
- (PROT_GROWSUP): Likewise.
-
- Please apply.
-
- Maciej
-
-glibc-2.3.3-20041018-mips-prot_grows-1
-diff -up --recursive --new-file glibc-2.3.3-20041018.macro/sysdeps/unix/sysv/linux/mips/bits/mman.h glibc-2.3.3-20041018/sysdeps/unix/sysv/linux/mips/bits/mman.h
---- glibc-2.3.3-20041018.macro/sysdeps/unix/sysv/linux/mips/bits/mman.h Sat Mar 8 03:26:00 2003
-+++ glibc-2.3.3-20041018/sysdeps/unix/sysv/linux/mips/bits/mman.h Mon Oct 18 14:48:57 2004
-@@ -1,5 +1,5 @@
- /* Definitions for POSIX memory map interface. Linux/MIPS version.
-- Copyright (C) 1997, 2000, 2003 Free Software Foundation, Inc.
-+ Copyright (C) 1997, 2000, 2003, 2004 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
-@@ -34,6 +34,10 @@
- #define PROT_WRITE 0x2 /* Page can be written. */
- #define PROT_EXEC 0x4 /* Page can be executed. */
- #define PROT_NONE 0x0 /* Page can not be accessed. */
-+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
-+ growsdown vma (mprotect only). */
-+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
-+ growsup vma (mprotect only). */
-
- /* Sharing types (must choose one and only one of these). */
- #define MAP_SHARED 0x01 /* Share changes. */
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-rtld_deepbind-undefined.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-rtld_deepbind-undefined.patch
deleted file mode 100644
index 16080393025d..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-rtld_deepbind-undefined.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-2004-10-18 Maciej W. Rozycki <macro@mips.com>
-
- * sysdeps/mips/bits/dlfcn.h (RTLD_DEEPBIND): Define.
-
- Please apply.
-
- Maciej
-
-glibc-2.3.3-20041018-mips-rtld_deepbind-2.patch
-diff -up --recursive --new-file glibc-2.3.3-20041018.macro/sysdeps/mips/bits/dlfcn.h glibc-2.3.3-20041018/sysdeps/mips/bits/dlfcn.h
---- glibc-2.3.3-20041018.macro/sysdeps/mips/bits/dlfcn.h Sat Oct 27 02:25:51 2001
-+++ glibc-2.3.3-20041018/sysdeps/mips/bits/dlfcn.h Mon Oct 18 16:21:44 2004
-@@ -1,5 +1,6 @@
- /* System dependent definitions for run-time dynamic loading.
-- Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
-+ Copyright (C) 1996, 1997, 1999, 2000, 2001, 2004
-+ 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
-@@ -24,8 +25,9 @@
- /* The MODE argument to `dlopen' contains one of the following: */
- #define RTLD_LAZY 0x0001 /* Lazy function call binding. */
- #define RTLD_NOW 0x0002 /* Immediate function call binding. */
--#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
-+#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
- #define RTLD_NOLOAD 0x00008 /* Do not load the object. */
-+#define RTLD_DEEPBIND 0x00010 /* Use deep binding. */
-
- /* If the following bit is set in the MODE argument to `dlopen',
- the symbols of the loaded object and its dependencies are made
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-sysdep-cancel.diff b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-sysdep-cancel.diff
deleted file mode 100644
index 0e70b8ddf1ad..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-sysdep-cancel.diff
+++ /dev/null
@@ -1,54 +0,0 @@
-Index: linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
-===================================================================
-RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h,v
-retrieving revision 1.2
-diff -u -r1.2 sysdep-cancel.h
---- linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h 28 Jul 2003 18:45:37 -0000 1.2
-+++ linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h 1 Jun 2004 17:19:08 -0000
-@@ -27,9 +27,6 @@
- #ifdef __PIC__
- # undef PSEUDO
- # define PSEUDO(name, syscall_name, args) \
-- .align 2; \
-- 99: la t9,__syscall_error; \
-- jr t9; \
- ENTRY (name) \
- .set noreorder; \
- .cpload t9; \
-@@ -44,25 +41,25 @@
- ret; \
- L(pseudo_cancel): \
- SAVESTK_##args; \
-- sw ra, 28(sp); \
-- sw gp, 32(sp); \
-+ sw gp, 28(sp); \
-+ sw ra, 32(sp); \
- PUSHARGS_##args; /* save syscall args */ \
- CENABLE; \
-- lw gp, 32(sp); \
-- sw v0, 44(sp); /* save mask */ \
-+ lw gp, 28(sp); \
-+ sw v0, 36(sp); /* save mask */ \
- POPARGS_##args; /* restore syscall args */ \
- .set noreorder; \
- li v0, SYS_ify (syscall_name); \
- syscall; \
- .set reorder; \
-- sw v0, 36(sp); /* save syscall result */ \
-- sw a3, 40(sp); /* save syscall error flag */ \
-- lw a0, 44(sp); /* pass mask as arg1 */ \
-+ sw v0, 40(sp); /* save syscall result */ \
-+ sw a3, 44(sp); /* save syscall error flag */ \
-+ lw a0, 36(sp); /* pass mask as arg1 */ \
- CDISABLE; \
-- lw gp, 32(sp); \
-- lw v0, 36(sp); /* restore syscall result */ \
-- lw a3, 40(sp); /* restore syscall error flag */ \
-- lw ra, 28(sp); /* restore return address */ \
-+ lw gp, 28(sp); \
-+ lw v0, 40(sp); /* restore syscall result */ \
-+ lw a3, 44(sp); /* restore syscall error flag */ \
-+ lw ra, 32(sp); /* restore return address */ \
- RESTORESTK; \
- bne a3, zero, SYSCALL_ERROR_LABEL; \
- L(pseudo_end):
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-update-__throw.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-update-__throw.patch
deleted file mode 100644
index a2c14886c13c..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-mips-update-__throw.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-2004-10-18 Maciej W. Rozycki <macro@mips.com>
-
- * sysdeps/unix/sysv/linux/mips/bits/socket.h (__cmsg_nxthdr): Use
- __NTH instead of __THROW in the inline definition.
- * sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set):
- Likewise.
-
- Please apply.
-
- Maciej
-
-glibc-2.3.3-20041018-mips-nth-1.patch
-diff -up --recursive --new-file glibc-2.3.3-20041018.macro/sysdeps/unix/sysv/linux/mips/bits/socket.h glibc-2.3.3-20041018/sysdeps/unix/sysv/linux/mips/bits/socket.h
---- glibc-2.3.3-20041018.macro/sysdeps/unix/sysv/linux/mips/bits/socket.h Thu Sep 27 02:25:58 2001
-+++ glibc-2.3.3-20041018/sysdeps/unix/sysv/linux/mips/bits/socket.h Mon Oct 18 13:12:39 2004
-@@ -1,5 +1,6 @@
- /* System-specific socket constants and types. Linux/MIPS version.
-- Copyright (C) 1991,92,1994-1999,2000,2001 Free Software Foundation, Inc.
-+ Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004
-+ 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
-@@ -261,7 +262,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
- # define _EXTERN_INLINE extern __inline
- # endif
- _EXTERN_INLINE struct cmsghdr *
--__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
-+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
- {
- if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
- /* The kernel header does this so there may be a reason. */
-diff -up --recursive --new-file glibc-2.3.3-20041018.macro/sysdeps/unix/sysv/linux/mips/sys/tas.h glibc-2.3.3-20041018/sysdeps/unix/sysv/linux/mips/sys/tas.h
---- glibc-2.3.3-20041018.macro/sysdeps/unix/sysv/linux/mips/sys/tas.h Wed Jul 21 01:26:43 2004
-+++ glibc-2.3.3-20041018/sysdeps/unix/sysv/linux/mips/sys/tas.h Mon Oct 18 11:18:56 2004
-@@ -35,7 +35,7 @@ extern int _test_and_set (int *p, int v)
- # endif
-
- _EXTERN_INLINE int
--_test_and_set (int *p, int v) __THROW
-+__NTH (_test_and_set (int *p, int v))
- {
- int r, t;
-
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-altivec.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-altivec.patch
deleted file mode 100644
index 8ddc8afdd165..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-altivec.patch
+++ /dev/null
@@ -1,229 +0,0 @@
-diff -urN libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
---- libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S 2004-05-28 16:19:18.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S 2004-06-14 19:28:43.131988368 -0500
-@@ -187,8 +187,8 @@
- addi r9,r9,32
-
- stvx v18,0,r10
-- stvx v11,0,r9
-- addi r19,r10,32
-+ stvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- stvx v20,0,r10
-@@ -221,11 +221,6 @@
- addi r10,r10,32
- addi r9,r9,32
-
-- stvx v10,0,r10
-- stvx v11,0,r9
-- addi r10,r10,32
-- addi r9,r9,32
--
- mfvscr v0
- mfspr r0,VRSAVE
- stvx v0,0,r10
-diff -urN libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
---- libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S 2004-05-28 16:19:18.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S 2004-06-14 19:36:33.639954472 -0500
-@@ -133,8 +133,8 @@
- addi r9,r9,32
-
- lvx v18,0,r10
-- lvx v11,0,r9
-- addi r19,r10,32
-+ lvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- lvx v20,0,r10
-diff -urN libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
---- libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S 2004-05-28 16:19:18.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S 2004-06-14 19:39:49.580990280 -0500
-@@ -189,8 +189,8 @@
- addi r9,r9,32
-
- stvx v18,0,r10
-- stvx v11,0,r9
-- addi r19,r10,32
-+ stvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- stvx v20,0,r10
-@@ -223,11 +223,6 @@
- addi r10,r10,32
- addi r9,r9,32
-
-- stvx v10,0,r10
-- stvx v11,0,r9
-- addi r10,r10,32
-- addi r9,r9,32
--
- mfvscr v0
- mfspr r0,VRSAVE
- stvx v0,0,r10
-@@ -339,8 +334,8 @@
- addi r9,r9,32
-
- lvx v18,0,r10
-- lvx v11,0,r9
-- addi r19,r10,32
-+ lvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- lvx v20,0,r10
-diff -urN libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
---- libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S 2004-05-28 16:19:18.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S 2004-06-14 19:27:34.406052600 -0500
-@@ -268,21 +268,22 @@
- stfd fp0,(SIGCONTEXT_FP_REGS+(32*8))(r3)
-
- ld r5,.LC__dl_hwcap@toc(r2)
-- li r10,0
- # ifdef SHARED
- /* Load _rtld-global._dl_hwcap. */
- ld r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
- # else
- ld r5,0(r5) /* Load extern _dl_hwcap. */
--# endif
-- andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-- beq L(has_no_vec)
--
-+# endif
- la r10,(SIGCONTEXT_V_RESERVE+8)(r3)
- la r9,(SIGCONTEXT_V_RESERVE+24)(r3)
-+
-+ andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-+
- clrrdi r10,r10,4
-+ beq L(has_no_vec)
- clrrdi r9,r9,4
--
-+ mr r5,r10 /* Capture *v_regs value in r5. */
-+
- stvx v0,0,r10
- stvx v1,0,r9
- addi r10,r10,32
-@@ -329,8 +330,8 @@
- addi r9,r9,32
-
- stvx v18,0,r10
-- stvx v11,0,r9
-- addi r19,r10,32
-+ stvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- stvx v20,0,r10
-@@ -363,11 +364,6 @@
- addi r10,r10,32
- addi r9,r9,32
-
-- stvx v10,0,r10
-- stvx v11,0,r9
-- addi r10,r10,32
-- addi r9,r9,32
--
- mfvscr v0
- mfspr r0,VRSAVE
- stvx v0,0,r10
-@@ -378,7 +374,7 @@
- Store either a NULL or a quadword aligned pointer to the Vector register
- array into *v_regs.
- */
-- std r10,(SIGCONTEXT_V_REGS_PTR)(r3)
-+ std r5,(SIGCONTEXT_V_REGS_PTR)(r3)
-
- addi r5,r3,UCONTEXT_SIGMASK
- li r4,0
-diff -urN libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
---- libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S 2004-05-28 16:19:18.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S 2004-06-09 11:28:37.000000000 -0500
-@@ -293,8 +293,8 @@
- addi r9,r9,32
-
- lvx v18,0,r10
-- lvx v11,0,r9
-- addi r19,r10,32
-+ lvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- lvx v20,0,r10
-diff -urN libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S libc23/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
---- libc23-cvstip-20040607/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S 2004-05-28 16:19:18.000000000 -0500
-+++ libc23/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S 2004-06-14 19:28:05.164035488 -0500
-@@ -391,20 +391,22 @@
- stfd fp0,(SIGCONTEXT_FP_REGS+(32*8))(r3)
-
- ld r8,.LC__dl_hwcap@toc(r2)
-- li r10,0
- #ifdef SHARED
- /* Load _rtld-global._dl_hwcap. */
- ld r8,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r8)
- #else
- ld r8,0(r8) /* Load extern _dl_hwcap. */
- #endif
-- andis. r8,r8,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-- beq L(has_no_vec)
--
- la r10,(SIGCONTEXT_V_RESERVE+8)(r3)
- la r9,(SIGCONTEXT_V_RESERVE+24)(r3)
-+
-+ andis. r8,r8,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-+
- clrrdi r10,r10,4
-+ beq L(has_no_vec)
-+
- clrrdi r9,r9,4
-+ mr r8,r10 /* Capture *v_regs value in r5. */
-
- stvx v0,0,r10
- stvx v1,0,r9
-@@ -452,8 +454,8 @@
- addi r9,r9,32
-
- stvx v18,0,r10
-- stvx v11,0,r9
-- addi r19,r10,32
-+ stvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- stvx v20,0,r10
-@@ -486,11 +488,6 @@
- addi r10,r10,32
- addi r9,r9,32
-
-- stvx v10,0,r10
-- stvx v11,0,r9
-- addi r10,r10,32
-- addi r9,r9,32
--
- mfvscr v0
- mfspr r0,VRSAVE
- stvx v0,0,r10
-@@ -501,7 +498,7 @@
- Store either a NULL or a quadword aligned pointer to the Vector register
- array into *v_regs.
- */
-- std r10,(SIGCONTEXT_V_REGS_PTR)(r3)
-+ std r8,(SIGCONTEXT_V_REGS_PTR)(r3)
-
- mr r31,r4
- addi r5,r3,UCONTEXT_SIGMASK
-@@ -596,8 +593,8 @@
- addi r9,r9,32
-
- lvx v18,0,r10
-- lvx v11,0,r9
-- addi r19,r10,32
-+ lvx v19,0,r9
-+ addi r10,r10,32
- addi r9,r9,32
-
- lvx v20,0,r10
-
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch
deleted file mode 100644
index 755169014248..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch
+++ /dev/null
@@ -1,96 +0,0 @@
---- glibc-2.3.3.old/nptl/sysdeps/pthread/pthread.h 2004-09-21 19:52:49.003553536 +0000
-+++ glibc-2.3.3/nptl/sysdeps/pthread/pthread.h 2004-09-21 19:55:01.582398488 +0000
-@@ -27,6 +27,7 @@
- #include <signal.h>
- #include <bits/pthreadtypes.h>
- #include <bits/setjmp.h>
-+#include <bits/wordsize.h>
-
-
- /* Detach state. */
-@@ -63,17 +64,26 @@
- #define PTHREAD_MUTEX_INITIALIZER \
- { }
- #ifdef __USE_GNU
--# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-- { .__data = { .__kind = PTHREAD_MUTEX_RECURSIVE_NP } }
--# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-- { .__data = { .__kind = PTHREAD_MUTEX_ERRORCHECK_NP } }
--# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-- { .__data = { .__kind = PTHREAD_MUTEX_ADAPTIVE_NP } }
-+# if __WORDSIZE == 64
-+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-+ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
-+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
-+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
-+# else
-+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-+ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
-+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-+ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
-+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-+ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
-+# endif
- #endif
-
-
- /* Read-write lock types. */
--#ifdef __USE_UNIX98
-+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
- enum
- {
- PTHREAD_RWLOCK_PREFER_READER_NP,
-@@ -81,15 +91,21 @@
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
- PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
- };
--#endif /* Unix98 */
-
- /* Read-write lock initializers. */
--#define PTHREAD_RWLOCK_INITIALIZER \
-+# define PTHREAD_RWLOCK_INITIALIZER \
- { }
--#ifdef __USE_GNU
--# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
-- { .__data = { .__flags = PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
--#endif
-+# ifdef __USE_GNU
-+# if __WORDSIZE == 64
-+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
-+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
-+# else
-+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
-+ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
-+# endif
-+# endif
-+#endif /* Unix98 or XOpen2K */
-
-
- /* Scheduler inheritance. */
-@@ -390,9 +406,12 @@
- /* Guarantee that the initialization function INIT_ROUTINE will be called
- only once, even if pthread_once is executed several times with the
- same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
-- extern variable initialized to PTHREAD_ONCE_INIT. */
-+ extern variable initialized to PTHREAD_ONCE_INIT.
-+
-+ The initialization functions might throw exception which is why
-+ this function is not marked with __THROW. */
- extern int pthread_once (pthread_once_t *__once_control,
-- void (*__init_routine) (void)) __THROW;
-+ void (*__init_routine) (void));
-
-
- /* Functions for handling cancellation.
-@@ -699,7 +718,7 @@
- #endif
-
-
--#ifdef __USE_UNIX98
-+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
- /* Functions for handling read-write locks. */
-
- /* Initialize read-write lock RWLOCK using attributes ATTR, or use
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-res_init.patch b/sys-libs/glibc/files/2.3.4/glibc-2.3.4-res_init.patch
deleted file mode 100644
index fa907de4d3b7..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4-res_init.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-2004-08-12 H.J. Lu <hongjiu.lu@intel.com>
-
- * resolv/res_libc.c: Move definition of __res_maybe_init ...
- * resolv/res_init.c: ... here.
-
-2004-08-11 Andreas Schwab <schwab@suse.de>
-
- * resolv/res_libc.c: Move definition of __res_initstamp ...
- * resolv/res_init.c: ... here.
-
---- resolv/res_init.c.res_init 2004-08-11 14:23:06.000000000 -0700
-+++ resolv/res_init.c 2004-08-12 16:29:09.000000000 -0700
-@@ -106,6 +106,10 @@ static u_int32_t net_mask __P((struct in
- # define isascii(c) (!(c & 0200))
- #endif
-
-+#ifdef _LIBC
-+unsigned long long int __res_initstamp attribute_hidden;
-+#endif
-+
- /*
- * Resolver state default settings.
- */
-@@ -162,7 +166,6 @@ __res_vinit(res_state statp, int preinit
- int dots;
- #endif
- #ifdef _LIBC
-- extern unsigned long long int __res_initstamp attribute_hidden;
- statp->_u._ext.initstamp = __res_initstamp;
- #endif
-
-@@ -574,6 +577,39 @@ libc_hidden_def (__res_nclose)
- #endif
-
- #ifdef _LIBC
-+/* Initialize resp if RES_INIT is not yet set or if res_init in some other
-+ thread requested re-initializing. */
-+int
-+__res_maybe_init (res_state resp, int preinit)
-+{
-+ if (resp->options & RES_INIT) {
-+ if (__res_initstamp != resp->_u._ext.initstamp) {
-+ if (resp->nscount > 0) {
-+ __res_nclose (resp);
-+ for (int ns = 0; ns < MAXNS; ns++) {
-+ free (resp->_u._ext.nsaddrs[ns]);
-+ resp->_u._ext.nsaddrs[ns] = NULL;
-+ }
-+ return __res_vinit (resp, 1);
-+ }
-+ }
-+ return 0;
-+ } else if (preinit) {
-+ if (!resp->retrans)
-+ resp->retrans = RES_TIMEOUT;
-+ if (!resp->retry)
-+ resp->retry = 4;
-+ resp->options = RES_DEFAULT;
-+ if (!resp->id)
-+ resp->id = res_randomid ();
-+ return __res_vinit (resp, 1);
-+ } else
-+ return __res_ninit (resp);
-+}
-+libc_hidden_def (__res_maybe_init)
-+#endif
-+
-+#ifdef _LIBC
- # ifdef _LIBC_REENTRANT
- /* This is called when a thread is exiting to free resources held in _res. */
- static void __attribute__ ((section ("__libc_thread_freeres_fn")))
---- resolv/res_libc.c.res_init 2004-08-11 14:23:06.000000000 -0700
-+++ resolv/res_libc.c 2004-08-12 16:28:00.000000000 -0700
-@@ -28,7 +28,7 @@
- out) since res_init() should go into libc.so but the rest of that
- file should not. */
-
--unsigned long long int __res_initstamp attribute_hidden;
-+extern unsigned long long int __res_initstamp attribute_hidden;
- /* We have atomic increment operations on 64-bit platforms. */
- #if __WORDSIZE == 64
- # define atomicinclock(lock) (void) 0
-@@ -94,37 +94,6 @@ res_init(void) {
-
- return (__res_vinit(&_res, 1));
- }
--
--/* Initialize resp if RES_INIT is not yet set or if res_init in some other
-- thread requested re-initializing. */
--int
--__res_maybe_init (res_state resp, int preinit)
--{
-- if (resp->options & RES_INIT) {
-- if (__res_initstamp != resp->_u._ext.initstamp) {
-- if (resp->nscount > 0) {
-- __res_nclose (resp);
-- for (int ns = 0; ns < MAXNS; ns++) {
-- free (resp->_u._ext.nsaddrs[ns]);
-- resp->_u._ext.nsaddrs[ns] = NULL;
-- }
-- return __res_vinit (resp, 1);
-- }
-- }
-- return 0;
-- } else if (preinit) {
-- if (!resp->retrans)
-- resp->retrans = RES_TIMEOUT;
-- if (!resp->retry)
-- resp->retry = 4;
-- resp->options = RES_DEFAULT;
-- if (!resp->id)
-- resp->id = res_randomid ();
-- return __res_vinit (resp, 1);
-- } else
-- return __res_ninit (resp);
--}
--libc_hidden_def (__res_maybe_init)
-
- /* This needs to be after the use of _res in res_init, above. */
- #undef _res
diff --git a/sys-libs/glibc/files/2.3.4/glibc-2.3.4.20040808-i386-got-fix.diff b/sys-libs/glibc/files/2.3.4/glibc-2.3.4.20040808-i386-got-fix.diff
deleted file mode 100644
index ea9a99ebe21a..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-2.3.4.20040808-i386-got-fix.diff
+++ /dev/null
@@ -1,129 +0,0 @@
---- sysdeps/i386/elf/start.S.orig 1969-12-31 19:00:00.000000000 -0500
-+++ sysdeps/i386/elf/start.S 2004-08-08 10:07:01.718652784 -0400
-@@ -0,0 +1,126 @@
-+/* Startup code compliant to the ELF i386 ABI.
-+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
-+ 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. */
-+
-+/* This is the canonical entry point, usually the first thing in the text
-+ segment. The SVR4/i386 ABI (pages 3-31, 3-32) says that when the entry
-+ point runs, most registers' values are unspecified, except for:
-+
-+ %edx Contains a function pointer to be registered with `atexit'.
-+ This is how the dynamic linker arranges to have DT_FINI
-+ functions called for shared libraries that have been loaded
-+ before this code runs.
-+
-+ %esp The stack contains the arguments and environment:
-+ 0(%esp) argc
-+ 4(%esp) argv[0]
-+ ...
-+ (4*argc)(%esp) NULL
-+ (4*(argc+1))(%esp) envp[0]
-+ ...
-+ NULL
-+*/
-+
-+#include "bp-sym.h"
-+
-+ .text
-+ .globl _start
-+ .type _start,@function
-+_start:
-+ /* Clear the frame pointer. The ABI suggests this be done, to mark
-+ the outermost frame obviously. */
-+ xorl %ebp, %ebp
-+
-+ /* Extract the arguments as encoded on the stack and set up
-+ the arguments for `main': argc, argv. envp will be determined
-+ later in __libc_start_main. */
-+ popl %esi /* Pop the argument count. */
-+ movl %esp, %ecx /* argv starts just at the current stack top.*/
-+
-+ /* Before pushing the arguments align the stack to a 16-byte
-+ (SSE needs 16-byte alignment) boundary to avoid penalties from
-+ misaligned accesses. Thanks to Edward Seidl <seidl@janed.com>
-+ for pointing this out. */
-+ andl $0xfffffff0, %esp
-+ pushl %eax /* Push garbage because we allocate
-+ 28 more bytes. */
-+
-+ /* Provide the highest stack address to the user code (for stacks
-+ which grow downwards). */
-+ pushl %esp
-+
-+ pushl %edx /* Push address of the shared library
-+ termination function. */
-+
-+#ifdef SHARED
-+ /* Load PIC register. */
-+ call 1f
-+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
-+
-+ /* Push address of our own entry points to .fini and .init. */
-+ leal __libc_csu_fini@GOTOFF(%ebx), %eax
-+ pushl %eax
-+ leal __libc_csu_init@GOTOFF(%ebx), %eax
-+ pushl %eax
-+
-+ pushl %ecx /* Push second argument: argv. */
-+ pushl %esi /* Push first argument: argc. */
-+
-+ pushl BP_SYM (main)@GOT(%ebx)
-+
-+ /* Call the user's main function, and exit with its value.
-+ But let the libc call main. */
-+ call BP_SYM (__libc_start_main)@PLT
-+#else
-+ /* Push address of our own entry points to .fini and .init. */
-+ pushl $__libc_csu_fini
-+ pushl $__libc_csu_init
-+
-+ pushl %ecx /* Push second argument: argv. */
-+ pushl %esi /* Push first argument: argc. */
-+
-+ pushl $BP_SYM (main)
-+
-+ /* Call the user's main function, and exit with its value.
-+ But let the libc call main. */
-+ call BP_SYM (__libc_start_main)
-+#endif
-+
-+ hlt /* Crash if somehow `exit' does return. */
-+
-+#ifdef SHARED
-+1: movl (%esp), %ebx
-+ ret
-+#endif
-+
-+/* To fulfill the System V/i386 ABI we need this symbol. Yuck, it's so
-+ meaningless since we don't support machines < 80386. */
-+ .section .rodata
-+ .globl _fp_hw
-+_fp_hw: .long 3
-+ .size _fp_hw, 4
-+ .type _fp_hw,@object
-+
-+/* Define a symbol for the first piece of initialized data. */
-+ .data
-+ .globl __data_start
-+__data_start:
-+ .long 0
-+ .weak data_start
-+ data_start = __data_start
diff --git a/sys-libs/glibc/files/2.3.4/glibc-gentoo-libdir.patch b/sys-libs/glibc/files/2.3.4/glibc-gentoo-libdir.patch
deleted file mode 100644
index 01f414bb1255..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-gentoo-libdir.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -Nru glibc-2.3.3.old/sysdeps/unix/sysv/linux/configure glibc-2.3.3/sysdeps/unix/sysv/linux/configure
---- glibc-2.3.3.old/sysdeps/unix/sysv/linux/configure 2004-09-06 12:33:39.320387104 -0400
-+++ glibc-2.3.3/sysdeps/unix/sysv/linux/configure 2004-09-06 12:34:42.575770824 -0400
-@@ -224,29 +224,13 @@
- # in /lib and /etc.
- case "$prefix" in
- /usr | /usr/)
-- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
-- case $machine in
-- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
-- mips/mips64/n64/* )
-- libc_cv_slibdir="/lib64"
-+ libc_cv_slibdir="/@GENTOO_LIBDIR@"
- if test "$libdir" = '${exec_prefix}/lib'; then
-- libdir='${exec_prefix}/lib64';
-+ libdir='${exec_prefix}/@GENTOO_LIBDIR@'
- # Locale data can be shared between 32bit and 64bit libraries
- libc_cv_localedir='${exec_prefix}/lib/locale'
- fi
-- ;;
-- mips/mips64/n32/* )
-- libc_cv_slibdir="/lib32"
-- if test "$libdir" = '${exec_prefix}/lib'; then
-- libdir='${exec_prefix}/lib32';
-- # Locale data can be shared between 32bit and 64bit libraries
-- libc_cv_localedir='${exec_prefix}/lib/locale'
-- fi
-- ;;
-- *)
-- libc_cv_slibdir="/lib"
-- ;;
-- esac
-+
- # Allow the user to override the path with --sysconfdir
- if test $sysconfdir = '${prefix}/etc'; then
- libc_cv_sysconfdir=/etc
diff --git a/sys-libs/glibc/files/2.3.4/glibc-sec-hotfix-20040916.patch b/sys-libs/glibc/files/2.3.4/glibc-sec-hotfix-20040916.patch
deleted file mode 100644
index 3858a0f9c9d1..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc-sec-hotfix-20040916.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff -Nru glibc-2.3.3.old/elf/rtld.c glibc-2.3.3/elf/rtld.c
---- glibc-2.3.3.old/elf/rtld.c 2004-09-16 15:02:16.000000000 -0400
-+++ glibc-2.3.3/elf/rtld.c 2004-09-16 15:04:58.000000000 -0400
-@@ -2041,6 +2041,30 @@
- GLRO(dl_profile_output)
- = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0];
-
-+ /* Extra security for SUID binaries. Remove all dangerous environment
-+ variables. */
-+ if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
-+ {
-+ static const char unsecure_envvars[] =
-+#ifdef EXTRA_UNSECURE_ENVVARS
-+ EXTRA_UNSECURE_ENVVARS
-+#endif
-+ UNSECURE_ENVVARS;
-+ const char *nextp;
-+
-+ nextp = unsecure_envvars;
-+ do
-+ {
-+ unsetenv (nextp);
-+ /* We could use rawmemchr but this need not be fast. */
-+ nextp = (char *) (strchr) (nextp, '\0') + 1;
-+ }
-+ while (*nextp != '\0');
-+
-+ if (__access ("/etc/suid-debug", F_OK) != 0)
-+ unsetenv ("MALLOC_CHECK_");
-+ }
-+
- while ((envline = _dl_next_ld_env_entry (&runp)) != NULL)
- {
- size_t len = 0;
-@@ -2188,33 +2212,10 @@
- /* The caller wants this information. */
- *modep = mode;
-
-- /* Extra security for SUID binaries. Remove all dangerous environment
-- variables. */
-- if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
-- {
-- static const char unsecure_envvars[] =
--#ifdef EXTRA_UNSECURE_ENVVARS
-- EXTRA_UNSECURE_ENVVARS
--#endif
-- UNSECURE_ENVVARS;
-- const char *nextp;
--
-- nextp = unsecure_envvars;
-- do
-- {
-- unsetenv (nextp);
-- /* We could use rawmemchr but this need not be fast. */
-- nextp = (char *) (strchr) (nextp, '\0') + 1;
-- }
-- while (*nextp != '\0');
--
-- if (__access ("/etc/suid-debug", F_OK) != 0)
-- unsetenv ("MALLOC_CHECK_");
-- }
- /* If we have to run the dynamic linker in debugging mode and the
- LD_DEBUG_OUTPUT environment variable is given, we write the debug
- messages to this file. */
-- else if (any_debug && debug_output != NULL)
-+ if (any_debug && debug_output != NULL)
- {
- #ifdef O_NOFOLLOW
- const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW;
-diff -Nru glibc-2.3.3.old/malloc/malloc.c glibc-2.3.3/malloc/malloc.c
---- glibc-2.3.3.old/malloc/malloc.c 2004-09-16 15:03:22.000000000 -0400
-+++ glibc-2.3.3/malloc/malloc.c 2004-09-16 15:04:58.000000000 -0400
-@@ -321,6 +321,10 @@
- #define assert(x) ((void)0)
- #endif
-
-+#include <abort-instr.h>
-+#ifndef ABORT_INSTRUCTION
-+#define ABORT_INSTRUCTION
-+#endif
-
- /*
- INTERNAL_SIZE_T is the word-size used for internal bookkeeping
-diff -Nru glibc-2.3.3.old/sysdeps/generic/unsecvars.h glibc-2.3.3/sysdeps/generic/unsecvars.h
---- glibc-2.3.3.old/sysdeps/generic/unsecvars.h 2004-09-16 15:03:11.000000000 -0400
-+++ glibc-2.3.3/sysdeps/generic/unsecvars.h 2004-09-16 15:04:58.000000000 -0400
-@@ -3,6 +3,8 @@
- with a '\0' explicitly. */
- #define UNSECURE_ENVVARS \
- "LD_PRELOAD\0" \
-+ "LD_DEBUG\0" \
-+ "LD_TRACE_PRELINKING\0" \
- "LD_LIBRARY_PATH\0" \
- "LD_ORIGIN_PATH\0" \
- "LD_DEBUG_OUTPUT\0" \
diff --git a/sys-libs/glibc/files/2.3.4/glibc234-alpha-xstat.patch b/sys-libs/glibc/files/2.3.4/glibc234-alpha-xstat.patch
deleted file mode 100644
index b68f57e4688c..000000000000
--- a/sys-libs/glibc/files/2.3.4/glibc234-alpha-xstat.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-diff -u -p -r1.83 kernel-features.h
---- sysdeps/unix/sysv/linux/kernel-features.h 26 Jan 2005 20:01:10 -0000 1.83
-+++ sysdeps/unix/sysv/linux/kernel-features.h 18 Feb 2005 06:21:10 -0000
-@@ -413,6 +413,11 @@
- # define __ASSUME_GETDENTS32_D_TYPE 1
- #endif
-
-+/* Starting with version 2.6.4, alpha stat64 syscalls are available. */
-+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
-+# define __ASSUME_STAT64_SYSCALL 1
-+#endif
-+
- /* Starting with version 2.5.3, the initial location returned by `brk'
- after exec is always rounded up to the next page. */
- #if __LINUX_KERNEL_VERSION >= 132355
-diff -u -p -r1.1 fxstat.c
---- sysdeps/unix/sysv/linux/alpha/fxstat.c 11 Mar 2004 02:58:44 -0000 1.1
-+++ sysdeps/unix/sysv/linux/alpha/fxstat.c 18 Feb 2005 06:21:10 -0000
-@@ -1,5 +1,5 @@
- /* fxstat using old-style Unix stat system call.
-- Copyright (C) 2004 Free Software Foundation, Inc.
-+ Copyright (C) 2004, 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
-@@ -35,27 +35,39 @@ int
- __fxstat (int vers, int fd, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_fstat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__fxstat)
-diff -u -p -r1.1 lxstat.c
---- sysdeps/unix/sysv/linux/alpha/lxstat.c 11 Mar 2004 02:58:44 -0000 1.1
-+++ sysdeps/unix/sysv/linux/alpha/lxstat.c 18 Feb 2005 06:21:10 -0000
-@@ -1,5 +1,5 @@
- /* lxstat using old-style Unix stat system call.
-- Copyright (C) 2004 Free Software Foundation, Inc.
-+ Copyright (C) 2004, 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
-@@ -35,27 +35,39 @@ int
- __lxstat (int vers, const char *name, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_lstat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__lxstat)
-diff -u -p -r1.1 xstat.c
---- sysdeps/unix/sysv/linux/alpha/xstat.c 11 Mar 2004 02:58:44 -0000 1.1
-+++ sysdeps/unix/sysv/linux/alpha/xstat.c 18 Feb 2005 06:21:10 -0000
-@@ -1,5 +1,5 @@
- /* xstat using old-style Unix stat system call.
-- Copyright (C) 2004 Free Software Foundation, Inc.
-+ Copyright (C) 2004, 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
-@@ -35,27 +35,39 @@ int
- __xstat (int vers, const char *name, struct stat *buf)
- {
- INTERNAL_SYSCALL_DECL (err);
-- int result, errno_out;
-+ int result;
- struct kernel_stat kbuf;
-
-+#if __ASSUME_STAT64_SYSCALL > 0
-+ if (vers == _STAT_VER_KERNEL64)
-+ {
-+ result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
-+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
-+ return result;
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
-+ return -1;
-+ }
-+#elif defined __NR_stat64
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
-+ int errno_out;
- result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
-- goto fail;
-+ {
-+ __set_errno (errno_out);
-+ return -1;
-+ }
- __libc_missing_axp_stat64 = 1;
- }
-+#endif
-
- result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kbuf, buf);
-- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
--
-- fail:
-- __set_errno (errno_out);
-+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- hidden_def (__xstat)
-diff -u -p -r1.6 xstatconv.c
---- sysdeps/unix/sysv/linux/alpha/xstatconv.c 11 Mar 2004 02:58:44 -0000 1.6
-+++ sysdeps/unix/sysv/linux/alpha/xstatconv.c 26 Feb 2005 13:58:07 -0000
-@@ -1,5 +1,5 @@
- /* Convert between the kernel's `struct stat' format, and libc's.
-- Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
-+ Copyright (C) 1997, 2003, 2004, 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
-@@ -22,9 +22,14 @@
- #include <sys/stat.h>
- #include <kernel_stat.h>
- #include <xstatconv.h>
-+#include <sys/syscall.h>
-
-
-+#ifdef __NR_stat64
-+# if __ASSUME_STAT64_SYSCALL == 0
- int __libc_missing_axp_stat64;
-+# endif
-+#endif
-
- int
- __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
-diff -u -p -r1.1 xstatconv.h
---- sysdeps/unix/sysv/linux/alpha/xstatconv.h 11 Mar 2004 02:58:44 -0000 1.1
-+++ sysdeps/unix/sysv/linux/alpha/xstatconv.h 26 Feb 2005 13:58:07 -0000
-@@ -1,5 +1,5 @@
- /* Convert between the kernel's `struct stat' format, and libc's.
-- Copyright (C) 2004 Free Software Foundation, Inc.
-+ Copyright (C) 2004, 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
-@@ -18,7 +18,12 @@
- 02111-1307 USA. */
-
- #include "kernel-features.h"
-+#include <sys/syscall.h>
-
-+#ifdef __NR_stat64
-+# if __ASSUME_STAT64_SYSCALL == 0
- extern int __libc_missing_axp_stat64 attribute_hidden;
-+# endif
-+#endif
- extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
- attribute_hidden;
diff --git a/sys-libs/glibc/files/2.3.4/host.conf b/sys-libs/glibc/files/2.3.4/host.conf
deleted file mode 100644
index b37a26b7ca06..000000000000
--- a/sys-libs/glibc/files/2.3.4/host.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-# /etc/host.conf:
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/2.3.4/host.conf,v 1.2 2004/11/24 05:31:58 vapier Exp $
-
-# The file /etc/host.conf contains configuration information specific to
-# the resolver library. It should contain one configuration keyword per
-# line, followed by appropriate configuration information. The keywords
-# recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.
-
-
-
-# This keyword specifies how host lookups are to be performed. It
-# should be followed by one or more lookup methods, separated by
-# commas. Valid methods are bind, hosts, and nis.
-#
-order hosts, bind
-
-
-# Valid values are on and off. If set to on, the resolv+ library treats
-# the .local top level domain as link-local domain and sends multicast
-# DNS requests to the multicast address 224.0.0.251 port 5353 instead
-# of normal DNS requests. If you already use the .local domain in your
-# nameserver configuration you will have to switch this option off.
-#
-mdns off
-
-
-# Valid values are on and off. If set to on, the resolv+ library
-# will return all valid addresses for a host that appears in the
-# /etc/hosts file, instead of only the first. This is off by
-# default, as it may cause a substantial performance loss at sites
-# with large hosts files.
-#
-multi off
diff --git a/sys-libs/glibc/files/2.3.4/hppa-no-pie.patch b/sys-libs/glibc/files/2.3.4/hppa-no-pie.patch
deleted file mode 100644
index a91072c25ba4..000000000000
--- a/sys-libs/glibc/files/2.3.4/hppa-no-pie.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-PIE support is broken on PARISC in this glibc so make sure we dont force
-building nscd as a PIE or bad things happen.
-
---- nscd/Makefile
-+++ nscd/Makefile
-@@ -35,7 +35,7 @@
- ifeq ($(have-thread-library),yes)
-
- others := nscd_nischeck
--ifneq (yesyes,$(have-fpie)$(build-shared))
-+ifneq (yes,$(build-shared))
- others += nscd
- endif
- install-sbin := nscd nscd_nischeck
-@@ -60,27 +60,10 @@
- CFLAGS-nscd_getgr_r.c = -fexceptions
- CFLAGS-nscd_gethst_r.c = -fexceptions
-
--ifeq (yesyes,$(have-fpie)$(build-shared))
--CFLAGS-nscd.c = -fpie
--CFLAGS-connections.c = -fpie
--CFLAGS-pwdcache.c = -fpie
--CFLAGS-getpwnam_r.c = -fpie
--CFLAGS-getpwuid_r.c = -fpie
--CFLAGS-grpcache.c = -fpie
--CFLAGS-getgrnam_r.c = -fpie
--CFLAGS-getgrgid_r.c = -fpie
--CFLAGS-hstcache.c = -fpie
--CFLAGS-gethstbyad_r.c = -fpie
--CFLAGS-gethstbynm2_r.c = -fpie
--CFLAGS-dbg_log.c = -fpie
--CFLAGS-nscd_conf.c = -fpie
--CFLAGS-nscd_stat.c = -fpie
--CFLAGS-cache.c = -fpie
--CFLAGS-xmalloc.c = -fpie
--CFLAGS-xstrdup.c = -fpie
-+ifeq (yes,$(build-shared))
-
- $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
-- $(LINK.o) -pie -Wl,-O1 \
-+ $(LINK.o) -Wl,-O1 \
- $(sysdep-LDFLAGS) $(config-LDFLAGS) \
- $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
- $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
diff --git a/sys-libs/glibc/files/2.3.5/glibc-2.3.5-frandom-detect.patch b/sys-libs/glibc/files/2.3.5/glibc-2.3.5-frandom-detect.patch
deleted file mode 100644
index 3b1a71a5ef60..000000000000
--- a/sys-libs/glibc/files/2.3.5/glibc-2.3.5-frandom-detect.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- config.h.in
-+++ config.h.in
-@@ -215,4 +215,7 @@
- #undef HAVE_LIBIDN
-
-+/* Defined if economical random device is available. */
-+#undef HAVE_DEV_ERANDOM
-+
- /* Define if inlined system calls are available. */
- #undef HAVE_INLINED_SYSCALLS
---- configure.in
-+++ configure.in
-@@ -264,4 +264,11 @@
- AC_SUBST(all_warnings)
-
-+dnl See whether the user wants to disable checking for /dev/erandom
-+AC_ARG_ENABLE([dev-erandom],
-+ AC_HELP_STRING([--disable-dev-erandom],
-+ [disable testing for /dev/erandom]),
-+ [try_dev_erandom=$enableval],
-+ [try_dev_erandom=yes])
-+
- AC_CANONICAL_HOST
-
-@@ -1974,4 +1981,19 @@
- AC_SUBST(sizeof_long_double)
-
-+dnl check whether we have an economical random device
-+if test "$try_dev_erandom" = yes ; then
-+ AC_CACHE_CHECK(for economical random device, ac_cv_have_dev_random,
-+ [if test -r "/dev/erandom" ; then
-+ ac_cv_have_dev_erandom=yes; else ac_cv_have_dev_erandom=no; fi])
-+ if test "$ac_cv_have_dev_erandom" = yes; then
-+ AC_DEFINE(HAVE_DEV_ERANDOM,1,
-+ [defined if the system supports an economical random device])
-+ fi
-+else
-+ AC_MSG_CHECKING(for economical random device)
-+ ac_cv_have_dev_erandom=no
-+ AC_MSG_RESULT(has been disabled)
-+fi
-+
- ### End of automated tests.
- ### Now run sysdeps configure fragments.
---- configure
-+++ configure
-@@ -884,6 +884,7 @@
- --enable-kernel=VERSION compile for compatibility with kernel not older than
- VERSION
- --enable-all-warnings enable all useful warnings gcc can issue
-+ --disable-dev-erandom disable testing for /dev/erandom
-
- Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
-@@ -1697,6 +1698,14 @@
- fi;
-
-
-+# Check whether --enable-dev-erandom or --disable-dev-erandom was given.
-+if test "${enable_dev_erandom+set}" = set; then
-+ enableval="$enable_dev_erandom"
-+ try_dev_erandom=$enableval
-+else
-+ try_dev_erandom=yes
-+fi;
-+
- # Make sure we can run config.sub.
- $ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-@@ -7449,6 +7458,32 @@
- sizeof_long_double=$ac_cv_sizeof_long_double
-
-
-+if test "$try_dev_erandom" = yes ; then
-+ echo "$as_me:$LINENO: checking for economical random device" >&5
-+echo $ECHO_N "checking for economical random device... $ECHO_C" >&6
-+if test "${ac_cv_have_dev_random+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ if test -r "/dev/erandom" ; then
-+ ac_cv_have_dev_erandom=yes; else ac_cv_have_dev_erandom=no; fi
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_have_dev_random" >&5
-+echo "${ECHO_T}$ac_cv_have_dev_random" >&6
-+ if test "$ac_cv_have_dev_erandom" = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_DEV_ERANDOM 1
-+_ACEOF
-+
-+ fi
-+else
-+ echo "$as_me:$LINENO: checking for economical random device" >&5
-+echo $ECHO_N "checking for economical random device... $ECHO_C" >&6
-+ ac_cv_have_dev_erandom=no
-+ echo "$as_me:$LINENO: result: has been disabled" >&5
-+echo "${ECHO_T}has been disabled" >&6
-+fi
-+
- ### End of automated tests.
- ### Now run sysdeps configure fragments.
-
diff --git a/sys-libs/glibc/files/2.3.5/glibc-2.3.5-propolice-guard-functions.patch b/sys-libs/glibc/files/2.3.5/glibc-2.3.5-propolice-guard-functions.patch
deleted file mode 100644
index 3a75cf1298af..000000000000
--- a/sys-libs/glibc/files/2.3.5/glibc-2.3.5-propolice-guard-functions.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-The configure check for SSP is taken from glibc HEAD.
-
-diff -ur glibc-2.3.5-orig/config.make.in glibc-2.3.5/config.make.in
---- glibc-2.3.5-orig/config.make.in 2006-01-18 00:31:17.000000000 -0500
-+++ glibc-2.3.5/config.make.in 2006-01-18 00:33:25.000000000 -0500
-@@ -61,6 +61,7 @@
- have-selinux = @have_selinux@
- have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
- fno-unit-at-a-time = @fno_unit_at_a_time@
-+have-ssp = @libc_cv_ssp@
- bind-now = @bindnow@
-
- static-libgcc = @libc_cv_gcc_static_libgcc@
-diff -ur glibc-2.3.5-orig/configure glibc-2.3.5/configure
---- glibc-2.3.5-orig/configure 2006-01-18 00:31:17.000000000 -0500
-+++ glibc-2.3.5/configure 2006-01-18 00:35:54.000000000 -0500
-@@ -313,7 +313,7 @@
- # include <unistd.h>
- #endif"
-
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_have_initfini libc_cv_cpp_asm_debuginfo no_whole_archive exceptions LIBGD have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES linux_doors mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini libc_cv_cpp_asm_debuginfo no_whole_archive exceptions LIBGD have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES linux_doors mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
- ac_subst_files=''
-
- # Initialize some variables set by options.
-@@ -5785,6 +5785,33 @@
- fi
-
-
-+echo "$as_me:$LINENO: checking for -fstack-protector" >&5
-+echo $ECHO_N "checking for -fstack-protector... $ECHO_C" >&6
-+if test "${libc_cv_ssp+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat > conftest.c <<EOF
-+int foo;
-+main () { return 0;}
-+EOF
-+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fstack-protector
-+ -o conftest conftest.c 1>&5'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }
-+then
-+ libc_cv_ssp=yes
-+else
-+ libc_cv_ssp=no
-+fi
-+rm -f conftest*
-+fi
-+echo "$as_me:$LINENO: result: $libc_cv_ssp" >&5
-+echo "${ECHO_T}$libc_cv_ssp" >&6
-+
-+
- if test $elf != yes; then
- echo "$as_me:$LINENO: checking for .init and .fini sections" >&5
- echo $ECHO_N "checking for .init and .fini sections... $ECHO_C" >&6
-@@ -8424,6 +8451,7 @@
- s,@libc_cv_z_execstack@,$libc_cv_z_execstack,;t t
- s,@libc_cv_fpie@,$libc_cv_fpie,;t t
- s,@fno_unit_at_a_time@,$fno_unit_at_a_time,;t t
-+s,@libc_cv_ssp@,$libc_cv_ssp,;t t
- s,@libc_cv_have_initfini@,$libc_cv_have_initfini,;t t
- s,@libc_cv_cpp_asm_debuginfo@,$libc_cv_cpp_asm_debuginfo,;t t
- s,@no_whole_archive@,$no_whole_archive,;t t
-diff -ur glibc-2.3.5-orig/configure.in glibc-2.3.5/configure.in
---- glibc-2.3.5-orig/configure.in 2006-01-18 00:31:17.000000000 -0500
-+++ glibc-2.3.5/configure.in 2006-01-18 00:35:50.000000000 -0500
-@@ -1500,6 +1500,21 @@
- fi
- AC_SUBST(fno_unit_at_a_time)
-
-+AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
-+cat > conftest.c <<EOF
-+int foo;
-+main () { return 0;}
-+EOF
-+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fstack-protector
-+ -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
-+then
-+ libc_cv_ssp=yes
-+else
-+ libc_cv_ssp=no
-+fi
-+rm -f conftest*])
-+AC_SUBST(libc_cv_ssp)
-+
- if test $elf != yes; then
- AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
- [AC_TRY_COMPILE(, [asm (".section .init");
-diff -ur glibc-2.3.5-orig/sysdeps/generic/libc-start.c glibc-2.3.5/sysdeps/generic/libc-start.c
---- glibc-2.3.5-orig/sysdeps/generic/libc-start.c 2006-01-18 00:31:35.000000000 -0500
-+++ glibc-2.3.5/sysdeps/generic/libc-start.c 2006-01-18 00:30:39.000000000 -0500
-@@ -188,6 +188,9 @@
- GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
- #endif
-
-+ /* call the __guard_setup to set up the random __guard value */
-+ __guard_setup (); /* pappy@gentoo.org (pappy rules) */
-+
- #ifdef HAVE_CLEANUP_JMP_BUF
- /* Memory for the cancellation buffer. */
- struct pthread_unwind_buf unwind_buf;
-diff -ur glibc-2.3.5-orig/sysdeps/unix/sysv/linux/Dist glibc-2.3.5/sysdeps/unix/sysv/linux/Dist
---- glibc-2.3.5-orig/sysdeps/unix/sysv/linux/Dist 2006-01-18 00:31:35.000000000 -0500
-+++ glibc-2.3.5/sysdeps/unix/sysv/linux/Dist 2006-01-18 00:30:39.000000000 -0500
-@@ -1,3 +1,4 @@
-+ssp.c
- bits/initspin.h
- cmsg_nxthdr.c
- dl-brk.c
-diff -ur glibc-2.3.5-orig/sysdeps/unix/sysv/linux/Makefile glibc-2.3.5/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.3.5-orig/sysdeps/unix/sysv/linux/Makefile 2006-01-18 00:31:35.000000000 -0500
-+++ glibc-2.3.5/sysdeps/unix/sysv/linux/Makefile 2006-01-18 00:33:03.000000000 -0500
-@@ -1,5 +1,8 @@
- ifeq ($(subdir),csu)
--sysdep_routines += errno-loc
-+sysdep_routines += errno-loc ssp
-+ifeq (yes,$(have-ssp))
-+CFLAGS-ssp.c += -fno-stack-protector
-+endif
- endif
-
- ifeq ($(subdir),assert)
-diff -ur glibc-2.3.5-orig/sysdeps/unix/sysv/linux/Versions glibc-2.3.5/sysdeps/unix/sysv/linux/Versions
---- glibc-2.3.5-orig/sysdeps/unix/sysv/linux/Versions 2006-01-18 00:31:35.000000000 -0500
-+++ glibc-2.3.5/sysdeps/unix/sysv/linux/Versions 2006-01-18 00:30:39.000000000 -0500
-@@ -108,6 +108,8 @@
- GLIBC_2.3.2 {
- # New kernel interfaces.
- epoll_create; epoll_ctl; epoll_wait;
-+ # global objects and functions for the propolice patch in gcc - moved from libgcc by pappy@gentoo.org
-+ __guard; __guard_setup; __stack_smash_handler;
- }
- GLIBC_2.3.3 {
- gnu_dev_major; gnu_dev_minor; gnu_dev_makedev;
diff --git a/sys-libs/glibc/files/2.3.5/ssp.c b/sys-libs/glibc/files/2.3.5/ssp.c
deleted file mode 100644
index 880158d5cd31..000000000000
--- a/sys-libs/glibc/files/2.3.5/ssp.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/2.3.5/ssp.c,v 1.3 2005/06/07 01:38:58 vapier Exp $
- *
- * This is a modified version of Hiroaki Etoh's stack smashing routines
- * implemented for glibc.
- *
- * The following people have contributed input to this code.
- * 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>
- *
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef __SSP__
-# error ssp.c has to be built w/ -fno-stack-protector
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/un.h>
-#include <sys/syslog.h>
-#include <sys/time.h>
-#ifdef __SSP_USE_ERANDOM__
-# include <sys/sysctl.h>
-#endif
-
-#ifdef __PROPOLICE_BLOCK_SEGV__
-# define SSP_SIGTYPE SIGSEGV
-#elif __PROPOLICE_BLOCK_KILL__
-# define SSP_SIGTYPE SIGKILL
-#else
-# define SSP_SIGTYPE SIGABRT
-#endif
-
-unsigned long __guard = 0UL;
-
-/* Use of __* functions from the rest of glibc here avoids
- * initialisation problems for executables preloaded with
- * libraries that overload the associated standard library
- * functions.
- */
-#ifdef __UCLIBC__
-extern int __libc_open(__const char *file, int flags, ...);
-extern ssize_t __libc_read(int fd, void *buf, size_t count);
-extern int __libc_close(int fd);
-#else
-# define __libc_open(file, flags) __open(file, flags)
-# define __libc_read(fd, buf, count) __read(fd, buf, count)
-# define __libc_close(fd) __close(fd)
-# define __libc_write(fd, buf, count) __write(fd, buf, count)
-#endif
-
-void __guard_setup(void) __attribute__ ((constructor));
-void __guard_setup(void)
-{
- size_t size;
-
- if (__guard != 0UL)
- return;
-
- /* Start with the "terminator canary". */
- __guard = 0xFF0A0D00UL;
-
-#ifndef __SSP_QUICK_CANARY__
-# ifdef __SSP_USE_ERANDOM__
- {
- int mib[3];
- /* Random is another depth in Linux, hence an array of 3. */
- mib[0] = CTL_KERN;
- mib[1] = KERN_RANDOM;
- mib[2] = RANDOM_ERANDOM;
-
- size = sizeof(unsigned long);
- if (__sysctl(mib, 3, &__guard, &size, NULL, 0) != (-1))
- if (__guard != 0UL)
- return;
- }
-# endif /* ifdef __SSP_USE_ERANDOM__ */
- /*
- * Attempt to open kernel pseudo random device if one exists before
- * opening urandom to avoid system entropy depletion.
- */
- {
- int fd;
-
-# ifdef __SSP_USE_ERANDOM__
- if ((fd = __libc_open("/dev/erandom", O_RDONLY)) == (-1))
-# endif
- fd = __libc_open("/dev/urandom", O_RDONLY);
- if (fd != (-1)) {
- size = __libc_read(fd, (char *) &__guard, sizeof(__guard));
- __libc_close(fd);
- if (size == sizeof(__guard))
- return;
- }
- }
-#endif /* ifndef __SSP_QUICK_CANARY__ */
-
- /* Everything failed? Or we are using a weakened model of the
- * terminator canary */
- {
- struct timeval tv;
- __gettimeofday(&tv, NULL);
- __guard ^= tv.tv_usec ^ tv.tv_sec;
- }
-}
-
-void __stack_smash_handler(char func[], int damaged __attribute__ ((unused)));
-void __stack_smash_handler(char func[], int damaged)
-{
- extern char *__progname;
- const char message[] = ": stack smashing attack in function ";
- struct sigaction sa;
- sigset_t mask;
-
- sigfillset(&mask);
-
- sigdelset(&mask, SSP_SIGTYPE); /* Block all signal handlers */
- sigprocmask(SIG_BLOCK, &mask, NULL); /* except SSP_SIGTYPE */
-
- /* Print error message to stderr and syslog */
-#if 1 /* syslog() causes issues with glibc #94325 */
- __libc_write(STDERR_FILENO, __progname, strlen(__progname));
- __libc_write(STDERR_FILENO, message, strlen(message));
- __libc_write(STDERR_FILENO, func, strlen(func));
- __libc_write(STDERR_FILENO, "()\n", 3);
- //_syscall3(int, _ssp_syslog, int, type, char *, bufp, int, len)
- //_ssp_syslog(LOG_INFO,
-#else
- fprintf(stderr, "%s%s%s()\n", __progname, message, func);
- syslog(LOG_INFO, "%s%s%s()", __progname, message, func);
-#endif
-
- /* Make the default handler associated with the signal handler */
- memset(&sa, 0, sizeof(struct sigaction));
- sigfillset(&sa.sa_mask); /* Block all signals */
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
- sigaction(SSP_SIGTYPE, &sa, NULL);
- (void) kill(getpid(), SSP_SIGTYPE);
- _exit(127);
-}
diff --git a/sys-libs/glibc/files/2.3.6/glibc-2.3.6-propolice-guard-functions.patch b/sys-libs/glibc/files/2.3.6/glibc-2.3.6-propolice-guard-functions.patch
deleted file mode 100644
index 8779a2c0f91e..000000000000
--- a/sys-libs/glibc/files/2.3.6/glibc-2.3.6-propolice-guard-functions.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-The configure check for SSP was taken from glibc HEAD
-
-diff -ur glibc-2.3.6-orig/config.make.in glibc-2.3.6/config.make.in
---- glibc-2.3.6-orig/config.make.in 2006-01-17 14:22:02.000000000 -0500
-+++ glibc-2.3.6/config.make.in 2006-01-17 14:22:39.000000000 -0500
-@@ -62,6 +62,7 @@
- have-libaudit = @have_libaudit@
- have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
- fno-unit-at-a-time = @fno_unit_at_a_time@
-+have-ssp = @libc_cv_ssp@
- bind-now = @bindnow@
-
- static-libgcc = @libc_cv_gcc_static_libgcc@
-diff -ur glibc-2.3.6-orig/configure glibc-2.3.6/configure
---- glibc-2.3.6-orig/configure 2006-01-17 14:22:17.000000000 -0500
-+++ glibc-2.3.6/configure 2006-01-17 14:18:24.000000000 -0500
-@@ -313,7 +313,7 @@
- # include <unistd.h>
- #endif"
-
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_have_initfini libc_cv_cpp_asm_debuginfo no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES linux_doors mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini libc_cv_cpp_asm_debuginfo no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES linux_doors mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
- ac_subst_files=''
-
- # Initialize some variables set by options.
-@@ -5785,6 +5785,33 @@
- fi
-
-
-+echo "$as_me:$LINENO: checking for -fstack-protector" >&5
-+echo $ECHO_N "checking for -fstack-protector... $ECHO_C" >&6
-+if test "${libc_cv_ssp+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat > conftest.c <<EOF
-+int foo;
-+main () { return 0;}
-+EOF
-+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fstack-protector
-+ -o conftest conftest.c 1>&5'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }
-+then
-+ libc_cv_ssp=yes
-+else
-+ libc_cv_ssp=no
-+fi
-+rm -f conftest*
-+fi
-+echo "$as_me:$LINENO: result: $libc_cv_ssp" >&5
-+echo "${ECHO_T}$libc_cv_ssp" >&6
-+
-+
- if test $elf != yes; then
- echo "$as_me:$LINENO: checking for .init and .fini sections" >&5
- echo $ECHO_N "checking for .init and .fini sections... $ECHO_C" >&6
-@@ -8504,6 +8531,7 @@
- s,@libc_cv_z_execstack@,$libc_cv_z_execstack,;t t
- s,@libc_cv_fpie@,$libc_cv_fpie,;t t
- s,@fno_unit_at_a_time@,$fno_unit_at_a_time,;t t
-+s,@libc_cv_ssp@,$libc_cv_ssp,;t t
- s,@libc_cv_have_initfini@,$libc_cv_have_initfini,;t t
- s,@libc_cv_cpp_asm_debuginfo@,$libc_cv_cpp_asm_debuginfo,;t t
- s,@no_whole_archive@,$no_whole_archive,;t t
-diff -ur glibc-2.3.6-orig/configure.in glibc-2.3.6/configure.in
---- glibc-2.3.6-orig/configure.in 2006-01-17 14:22:17.000000000 -0500
-+++ glibc-2.3.6/configure.in 2006-01-17 14:18:24.000000000 -0500
-@@ -1500,6 +1500,21 @@
- fi
- AC_SUBST(fno_unit_at_a_time)
-
-+AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
-+cat > conftest.c <<EOF
-+int foo;
-+main () { return 0;}
-+EOF
-+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fstack-protector
-+ -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
-+then
-+ libc_cv_ssp=yes
-+else
-+ libc_cv_ssp=no
-+fi
-+rm -f conftest*])
-+AC_SUBST(libc_cv_ssp)
-+
- if test $elf != yes; then
- AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
- [AC_TRY_COMPILE(, [asm (".section .init");
-diff -ur glibc-2.3.6-orig/sysdeps/generic/libc-start.c glibc-2.3.6/sysdeps/generic/libc-start.c
---- glibc-2.3.6-orig/sysdeps/generic/libc-start.c 2006-01-17 14:22:17.000000000 -0500
-+++ glibc-2.3.6/sysdeps/generic/libc-start.c 2006-01-17 14:18:24.000000000 -0500
-@@ -188,6 +188,9 @@
- GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
- #endif
-
-+ /* call the __guard_setup to set up the random __guard value */
-+ __guard_setup (); /* pappy@gentoo.org (pappy rules) */
-+
- #ifdef HAVE_CLEANUP_JMP_BUF
- /* Memory for the cancellation buffer. */
- struct pthread_unwind_buf unwind_buf;
-diff -ur glibc-2.3.6-orig/sysdeps/unix/sysv/linux/Dist glibc-2.3.6/sysdeps/unix/sysv/linux/Dist
---- glibc-2.3.6-orig/sysdeps/unix/sysv/linux/Dist 2006-01-17 14:22:17.000000000 -0500
-+++ glibc-2.3.6/sysdeps/unix/sysv/linux/Dist 2006-01-17 14:18:24.000000000 -0500
-@@ -1,3 +1,4 @@
-+ssp.c
- bits/initspin.h
- cmsg_nxthdr.c
- dl-brk.c
-diff -ur glibc-2.3.6-orig/sysdeps/unix/sysv/linux/Makefile glibc-2.3.6/sysdeps/unix/sysv/linux/Makefile
---- glibc-2.3.6-orig/sysdeps/unix/sysv/linux/Makefile 2006-01-17 14:22:17.000000000 -0500
-+++ glibc-2.3.6/sysdeps/unix/sysv/linux/Makefile 2006-01-17 14:18:24.000000000 -0500
-@@ -1,5 +1,8 @@
- ifeq ($(subdir),csu)
--sysdep_routines += errno-loc
-+sysdep_routines += errno-loc ssp
-+ifeq (yes,$(have-ssp))
-+CFLAGS-ssp.c += -fno-stack-protector
-+endif
- endif
-
- ifeq ($(subdir),assert)
-diff -ur glibc-2.3.6-orig/sysdeps/unix/sysv/linux/Versions glibc-2.3.6/sysdeps/unix/sysv/linux/Versions
---- glibc-2.3.6-orig/sysdeps/unix/sysv/linux/Versions 2006-01-17 14:22:17.000000000 -0500
-+++ glibc-2.3.6/sysdeps/unix/sysv/linux/Versions 2006-01-17 14:18:24.000000000 -0500
-@@ -108,6 +108,8 @@
- GLIBC_2.3.2 {
- # New kernel interfaces.
- epoll_create; epoll_ctl; epoll_wait;
-+ # global objects and functions for the propolice patch in gcc - moved from libgcc by pappy@gentoo.org
-+ __guard; __guard_setup; __stack_smash_handler;
- }
- GLIBC_2.3.3 {
- gnu_dev_major; gnu_dev_minor; gnu_dev_makedev;
diff --git a/sys-libs/glibc/files/2.3.6/host.conf b/sys-libs/glibc/files/2.3.6/host.conf
deleted file mode 100644
index eab7426ef0d7..000000000000
--- a/sys-libs/glibc/files/2.3.6/host.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-# /etc/host.conf:
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/2.3.6/host.conf,v 1.1 2006/02/21 23:35:21 vapier Exp $
-
-# The file /etc/host.conf contains configuration information specific to
-# the resolver library. It should contain one configuration keyword per
-# line, followed by appropriate configuration information. The keywords
-# recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.
-
-
-
-# This keyword specifies how host lookups are to be performed. It
-# should be followed by one or more lookup methods, separated by
-# commas. Valid methods are bind, hosts, and nis.
-#
-order hosts, bind
-
-
-# Valid values are on and off. If set to on, the resolv+ library
-# will return all valid addresses for a host that appears in the
-# /etc/hosts file, instead of only the first. This is off by
-# default, as it may cause a substantial performance loss at sites
-# with large hosts files.
-#
-multi off
diff --git a/sys-libs/glibc/files/2.4/glibc-gentoo-libdir.patch b/sys-libs/glibc/files/2.4/glibc-gentoo-libdir.patch
deleted file mode 100644
index f263746774f6..000000000000
--- a/sys-libs/glibc/files/2.4/glibc-gentoo-libdir.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- glibc-2.4/sysdeps/unix/sysv/linux/configure
-+++ glibc-2.4/sysdeps/unix/sysv/linux/configure
-@@ -224,23 +224,12 @@
- # in /lib and /etc.
- case "$prefix" in
- /usr | /usr/)
-- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
-- # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
-- # and libc_cv_localedir.
-- test -n "$libc_cv_slibdir" || \
-- case $machine in
-- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
-- libc_cv_slibdir="/lib64"
-+ libc_cv_slibdir="/@GENTOO_LIBDIR@"
- if test "$libdir" = '${exec_prefix}/lib'; then
-- libdir='${exec_prefix}/lib64';
-+ libdir='${exec_prefix}/@GENTOO_LIBDIR@'
- # Locale data can be shared between 32bit and 64bit libraries
- libc_cv_localedir='${exec_prefix}/lib/locale'
- fi
-- ;;
-- *)
-- libc_cv_slibdir="/lib"
-- ;;
-- esac
- # Allow the user to override the path with --sysconfdir
- if test $sysconfdir = '${prefix}/etc'; then
- libc_cv_sysconfdir=/etc
diff --git a/sys-libs/glibc/files/2.4/ssp_simple.c b/sys-libs/glibc/files/2.4/ssp_simple.c
deleted file mode 100644
index ec16dc60d5f2..000000000000
--- a/sys-libs/glibc/files/2.4/ssp_simple.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Just do:
- * # gcc -fno-stack-protector -s -shared -fPIC ssp_simple.c -o /lib/libssp_simple.so
- * # echo '/lib/libssp_simple.so' > /etc/ld.so.preload
- * # emerge glibc
- * # rm -f /lib/libssp_simple.so /etc/ld.so.preload
- */
-
-#include <syslog.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/sysctl.h>
-
-unsigned long __guard = 0UL; static void __guard_setup(void) __attribute__ ((constructor));
-void __stack_smash_handler(char func[], int damaged __attribute__ ((unused)));
-static void __guard_setup(void) { if (__guard != 0UL) return; __guard = 0xFF0A0D00UL; }
-
-void __stack_smash_handler(char func[], int damaged) {
- syslog(LOG_CRIT, "stack overflow in function %s(); %s=%p __guard_setup=%p __guard=%p " \
- "PPID=%d PID=%d UID=%d EUID=%d GID=%d EGID=%d",
- func, func, __guard_setup, __guard,
- getppid(), getpid(), getuid(), geteuid(), getgid(), getegid());
- _exit(127);
-}
diff --git a/sys-libs/glibc/files/fix-sysctl_h.patch b/sys-libs/glibc/files/fix-sysctl_h.patch
deleted file mode 100644
index 2c490844c81a..000000000000
--- a/sys-libs/glibc/files/fix-sysctl_h.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- linux.orig/include/linux/sysctl.h.orig 2003-05-18 22:12:39.000000000 +0200
-+++ linux.fixed/include/linux/sysctl.h 2003-05-18 22:13:58.000000000 +0200
-@@ -35,6 +35,10 @@
- the largest acceptable value for the nlen
- member of a struct __sysctl_args to have? */
-
-+#ifndef __user
-+#define __user
-+#endif
-+
- struct __sysctl_args {
- int __user *name;
- int nlen;
diff --git a/sys-libs/glibc/files/glibc-2.2.2-test-lfs-timeout.patch b/sys-libs/glibc/files/glibc-2.2.2-test-lfs-timeout.patch
deleted file mode 100644
index ac4de72dad00..000000000000
--- a/sys-libs/glibc/files/glibc-2.2.2-test-lfs-timeout.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- test-lfs.c~ Fri Feb 9 18:04:07 2001
-+++ test-lfs.c Sat Feb 17 04:30:18 2001
-@@ -34,7 +34,7 @@
- #define PREPARE do_prepare
-
- /* We might need a bit longer timeout. */
--#define TIMEOUT 20 /* sec */
-+#define TIMEOUT 120 /* sec */
-
- /* This defines the `main' function and some more. */
- #include <test-skeleton.c>
diff --git a/sys-libs/glibc/files/glibc-sec-hotfix-20040804.patch b/sys-libs/glibc/files/glibc-sec-hotfix-20040804.patch
deleted file mode 100644
index 14ffd90b5b28..000000000000
--- a/sys-libs/glibc/files/glibc-sec-hotfix-20040804.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-#! /bin/sh -e
-
-# All lines beginning with `# DP:' are a description of the patch.
-# DP: Add grsecurity enhancements to glibc
-# DP: * Adds Stefan Esser's unlink sanity check
-# DP: * Removes LD_DEBUG for suid apps
-# DP: * Fixes a glibc bug where certain envvars are interpreted
-# DP: even if UNSECURE_ENVVARS says to drop them
-
-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 -p0 < $0;;
- -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p0 < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-esac
-exit 0
-
---- malloc/malloc.c 2004-08-03 18:06:35 -0400
-+++ malloc/malloc.c 2004-08-03 18:08:53 -0400
-@@ -311,6 +311,10 @@
- #define assert(x) ((void)0)
- #endif
-
-+#include <abort-instr.h>
-+#ifndef ABORT_INSTRUCTION
-+#define ABORT_INSTRUCTION
-+#endif
-
- /*
- INTERNAL_SIZE_T is the word-size used for internal bookkeeping
-@@ -1951,6 +1955,13 @@
- #define unlink(P, BK, FD) { \
- FD = P->fd; \
- BK = P->bk; \
-+ if (FD->bk != P || BK->fd != P) \
-+ { \
-+ ABORT_INSTRUCTION; \
-+ _exit(127); \
-+ while (1) \
-+ ABORT_INSTRUCTION; \
-+ } \
- FD->bk = BK; \
- BK->fd = FD; \
- }
---- sysdeps/generic/unsecvars.h 2004-08-03 18:13:13 -0400
-+++ sysdeps/generic/unsecvars.h 2004-08-03 18:11:41 -0400
-@@ -3,6 +3,8 @@
- with a '\0' explicitly. */
- #define UNSECURE_ENVVARS \
- "LD_PRELOAD\0" \
-+ "LD_DEBUG\0" \
-+ "LD_TRACE_PRELINKING\0" \
- "LD_LIBRARY_PATH\0" \
- "LD_ORIGIN_PATH\0" \
- "LD_DEBUG_OUTPUT\0" \
---- elf/rtld.c 2003-01-07 13:47:35 -0500
-+++ elf/rtld.c 2004-08-03 22:15:51 -0400
-@@ -1762,6 +1762,30 @@
- GL(dl_profile_output)
- = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0];
-
-+ /* Extra security for SUID binaries. Remove all dangerous environment
-+ variables. */
-+ if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
-+ {
-+ static const char unsecure_envvars[] =
-+#ifdef EXTRA_UNSECURE_ENVVARS
-+ EXTRA_UNSECURE_ENVVARS
-+#endif
-+ UNSECURE_ENVVARS;
-+ const char *nextp;
-+
-+ nextp = unsecure_envvars;
-+ do
-+ {
-+ unsetenv (nextp);
-+ /* We could use rawmemchr but this need not be fast. */
-+ nextp = (char *) (strchr) (nextp, '\0') + 1;
-+ }
-+ while (*nextp != '\0');
-+
-+ if (__access ("/etc/suid-debug", F_OK) != 0)
-+ unsetenv ("MALLOC_CHECK_");
-+ }
-+
- while ((envline = _dl_next_ld_env_entry (&runp)) != NULL)
- {
- size_t len = 0;
-@@ -1897,33 +1921,10 @@
- /* The caller wants this information. */
- *modep = mode;
-
-- /* Extra security for SUID binaries. Remove all dangerous environment
-- variables. */
-- if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
-- {
-- static const char unsecure_envvars[] =
--#ifdef EXTRA_UNSECURE_ENVVARS
-- EXTRA_UNSECURE_ENVVARS
--#endif
-- UNSECURE_ENVVARS;
-- const char *nextp;
--
-- nextp = unsecure_envvars;
-- do
-- {
-- unsetenv (nextp);
-- /* We could use rawmemchr but this need not be fast. */
-- nextp = (char *) (strchr) (nextp, '\0') + 1;
-- }
-- while (*nextp != '\0');
--
-- if (__access ("/etc/suid-debug", F_OK) != 0)
-- unsetenv ("MALLOC_CHECK_");
-- }
- /* If we have to run the dynamic linker in debugging mode and the
- LD_DEBUG_OUTPUT environment variable is given, we write the debug
- messages to this file. */
-- else if (any_debug && debug_output != NULL)
-+ if (any_debug && debug_output != NULL)
- {
- #ifdef O_NOFOLLOW
- const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW;
diff --git a/sys-libs/glibc/files/glibc-sec-hotfix-20040916.patch b/sys-libs/glibc/files/glibc-sec-hotfix-20040916.patch
deleted file mode 100644
index 3858a0f9c9d1..000000000000
--- a/sys-libs/glibc/files/glibc-sec-hotfix-20040916.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff -Nru glibc-2.3.3.old/elf/rtld.c glibc-2.3.3/elf/rtld.c
---- glibc-2.3.3.old/elf/rtld.c 2004-09-16 15:02:16.000000000 -0400
-+++ glibc-2.3.3/elf/rtld.c 2004-09-16 15:04:58.000000000 -0400
-@@ -2041,6 +2041,30 @@
- GLRO(dl_profile_output)
- = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0];
-
-+ /* Extra security for SUID binaries. Remove all dangerous environment
-+ variables. */
-+ if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
-+ {
-+ static const char unsecure_envvars[] =
-+#ifdef EXTRA_UNSECURE_ENVVARS
-+ EXTRA_UNSECURE_ENVVARS
-+#endif
-+ UNSECURE_ENVVARS;
-+ const char *nextp;
-+
-+ nextp = unsecure_envvars;
-+ do
-+ {
-+ unsetenv (nextp);
-+ /* We could use rawmemchr but this need not be fast. */
-+ nextp = (char *) (strchr) (nextp, '\0') + 1;
-+ }
-+ while (*nextp != '\0');
-+
-+ if (__access ("/etc/suid-debug", F_OK) != 0)
-+ unsetenv ("MALLOC_CHECK_");
-+ }
-+
- while ((envline = _dl_next_ld_env_entry (&runp)) != NULL)
- {
- size_t len = 0;
-@@ -2188,33 +2212,10 @@
- /* The caller wants this information. */
- *modep = mode;
-
-- /* Extra security for SUID binaries. Remove all dangerous environment
-- variables. */
-- if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
-- {
-- static const char unsecure_envvars[] =
--#ifdef EXTRA_UNSECURE_ENVVARS
-- EXTRA_UNSECURE_ENVVARS
--#endif
-- UNSECURE_ENVVARS;
-- const char *nextp;
--
-- nextp = unsecure_envvars;
-- do
-- {
-- unsetenv (nextp);
-- /* We could use rawmemchr but this need not be fast. */
-- nextp = (char *) (strchr) (nextp, '\0') + 1;
-- }
-- while (*nextp != '\0');
--
-- if (__access ("/etc/suid-debug", F_OK) != 0)
-- unsetenv ("MALLOC_CHECK_");
-- }
- /* If we have to run the dynamic linker in debugging mode and the
- LD_DEBUG_OUTPUT environment variable is given, we write the debug
- messages to this file. */
-- else if (any_debug && debug_output != NULL)
-+ if (any_debug && debug_output != NULL)
- {
- #ifdef O_NOFOLLOW
- const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW;
-diff -Nru glibc-2.3.3.old/malloc/malloc.c glibc-2.3.3/malloc/malloc.c
---- glibc-2.3.3.old/malloc/malloc.c 2004-09-16 15:03:22.000000000 -0400
-+++ glibc-2.3.3/malloc/malloc.c 2004-09-16 15:04:58.000000000 -0400
-@@ -321,6 +321,10 @@
- #define assert(x) ((void)0)
- #endif
-
-+#include <abort-instr.h>
-+#ifndef ABORT_INSTRUCTION
-+#define ABORT_INSTRUCTION
-+#endif
-
- /*
- INTERNAL_SIZE_T is the word-size used for internal bookkeeping
-diff -Nru glibc-2.3.3.old/sysdeps/generic/unsecvars.h glibc-2.3.3/sysdeps/generic/unsecvars.h
---- glibc-2.3.3.old/sysdeps/generic/unsecvars.h 2004-09-16 15:03:11.000000000 -0400
-+++ glibc-2.3.3/sysdeps/generic/unsecvars.h 2004-09-16 15:04:58.000000000 -0400
-@@ -3,6 +3,8 @@
- with a '\0' explicitly. */
- #define UNSECURE_ENVVARS \
- "LD_PRELOAD\0" \
-+ "LD_DEBUG\0" \
-+ "LD_TRACE_PRELINKING\0" \
- "LD_LIBRARY_PATH\0" \
- "LD_ORIGIN_PATH\0" \
- "LD_DEBUG_OUTPUT\0" \
diff --git a/sys-libs/glibc/files/locales.build b/sys-libs/glibc/files/locales.build
deleted file mode 100644
index ce2a88cfa430..000000000000
--- a/sys-libs/glibc/files/locales.build
+++ /dev/null
@@ -1,25 +0,0 @@
-# This file names the list of locales to be built when glibc is installed.
-# The format is <locale>/<charmap>, where <locale> is a locale from the
-# /usr/share/i18n/locales directory, and <charmap> is name of one of the files
-# in /usr/share/i18n/charmaps/. All blank lines and lines starting with # are
-# ignored. Here is an example:
-# en_US/ISO-8859-1
-#
-# For the full list, see the file SUPPORTED in the glibc tarball:
-# glibc/localedata/SUPPORTED
-
-en_US/ISO-8859-1
-en_US.UTF-8/UTF-8
-ja_JP.EUC-JP/EUC-JP
-ja_JP.UTF-8/UTF-8
-ja_JP/EUC-JP
-en_HK/ISO-8859-1
-en_PH/ISO-8859-1
-de_DE/ISO-8859-1
-de_DE@euro/ISO-8859-15
-es_MX/ISO-8859-1
-fa_IR/UTF-8
-fr_FR/ISO-8859-1
-fr_FR@euro/ISO-8859-15
-it_IT/ISO-8859-1
-
diff --git a/sys-libs/glibc/files/nscd.conf b/sys-libs/glibc/files/nscd.conf
deleted file mode 100644
index 226dda377f6d..000000000000
--- a/sys-libs/glibc/files/nscd.conf
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# /etc/nscd.conf
-#
-# An example Name Service Cache config file. This file is needed by nscd.
-#
-# Legal entries are:
-#
-# logfile <file>
-# debug-level <level>
-# threads <#threads to use>
-# server-user <user to run server as instead of root>
-# server-user is ignored if nscd is started with -S parameters
-#
-# enable-cache <service> <yes|no>
-# positive-time-to-live <service> <time in seconds>
-# negative-time-to-live <service> <time in seconds>
-# suggested-size <service> <prime number>
-# check-files <service> <yes|no>
-#
-# Currently supported cache names (services): passwd, group, hosts
-#
-
-
-# logfile /var/log/nscd.log
-# threads 6
-# server-user nobody
- debug-level 0
-
- enable-cache passwd yes
- positive-time-to-live passwd 600
- negative-time-to-live passwd 20
- suggested-size passwd 211
- check-files passwd yes
-
- enable-cache group yes
- positive-time-to-live group 3600
- negative-time-to-live group 60
- suggested-size group 211
- check-files group yes
-
- enable-cache hosts yes
- positive-time-to-live hosts 3600
- negative-time-to-live hosts 20
- suggested-size hosts 211
- check-files hosts yes
diff --git a/sys-libs/glibc/files/test-__thread.c b/sys-libs/glibc/files/test-__thread.c
deleted file mode 100644
index be37c0e2acc2..000000000000
--- a/sys-libs/glibc/files/test-__thread.c
+++ /dev/null
@@ -1,7 +0,0 @@
-extern __thread int i;
-
-int main() {
-
- return 0;
-}
-
diff --git a/sys-libs/glibc/files/test-sysctl_h.c b/sys-libs/glibc/files/test-sysctl_h.c
deleted file mode 100644
index 1512b4d5bca1..000000000000
--- a/sys-libs/glibc/files/test-sysctl_h.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <linux/sysctl.h>
-
-int main()
-{
- return 0;
-}
-
diff --git a/sys-libs/glibc/glibc-2.3.2-r12.ebuild b/sys-libs/glibc/glibc-2.3.2-r12.ebuild
deleted file mode 100644
index 729e45dc5b95..000000000000
--- a/sys-libs/glibc/glibc-2.3.2-r12.ebuild
+++ /dev/null
@@ -1,726 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.2-r12.ebuild,v 1.27 2009/09/23 22:04:09 patrick Exp $
-
-inherit eutils flag-o-matic toolchain-funcs
-
-# Branch update support. Following will disable:
-# BRANCH_UPDATE=
-BRANCH_UPDATE="20031115"
-
-# Minimum kernel version for --enable-kernel
-export MIN_KV="2.4.1"
-# Minimum kernel version for enabling TLS and NPTL ...
-# NOTE: do not change this if you do not know what
-# you are doing !
-export MIN_NPTL_KV="2.6.0"
-
-# (very) Theoretical cross-compiler support
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-MY_PV="${PV/_}"
-S="${WORKDIR}/${P%_*}"
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${MY_PV}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-${MY_PV}.tar.bz2
- http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${MY_PV}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-linuxthreads-${MY_PV}.tar.bz2
- mirror://gentoo/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2
- mirror://gentoo/${P}-manpages.tar.bz2
- hppa? ( mirror://gentoo/${P}-hppa-patches-p1.tar.bz2 )"
-
-LICENSE="LGPL-2"
-[[ ${CTARGET} != ${CHOST} ]] \
- && SLOT="${CTARGET}-2.2" \
- || SLOT="2.2"
-KEYWORDS="alpha amd64 arm hppa ia64 mips ppc s390 sh sparc x86"
-IUSE="build nls nptl userlocales"
-RESTRICT="strip" # we'll handle stripping ourself #46186
-
-# We need new cleanup attribute support from gcc for NPTL among things ...
-DEPEND=">=sys-devel/gcc-3.2.3-r1
- x86? ( nptl? ( >=sys-devel/gcc-3.3.1-r1 ) )
- >=sys-devel/binutils-2.14.90.0.6-r1
- virtual/os-headers
- nls? ( sys-devel/gettext )"
-RDEPEND="nls? ( sys-devel/gettext )"
-PDEPEND="ppc? ( >=sys-kernel/linux-headers-2.4.22 )"
-PROVIDE="virtual/libc"
-
-# Try to get a kernel source tree with version equal or greater
-# than $1. We basically just try a few default locations. The
-# version need to be that which KV_to_int() returns ...
-get_KHV() {
- local headers=
-
- [ -z "$1" ] && return 1
-
- # - First check if linux-headers are installed (or symlink
- # to current kernel ...)
- # - Ok, do we have access to the current kernel's headers ?
- # - Last option ... maybe its a weird bootstrap with /lib
- # binded to the chroot ...
-
- # We do not really support more than 2 arguments ...
- if [ -n "$2" ]
- then
- headers="$2"
- else
- # We try to find the current kernel's headers first,
- # as we would rather build against linux 2.5 headers ...
- headers="/lib/modules/`uname -r`/build/include \
- ${ROOT}/lib/modules/`uname -r`/build/include \
- /usr/src/linux/include \
- ${ROOT}/usr/src/linux/include \
- ${ROOT}/usr/include"
- fi
-
- for x in ${headers}
- do
- local header="${x}/linux/version.h"
-
- if [ -f ${header} ]
- then
-
- local version="`grep 'LINUX_VERSION_CODE' ${header} | \
- sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
-
- if [ "${version}" -ge "$1" ]
- then
- echo "${x}"
-
- return 0
- fi
- fi
- done
-
- return 1
-}
-
-use_nptl() {
- # Enable NPTL support if:
- # - We have 'nptl' in USE
- # - We have linux-2.5 or later kernel (should prob check for 2.4.20 ...)
- if use nptl && [ "`get_KV`" -ge "`KV_to_int ${MIN_NPTL_KV}`" ]
- then
- # Enable NPTL support if:
- # - We have 'x86' in USE and:
- # - a CHOST of "i486-pc-linux-gnu"
- # - a CHOST of "i586-pc-linux-gnu"
- # - a CHOST of "i686-pc-linux-gnu"
- # - Or we have 'alpha' in USE
- # - Or we have 'amd64' in USE
- # - Or we have 'mips' in USE
- # - Or we have 'ppc' in USE
- case $(tc-arch ${CTARGET}) in
- "x86")
- if [ "${CHOST/-*}" = "i486" -o \
- "${CHOST/-*}" = "i586" -o \
- "${CHOST/-*}" = "i686" ]
- then
- return 0
- fi
- ;;
- "alpha"|"amd64"|"mips"|"ppc")
- return 0
- ;;
- *)
- return 1
- ;;
- esac
- fi
-
- return 1
-}
-
-install_locales() {
- einfo "Installing Locale data..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root=${D} \
- localedata/install-locales -C ${buildtarget} || die
- keepdir /usr/lib/locale/ru_RU/LC_MESSAGES
-}
-
-setup_locales() {
- if ! use userlocales ; then
- einfo "userlocales not enabled, installing -ALL- locales..."
- elif [[ -e ${ROOT}/etc/locales.build ]] ; then
- einfo "Installing locales in /etc/locales.build..."
- echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
- cat "${ROOT}"/etc/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
- >> SUPPORTED.locales
- cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
- elif [ -e ${FILESDIR}/locales.build ]; then
- einfo "Installing locales in ${FILESDIR}/locales.build..."
- echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
- cat ${FILESDIR}/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
- >> SUPPORTED.locales
- cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
- else
- einfo "Installing -ALL- locales..."
- fi
- install_locales || die
-}
-
-glibc_setup() {
- # Check if we are going to downgrade, we don't like that
- #local old_version
- #
- #old_version="`best_version glibc`"
- #old_version="${old_version/sys-libs\/glibc-/}"
- #
- #if [ "$old_version" ]; then
- # if [ `python -c "import portage; print int(portage.vercmp(\"${PV}\",\"$old_version\"))"` -lt 0 ]; then
- # if [ "${FORCE_DOWNGRADE}" ]; then
- # ewarn "downgrading glibc, still not recommended, but we'll do as you wish"
- # else
- # eerror "Downgrading glibc is not supported and we strongly recommend that"
- # eerror "you don't do it as it WILL break all applications compiled against"
- # eerror "the new version (most likely including python and portage)."
- # eerror "If you are REALLY sure that you want to do it set "
- # eerror " FORCE_DOWNGRADE=1"
- # eerror "when you try it again."
- # die "glibc downgrade"
- # fi
- # fi
- #fi
-
- # We need gcc 3.2 or later ...
- if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ]
- then
- echo
- eerror "As of glibc-2.3, gcc-3.2 or later is needed"
- eerror "for the build to succeed."
- die "GCC too old"
- fi
-
- echo
-
- if use_nptl
- then
- # The use_nptl should have already taken care of kernel version,
- # arch and CHOST, so now just check if we can find suitable kernel
- # source tree or headers ....
- einfon "Checking for sufficient version kernel headers ... "
- if ! get_KHV "`KV_to_int ${MIN_NPTL_KV}`" &> /dev/null
- then
- echo "no"
- echo
- eerror "Could not find a kernel source tree or headers with"
- eerror "version ${MIN_NPTL_KV} or later! Please correct this"
- eerror "and try again."
- die "Insufficient kernel headers present!"
- else
- echo "yes"
- fi
- fi
-
- if [ "$(KV_to_int $(uname -r))" -gt "`KV_to_int '2.5.68'`" ]
- then
- local KERNEL_HEADERS="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")"
-
- einfon "Checking kernel headers for broken sysctl.h ... "
- if ! gcc -I"${KERNEL_HEADERS}" \
- -c ${FILESDIR}/test-sysctl_h.c -o ${T}/test1.o &> /dev/null
- then
- echo "yes"
- echo
- eerror "Your version of:"
- echo
- eerror " ${KERNEL_HEADERS}/linux/sysctl.h"
- echo
- eerror "is broken (from a user space perspective). Please apply"
- eerror "the following patch:"
- echo
- eerror "*******************************************************"
- cat ${FILESDIR}/fix-sysctl_h.patch
- eerror "*******************************************************"
- echo
- einfo "To fix, just do this:"
- einfo "cd ${KERNEL_HEADERS}/linux/"
- einfo "patch -p3 < ${FILESDIR}/fix-sysctl_h.patch"
- echo
- die "Broken linux/sysctl.h header included in kernel sources!"
- else
- echo "no"
- fi
- fi
-
- if use_nptl
- then
- einfon "Checking gcc for __thread support ... "
- if ! gcc -c ${FILESDIR}/test-__thread.c -o ${T}/test2.o &> /dev/null
- then
- echo "no"
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "please update to gcc-3.2.2-r1 or later, and try again."
- die "No __thread support in gcc!"
- else
- echo "yes"
- fi
-
- elif use nptl &> /dev/null
- then
- echo
- # Just tell the user not to expect too much ...
- ewarn "You have \"nptl\" in your USE, but your kernel version or"
- ewarn "architecture does not support it!"
- fi
-
- echo
-}
-
-src_unpack() {
-
- unpack glibc-${MY_PV}.tar.bz2
-
- # Needed for s390/linux-2.6 headers
- cp ${FILESDIR}/2.3.2/posix_fadvise64.c \
- ${S}/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c \
- || die
-
- # we only need to check this one time. Bug #61856
- glibc_setup
-
- # Extract pre-made man pages. Otherwise we need perl, which is a no-no.
- mkdir -p ${S}/man; cd ${S}/man
- use_nptl || tar xjf ${DISTDIR}/glibc-${MY_PV}-manpages.tar.bz2
-
- cd ${S}
- # Extract our threads package ...
- if (! use_nptl) && [[ -z ${BRANCH_UPDATE} ]] ; then
- unpack glibc-linuxthreads-${MY_PV}.tar.bz2
- fi
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- epatch ${DISTDIR}/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2
- fi
-
- if use_nptl ; then
- epatch ${FILESDIR}/2.3.2/${P}-redhat-nptl-fixes.patch
- else
- epatch ${FILESDIR}/2.3.2/${P}-redhat-linuxthreads-fixes.patch
- fi
-
- # To circumvent problems with propolice __guard and
- # __guard_setup__stack_smash_handler
- #
- # http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml
- if [[ $(tc-arch ${CTARGET}) != "hppa" ]] ; then
- cd ${S}; epatch ${FILESDIR}/${PV}/${P}-propolice-guard-functions-v2.patch
- fi
-
- # With latest versions of glibc, a lot of apps failed on a PaX enabled
- # system with:
- #
- # cannot enable executable stack as shared object requires: Permission denied
- #
- # This is due to PaX 'exec-protecting' the stack, and ld.so then trying
- # to make the stack executable due to some libraries not containing the
- # PT_GNU_STACK section. Bug #32960. <azarah@gentoo.org> (12 Nov 2003).
- epatch ${FILESDIR}/2.3.2/${PN}-2.3.2-dl_execstack-PaX-support.patch
-
- # Upstream patch to fix assert.h
- epatch ${FILESDIR}/2.3.2/${P}-assert.patch
-
- # This next patch fixes a test that will timeout due to ReiserFS' slow handling of sparse files
-# cd ${S}/io; epatch ${FILESDIR}/glibc-2.2.2-test-lfs-timeout.patch
-
- # This add back glibc 2.2 compadibility. See bug #8766 and #9586 for more info,
- # and also:
- #
- # http://lists.debian.org/debian-glibc/2002/debian-glibc-200210/msg00093.html
- #
- # We should think about remoing it in the future after things have settled.
- #
- # Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it.
- #
- # <azarah@gentoo.org> (26 Oct 2002).
- cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-ctype-compat-v3.patch
-
- # One more compat issue which breaks sun-jdk-1.3.1. See bug #8766 for more
- # info, and also:
- #
- # http://sources.redhat.com/ml/libc-alpha/2002-04/msg00143.html
- #
- # Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it.
- #
- # <azarah@gentoo.org> (30 Oct 2002).
- cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libc_wait-compat.patch
-
- # One more compat issue ... libc_stack_end is missing from ld.so.
- # Got this one from diffing redhat glibc tarball .. would help if
- # they used patches and not modified tarball ...
- #
- # <azarah@gentoo.org> (7 Nov 2002).
-# cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-stack_end-compat.patch
-
- # The mathinline.h header omits the middle term of a ?: expression. This
- # is a gcc extension, but since the ISO standard forbids it, it's a
- # GLIBC bug (bug #27142). See also:
- #
- # http://bugs.gentoo.org/show_bug.cgi?id=27142
- #
- cd ${S}; epatch ${FILESDIR}/${PV}/${P}-fix-omitted-operand-in-mathinline_h.patch
-
- # We do not want name_insert() in iconvconfig.c to be defined inside
- # write_output() as it causes issues with PaX.
- cd ${S}; epatch ${FILESDIR}/${PV}/${P}-iconvconfig-name_insert.patch
-
- # Fix broken reverse resolving for IPv6 addresses, bug #42492.
- cd ${S}; epatch ${FILESDIR}/${PV}/${P}-ipv6-bytestring-fix.patch
-
- # A few patches only for the MIPS platform. Descriptions of what they
- # do can be found in the patch headers.
- # <tuxus@gentoo.org> thx <dragon@gentoo.org> (11 Jan 2003)
- # <kumba@gentoo.org> remove tst-rndseek-mips & ulps-mips patches
- if [[ $(tc-arch ${CTARGET}) == "mips" ]] ; then
- cd ${S}
- epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-fpu-cw-mips.patch
- epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libgcc-compat-mips.patch
- epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-librt-mips.patch
- epatch ${FILESDIR}/2.3.2/${P}-mips-add-n32-n64-sysdep-cancel.patch
- epatch ${FILESDIR}/2.3.2/${P}-mips-configure-for-n64-symver.patch
- epatch ${FILESDIR}/2.3.2/${P}-mips-pread-linux2.5.patch
- epatch ${FILESDIR}/2.3.2/${P}-mips-fix-nested-entend-pairs.patch
- fi
-
- if [[ $(tc-arch ${CTARGET}) == "alpha" ]] ; then
- cd ${S}
- # Fix compatability with compaq compilers by ifdef'ing out some
- # 2.3.2 additions.
- # <taviso@gentoo.org> (14 Jun 2003).
- epatch ${FILESDIR}/2.3.2/${P}-decc-compaq.patch
-
- # Fix compilation with >=gcc-3.2.3 (01 Nov 2003 agriffis)
- epatch ${FILESDIR}/2.3.2/${P}-alpha-pwrite.patch
- epatch ${FILESDIR}/2.3.2/${P}-alpha-crti.patch
-
- # Fix building with 2.6 headers #52764
- epatch ${FILESDIR}/2.3.2/${P}-alpha-sysdeps.patch
- fi
-
- if [[ $(tc-arch ${CTARGET}) == "amd64" ]] ; then
- cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-amd64-nomultilib.patch
- fi
-
- if [[ $(tc-arch ${CTARGET}) == "ia64" ]] ; then
- # The basically problem is glibc doesn't store information about
- # what the kernel interface is so that it can't efficiently set up
- # parameters for system calls. This patch from H.J. Lu fixes it:
- #
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00165.html
- #
- cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-ia64-LOAD_ARGS-fixup.patch
- fi
-
- if [[ $(tc-arch ${CTARGET}) == "hppa" ]] ; then
- cd ${WORKDIR}
- unpack ${P}-hppa-patches-p1.tar.bz2
- cd ${S}
- epatch "${FILESDIR}"/2.3.4/hppa-no-pie.patch
- EPATCH_EXCLUDE="010* 020* 030* 040* 050* 055*"
- for i in ${EPATCH_EXCLUDE}
- do
- rm -f ${WORKDIR}/${P}-hppa-patches/$i
- done
- for i in ${WORKDIR}/${P}-hppa-patches/*
- do
- einfo Applying `basename $i`...
- patch -p1 < $i
- done
- einfo Applying glibc23-07-hppa-atomicity.dpatch...
- patch -p 1 < ${FILESDIR}/2.3.1/glibc23-07-hppa-atomicity.dpatch
- fi
-
- if [[ $(tc-arch ${CTARGET}) == "s390" ]] ; then
- # The deprecated ustat.h causes problems on s390
- #
- # http://sources.redhat.com/ml/bug-glibc/2003-08/msg00020.html
- #
- # Closes Bug 47415
- cd ${S}/sysdeps/unix/sysv/linux; epatch ${FILESDIR}/2.3.2/${P}-s390-deprecated-ustat-fixup.patch
- fi
-
- if [[ $(tc-arch ${CTARGET}) == "arm" ]] ; then
- cd ${S}
- # sjlj exceptions causes undefined frame variables (ported from cvs)
- epatch ${FILESDIR}/2.3.2/${P}-framestate-USING_SJLJ_EXCEPTIONS.patch
- # BUS_ISA is needed in ioperm.c but is defined in linux/input.h
- epatch ${FILESDIR}/2.3.2/${P}-arm-bus-defines.patch
- # armformat fixes the linker script creation (taken from netwinder.org glibc rpm)
- epatch ${FILESDIR}/2.3.2/${P}-armformat.patch
- fi
-
- # Fix info leakage #59526
- cd ${S}; epatch ${FILESDIR}/glibc-sec-hotfix-20040804.patch
-
- # Improved handled temporary files. bug #66358
- epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-tempfile.patch
-
- # Fix permissions on some of the scripts
- chmod u+x ${S}/scripts/*.sh
-}
-
-setup_flags() {
- # Over-zealous CFLAGS can often cause problems. What may work for one person may not
- # work for another. To avoid a large influx of bugs relating to failed builds, we
- # strip most CFLAGS out to ensure as few problems as possible.
- strip-flags
- strip-unsupported-flags
-
- # -freorder-blocks for all but ia64 s390 s390x
- use ppc || append-flags "-freorder-blocks"
-
- # Sparc/Sparc64 support
- if use sparc
- then
-
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- replace-flags "-fcall-used-g7" ""
- append-flags "-fcall-used-g6"
-
- # Sparc64 Only support...
- if [ "${PROFILE_ARCH}" = "sparc64" ]
- then
-
- # Get rid of -mcpu options, the CHOST will fix this up
- replace-flags "-mcpu=ultrasparc" ""
- replace-flags "-mcpu=v9" ""
-
- # Get rid of flags known to fail
- replace-flags "-mvis" ""
-
- # Setup the CHOST properly to insure "sparcv9"
- # This passes -mcpu=ultrasparc -Wa,-Av9a to the compiler
- [ "${CHOST}" == "sparc-unknown-linux-gnu" ] && \
- export CHOST="sparcv9-unknown-linux-gnu"
- fi
- fi
-
- # We don't want these flags for glibc
- filter-flags -fomit-frame-pointer -malign-double
- filter-ldflags -pie
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be conservative here
- append-flags -O2
- export LDFLAGS="${LDFLAGS//-Wl,--relax}"
-}
-
-src_compile() {
- local myconf=
- local myconf_nptl=
-
- setup_flags
-
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- use nls || myconf="${myconf} --disable-nls"
-
- if use_nptl
- then
- local kernelheaders="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")"
-
- # NTPL and Thread Local Storage support.
- myconf="${myconf} --with-tls --with-__thread \
- --enable-add-ons=nptl \
- --enable-kernel=${MIN_NPTL_KV} \
- --with-headers=${kernelheaders}"
- else
- myconf="${myconf} --without-__thread \
- --enable-add-ons=linuxthreads"
-
- # If we build for the build system we use the kernel headers from the target
- # We also now set it without "build" as well, else it might use the
- # current kernel's headers, which might just fail (the linux-headers
- # package is usually well tested...)
-# ( use build || use sparc ) \
-# && myconf="${myconf} --with-headers=${ROOT}usr/include"
- myconf="${myconf} --with-headers=${ROOT}usr/include"
-
- # If kernel version and headers in ${ROOT}/usr/include are ok,
- # then enable --enable-kernel=${MIN_KV} ...
- if [ "`get_KV`" -ge "`KV_to_int ${MIN_KV}`" -a \
- -n "$(get_KHV "`KV_to_int ${MIN_KV}`" "${ROOT}/usr/include")" ]
- then
- myconf="${myconf} --enable-kernel=${MIN_KV}"
- else
- myconf="${myconf} --enable-kernel=2.2.5"
- fi
- fi
-
- # some silly people set LD_RUN_PATH and that breaks things.
- # see bug 19043
- unset LD_RUN_PATH
-
- einfo "Configuring GLIBC..."
- rm -rf ${S}/buildhere
- mkdir -p ${S}/buildhere
- cd ${S}/buildhere
- ../configure --build=${CHOST} \
- --host=${CHOST} \
- --with-gd=no \
- --without-cvs \
- --disable-profile \
- --prefix=/usr \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --libexecdir=/usr/lib/misc \
- ${myconf} || die
-
- einfo "Building GLIBC..."
- cd ${S}/buildhere
- make PARALLELMFLAGS="${MAKEOPTS}" || die
-# einfo "Doing GLIBC checks..."
-# make check
-}
-
-src_test() {
- # This is wrong, but glibc's tests fail bad when screwing
- # around with sandbox, so lets just punt it
- unset LD_PRELOAD
-
- cd ${S}/buildhere
- make check || die "make check failed :("
-}
-
-src_install() {
- local buildtarget="buildhere"
-
- setup_flags
-
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- einfo "Installing GLIBC..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root=${D} \
- install -C ${buildtarget} || die
- # now, strip everything but the thread libs #46186
- mkdir ${T}/thread-backup
- mv ${D}/lib/lib{pthread,thread_db}* ${T}/thread-backup/
- env -uRESTRICT CHOST=${CTARGET} prepallstrip
- mv ${T}/thread-backup/* ${D}/lib/
-
- # If librt.so is a symlink, change it into linker script (Redhat)
- if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ]
- then
- local LIBRTSO="`cd ${D}/lib; echo librt.so.*`"
- local LIBPTHREADSO="`cd ${D}/lib; echo libpthread.so.*`"
-
- rm -f ${D}/usr/lib/librt.so
- cat > ${D}/usr/lib/librt.so <<EOF
-/* GNU ld script
- librt.so.1 needs libpthread.so.0 to come before libc.so.6*
- in search scope. */
-EOF
- grep "OUTPUT_FORMAT" ${D}/usr/lib/libc.so >> ${D}/usr/lib/librt.so
- echo "GROUP ( /lib/${LIBPTHREADSO} /lib/${LIBRTSO} )" \
- >> ${D}/usr/lib/librt.so
-
- for x in ${D}/usr/lib/librt.so.[1-9]
- do
- [ -L "${x}" ] && rm -f ${x}
- done
- fi
-
- if ! use build
- then
- if ! has noinfo ${FEATURES} ; then
- einfo "Installing Info pages..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root=${D} \
- info -C ${buildtarget} || die
- fi
-
- setup_locales
-
- einfo "Installing man pages and docs..."
- # Install linuxthreads man pages
- use_nptl || {
- dodir /usr/share/man/man3
- doman ${S}/man/*.3thr
- }
-
- # Install nscd config file
- insinto /etc ; doins ${FILESDIR}/nscd.conf
- exeinto /etc/init.d ; doexe ${FILESDIR}/nscd
- doins "${FILESDIR}"/nsswitch.conf
-
- dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE \
- NEWS NOTES PROJECTS README*
- else
- rm -rf ${D}/usr/share ${D}/usr/lib/gconv
-
- einfo "Installing Timezone data..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root=${D} \
- timezone/install-others -C ${buildtarget} || die
- fi
- insinto /etc
- # This is our new config file for building locales
- doins ${FILESDIR}/locales.build
-
- # Is this next line actually needed or does the makefile get it right?
- # It previously has 0755 perms which was killing things.
- fperms 4755 /usr/lib/misc/pt_chown
-
- # Currently libraries in /usr/lib/gconv do not get loaded if not
- # in search path ...
-# insinto /etc/env.d
-# doins ${FILESDIR}/03glibc
-
- rm -f ${D}/etc/ld.so.cache
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f ${D}/etc/localtime
-
- # Some things want this, notably ash.
- dosym /usr/lib/libbsd-compat.a /usr/lib/libbsd.a
-}
-
-pkg_preinst() {
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locales.build ]] && rm -f "${D}"/etc/locales.build
-}
-
-pkg_postinst() {
- # Correct me if I am wrong here, but my /etc/localtime is a file
- # created by zic ....
- # I am thinking that it should only be recreated if no /etc/localtime
- # exists, or if it is an invalid symlink.
- #
- # For invalid symlink:
- # -f && -e will fail
- # -L will succeed
- #
- if [ ! -e ${ROOT}/etc/localtime ]
- then
- echo "Please remember to set your timezone using the zic command."
- rm -f ${ROOT}/etc/localtime
- ln -s ../usr/share/zoneinfo/Factory ${ROOT}/etc/localtime
- fi
-
- if [ -x ${ROOT}/usr/sbin/iconvconfig ]
- then
- # Generate fastloading iconv module configuration file.
- ${ROOT}/usr/sbin/iconvconfig --prefix=${ROOT}
- fi
-
- # Reload init ...
- if [ "${ROOT}" = "/" ]
- then
- /sbin/telinit U &> /dev/null
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.3.5-r3.ebuild b/sys-libs/glibc/glibc-2.3.5-r3.ebuild
deleted file mode 100644
index 847a1b7df736..000000000000
--- a/sys-libs/glibc/glibc-2.3.5-r3.ebuild
+++ /dev/null
@@ -1,1285 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.5-r3.ebuild,v 1.38 2009/12/10 01:31:25 vapier Exp $
-
-# 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/
-
-KEYWORDS="-* alpha amd64 arm -hppa ia64 m68k mips ppc ~s390 sh sparc x86"
-
-BRANCH_UPDATE=""
-
-# From linuxthreads/man
-GLIBC_MANPAGE_VERSION="2.3.5"
-
-# From manual
-GLIBC_INFOPAGE_VERSION="2.3.5"
-
-# Gentoo patchset
-PATCH_VER="1.16"
-
-# C Stubbs addon (contained in fedora, so ignoring)
-#CSTUBS_VER="2.1.2"
-#CSTUBS_TARBALL="c_stubs-${CSTUBS_VER}.tar.bz2"
-#CSTUBS_URI="mirror://gentoo/${CSTUBS_TARBALL}"
-
-# Fedora addons (from RHEL's glibc-2.3.4-2.src.rpm)
-FEDORA_VER="20041219T2331"
-FEDORA_TARBALL="glibc-fedora-${FEDORA_VER}.tar.bz2"
-FEDORA_URI="mirror://gentoo/${FEDORA_TARBALL}"
-
-GENTOO_TOOLCHAIN_BASE_URI="mirror://gentoo"
-
-### PUNT OUT TO ECLASS?? ###
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-LICENSE="LGPL-2"
-
-IUSE="nls build nptl nptlonly erandom hardened userlocales multilib selinux glibc-compat20 glibc-omitfp linuxthreads-tls profile"
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- PROVIDE="virtual/libc"
-fi
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
-
-# Don't set this to :-, - allows BRANCH_UPDATE=""
-BRANCH_UPDATE=${BRANCH_UPDATE-$(get_version_component_range 4)}
-
-# (Recent snapshots fails with 2.6.5 and earlier with NPTL)
-NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-"2.6.6"}
-LT_KERNEL_VERSION=${LT_KERNEL_VERSION:-"2.4.1"}
-
-### SRC_URI ###
-
-# This function handles the basics of setting the SRC_URI for a glibc ebuild.
-# To use, set SRC_URI with:
-#
-# SRC_URI="$(get_glibc_src_uri)"
-#
-# Other than the variables normally set by portage, this function's behavior
-# can be altered by setting the following:
-#
-# GENTOO_TOOLCHAIN_BASE_URI
-# This sets the base URI for all gentoo-specific patch files. Note
-# that this variable is only important for a brief period of time,
-# before your source files get picked up by mirrors. However, it is
-# still highly suggested that you keep files in this location
-# available.
-#
-# BRANCH_UPDATE
-# If set, this variable signals that we should be using the main
-# release tarball (determined by ebuild version) and applying a
-# CVS branch update patch against it. The location of this branch
-# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
-# Just like with SNAPSHOT, this variable is ignored if the ebuild
-# has a _pre suffix.
-#
-# PATCH_VER
-# PATCH_GLIBC_VER
-# This should be set to the version of the gentoo patch tarball.
-# The resulting filename of this tarball will be:
-# glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
-#
-# GLIBC_MANPAGE_VERSION
-# GLIBC_INFOPAGE_VERSION
-# The version of glibc for which we will download pages. This will
-# default to ${GLIBC_RELEASE_VER}, but we may not want to pre-generate man pages
-# for prerelease test ebuilds for example. This allows you to
-# continue using pre-generated manpages from the last stable release.
-# If set to "none", this will prevent the downloading of manpages,
-# which is useful for individual library targets.
-#
-get_glibc_src_uri() {
- GENTOO_TOOLCHAIN_BASE_URI=${GENTOO_TOOLCHAIN_BASE_URI:-"mirror://gentoo"}
-
-# GLIBC_SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2
- GLIBC_SRC_URI="mirror://gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2"
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2"
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2"
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2"
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2"
- fi
-
- if [[ -n ${CSTUBS_URI} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI} ${CSTUBS_URI}"
- fi
-
- if [[ -n ${FEDORA_URI} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI} ${FEDORA_URI}"
- fi
-
- echo "${GLIBC_SRC_URI}"
-}
-
-SRC_URI=$(get_glibc_src_uri)
-S=${WORKDIR}/glibc-${GLIBC_RELEASE_VER}
-
-### EXPORTED FUNCTIONS ###
-toolchain-glibc_src_unpack() {
- # Check NPTL support _before_ we unpack things to save some time
- want_nptl && check_nptl_support
-
- unpack glibc-${GLIBC_RELEASE_VER}.tar.bz2
-
- cd "${S}"
- unpack glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
- unpack glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2
-
- [[ -n ${CSTUBS_TARBALL} ]] && unpack ${CSTUBS_TARBALL}
- [[ -n ${FEDORA_TARBALL} ]] && unpack ${FEDORA_TARBALL}
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${WORKDIR}"
- unpack glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- fi
-
- # XXX: We should do the branchupdate, before extracting the manpages and
- # infopages else it does not help much (mtimes change if there is a change
- # to them with branchupdate)
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- cd "${S}"
- epatch "${DISTDIR}"/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
-
- # Snapshot date patch
- einfo "Patching version to display snapshot date ..."
- sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- cd "${WORKDIR}"
- unpack glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- cd "${S}"
- unpack glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${S}"
- EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-${PATCH_VER} ..." \
- EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
- EPATCH_SUFFIX="patch" \
- ARCH=$(tc-arch) \
- epatch "${WORKDIR}"/patches
- fi
-}
-
-toolchain-glibc_src_compile() {
- # Set gconvdir to /usr/$(get_libdir)/gconv on archs with multiple ABIs
- local MAKEFLAGS=""
- has_multilib_profile && MAKEFLAGS="gconvdir=$(alt_usrlibdir)/gconv"
-
- echo
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
- einfo " $(printf '%15s' ${v}:) ${!v}"
- done
- echo
-
- if want_linuxthreads ; then
- glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" ${MAKEFLAGS} || die
- fi
- if want_nptl ; then
- # ... and then do the optional nptl build
- unset LD_ASSUME_KERNEL
- glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" ${MAKEFLAGS} || die
- fi
-}
-
-toolchain-glibc_src_test() {
- # This is wrong, but glibc's tests fail bad when screwing
- # around with sandbox, so lets just punt it
- unset LD_PRELOAD
-
- # do the linuxthreads build unless we're using nptlonly
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Checking GLIBC with linuxthreads..."
- make check || die "linuxthreads glibc did not pass make check"
- fi
- if want_nptl ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- unset LD_ASSUME_KERNEL || :
- einfo "Checking GLIBC with NPTL..."
- make check || die "nptl glibc did not pass make check"
- fi
-}
-
-toolchain-glibc_pkg_preinst() {
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && ! { want_nptl && want_linuxthreads; }; then
- addwrite "${ROOT}"/$(alt_libdir)/
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locales.build ]] && rm -f "${D}"/etc/locales.build
-}
-
-toolchain-glibc_src_install() {
- # Need to dodir first because it might not exist (bad amd64 profiles)
- dodir $(alt_usrlibdir)
-
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${D}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${D}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- rm -rf "${D}"$(alt_prefix)/{bin,etc,$(get_libdir)/{gconv,misc},sbin,share}
- else
- # zoneinfo stuff is now provided by the timezone-data package
- rm -rf "${D}"/usr/share/zoneinfo
- rm -f "${D}"/usr/bin/tzselect
- rm -f "${D}"/usr/sbin/{zic,zdump}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- mkdir -p "${D}"$(alt_libdir)/tls/
-
- libcsofile=$(basename "${D}"$(alt_libdir)/libc-*.so)
- cp -a libc.so "${D}"$(alt_libdir)/tls/${libcsofile} || die
- dosym ${libcsofile} $(alt_libdir)/tls/$(ls libc.so.*)
-
- libmsofile=$(basename "${D}"$(alt_libdir)/libm-*.so)
- pushd math > /dev/null
- cp -a libm.so "${D}"$(alt_libdir)/tls/${libmsofile} || die
- dosym ${libmsofile} $(alt_libdir)/tls/$(ls libm.so.*)
- popd > /dev/null
-
- librtsofile=$(basename "${D}"$(alt_libdir)/librt-*.so)
- pushd rt > /dev/null
- cp -a librt.so "${D}"$(alt_libdir)/tls/${librtsofile} || die
- dosym ${librtsofile} $(alt_libdir)/tls/$(ls librt.so.*)
- popd > /dev/null
-
- libthreaddbsofile=$(basename "${D}"$(alt_libdir)/libthread_db-*.so)
- pushd nptl_db > /dev/null
- cp -a libthread_db.so "${D}"$(alt_libdir)/tls/${libthreaddbsofile} || die
- dosym ${libthreaddbsofile} $(alt_libdir)/tls/$(ls libthread_db.so.*)
- popd > /dev/null
-
- libpthreadsofile=libpthread-${GLIBC_RELEASE_VER}.so
- cp -a nptl/libpthread.so "${D}"$(alt_libdir)/tls/${libpthreadsofile} || die
- dosym ${libpthreadsofile} $(alt_libdir)/tls/libpthread.so.0
-
- # and now for the static libs
- mkdir -p "${D}"$(alt_usrlibdir)/nptl
- cp -a libc.a nptl/libpthread.a nptl/libpthread_nonshared.a rt/librt.a \
- "${D}"$(alt_usrlibdir)/nptl
-
- # linker script crap
- for lib in libc libpthread; do
- sed -e "s:$(alt_libdir)/${lib}.so:$(alt_libdir)/tls/${lib}.so:g" \
- -e "s:$(alt_usrlibdir)/${lib}_nonshared.a:$(alt_usrlibdir)/nptl/${lib}_nonshared.a:g" \
- "${D}"$(alt_usrlibdir)/${lib}.so \
- > "${D}"$(alt_usrlibdir)/nptl/${lib}.so
-
- chmod 755 "${D}"$(alt_usrlibdir)/nptl/${lib}.so
- done
-
- dosym ../librt.so $(alt_usrlibdir)/nptl/librt.so
-
- # last but not least... headers.
- mkdir -p "${D}"/nptl "${D}"$(alt_headers)/nptl
- make install_root="${D}"/nptl install-headers PARALLELMFLAGS="${MAKEOPTS} -j1"
- pushd "${D}"/nptl/$(alt_headers) > /dev/null
- for i in $(find . -type f) ; do
- if ! [[ -f ${D}$(alt_headers)/$i ]] \
- || ! cmp -s $i ${D}$(alt_headers)/$i; then
- mkdir -p ${D}$(alt_headers)/nptl/`dirname $i`
- cp -a $i ${D}$(alt_headers)/nptl/$i
- fi
- done
- popd > /dev/null
- rm -rf ${D}/nptl
- fi
-
- # We'll take care of the cache ourselves
- rm -f ${D}/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym include $(alt_prefix)/sys-include
- dosym . $(alt_prefix)/usr
- return 0
- fi
-
- # Everything past this point just needs to be done once... don't waste time building locale files twice...
- is_final_abi || return 0
-
- if want_linuxthreads ; then
- MYMAINBUILDDIR=build-${ABI}-${CTARGET}-linuxthreads
- else
- MYMAINBUILDDIR=build-${ABI}-${CTARGET}-nptl
- fi
- cd "${WORKDIR}"/${MYMAINBUILDDIR}
- if ! use build ; then
- if ! has noinfo ${FEATURES} && [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- einfo "Installing info pages..."
-
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root=${D} \
- info -i
- fi
-
- setup_locales
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- # Install nscd config file
- insinto /etc
- doins ${FILESDIR}/nscd.conf
- doins "${FILESDIR}"/nsswitch.conf
-
- doinitd "${FILESDIR}"/nscd
-
- cd ${S}
- dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE NEWS NOTES PROJECTS README*
- else
- rm -rf ${D}/usr/share
- for dir in $(get_all_libdirs); do
- rm -rf ${D}/usr/${dir}/gconv &> /dev/null
- done
-
- einfo "Installing Timezone data..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root=${D} \
- timezone/install-others || die
- fi
-
- # Is this next line actually needed or does the makefile get it right?
- # It previously has 0755 perms which was killing things.
- fperms 4711 $(alt_prefix)/lib/misc/glibc/pt_chown
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f ${D}/etc/localtime
-
- insinto /etc
- # This is our new config file for building locales
- doins ${FILESDIR}/locales.build
- # example host.conf with multicast dns disabled by default
- doins ${FILESDIR}/2.3.4/host.conf
-
- # simple test to make sure our new glibc isnt completely broken.
- # for now, skip the multilib scenario. also make sure we don't
- # test with statically built binaries since they will fail.
- [[ ${CBUILD} != ${CHOST} ]] && return 0
- [[ $(get_libdir) != "lib" ]] && return 0
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest/statically linked} != "${striptest}" ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-toolchain-glibc_pkg_postinst() {
- # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
- # isn't removed in unmerge which happens sometimes. See bug #87671
- if ! is_crosscompile && want_linuxthreads ; then
- for libdir in $(get_all_libdirs) ; do
- for f in ${ROOT}/${libdir}/libpthread-2.* ${ROOT}/${libdir}/libpthread-0.6* ; do
- if [[ -f ${f} ]] ; then
- rm -f ${f}
- ldconfig
- fi
- done
- done
- fi
-
- if ! is_crosscompile && [ -x "${ROOT}/usr/sbin/iconvconfig" ] ; then
- # Generate fastloading iconv module configuration file.
- ${ROOT}/usr/sbin/iconvconfig --prefix=${ROOT}
- fi
-
- if [ ! -e "${ROOT}/lib/ld.so.1" ] && use ppc64 && ! has_multilib_profile ; then
- ## SHOULDN'T THIS BE lib64??
- ln -s ld64.so.1 ${ROOT}/lib/ld.so.1
- fi
-
- # Reload init ...
- if ! is_crosscompile && [ "${ROOT}" = "/" ] ; then
- /sbin/telinit U &> /dev/null
- fi
-
- # warn the few multicast-dns-by-default users we've had about the change
- # in behavior...
- echo
- einfo "Gentoo's glibc now disables multicast dns by default in our"
- einfo "example host.conf. To re-enable this functionality, simply"
- einfo "remove the line that disables it (mdns off)."
- echo
-
- if want_nptl && want_linuxthreads ; then
- einfo "The default behavior of glibc on your system is to use NPTL. If"
- einfo "you want to use linuxthreads for a particular program, start it"
- einfo "by executing 'LD_ASSUME_KERNEL=${LT_KERNEL_VERSION} <program> [<options>]'"
- echo
- fi
-}
-
-### SUPPORT FUNCTIONS ###
-# We need to be able to set alternative headers for
-# compiling for non-native platform
-# Will also become useful for testing kernel-headers without screwing up
-# the whole system.
-# note: intentionally undocumented.
-alt_headers() {
- if [[ -z ${ALT_HEADERS} ]] ; then
- if is_crosscompile ; then
- ALT_HEADERS="/usr/${CTARGET}/include"
- else
- ALT_HEADERS="/usr/include"
- fi
- fi
- echo "${ALT_HEADERS}"
-}
-alt_build_headers() {
- if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS=$(alt_headers)
- tc-is-cross-compiler && ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
- fi
- echo "${ALT_BUILD_HEADERS}"
-}
-
-alt_prefix() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}
- else
- echo /usr
- fi
-}
-
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-alt_usrlibdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /usr/$(get_libdir)
- fi
-}
-
-setup_flags() {
- # Make sure host make.conf doesn't pollute us
- if is_crosscompile || tc-is-cross-compiler ; then
- CHOST=${CTARGET} strip-unsupported-flags
- fi
-
- # Store our CFLAGS because it's changed depending on which CTARGET
- # we are building when pulling glibc on a multilib profile
- CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
- CFLAGS=${CFLAGS_BASE}
- ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
- ASFLAGS=${ASFLAGS_BASE}
-
- # Over-zealous CFLAGS can often cause problems. What may work for one
- # person may not work for another. To avoid a large influx of bugs
- # relating to failed builds, we strip most CFLAGS out to ensure as few
- # problems as possible.
- strip-flags
- strip-unsupported-flags
- filter-flags -m32 -m64 -mabi=*
-
- unset CBUILD_OPT CTARGET_OPT
- if has_multilib_profile ; then
- CTARGET_OPT=$(get_abi_CTARGET)
- [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
- fi
-
- case $(tc-arch) in
- amd64)
- # Punt this when amd64's 2004.3 is removed
- CFLAGS_x86="-m32"
- ;;
- ppc)
- append-flags "-freorder-blocks"
- ;;
- sparc)
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- filter-flags "-fcall-used-g7"
- append-flags "-fcall-used-g6"
- filter-flags "-mvis"
-
- if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
- case ${ABI} in
- sparc64)
- filter-flags -Wa,-xarch -Wa,-A
-
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparc64b-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9b"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
- else
- CTARGET_OPT="sparc64-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9a"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
- fi
- ;;
- *)
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- else
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- ;;
- esac
- else
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- elif { is_crosscompile && want_nptl; } || is-flag "-mcpu=ultrasparc2" || is-flag "-mcpu=ultrasparc"; then
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- fi
- ;;
- esac
-
- if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
- CBUILD_OPT=${CTARGET_OPT}
- fi
-
- if $(tc-getCC ${CTARGET}) -v 2>&1 | grep -q 'gcc version 3.[0123]'; then
- append-flags -finline-limit=2000
- fi
-
- # We don't want these flags for glibc
- filter-ldflags -pie
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be
- # conservative here
- filter-flags -O?
- append-flags -O2
-}
-
-check_kheader_version() {
- local header="$(alt_build_headers)/linux/version.h"
-
- [[ -z $1 ]] && return 1
-
- if [ -f "${header}" ] ; then
- local version="`grep 'LINUX_VERSION_CODE' ${header} | \
- sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
-
- if [ "${version}" -ge "$1" ] ; then
- return 0
- fi
- fi
-
- return 1
-}
-
-check_nptl_support() {
- local min_kernel_version="$(KV_to_int "${NPTL_KERNEL_VERSION}")"
-
- echo
-
- einfon "Checking gcc for __thread support ... "
- if want__thread ; then
- echo "yes"
- else
- echo "no"
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "please update to gcc-3.2.2-r1 or later, and try again."
- die "No __thread support in gcc!"
- fi
-
- # Building fails on an non-supporting kernel
- einfon "Checking kernel version (>=${NPTL_KERNEL_VERSION}) ... "
- if [ "`get_KV`" -lt "${min_kernel_version}" ] ; then
- echo "no"
- echo
- eerror "You need a kernel of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "Kernel version too low!"
- else
- echo "yes"
- fi
-
- # Building fails with too low linux-headers
- einfon "Checking linux-headers version (>=${NPTL_KERNEL_VERSION}) ... "
- if ! check_kheader_version "${min_kernel_version}"; then
- echo "no"
- echo
- eerror "You need linux-headers of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "linux-headers version too low!"
- else
- echo "yes"
- fi
-
- echo
-}
-
-want_nptl() {
- want_tls || return 1
- use nptl || return 1
-
- # Archs that can use NPTL
- case $(tc-arch) in
- alpha|amd64|ia64|mips|ppc|ppc64|s390|sh|x86)
- return 0;
- ;;
- sparc)
- # >= v9 is needed for nptl.
- [[ "${PROFILE_ARCH}" == "sparc" ]] && return 1
- return 0;
- ;;
- esac
-
- return 1
-}
-
-want_linuxthreads() {
- ! use nptlonly && return 0
- want_nptl || return 0
- return 1
-}
-
-want_tls() {
- # Archs that can use TLS (Thread Local Storage)
- case $(tc-arch) in
- alpha|amd64|ia64|mips|ppc|ppc64|s390|sh)
- return 0;
- ;;
- sparc)
- # 2.3.6 should have tls support on sparc64
- # when using newer binutils
- case ${CTARGET/-*} in
- sparc64*) return 1 ;;
- *) return 0 ;;
- esac
- ;;
- x86)
- # requires i486 or better #106556
- [[ ${CTARGET} == i[4567]86* ]] && return 0
- ;;
- esac
-
- return 1
-}
-
-want__thread() {
- want_tls || return 1
-
- # For some reason --with-tls --with__thread is causing segfaults on sparc32.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
-
- [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
-
- $(tc-getCC ${CTARGET}) -c ${FILESDIR}/test-__thread.c -o ${T}/test2.o &> /dev/null
- WANT__THREAD=$?
-
- return ${WANT__THREAD}
-}
-
-install_locales() {
- unset LANGUAGE LANG LC_ALL
- cd "${WORKDIR}"/${MYMAINBUILDDIR} || die "${WORKDIR}/${MYMAINBUILDDIR}"
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root=${D} localedata/install-locales || die
-}
-
-setup_locales() {
- if use !userlocales ; then
- einfo "userlocales not enabled, installing -ALL- locales..."
- install_locales || die
- elif [ -e /etc/locales.build ] ; then
- einfo "Installing locales in /etc/locales.build..."
- echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
- cat /etc/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
- >> SUPPORTED.locales
- cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
- install_locales || die
- elif [ -e ${FILESDIR}/locales.build ] ; then
- einfo "Installing locales in ${FILESDIR}/locales.build..."
- echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
- cat ${FILESDIR}/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
- >> SUPPORTED.locales
- cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
- install_locales || die
- else
- einfo "Installing -ALL- locales..."
- install_locales || die
- fi
-}
-
-glibc_do_configure() {
- local myconf
-
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
- # silly users
- unset LD_RUN_PATH
-
- # set addons
- pushd ${S} > /dev/null
- ADDONS=$(echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d')
- use glibc-compat20 && [[ -d glibc-compat ]] && ADDONS="${ADDONS},glibc-compat"
- popd > /dev/null
-
- use nls || myconf="${myconf} --disable-nls"
- use erandom || myconf="${myconf} --disable-dev-erandom"
-
- use glibc-omitfp && myconf="${myconf} --enable-omitfp"
-
- [[ ${CTARGET} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
-
- if [ "$1" == "linuxthreads" ] ; then
- if want_tls && [[ ${CTARGET} != i[45]86-* ]] ; then
- myconf="${myconf} --with-tls"
-
- if want__thread && use linuxthreads-tls ; then
- myconf="${myconf} --with-__thread"
- else
- myconf="${myconf} --without-__thread"
- fi
- else
- myconf="${myconf} --without-tls --without-__thread"
- fi
-
- myconf="${myconf} --enable-add-ons=linuxthreads${ADDONS}"
- myconf="${myconf} --enable-kernel=${LT_KERNEL_VERSION}"
- elif [ "$1" == "nptl" ] ; then
- myconf="${myconf} --with-tls --with-__thread"
- myconf="${myconf} --enable-add-ons=nptl${ADDONS}"
- myconf="${myconf} --enable-kernel=${NPTL_KERNEL_VERSION}"
- else
- die "invalid pthread option"
- fi
-
- # Since SELinux support is only required for nscd, only enable it if:
- # 1. USE selinux
- # 2. ! USE build
- # 3. only for the primary ABI on multilib systems
- if use selinux && ! use build; then
- if use multilib || has_multilib_profile; then
- if is_final_abi; then
- myconf="${myconf} --with-selinux"
- else
- myconf="${myconf} --without-selinux"
- fi
- else
- myconf="${myconf} --with-selinux"
- fi
- else
- myconf="${myconf} --without-selinux"
- fi
-
- # Pick out the correct location for build headers
- myconf="${myconf}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- $(use_enable profile)
- --without-gd
- --with-headers=$(alt_build_headers)
- --prefix=$(alt_prefix)
- --mandir=$(alt_prefix)/share/man
- --infodir=$(alt_prefix)/share/info
- --libexecdir=$(alt_prefix)/lib/misc/glibc
- ${EXTRA_ECONF}"
-
- has_version app-admin/eselect-compiler || export CC="$(tc-getCC ${CTARGET})"
-
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
- mkdir -p ${GBUILDDIR}
- cd ${GBUILDDIR}
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
- ${S}/configure ${myconf} || die "failed to configure glibc"
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- addwrite ${ROOT}/
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- addwrite ${ROOT}/usr
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- addwrite ${ROOT}/usr/X11R6
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-use_multilib() {
- case ${CTARGET} in
- sparc64*|mips64*|x86_64*|powerpc64*|s390x*)
- has_multilib_profile || use multilib ;;
- *) false ;;
- esac
-}
-
-# Setup toolchain variables that would be defined in the profiles for these archs.
-setup_env() {
- if is_crosscompile || tc-is-cross-compiler ; then
- multilib_env ${CTARGET}
- if ! use multilib ; then
- MULTILIB_ABIS=${DEFAULT_ABI}
- else
- MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
- fi
-
- # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
- # and fall back on CFLAGS.
- local VAR=CFLAGS_${CTARGET//[-.]/_}
- CFLAGS=${!VAR-${CFLAGS}}
- fi
-
- setup_flags
-
- export ABI=${ABI:-${DEFAULT_ABI:-default}}
-
- if is_crosscompile || tc-is-cross-compiler ; then
- local VAR=CFLAGS_${ABI}
- # We need to export CFLAGS with abi information in them because
- # glibc's configure script checks CFLAGS for some targets (like mips)
- export CFLAGS="${!VAR} ${CFLAGS}"
- fi
-}
-
-### /ECLASS PUNTAGE ###
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- SLOT="2.2"
-fi
-
-# we'll handle stripping ourself #46186
-RESTRICT="strip"
-EMULTILIB_PKG="true"
-
-# We need new cleanup attribute support from gcc for NPTL among things ...
-# We also need linux26-headers if using NPTL. Including kernel headers is
-# incredibly unreliable, and this new linux-headers release from plasmaroo
-# should work with userspace apps, at least on amd64 and ppc64.
-#
-# We need a new-enough binutils for as-needed
-DEPEND=">=sys-devel/gcc-3.2.3-r1
- nptl? ( >=sys-devel/gcc-3.3.1-r1 >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} )
- >=sys-devel/binutils-2.15
- >=sys-devel/gcc-config-1.3.9
- virtual/os-headers
- nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
-
- if [[ ${CATEGORY} == *-linux* ]] ; then
- if [[ ${CATEGORY/mips} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} >=${CATEGORY}/mips-headers-2.6.10"
- else
- DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
- fi
- fi
-else
- DEPEND="${DEPEND} sys-libs/timezone-data"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
- fi
-
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
-
- # give some sort of warning about the nptl logic changes...
- if want_nptl && want_linuxthreads ; then
-
- ewarn "Warning! Gentoo's GLIBC with NPTL enabled now behaves like the"
- ewarn "glibc from almost every other distribution out there. This means"
- ewarn "that glibc is compiled -twice-, once with linuxthreads and once"
- ewarn "with nptl. The NPTL version is installed to lib/tls and is still"
- ewarn "used by default. If you do not need nor want the linuxthreads"
- ewarn "fallback, you can disable this behavior by adding nptlonly to"
- ewarn "USE to save yourself some compile time."
-
- ebeep
- epause 5
- fi
-}
-
-src_unpack() {
- setup_env
-
- case $(tc-arch) in
- hppa)
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 2000-all-2.3.2-propolice-guard-functions-v3.patch"
- use hardened || GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 6490_hppa_hardened-disable__init_arrays.patch"
- ;;
- mips)
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 3000-all-2.3.4-dl_execstack-PaX-support.patch"
- use_multilib \
- && GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 6680_mips_nolib3264.patch" \
- || GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 5005_all_enable-multilib-with-cross-compile.patch"
- ;;
- amd64)
- if ! has_multilib_profile && ! is_crosscompile ; then
- # the gentoo-libdir patch hack conflicts with these
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 5005_all_enable-multilib-with-cross-compile.patch"
- fi
- ;;
- esac
-
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 5020_all_nomalloccheck.patch"
-
- toolchain-glibc_src_unpack
-
- # XXX: do not package ssp up into tarballs, leave it in FILESDIR
- cd "${S}"
- cp "${FILESDIR}"/2.3.5/ssp.c sysdeps/unix/sysv/linux/ || die "could not find ssp.c"
- rm -f "${WORKDIR}"/patches/2*
- epatch "${FILESDIR}"/2.3.5/glibc-2.3.5-propolice-guard-functions.patch
- epatch "${FILESDIR}"/2.3.5/glibc-2.3.5-frandom-detect.patch
-
- case $(tc-arch) in
- alpha)
- # Is this still needed?
- rm -f sysdeps/alpha/alphaev6/memcpy.S
- ;;
- amd64)
- if ! has_multilib_profile && ! is_crosscompile; then
- # CONF_LIBDIR support
- epatch ${FILESDIR}/2.3.4/glibc-gentoo-libdir.patch
- sed -i -e "s:@GENTOO_LIBDIR@:$(get_libdir):g" ${S}/sysdeps/unix/sysv/linux/configure
- fi
- ;;
- ppc64)
- # setup lib -- seems like a good place to set this up
- has_multilib_profile || get_libdir_override lib64
- ;;
- esac
-
- # Glibc is stupid sometimes, and doesn't realize that with a
- # static C-Only gcc, -lgcc_eh doesn't exist.
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- echo 'int main(){}' > ${T}/gcc_eh_test.c
- if ! $(tc-getCC ${CTARGET}) ${T}/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
- sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
- fi
-
- # Some configure checks fail on the first emerge through because they
- # try to link. This doesn't work well if we don't have a libc yet.
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- if is_crosscompile && use build; then
- rm ${S}/sysdeps/sparc/sparc64/elf/configure{,.in}
- rm ${S}/nptl/sysdeps/pthread/configure{,.in}
- fi
-
- cd "${WORKDIR}"
- find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
- find . -name configure -exec touch {} \;
-
- # Fix permissions on some of the scripts
- chmod u+x "${S}"/scripts/*.sh
-}
-
-src_compile() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Building multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_compile
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
- fi
-
- toolchain-glibc_src_compile
-}
-
-src_test() {
- setup_env
-
- if [[ -z ${OABI} ]] && has_multilib_profile ; then
- OABI=${ABI}
- einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
- for ABI in $(get_install_abis) ; do
- export ABI
- einfo " Testing ${ABI} glibc"
- src_test
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
-
- toolchain-glibc_src_test
-}
-
-src_strip() {
- # Now, strip everything but the thread libs #46186, as well as the dynamic
- # linker, else we cannot set breakpoints in shared libraries due to bugs in
- # gdb. Also want to grab stuff in tls subdir. whee.
-#when new portage supports this ...
-# env \
-# -uRESTRICT \
-# CHOST=${CTARGET} \
-# STRIP_MASK="/*/{,tls/}{ld-,lib{pthread,thread_db}}*" \
-# prepallstrip
- pushd "${D}" > /dev/null
-
- if ! is_crosscompile ; then
- mkdir -p "${T}"/strip-backup
- for x in $(find "${D}" -maxdepth 3 \
- '(' -name 'ld-*' -o -name 'libpthread*' -o -name 'libthread_db*' ')' \
- -a '(' '!' -name '*.a' ')' -type f -printf '%P ')
- do
- mkdir -p "${T}/strip-backup/${x%/*}"
- cp -a -- "${D}/${x}" "${T}/strip-backup/${x}" || die "backing up ${x}"
- done
- fi
- env -uRESTRICT CHOST=${CTARGET} prepallstrip
- if ! is_crosscompile ; then
- cp -a -- "${T}"/strip-backup/* "${D}"/ || die "restoring non-stripped libs"
- fi
-
- popd > /dev/null
-}
-
-src_install() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- # Handle stupid lib32 BS
- unset OLD_LIBDIR
- if ! is_crosscompile ; then
- if [[ $(tc-arch) == "amd64" && ${ABI} == "x86" && $(get_libdir) != "lib" ]] ; then
- OLD_LIBDIR=$(get_libdir)
- LIBDIR_x86="lib"
- fi
-
- if [[ $(tc-arch) == "ppc64" && ${ABI} == "ppc" && $(get_libdir) != "lib" ]] ; then
- OLD_LIBDIR=$(get_libdir)
- LIBDIR_ppc="lib"
- fi
- fi
-
- toolchain-glibc_src_install
- [[ -z ${OABI} ]] && src_strip
-
- # Handle stupid lib32 BS on amd64 and ppc64
- if [[ -n ${OLD_LIBDIR} ]] ; then
- cd "${S}"
- [[ $(tc-arch) == "amd64" ]] && LIBDIR_x86=${OLD_LIBDIR}
- [[ $(tc-arch) == "ppc64" ]] && LIBDIR_ppc=${OLD_LIBDIR}
- unset OLD_LIBDIR
-
- mv "${D}"/lib "${D}"/$(get_libdir)
- mv "${D}"/usr/lib "${D}"/usr/$(get_libdir)
- dodir /lib
- dodir /usr/lib
- mv "${D}"/usr/$(get_libdir)/locale "${D}"/usr/lib
- [[ $(tc-arch) == "amd64" ]] && dosym ../$(get_libdir)/ld-linux.so.2 /lib/ld-linux.so.2
- [[ $(tc-arch) == "ppc64" ]] && dosym ../$(get_libdir)/ld.so.1 /lib/ld.so.1
-
- for f in "${D}"/usr/$(get_libdir)/*.so; do
- local basef=$(basename "${f}")
- if [[ -L ${f} ]] ; then
- local target=$(readlink "${f}")
- target=${target/\/lib\//\/$(get_libdir)\/}
- rm "${f}"
- dosym "${target}" /usr/$(get_libdir)/"${basef}"
- fi
- done
-
- dosed "s:/lib/:/$(get_libdir)/:g" /usr/$(get_libdir)/lib{c,pthread}.so
-
- if want_nptl && want_linuxthreads ; then
- dosed "s:/lib/:/$(get_libdir)/:g" /usr/$(get_libdir)/nptl/lib{c,pthread}.so
- fi
- fi
-
- # PPC NPTL fix
- if [[ $(tc-arch) == "ppc" ]] && use nptl && ! use nptlonly ; then
- cp ${WORKDIR}/build-default-${CTARGET}-nptl/elf/ld.so ${D}/lib/ld-${PV}.so
- fi
-}
-
-pkg_preinst() {
- toolchain-glibc_pkg_preinst
-}
-
-pkg_postinst() {
- toolchain-glibc_pkg_postinst
-}
diff --git a/sys-libs/glibc/glibc-2.3.6-r4.ebuild b/sys-libs/glibc/glibc-2.3.6-r4.ebuild
deleted file mode 100644
index fc86e76ed726..000000000000
--- a/sys-libs/glibc/glibc-2.3.6-r4.ebuild
+++ /dev/null
@@ -1,1225 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.6-r4.ebuild,v 1.42 2009/12/10 01:31:25 vapier Exp $
-
-# 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/
-
-KEYWORDS="-* alpha amd64 arm hppa ia64 mips ppc ppc64 ~s390 sh sparc x86"
-
-BRANCH_UPDATE=""
-
-# Generated man pages
-GLIBC_MANPAGE_VERSION="2.3.6-1"
-
-# Generated stuff in manual subdir
-GLIBC_INFOPAGE_VERSION="2.3.6"
-
-# Gentoo patchset
-PATCH_VER="1.17"
-
-GENTOO_TOOLCHAIN_BASE_URI="mirror://gentoo"
-GENTOO_TOOLCHAIN_DEV_URI="http://dev.gentoo.org/~azarah/glibc/XXX http://dev.gentoo.org/~vapier/dist/XXX"
-
-### PUNT OUT TO ECLASS?? ###
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-LICENSE="LGPL-2"
-
-IUSE="nls build nptl nptlonly erandom hardened multilib selinux glibc-compat20 glibc-omitfp profile"
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- PROVIDE="virtual/libc"
-fi
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-just_headers() {
- is_crosscompile && use crosscompile_opts_headers-only
-}
-
-GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
-
-# Don't set this to :-, - allows BRANCH_UPDATE=""
-BRANCH_UPDATE=${BRANCH_UPDATE-$(get_version_component_range 4)}
-
-# (Recent snapshots fails with 2.6.5 and earlier with NPTL)
-NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-"2.6.9"}
-LT_KERNEL_VERSION=${LT_KERNEL_VERSION:-"2.4.1"}
-
-### SRC_URI ###
-
-# This function handles the basics of setting the SRC_URI for a glibc ebuild.
-# To use, set SRC_URI with:
-#
-# SRC_URI="$(get_glibc_src_uri)"
-#
-# Other than the variables normally set by portage, this function's behavior
-# can be altered by setting the following:
-#
-# GENTOO_TOOLCHAIN_BASE_URI
-# This sets the base URI for all gentoo-specific patch files. Note
-# that this variable is only important for a brief period of time,
-# before your source files get picked up by mirrors. However, it is
-# still highly suggested that you keep files in this location
-# available.
-#
-# BRANCH_UPDATE
-# If set, this variable signals that we should be using the main
-# release tarball (determined by ebuild version) and applying a
-# CVS branch update patch against it. The location of this branch
-# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
-# Just like with SNAPSHOT, this variable is ignored if the ebuild
-# has a _pre suffix.
-#
-# PATCH_VER
-# PATCH_GLIBC_VER
-# This should be set to the version of the gentoo patch tarball.
-# The resulting filename of this tarball will be:
-# glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
-#
-# GLIBC_MANPAGE_VERSION
-# GLIBC_INFOPAGE_VERSION
-# The version of glibc for which we will download pages. This will
-# default to ${GLIBC_RELEASE_VER}, but we may not want to pre-generate man pages
-# for prerelease test ebuilds for example. This allows you to
-# continue using pre-generated manpages from the last stable release.
-# If set to "none", this will prevent the downloading of manpages,
-# which is useful for individual library targets.
-#
-get_glibc_src_uri() {
- GENTOO_TOOLCHAIN_BASE_URI=${GENTOO_TOOLCHAIN_BASE_URI:-"mirror://gentoo"}
-
-# GLIBC_SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2
- GLIBC_SRC_URI="mirror://gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2"
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2}"
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- echo "${GLIBC_SRC_URI}"
-}
-
-SRC_URI=$(get_glibc_src_uri)
-S=${WORKDIR}/glibc-${GLIBC_RELEASE_VER}
-
-### EXPORTED FUNCTIONS ###
-toolchain-glibc_src_unpack() {
- # Check NPTL support _before_ we unpack things to save some time
- want_nptl && check_nptl_support
-
- unpack glibc-${GLIBC_RELEASE_VER}.tar.bz2
-
- cd "${S}"
- unpack glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
- unpack glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${WORKDIR}"
- unpack glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- # pull out all the addons
- local d
- for d in extra/*/configure ; do
- mv "${d%/configure}" "${S}" || die "moving ${d}"
- done
- fi
-
- # XXX: We should do the branchupdate, before extracting the manpages and
- # infopages else it does not help much (mtimes change if there is a change
- # to them with branchupdate)
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- cd "${S}"
- epatch "${DISTDIR}"/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
-
- # Snapshot date patch
- einfo "Patching version to display snapshot date ..."
- sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- cd "${WORKDIR}"
- unpack glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- cd "${S}"
- unpack glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${S}"
- EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-${PATCH_VER} ..." \
- EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
- EPATCH_SUFFIX="patch" \
- ARCH=$(tc-arch) \
- epatch "${WORKDIR}"/patches
- fi
-
- gnuconfig_update
-}
-
-toolchain-glibc_src_compile() {
- echo
- local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
- einfo " $(printf '%15s' ${v}:) ${!v}"
- done
- echo
-
- if want_linuxthreads ; then
- glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
- if want_nptl ; then
- # ... and then do the optional nptl build
- unset LD_ASSUME_KERNEL
- glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
-}
-
-toolchain-glibc_headers_compile() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
-
- # Pick out the correct location for build headers
- local myconf="--disable-sanity-checks --enable-hacker-mode"
- myconf="${myconf}
- --enable-add-ons=linuxthreads
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- ${EXTRA_ECONF}"
-
- einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
- CC=gcc \
- CFLAGS="-O1 -pipe" \
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-toolchain-glibc_src_test() {
- # This is wrong, but glibc's tests fail bad when screwing
- # around with sandbox, so lets just punt it
- unset LD_PRELOAD
-
- # do the linuxthreads build unless we're using nptlonly
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Checking GLIBC with linuxthreads..."
- make check || die "linuxthreads glibc did not pass make check"
- fi
- if want_nptl ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- unset LD_ASSUME_KERNEL || :
- einfo "Checking GLIBC with NPTL..."
- make check || die "nptl glibc did not pass make check"
- fi
-}
-
-toolchain-glibc_pkg_preinst() {
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && ! { want_nptl && want_linuxthreads; }; then
- addwrite "${ROOT}"/$(alt_libdir)/
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen
-}
-
-toolchain-glibc_src_install() {
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- local GBUILDDIR
- if want_linuxthreads ; then
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
- else
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
- fi
-
- local install_root=${D}
- if is_crosscompile ; then
- install_root="${install_root}/usr/${CTARGET}"
- fi
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- cd "${D}"/usr/${CTARGET} || die
- rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
-
- local l src_lib
- for l in libc libm librt libpthread libthread_db ; do
- # take care of shared lib first ...
- l=${l}.so
- if [[ -e ${l} ]] ; then
- src_lib=${l}
- else
- src_lib=$(eval echo */${l})
- fi
- cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
- fperms a+rx $(alt_libdir)/tls/${l}
- dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
-
- # then grab the linker script or the symlink ...
- if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
- dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
- else
- sed \
- -e "s:/${l}:/tls/${l}:g" \
- -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
- "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
- fi
-
- # then grab the static lib ...
- src_lib=${src_lib/%.so/.a}
- [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- src_lib=${src_lib/%.a/_nonshared.a}
- if [[ -e ${src_lib} ]] ; then
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- fi
- done
-
- # use the nptl linker instead of the linuxthreads one as the linuxthreads
- # one may lack TLS support and that can be really bad for business
- cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
- fi
-
- # We'll take care of the cache ourselves
- rm -f "${D}"/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- # When cross-compiling for a non-multilib setup, make sure we have
- # lib and a proper symlink setup
- if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
- cd "${D}"$(alt_libdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- cd "${D}"$(alt_usrlibdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- fi
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install some symlink hacks so that when we build
- # a 2nd stage cross-compiler, gcc finds the target system
- # headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym usr/include /usr/${CTARGET}/sys-include
- return 0
- fi
-
- # Everything past this point just needs to be done once ...
- is_final_abi || return 0
-
- # Make sure the non-native interp can be found on multilib systems
- if has_multilib_profile ; then
- case $(tc-arch) in
- amd64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
- dosym /$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
- ;;
- ppc64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
- dosym /$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
- ;;
- esac
- fi
-
- # Files for Debian-style locale updating
- dodir /usr/share/i18n
- sed \
- -e "/^#/d" \
- -e "/SUPPORTED-LOCALES=/d" \
- -e "s: \\\\::g" -e "s:/: :g" \
- "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
- || die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen || die
- doman *.[0-8]
- insinto /etc
- doins locale.gen || die
-
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- keepdir /usr/$(get_libdir)/locale
- for l in $(get_all_libdirs) ; do
- if [[ ! -e ${D}/usr/${l}/locale ]] ; then
- dosym /usr/$(get_libdir)/locale /usr/${l}/locale
- fi
- done
-
- if ! has noinfo ${FEATURES} && [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- einfo "Installing info pages..."
-
- make \
- -C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- info -i || die
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- # Install misc network config files
- insinto /etc
- doins "${FILESDIR}"/nscd.conf
- doins "${FILESDIR}"/nsswitch.conf
- doins "${FILESDIR}"/2.3.6/host.conf
- doinitd "${FILESDIR}"/nscd
-
- cd "${S}"
- dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE NEWS NOTES PROJECTS README*
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f "${D}"/etc/localtime
-
- # simple test to make sure our new glibc isnt completely broken.
- # for now, skip the multilib scenario. also make sure we don't
- # test with statically built binaries since they will fail.
- [[ ${CBUILD} != ${CHOST} ]] && return 0
- [[ $(get_libdir) != "lib" ]] && return 0
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest/statically linked} != "${striptest}" ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-toolchain-glibc_headers_install() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
- # Copy over headers that are not part of install-headers ... these
- # are pretty much taken verbatim from crosstool, see it for more details
- insinto $(alt_headers)/bits
- doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
- insinto $(alt_headers)/gnu
- doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- dosym usr/include /usr/${CTARGET}/sys-include
-}
-
-toolchain-glibc_pkg_postinst() {
- # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
- # isn't removed in unmerge which happens sometimes. See bug #87671
- if ! is_crosscompile && want_linuxthreads && [[ ${ROOT} == "/" ]] ; then
- for libdir in $(get_all_libdirs) ; do
- for f in "${ROOT}"/${libdir}/libpthread-2.* "${ROOT}"/${libdir}/libpthread-0.6* ; do
- if [[ -f ${f} ]] ; then
- rm -f ${f}
- ldconfig
- fi
- done
- done
- fi
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if [[ ! -e ${ROOT}/lib/ld.so.1 ]] && use ppc64 && ! has_multilib_profile ; then
- ## SHOULDN'T THIS BE lib64??
- ln -s ld64.so.1 "${ROOT}"/lib/ld.so.1
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U &> /dev/null
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- locale-gen --config "${locale_list}"
- fi
-
- echo
- einfo "Gentoo's glibc no longer includes mdns."
- einfo "If you want mdns, emerge the sys-auth/nss-mdns package."
- echo
-
- if want_nptl && want_linuxthreads ; then
- einfo "The default behavior of glibc on your system is to use NPTL. If"
- einfo "you want to use linuxthreads for a particular program, start it"
- einfo "by executing 'LD_ASSUME_KERNEL=${LT_KERNEL_VERSION} <program> [<options>]'"
- echo
- fi
-}
-
-### SUPPORT FUNCTIONS ###
-# We need to be able to set alternative headers for
-# compiling for non-native platform
-# Will also become useful for testing kernel-headers without screwing up
-# the whole system.
-# note: intentionally undocumented.
-alt_headers() {
- if [[ -z ${ALT_HEADERS} ]] ; then
- if is_crosscompile ; then
- ALT_HEADERS="/usr/${CTARGET}/usr/include"
- else
- ALT_HEADERS="/usr/include"
- fi
- fi
- echo "${ALT_HEADERS}"
-}
-alt_build_headers() {
- if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS=$(alt_headers)
- tc-is-cross-compiler && ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
- fi
- echo "${ALT_BUILD_HEADERS}"
-}
-
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-alt_usrlibdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/usr/$(get_libdir)
- else
- echo /usr/$(get_libdir)
- fi
-}
-
-setup_flags() {
- # Make sure host make.conf doesn't pollute us
- if is_crosscompile || tc-is-cross-compiler ; then
- CHOST=${CTARGET} strip-unsupported-flags
- fi
-
- # Store our CFLAGS because it's changed depending on which CTARGET
- # we are building when pulling glibc on a multilib profile
- CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
- CFLAGS=${CFLAGS_BASE}
- ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
- ASFLAGS=${ASFLAGS_BASE}
-
- # Over-zealous CFLAGS can often cause problems. What may work for one
- # person may not work for another. To avoid a large influx of bugs
- # relating to failed builds, we strip most CFLAGS out to ensure as few
- # problems as possible.
- strip-flags
- strip-unsupported-flags
- filter-flags -m32 -m64 -mabi=*
-
- unset CBUILD_OPT CTARGET_OPT
- if has_multilib_profile ; then
- CTARGET_OPT=$(get_abi_CTARGET)
- [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
- fi
-
- case $(tc-arch) in
- amd64)
- # Punt this when amd64's 2004.3 is removed
- CFLAGS_x86="-m32"
- ;;
- ppc)
- append-flags "-freorder-blocks"
- ;;
- sparc)
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- filter-flags "-fcall-used-g7"
- append-flags "-fcall-used-g6"
- filter-flags "-mvis"
-
- if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
- case ${ABI} in
- sparc64)
- filter-flags -Wa,-xarch -Wa,-A
-
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparc64b-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9b"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
- else
- CTARGET_OPT="sparc64-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9a"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
- fi
- ;;
- *)
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- else
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- ;;
- esac
- else
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- elif { is_crosscompile && want_nptl; } || is-flag "-mcpu=ultrasparc2" || is-flag "-mcpu=ultrasparc"; then
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- fi
- ;;
- esac
-
- if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
- CBUILD_OPT=${CTARGET_OPT}
- fi
-
- if $(tc-getCC ${CTARGET}) -v 2>&1 | grep -q 'gcc version 3.[0123]'; then
- append-flags -finline-limit=2000
- fi
-
- # We dont want these flags for glibc
- filter-ldflags -pie
-
- # We cannot build glibc with Bdirect support
- filter-flags -Wl,-Bdirect
- filter-ldflags -Bdirect
- filter-ldflags -Wl,-Bdirect
-
- # Same for hashvals ...
- filter-flags -Wl,-hashvals
- filter-ldflags -hashvals
- filter-ldflags -Wl,-hashvals
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be
- # conservative here
- filter-flags -O?
- append-flags -O2
-}
-
-check_kheader_version() {
- local header="$(alt_build_headers)/linux/version.h"
-
- [[ -z $1 ]] && return 1
-
- if [ -f "${header}" ] ; then
- local version="`grep 'LINUX_VERSION_CODE' ${header} | \
- sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
-
- if [ "${version}" -ge "$1" ] ; then
- return 0
- fi
- fi
-
- return 1
-}
-
-check_nptl_support() {
- local min_kernel_version=$(KV_to_int "${NPTL_KERNEL_VERSION}")
-
- echo
-
- ebegin "Checking gcc for __thread support"
- if ! eend $(want__thread ; echo $?) ; then
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "Please update your binutils/gcc and try again."
- die "No __thread support in gcc!"
- fi
-
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- # Building fails on an non-supporting kernel
- ebegin "Checking kernel version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $([[ $(get_KV) -ge ${min_kernel_version} ]] ; echo $?) ; then
- echo
- eerror "You need a kernel of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "Kernel version too low!"
- fi
- fi
-
- # Building fails with too low linux-headers
- ebegin "Checking linux-headers version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $(check_kheader_version "${min_kernel_version}" ; echo $?) ; then
- echo
- eerror "You need linux-headers of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "linux-headers version too low!"
- fi
-
- echo
-}
-
-want_nptl() {
- want_tls || return 1
- use nptl || return 1
-
- # Archs that can use NPTL
- case $(tc-arch) in
- alpha|amd64|ia64|mips|ppc|ppc64|s390|sh|x86)
- return 0;
- ;;
- sparc)
- # >= v9 is needed for nptl.
- [[ "${PROFILE_ARCH}" == "sparc" ]] && return 1
- return 0;
- ;;
- esac
-
- return 1
-}
-
-want_linuxthreads() {
- ! use nptlonly && return 0
- want_nptl || return 0
- return 1
-}
-
-want_tls() {
- # Archs that can use TLS (Thread Local Storage)
- case $(tc-arch) in
- alpha|amd64|ia64|mips|ppc|ppc64|s390|sh)
- return 0;
- ;;
- sparc)
- # 2.3.6 should have tls support on sparc64
- # when using newer binutils
- case ${CTARGET/-*} in
- sparc64*) return 1 ;;
- *) return 0 ;;
- esac
- ;;
- x86)
- # requires i486 or better #106556
- [[ ${CTARGET} == i[4567]86* ]] && return 0
- ;;
- esac
-
- return 1
-}
-
-want__thread() {
- want_tls || return 1
-
- # For some reason --with-tls --with__thread is causing segfaults on sparc32.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
-
- [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
-
- echo 'extern __thread int i;' > "${T}"/test-__thread.c
- $(tc-getCC ${CTARGET}) -c "${T}"/test-__thread.c -o "${T}"/test-__thread.o &> /dev/null
- WANT__THREAD=$?
- rm -f "${T}"/test-__thread.[co]
-
- return ${WANT__THREAD}
-}
-
-glibc_do_configure() {
- local myconf
-
- # set addons
- pushd "${S}" > /dev/null
- local ADDONS=$(echo */configure | sed \
- -e 's:/configure::g' \
- -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
- -e 's: \+$::' \
- -e 's! !,!g' \
- -e 's!^!,!' \
- -e '/^,\*$/d')
- popd > /dev/null
- use glibc-compat20 && [[ -d glibc-compat ]] && ADDONS="${ADDONS},glibc-compat"
-
- use nls || myconf="${myconf} --disable-nls"
- use erandom || myconf="${myconf} --disable-dev-erandom"
-
- use glibc-omitfp && myconf="${myconf} --enable-omitfp"
-
- [[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
-
- if [ "$1" == "linuxthreads" ] ; then
- if want_tls ; then
- myconf="${myconf} --with-tls"
-
- if want__thread && ! use glibc-compat20 ; then
- myconf="${myconf} --with-__thread"
- else
- myconf="${myconf} --without-__thread"
- fi
- else
- myconf="${myconf} --without-tls --without-__thread"
- fi
-
- myconf="${myconf} --enable-add-ons=linuxthreads${ADDONS}"
- myconf="${myconf} --enable-kernel=${LT_KERNEL_VERSION}"
- elif [ "$1" == "nptl" ] ; then
- myconf="${myconf} --with-tls --with-__thread"
- myconf="${myconf} --enable-add-ons=nptl${ADDONS}"
- myconf="${myconf} --enable-kernel=${NPTL_KERNEL_VERSION}"
- else
- die "invalid pthread option"
- fi
-
- # Since SELinux support is only required for nscd, only enable it if:
- # 1. USE selinux
- # 2. ! USE build
- # 3. only for the primary ABI on multilib systems
- if use selinux && ! use build ; then
- if use multilib || has_multilib_profile ; then
- if is_final_abi ; then
- myconf="${myconf} --with-selinux"
- else
- myconf="${myconf} --without-selinux"
- fi
- else
- myconf="${myconf} --with-selinux"
- fi
- else
- myconf="${myconf} --without-selinux"
- fi
-
- myconf="${myconf}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- $(use_enable profile)
- --without-gd
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- --libdir=/usr/$(get_libdir)
- --mandir=/usr/share/man
- --infodir=/usr/share/info
- --libexecdir=/usr/$(get_libdir)/misc/glibc
- ${EXTRA_ECONF}"
-
- # There is no configure option for this and we need to export it
- # since the glibc build will re-run configure on itself
- export libc_cv_slibdir=/$(get_libdir)
-
- has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
-
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- addwrite ${ROOT}/
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- addwrite ${ROOT}/usr
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- addwrite ${ROOT}/usr/X11R6
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-use_multilib() {
- case ${CTARGET} in
- sparc64*|mips64*|x86_64*|powerpc64*|s390x*)
- has_multilib_profile || use multilib ;;
- *) false ;;
- esac
-}
-
-# Setup toolchain variables that would be defined in the profiles for these archs.
-setup_env() {
- # These should not be set, else the zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
- # silly users
- unset LD_RUN_PATH
-
- if is_crosscompile || tc-is-cross-compiler ; then
- multilib_env ${CTARGET}
- if ! use multilib ; then
- MULTILIB_ABIS=${DEFAULT_ABI}
- else
- MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
- fi
-
- # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
- # and fall back on CFLAGS.
- local VAR=CFLAGS_${CTARGET//[-.]/_}
- CFLAGS=${!VAR-${CFLAGS}}
- fi
-
- setup_flags
-
- export ABI=${ABI:-${DEFAULT_ABI:-default}}
-
- if is_crosscompile || tc-is-cross-compiler ; then
- local VAR=CFLAGS_${ABI}
- # We need to export CFLAGS with abi information in them because
- # glibc's configure script checks CFLAGS for some targets (like mips)
- export CFLAGS="${!VAR} ${CFLAGS}"
- fi
-}
-
-### /ECLASS PUNTAGE ###
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- SLOT="2.2"
-fi
-
-# we'll handle stripping ourself #46186
-RESTRICT="strip"
-EMULTILIB_PKG="true"
-
-# We need a new-enough binutils for as-needed
-DEPEND="!ia64? ( >=sys-devel/gcc-3.4 )
- nptl? ( >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} )
- >=sys-devel/binutils-2.15.94
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
-
- if [[ ${CATEGORY} == *-linux* ]] ; then
- if [[ ${CATEGORY} == cross-mips* ]] ; then
- DEPEND="${DEPEND} >=${CATEGORY}/mips-headers-2.6.10"
- else
- DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
- fi
- fi
-else
- DEPEND="${DEPEND} sys-libs/timezone-data"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
- fi
-
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
-
- if [[ -e /proc/xen ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- if ! type -p scanelf > /dev/null ; then
- eerror "You do not have pax-utils installed."
- die "install pax-utils"
- fi
-
- # give some sort of warning about the nptl logic changes...
- if want_nptl && want_linuxthreads ; then
- ewarn "Warning! Gentoo's GLIBC with NPTL enabled now behaves like the"
- ewarn "glibc from almost every other distribution out there. This means"
- ewarn "that glibc is compiled -twice-, once with linuxthreads and once"
- ewarn "with nptl. The NPTL version is installed to lib/tls and is still"
- ewarn "used by default. If you do not need nor want the linuxthreads"
- ewarn "fallback, you can disable this behavior by adding nptlonly to"
- ewarn "USE to save yourself some compile time."
-
- ebeep
- epause 5
- fi
-}
-
-src_unpack() {
- setup_env
-
- # Do not enable -Bdirect support for now.
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 2020_all_2.3.6-hashvals.patch"
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 2030_all_2.3.6-bdirect.patch"
-
- toolchain-glibc_src_unpack
-
- # XXX: do not package ssp up into tarballs, leave it in FILESDIR
- cd "${S}"
- cp "${FILESDIR}"/2.3.5/ssp.c sysdeps/unix/sysv/linux/ || die "could not find ssp.c"
- rm -f "${WORKDIR}"/patches/2*
- epatch "${FILESDIR}"/2.3.6/glibc-2.3.6-propolice-guard-functions.patch
- epatch "${FILESDIR}"/2.3.5/glibc-2.3.5-frandom-detect.patch
-
- # Glibc is stupid sometimes, and doesn't realize that with a
- # static C-Only gcc, -lgcc_eh doesn't exist.
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- echo 'int main(){}' > "${T}"/gcc_eh_test.c
- if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
- sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
- fi
-
- # Some configure checks fail on the first emerge through because they
- # try to link. This doesn't work well if we don't have a libc yet.
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- if is_crosscompile && use build; then
- rm "${S}"/sysdeps/sparc/sparc64/elf/configure{,.in}
- rm "${S}"/nptl/sysdeps/pthread/configure{,.in}
- fi
-
- cd "${WORKDIR}"
- find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
- find . -name configure -exec touch {} \;
-
- # Fix permissions on some of the scripts
- chmod u+x "${S}"/scripts/*.sh
-}
-
-src_compile() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Building multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_compile
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_compile
- else
- toolchain-glibc_src_compile
- fi
-}
-
-src_test() {
- setup_env
-
- if [[ -z ${OABI} ]] && has_multilib_profile ; then
- OABI=${ABI}
- einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
- for ABI in $(get_install_abis) ; do
- export ABI
- einfo " Testing ${ABI} glibc"
- src_test
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
-
- toolchain-glibc_src_test
-}
-
-src_strip() {
- # Now, strip everything but the thread libs #46186, as well as the dynamic
- # linker, else we cannot set breakpoints in shared libraries due to bugs in
- # gdb. Also want to grab stuff in tls subdir. whee.
-#when new portage supports this ...
-# env \
-# -uRESTRICT \
-# CHOST=${CTARGET} \
-# STRIP_MASK="/*/{,tls/}{ld-,lib{pthread,thread_db}}*" \
-# prepallstrip
- pushd "${D}" > /dev/null
-
- if ! is_crosscompile ; then
- mkdir -p "${T}"/strip-backup
- for x in $(find "${D}" -maxdepth 3 \
- '(' -name 'ld-*' -o -name 'libpthread*' -o -name 'libthread_db*' ')' \
- -a '(' '!' -name '*.a' ')' -type f -printf '%P ')
- do
- mkdir -p "${T}/strip-backup/${x%/*}"
- cp -a -- "${D}/${x}" "${T}/strip-backup/${x}" || die "backing up ${x}"
- done
- fi
- env -uRESTRICT CHOST=${CTARGET} prepallstrip
- if ! is_crosscompile ; then
- cp -a -- "${T}"/strip-backup/* "${D}"/ || die "restoring non-stripped libs"
- fi
-
- popd > /dev/null
-}
-
-src_install() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_install
- else
- toolchain-glibc_src_install
- fi
- [[ -z ${OABI} ]] && src_strip
-}
-
-pkg_preinst() {
- toolchain-glibc_pkg_preinst
-}
-
-pkg_postinst() {
- toolchain-glibc_pkg_postinst
-}
diff --git a/sys-libs/glibc/glibc-2.3.6-r5.ebuild b/sys-libs/glibc/glibc-2.3.6-r5.ebuild
deleted file mode 100644
index cf96aaca8ab5..000000000000
--- a/sys-libs/glibc/glibc-2.3.6-r5.ebuild
+++ /dev/null
@@ -1,1230 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.6-r5.ebuild,v 1.28 2009/12/10 01:31:25 vapier Exp $
-
-# 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/
-
-KEYWORDS="-* alpha amd64 arm hppa ia64 mips ppc ppc64 ~s390 sh sparc x86"
-
-BRANCH_UPDATE=""
-
-# Generated man pages
-GLIBC_MANPAGE_VERSION="2.3.6-1"
-
-# Generated stuff in manual subdir
-GLIBC_INFOPAGE_VERSION="2.3.6"
-
-# Gentoo patchset
-PATCH_VER="1.19"
-
-GENTOO_TOOLCHAIN_BASE_URI="mirror://gentoo"
-GENTOO_TOOLCHAIN_DEV_URI="http://dev.gentoo.org/~azarah/glibc/XXX http://dev.gentoo.org/~vapier/dist/XXX"
-
-### PUNT OUT TO ECLASS?? ###
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-LICENSE="LGPL-2"
-
-IUSE="nls build nptl nptlonly erandom hardened multilib selinux glibc-compat20 glibc-omitfp profile"
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- PROVIDE="virtual/libc"
-fi
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-just_headers() {
- is_crosscompile && use crosscompile_opts_headers-only
-}
-
-GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
-
-# Don't set this to :-, - allows BRANCH_UPDATE=""
-BRANCH_UPDATE=${BRANCH_UPDATE-$(get_version_component_range 4)}
-
-# (Recent snapshots fails with 2.6.5 and earlier with NPTL)
-NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-"2.6.9"}
-LT_KERNEL_VERSION=${LT_KERNEL_VERSION:-"2.4.1"}
-
-### SRC_URI ###
-
-# This function handles the basics of setting the SRC_URI for a glibc ebuild.
-# To use, set SRC_URI with:
-#
-# SRC_URI="$(get_glibc_src_uri)"
-#
-# Other than the variables normally set by portage, this function's behavior
-# can be altered by setting the following:
-#
-# GENTOO_TOOLCHAIN_BASE_URI
-# This sets the base URI for all gentoo-specific patch files. Note
-# that this variable is only important for a brief period of time,
-# before your source files get picked up by mirrors. However, it is
-# still highly suggested that you keep files in this location
-# available.
-#
-# BRANCH_UPDATE
-# If set, this variable signals that we should be using the main
-# release tarball (determined by ebuild version) and applying a
-# CVS branch update patch against it. The location of this branch
-# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
-# Just like with SNAPSHOT, this variable is ignored if the ebuild
-# has a _pre suffix.
-#
-# PATCH_VER
-# PATCH_GLIBC_VER
-# This should be set to the version of the gentoo patch tarball.
-# The resulting filename of this tarball will be:
-# glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
-#
-# GLIBC_MANPAGE_VERSION
-# GLIBC_INFOPAGE_VERSION
-# The version of glibc for which we will download pages. This will
-# default to ${GLIBC_RELEASE_VER}, but we may not want to pre-generate man pages
-# for prerelease test ebuilds for example. This allows you to
-# continue using pre-generated manpages from the last stable release.
-# If set to "none", this will prevent the downloading of manpages,
-# which is useful for individual library targets.
-#
-get_glibc_src_uri() {
- GENTOO_TOOLCHAIN_BASE_URI=${GENTOO_TOOLCHAIN_BASE_URI:-"mirror://gentoo"}
-
-# GLIBC_SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2
- GLIBC_SRC_URI="mirror://gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2"
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2}"
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- echo "${GLIBC_SRC_URI}"
-}
-
-SRC_URI=$(get_glibc_src_uri)
-S=${WORKDIR}/glibc-${GLIBC_RELEASE_VER}
-
-### EXPORTED FUNCTIONS ###
-toolchain-glibc_src_unpack() {
- # Check NPTL support _before_ we unpack things to save some time
- want_nptl && check_nptl_support
-
- unpack glibc-${GLIBC_RELEASE_VER}.tar.bz2
-
- cd "${S}"
- unpack glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
- unpack glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${WORKDIR}"
- unpack glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- # pull out all the addons
- local d
- for d in extra/*/configure ; do
- mv "${d%/configure}" "${S}" || die "moving ${d}"
- done
- fi
-
- # XXX: We should do the branchupdate, before extracting the manpages and
- # infopages else it does not help much (mtimes change if there is a change
- # to them with branchupdate)
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- cd "${S}"
- epatch "${DISTDIR}"/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
-
- # Snapshot date patch
- einfo "Patching version to display snapshot date ..."
- sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- cd "${WORKDIR}"
- unpack glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- cd "${S}"
- unpack glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${S}"
- EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-${PATCH_VER} ..." \
- EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
- EPATCH_SUFFIX="patch" \
- ARCH=$(tc-arch) \
- epatch "${WORKDIR}"/patches
-
- # tag, glibc is it
- [[ -e csu/Banner ]] && die "need new banner location"
- echo "Gentoo patchset ${PATCH_VER}" > csu/Banner
- fi
-
- gnuconfig_update
-}
-
-toolchain-glibc_src_compile() {
- echo
- local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
- einfo " $(printf '%15s' ${v}:) ${!v}"
- done
- echo
-
- if want_linuxthreads ; then
- glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
- if want_nptl ; then
- # ... and then do the optional nptl build
- unset LD_ASSUME_KERNEL
- glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
-}
-
-toolchain-glibc_headers_compile() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
-
- # Pick out the correct location for build headers
- local myconf="--disable-sanity-checks --enable-hacker-mode"
- myconf="${myconf}
- --enable-add-ons=linuxthreads
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- ${EXTRA_ECONF}"
-
- einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
- CC=gcc \
- CFLAGS="-O1 -pipe" \
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-toolchain-glibc_src_test() {
- # This is wrong, but glibc's tests fail bad when screwing
- # around with sandbox, so lets just punt it
- unset LD_PRELOAD
-
- # do the linuxthreads build unless we're using nptlonly
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Checking GLIBC with linuxthreads..."
- make check || die "linuxthreads glibc did not pass make check"
- fi
- if want_nptl ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- unset LD_ASSUME_KERNEL || :
- einfo "Checking GLIBC with NPTL..."
- make check || die "nptl glibc did not pass make check"
- fi
-}
-
-toolchain-glibc_pkg_preinst() {
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && ! { want_nptl && want_linuxthreads; }; then
- addwrite "${ROOT}"/$(alt_libdir)/
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen
-}
-
-toolchain-glibc_src_install() {
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- local GBUILDDIR
- if want_linuxthreads ; then
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
- else
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
- fi
-
- local install_root=${D}
- if is_crosscompile ; then
- install_root="${install_root}/usr/${CTARGET}"
- fi
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- cd "${D}"/usr/${CTARGET} || die
- rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
-
- local l src_lib
- for l in libc libm librt libpthread libthread_db ; do
- # take care of shared lib first ...
- l=${l}.so
- if [[ -e ${l} ]] ; then
- src_lib=${l}
- else
- src_lib=$(eval echo */${l})
- fi
- cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
- fperms a+rx $(alt_libdir)/tls/${l}
- dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
-
- # then grab the linker script or the symlink ...
- if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
- dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
- else
- sed \
- -e "s:/${l}:/tls/${l}:g" \
- -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
- "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
- fi
-
- # then grab the static lib ...
- src_lib=${src_lib/%.so/.a}
- [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- src_lib=${src_lib/%.a/_nonshared.a}
- if [[ -e ${src_lib} ]] ; then
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- fi
- done
-
- # use the nptl linker instead of the linuxthreads one as the linuxthreads
- # one may lack TLS support and that can be really bad for business
- cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
- fi
-
- # We'll take care of the cache ourselves
- rm -f "${D}"/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- # When cross-compiling for a non-multilib setup, make sure we have
- # lib and a proper symlink setup
- if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
- cd "${D}"$(alt_libdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- cd "${D}"$(alt_usrlibdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- fi
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install some symlink hacks so that when we build
- # a 2nd stage cross-compiler, gcc finds the target system
- # headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym usr/include /usr/${CTARGET}/sys-include
- return 0
- fi
-
- # Everything past this point just needs to be done once ...
- is_final_abi || return 0
-
- # Make sure the non-native interp can be found on multilib systems
- if has_multilib_profile ; then
- case $(tc-arch) in
- amd64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
- dosym /$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
- ;;
- ppc64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
- dosym /$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
- ;;
- esac
- fi
-
- # Files for Debian-style locale updating
- dodir /usr/share/i18n
- sed \
- -e "/^#/d" \
- -e "/SUPPORTED-LOCALES=/d" \
- -e "s: \\\\::g" -e "s:/: :g" \
- "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
- || die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen || die
- doman *.[0-8]
- insinto /etc
- doins locale.gen || die
-
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- local a
- keepdir /usr/$(get_libdir)/locale
- for a in $(get_install_abis) ; do
- if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
- dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
- fi
- done
-
- if ! has noinfo ${FEATURES} && [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- einfo "Installing info pages..."
-
- make \
- -C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- info -i || die
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- # Install misc network config files
- insinto /etc
- doins "${WORKDIR}"/extra/etc/*.conf || die
- doinitd "${WORKDIR}"/extra/etc/nscd || die
-
- cd "${S}"
- dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE NEWS NOTES PROJECTS README*
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f "${D}"/etc/localtime
-
- # simple test to make sure our new glibc isnt completely broken.
- # for now, skip the multilib scenario. also make sure we don't
- # test with statically built binaries since they will fail.
- [[ ${CBUILD} != ${CHOST} ]] && return 0
- [[ $(get_libdir) != "lib" ]] && return 0
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-toolchain-glibc_headers_install() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
- # Copy over headers that are not part of install-headers ... these
- # are pretty much taken verbatim from crosstool, see it for more details
- insinto $(alt_headers)/bits
- doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
- insinto $(alt_headers)/gnu
- doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- dosym usr/include /usr/${CTARGET}/sys-include
-}
-
-toolchain-glibc_pkg_postinst() {
- # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
- # isn't removed in unmerge which happens sometimes. See bug #87671
- if ! is_crosscompile && want_linuxthreads && [[ ${ROOT} == "/" ]] ; then
- for libdir in $(get_all_libdirs) ; do
- for f in "${ROOT}"/${libdir}/libpthread-2.* "${ROOT}"/${libdir}/libpthread-0.6* ; do
- if [[ -f ${f} ]] ; then
- rm -f ${f}
- ldconfig
- fi
- done
- done
- fi
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if [[ ! -e ${ROOT}/lib/ld.so.1 ]] && use ppc64 && ! has_multilib_profile ; then
- ## SHOULDN'T THIS BE lib64??
- ln -s ld64.so.1 "${ROOT}"/lib/ld.so.1
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U &> /dev/null
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-
- echo
- einfo "Gentoo's glibc no longer includes mdns."
- einfo "If you want mdns, emerge the sys-auth/nss-mdns package."
- echo
-
- if want_nptl && want_linuxthreads ; then
- einfo "The default behavior of glibc on your system is to use NPTL. If"
- einfo "you want to use linuxthreads for a particular program, start it"
- einfo "by executing 'LD_ASSUME_KERNEL=${LT_KERNEL_VERSION} <program> [<options>]'"
- echo
- fi
-}
-
-### SUPPORT FUNCTIONS ###
-# We need to be able to set alternative headers for
-# compiling for non-native platform
-# Will also become useful for testing kernel-headers without screwing up
-# the whole system.
-# note: intentionally undocumented.
-alt_headers() {
- if [[ -z ${ALT_HEADERS} ]] ; then
- if is_crosscompile ; then
- ALT_HEADERS="/usr/${CTARGET}/usr/include"
- else
- ALT_HEADERS="/usr/include"
- fi
- fi
- echo "${ALT_HEADERS}"
-}
-alt_build_headers() {
- if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS=$(alt_headers)
- tc-is-cross-compiler && ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
- fi
- echo "${ALT_BUILD_HEADERS}"
-}
-
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-alt_usrlibdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/usr/$(get_libdir)
- else
- echo /usr/$(get_libdir)
- fi
-}
-
-setup_flags() {
- # Make sure host make.conf doesn't pollute us
- if is_crosscompile || tc-is-cross-compiler ; then
- CHOST=${CTARGET} strip-unsupported-flags
- fi
-
- # Store our CFLAGS because it's changed depending on which CTARGET
- # we are building when pulling glibc on a multilib profile
- CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
- CFLAGS=${CFLAGS_BASE}
- ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
- ASFLAGS=${ASFLAGS_BASE}
-
- # Over-zealous CFLAGS can often cause problems. What may work for one
- # person may not work for another. To avoid a large influx of bugs
- # relating to failed builds, we strip most CFLAGS out to ensure as few
- # problems as possible.
- strip-flags
- strip-unsupported-flags
- filter-flags -m32 -m64 -mabi=*
-
- unset CBUILD_OPT CTARGET_OPT
- if has_multilib_profile ; then
- CTARGET_OPT=$(get_abi_CTARGET)
- [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
- fi
-
- case $(tc-arch) in
- amd64)
- # Punt this when amd64's 2004.3 is removed
- CFLAGS_x86="-m32"
- ;;
- ppc)
- append-flags "-freorder-blocks"
- ;;
- sparc)
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- filter-flags "-fcall-used-g7"
- append-flags "-fcall-used-g6"
- filter-flags "-mvis"
-
- if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
- case ${ABI} in
- sparc64)
- filter-flags -Wa,-xarch -Wa,-A
-
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparc64b-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9b"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
- else
- CTARGET_OPT="sparc64-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9a"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
- fi
- ;;
- *)
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- else
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- ;;
- esac
- else
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- elif { is_crosscompile && want_nptl; } || is-flag "-mcpu=ultrasparc2" || is-flag "-mcpu=ultrasparc"; then
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- fi
- ;;
- esac
-
- if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
- CBUILD_OPT=${CTARGET_OPT}
- fi
-
- if $(tc-getCC ${CTARGET}) -v 2>&1 | grep -q 'gcc version 3.[0123]'; then
- append-flags -finline-limit=2000
- fi
-
- # We dont want these flags for glibc
- filter-ldflags -pie
-
- # We cannot build glibc with Bdirect support
- filter-flags -Wl,-Bdirect
- filter-ldflags -Bdirect
- filter-ldflags -Wl,-Bdirect
-
- # Same for hashvals ...
- filter-flags -Wl,-hashvals
- filter-ldflags -hashvals
- filter-ldflags -Wl,-hashvals
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be
- # conservative here. -fno-strict-aliasing is to work around #155906
- filter-flags -O?
- append-flags -O2 -fno-strict-aliasing
-}
-
-check_kheader_version() {
- local header="$(alt_build_headers)/linux/version.h"
-
- [[ -z $1 ]] && return 1
-
- if [ -f "${header}" ] ; then
- local version="`grep 'LINUX_VERSION_CODE' ${header} | \
- sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
-
- if [ "${version}" -ge "$1" ] ; then
- return 0
- fi
- fi
-
- return 1
-}
-
-check_nptl_support() {
- local min_kernel_version=$(KV_to_int "${NPTL_KERNEL_VERSION}")
-
- echo
-
- ebegin "Checking gcc for __thread support"
- if ! eend $(want__thread ; echo $?) ; then
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "Please update your binutils/gcc and try again."
- die "No __thread support in gcc!"
- fi
-
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- # Building fails on an non-supporting kernel
- ebegin "Checking kernel version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $([[ $(get_KV) -ge ${min_kernel_version} ]] ; echo $?) ; then
- echo
- eerror "You need a kernel of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "Kernel version too low!"
- fi
- fi
-
- # Building fails with too low linux-headers
- ebegin "Checking linux-headers version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $(check_kheader_version "${min_kernel_version}" ; echo $?) ; then
- echo
- eerror "You need linux-headers of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "linux-headers version too low!"
- fi
-
- echo
-}
-
-want_nptl() {
- want_tls || return 1
- use nptl || return 1
-
- # Archs that can use NPTL
- case $(tc-arch) in
- alpha|amd64|ia64|mips|ppc|ppc64|s390|sh|x86)
- return 0;
- ;;
- sparc)
- # >= v9 is needed for nptl.
- [[ "${PROFILE_ARCH}" == "sparc" ]] && return 1
- return 0;
- ;;
- esac
-
- return 1
-}
-
-want_linuxthreads() {
- ! use nptlonly && return 0
- want_nptl || return 0
- return 1
-}
-
-want_tls() {
- # Archs that can use TLS (Thread Local Storage)
- case $(tc-arch) in
- alpha|amd64|ia64|mips|ppc|ppc64|s390|sh)
- return 0;
- ;;
- sparc)
- # 2.3.6 should have tls support on sparc64
- # when using newer binutils
- case ${CTARGET/-*} in
- sparc64*) return 1 ;;
- *) return 0 ;;
- esac
- ;;
- x86)
- # requires i486 or better #106556
- [[ ${CTARGET} == i[4567]86* ]] && return 0
- ;;
- esac
-
- return 1
-}
-
-want__thread() {
- want_tls || return 1
-
- # For some reason --with-tls --with__thread is causing segfaults on sparc32.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
-
- [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
-
- echo 'extern __thread int i;' > "${T}"/test-__thread.c
- $(tc-getCC ${CTARGET}) -c "${T}"/test-__thread.c -o "${T}"/test-__thread.o &> /dev/null
- WANT__THREAD=$?
- rm -f "${T}"/test-__thread.[co]
-
- return ${WANT__THREAD}
-}
-
-glibc_do_configure() {
- local myconf
-
- # set addons
- pushd "${S}" > /dev/null
- local ADDONS=$(echo */configure | sed \
- -e 's:/configure::g' \
- -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
- -e 's: \+$::' \
- -e 's! !,!g' \
- -e 's!^!,!' \
- -e '/^,\*$/d')
- popd > /dev/null
- use glibc-compat20 && [[ -d glibc-compat ]] && ADDONS="${ADDONS},glibc-compat"
-
- use nls || myconf="${myconf} --disable-nls"
- use erandom || myconf="${myconf} --disable-dev-erandom"
-
- use glibc-omitfp && myconf="${myconf} --enable-omitfp"
-
- [[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
-
- if [ "$1" == "linuxthreads" ] ; then
- if want_tls ; then
- myconf="${myconf} --with-tls"
-
- if want__thread && ! use glibc-compat20 ; then
- myconf="${myconf} --with-__thread"
- else
- myconf="${myconf} --without-__thread"
- fi
- else
- myconf="${myconf} --without-tls --without-__thread"
- fi
-
- myconf="${myconf} --enable-add-ons=linuxthreads${ADDONS}"
- myconf="${myconf} --enable-kernel=${LT_KERNEL_VERSION}"
- elif [ "$1" == "nptl" ] ; then
- myconf="${myconf} --with-tls --with-__thread"
- myconf="${myconf} --enable-add-ons=nptl${ADDONS}"
- myconf="${myconf} --enable-kernel=${NPTL_KERNEL_VERSION}"
- else
- die "invalid pthread option"
- fi
-
- # Since SELinux support is only required for nscd, only enable it if:
- # 1. USE selinux
- # 2. ! USE build
- # 3. only for the primary ABI on multilib systems
- if use selinux && ! use build ; then
- if use multilib || has_multilib_profile ; then
- if is_final_abi ; then
- myconf="${myconf} --with-selinux"
- else
- myconf="${myconf} --without-selinux"
- fi
- else
- myconf="${myconf} --with-selinux"
- fi
- else
- myconf="${myconf} --without-selinux"
- fi
-
- myconf="${myconf}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- $(use_enable profile)
- --without-gd
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- --libdir=/usr/$(get_libdir)
- --mandir=/usr/share/man
- --infodir=/usr/share/info
- --libexecdir=/usr/$(get_libdir)/misc/glibc
- ${EXTRA_ECONF}"
-
- # There is no configure option for this and we need to export it
- # since the glibc build will re-run configure on itself
- export libc_cv_slibdir=/$(get_libdir)
-
- has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
-
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- addwrite ${ROOT}/
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- addwrite ${ROOT}/usr
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- addwrite ${ROOT}/usr/X11R6
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-use_multilib() {
- case ${CTARGET} in
- sparc64*|mips64*|x86_64*|powerpc64*|s390x*)
- has_multilib_profile || use multilib ;;
- *) false ;;
- esac
-}
-
-# Setup toolchain variables that would be defined in the profiles for these archs.
-setup_env() {
- # These should not be set, else the zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
- # silly users
- unset LD_RUN_PATH
-
- if is_crosscompile || tc-is-cross-compiler ; then
- multilib_env ${CTARGET}
- if ! use multilib ; then
- MULTILIB_ABIS=${DEFAULT_ABI}
- else
- MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
- fi
-
- # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
- # and fall back on CFLAGS.
- local VAR=CFLAGS_${CTARGET//[-.]/_}
- CFLAGS=${!VAR-${CFLAGS}}
- fi
-
- setup_flags
-
- export ABI=${ABI:-${DEFAULT_ABI:-default}}
-
- if is_crosscompile || tc-is-cross-compiler ; then
- local VAR=CFLAGS_${ABI}
- # We need to export CFLAGS with abi information in them because
- # glibc's configure script checks CFLAGS for some targets (like mips)
- export CFLAGS="${!VAR} ${CFLAGS}"
- fi
-}
-
-### /ECLASS PUNTAGE ###
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- SLOT="2.2"
-fi
-
-# we'll handle stripping ourself #46186
-RESTRICT="strip"
-EMULTILIB_PKG="true"
-
-# We need a new-enough binutils for as-needed
-DEPEND="!ia64? ( >=sys-devel/gcc-3.4 )
- nptl? ( >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} )
- >=sys-devel/binutils-2.15.94
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
-
- if [[ ${CATEGORY} == *-linux* ]] ; then
- if [[ ${CATEGORY} == cross-mips* ]] ; then
- DEPEND="${DEPEND} >=${CATEGORY}/mips-headers-2.6.10"
- else
- DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
- fi
- fi
-else
- DEPEND="${DEPEND} sys-libs/timezone-data"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
- fi
-
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- if ! type -p scanelf > /dev/null ; then
- eerror "You do not have pax-utils installed."
- die "install pax-utils"
- fi
-
- # give some sort of warning about the nptl logic changes...
- if want_nptl && want_linuxthreads ; then
- ewarn "Warning! Gentoo's GLIBC with NPTL enabled now behaves like the"
- ewarn "glibc from almost every other distribution out there. This means"
- ewarn "that glibc is compiled -twice-, once with linuxthreads and once"
- ewarn "with nptl. The NPTL version is installed to lib/tls and is still"
- ewarn "used by default. If you do not need nor want the linuxthreads"
- ewarn "fallback, you can disable this behavior by adding nptlonly to"
- ewarn "USE to save yourself some compile time."
-
- ebeep
- epause 5
- fi
-}
-
-src_unpack() {
- setup_env
-
- # Do not enable -Bdirect support for now.
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 2020_all_2.3.6-hashvals.patch"
- GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 2030_all_2.3.6-bdirect.patch"
-
- toolchain-glibc_src_unpack
-
- # XXX: do not package ssp up into tarballs, leave it in FILESDIR
- cd "${S}"
- cp "${FILESDIR}"/2.3.5/ssp.c sysdeps/unix/sysv/linux/ || die "could not find ssp.c"
- rm -f "${WORKDIR}"/patches/2*
- epatch "${FILESDIR}"/2.3.6/glibc-2.3.6-propolice-guard-functions.patch
- epatch "${FILESDIR}"/2.3.5/glibc-2.3.5-frandom-detect.patch
-
- # Glibc is stupid sometimes, and doesn't realize that with a
- # static C-Only gcc, -lgcc_eh doesn't exist.
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- echo 'int main(){}' > "${T}"/gcc_eh_test.c
- if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
- sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
- fi
-
- # Some configure checks fail on the first emerge through because they
- # try to link. This doesn't work well if we don't have a libc yet.
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- if is_crosscompile && use build; then
- rm "${S}"/sysdeps/sparc/sparc64/elf/configure{,.in}
- rm "${S}"/nptl/sysdeps/pthread/configure{,.in}
- fi
-
- cd "${WORKDIR}"
- find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
- find . -name configure -exec touch {} \;
-
- # Fix permissions on some of the scripts
- chmod u+x "${S}"/scripts/*.sh
-}
-
-src_compile() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Building multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_compile
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_compile
- else
- toolchain-glibc_src_compile
- fi
-}
-
-src_test() {
- setup_env
-
- if [[ -z ${OABI} ]] && has_multilib_profile ; then
- OABI=${ABI}
- einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
- for ABI in $(get_install_abis) ; do
- export ABI
- einfo " Testing ${ABI} glibc"
- src_test
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
-
- toolchain-glibc_src_test
-}
-
-src_strip() {
- # Now, strip everything but the thread libs #46186, as well as the dynamic
- # linker, else we cannot set breakpoints in shared libraries due to bugs in
- # gdb. Also want to grab stuff in tls subdir. whee.
-#when new portage supports this ...
-# env \
-# -uRESTRICT \
-# CHOST=${CTARGET} \
-# STRIP_MASK="/*/{,tls/}{ld-,lib{pthread,thread_db}}*" \
-# prepallstrip
- pushd "${D}" > /dev/null
-
- if ! is_crosscompile ; then
- mkdir -p "${T}"/strip-backup
- for x in $(find "${D}" -maxdepth 3 \
- '(' -name 'ld-*' -o -name 'libpthread*' -o -name 'libthread_db*' ')' \
- -a '(' '!' -name '*.a' ')' -type f -printf '%P ')
- do
- mkdir -p "${T}/strip-backup/${x%/*}"
- cp -a -- "${D}/${x}" "${T}/strip-backup/${x}" || die "backing up ${x}"
- done
- fi
- env -uRESTRICT CHOST=${CTARGET} prepallstrip
- if ! is_crosscompile ; then
- cp -a -- "${T}"/strip-backup/* "${D}"/ || die "restoring non-stripped libs"
- fi
-
- popd > /dev/null
-}
-
-src_install() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_install
- else
- toolchain-glibc_src_install
- fi
- [[ -z ${OABI} ]] && src_strip
-}
-
-pkg_preinst() {
- toolchain-glibc_pkg_preinst
-}
-
-pkg_postinst() {
- toolchain-glibc_pkg_postinst
-}
diff --git a/sys-libs/glibc/glibc-2.4-r4.ebuild b/sys-libs/glibc/glibc-2.4-r4.ebuild
deleted file mode 100644
index f4f9b1441400..000000000000
--- a/sys-libs/glibc/glibc-2.4-r4.ebuild
+++ /dev/null
@@ -1,1267 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.4-r4.ebuild,v 1.23 2009/12/10 01:31:26 vapier Exp $
-
-# 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/
-
-KEYWORDS="-* amd64 ~ia64 ~mips ppc ppc64 s390 sh ~sparc x86"
-
-BRANCH_UPDATE=""
-
-# Generated man pages
-GLIBC_MANPAGE_VERSION="none"
-
-# Generated stuff in manual subdir
-GLIBC_INFOPAGE_VERSION="none"
-
-# Gentoo patchset
-PATCH_VER="1.19"
-
-# PPC cpu addon
-# http://penguinppc.org/dev/glibc/glibc-powerpc-cpu-addon.html
-PPC_CPU_ADDON_VER="0.01"
-PPC_CPU_ADDON_TARBALL="glibc-powerpc-cpu-addon-v${PPC_CPU_ADDON_VER}.tgz"
-PPC_CPU_ADDON_URI="http://penguinppc.org/dev/glibc/${PPC_CPU_ADDON_TARBALL}"
-
-# LinuxThreads addon
-LT_VER="20060605"
-LT_TARBALL="glibc-linuxthreads-${LT_VER}.tar.bz2"
-LT_URI="ftp://sources.redhat.com/pub/glibc/snapshots/${LT_TARBALL} mirror://gentoo/${LT_TARBALL}"
-
-GENTOO_TOOLCHAIN_BASE_URI="mirror://gentoo"
-GENTOO_TOOLCHAIN_DEV_URI="http://dev.gentoo.org/~azarah/glibc/XXX http://dev.gentoo.org/~vapier/dist/XXX"
-
-### PUNT OUT TO ECLASS?? ###
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-LICENSE="LGPL-2"
-
-# note that nptl/nptlonly/glibc-compat20 are for upgrade checks only.
-# we dont generally support these things in this version.
-IUSE="nls build nptl nptlonly hardened multilib selinux glibc-omitfp profile glibc-compat20"
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- PROVIDE="virtual/libc"
-fi
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-just_headers() {
- is_crosscompile && use crosscompile_opts_headers-only
-}
-
-GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
-
-# Don't set this to :-, - allows BRANCH_UPDATE=""
-BRANCH_UPDATE=${BRANCH_UPDATE-$(get_version_component_range 4)}
-
-# (Recent snapshots fails with 2.6.5 and earlier with NPTL)
-NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-"2.6.9"}
-LT_KERNEL_VERSION=${LT_KERNEL_VERSION:-"2.4.1"}
-
-### SRC_URI ###
-
-# This function handles the basics of setting the SRC_URI for a glibc ebuild.
-# To use, set SRC_URI with:
-#
-# SRC_URI="$(get_glibc_src_uri)"
-#
-# Other than the variables normally set by portage, this function's behavior
-# can be altered by setting the following:
-#
-# GENTOO_TOOLCHAIN_BASE_URI
-# This sets the base URI for all gentoo-specific patch files. Note
-# that this variable is only important for a brief period of time,
-# before your source files get picked up by mirrors. However, it is
-# still highly suggested that you keep files in this location
-# available.
-#
-# BRANCH_UPDATE
-# If set, this variable signals that we should be using the main
-# release tarball (determined by ebuild version) and applying a
-# CVS branch update patch against it. The location of this branch
-# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
-# Just like with SNAPSHOT, this variable is ignored if the ebuild
-# has a _pre suffix.
-#
-# PATCH_VER
-# PATCH_GLIBC_VER
-# This should be set to the version of the gentoo patch tarball.
-# The resulting filename of this tarball will be:
-# glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
-#
-# GLIBC_MANPAGE_VERSION
-# GLIBC_INFOPAGE_VERSION
-# The version of glibc for which we will download pages. This will
-# default to ${GLIBC_RELEASE_VER}, but we may not want to pre-generate man pages
-# for prerelease test ebuilds for example. This allows you to
-# continue using pre-generated manpages from the last stable release.
-# If set to "none", this will prevent the downloading of manpages,
-# which is useful for individual library targets.
-#
-get_glibc_src_uri() {
- GENTOO_TOOLCHAIN_BASE_URI=${GENTOO_TOOLCHAIN_BASE_URI:-"mirror://gentoo"}
-
-# GLIBC_SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${GLIBC_RELEASE_VER}.tar.bz2
-# http://ftp.gnu.org/gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2
- GLIBC_SRC_URI="mirror://gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-ports-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2"
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2}"
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- [[ -n ${LT_VER} ]] && GLIBC_SRC_URI="${GLIBC_SRC_URI} ${LT_URI}"
-
- GLIBC_SRC_URI="${GLIBC_SRC_URI} ${PPC_CPU_ADDON_URI}"
-
- echo "${GLIBC_SRC_URI}"
-}
-
-SRC_URI=$(get_glibc_src_uri)
-S=${WORKDIR}/glibc-${GLIBC_RELEASE_VER}
-
-### EXPORTED FUNCTIONS ###
-unpack_addon() {
- local addon=$1 ver=${2:-${GLIBC_RELEASE_VER}}
- unpack glibc-${addon}-${ver}.tar.bz2
- mv glibc-${addon}-${ver} ${addon} || die
-}
-toolchain-glibc_src_unpack() {
- # Check NPTL support _before_ we unpack things to save some time
- want_nptl && check_nptl_support
-
- unpack glibc-${GLIBC_RELEASE_VER}.tar.bz2
-
- cd "${S}"
- if [[ -n ${LT_VER} ]] ; then
- unpack ${LT_TARBALL}
- mv glibc-linuxthreads-${LT_VER}/* . || die
- fi
- unpack_addon libidn
- unpack_addon ports
-
- if [[ -n ${PPC_CPU_ADDON_TARBALL} ]] ; then
- cd "${S}"
- unpack ${PPC_CPU_ADDON_TARBALL}
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${WORKDIR}"
- unpack glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- # pull out all the addons
- local d
- for d in extra/*/configure ; do
- mv "${d%/configure}" "${S}" || die "moving ${d}"
- done
- fi
-
- # XXX: We should do the branchupdate, before extracting the manpages and
- # infopages else it does not help much (mtimes change if there is a change
- # to them with branchupdate)
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- cd "${S}"
- epatch "${DISTDIR}"/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
-
- # Snapshot date patch
- einfo "Patching version to display snapshot date ..."
- sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- cd "${WORKDIR}"
- unpack glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- cd "${S}"
- unpack glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${S}"
- EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-${PATCH_VER} ..." \
- EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
- EPATCH_SUFFIX="patch" \
- ARCH=$(tc-arch) \
- epatch "${WORKDIR}"/patches
-
- # tag, glibc is it
- [[ -e csu/Banner ]] && die "need new banner location"
- echo "Gentoo patchset ${PATCH_VER}" > csu/Banner
- fi
-
- gnuconfig_update
-}
-
-toolchain-glibc_src_compile() {
- echo
- local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
- einfo " $(printf '%15s' ${v}:) ${!v}"
- done
- echo
-
- if want_linuxthreads ; then
- glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
- if want_nptl ; then
- # ... and then do the optional nptl build
- unset LD_ASSUME_KERNEL
- glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
-}
-
-toolchain-glibc_headers_compile() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
-
- # Pick out the correct location for build headers
- local myconf="--disable-sanity-checks --enable-hacker-mode"
- myconf="${myconf}
- --enable-add-ons=nptl,ports
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- ${EXTRA_ECONF}"
-
- einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
- CC=gcc \
- CFLAGS="-O1 -pipe" \
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-toolchain-glibc_src_test() {
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-$1 || die "cd build-${ABI}-${CTARGET}-$1"
- unset LD_ASSUME_KERNEL
- make check || die "make check failed for ${ABI}-${CTARGET}-$1"
-}
-
-toolchain-glibc_pkg_preinst() {
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && ! { want_nptl && want_linuxthreads; }; then
- addwrite "${ROOT}"/$(alt_libdir)/
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen
-}
-
-toolchain-glibc_src_install() {
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- local GBUILDDIR
- if want_linuxthreads ; then
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
- else
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
- fi
-
- local install_root=${D}
- if is_crosscompile ; then
- install_root="${install_root}/usr/${CTARGET}"
- fi
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- cd "${D}"/usr/${CTARGET} || die
- rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
-
- local l src_lib
- for l in libc libm librt libpthread libthread_db ; do
- # take care of shared lib first ...
- l=${l}.so
- if [[ -e ${l} ]] ; then
- src_lib=${l}
- else
- src_lib=$(eval echo */${l})
- fi
- cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
- fperms a+rx $(alt_libdir)/tls/${l}
- dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
-
- # then grab the linker script or the symlink ...
- if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
- dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
- else
- sed \
- -e "s:/${l}:/tls/${l}:g" \
- -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
- "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
- fi
-
- # then grab the static lib ...
- src_lib=${src_lib/%.so/.a}
- [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- src_lib=${src_lib/%.a/_nonshared.a}
- if [[ -e ${src_lib} ]] ; then
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- fi
- done
-
- # use the nptl linker instead of the linuxthreads one as the linuxthreads
- # one may lack TLS support and that can be really bad for business
- cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
- fi
-
- # We'll take care of the cache ourselves
- rm -f "${D}"/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- # When cross-compiling for a non-multilib setup, make sure we have
- # lib and a proper symlink setup
- if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
- cd "${D}"$(alt_libdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- cd "${D}"$(alt_usrlibdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- fi
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install some symlink hacks so that when we build
- # a 2nd stage cross-compiler, gcc finds the target system
- # headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym usr/include /usr/${CTARGET}/sys-include
- return 0
- fi
-
- # Everything past this point just needs to be done once ...
- is_final_abi || return 0
-
- # Make sure the non-native interp can be found on multilib systems
- if has_multilib_profile ; then
- case $(tc-arch) in
- amd64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
- dosym /$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
- ;;
- ppc64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
- dosym /$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
- ;;
- esac
- fi
-
- # Files for Debian-style locale updating
- dodir /usr/share/i18n
- sed \
- -e "/^#/d" \
- -e "/SUPPORTED-LOCALES=/d" \
- -e "s: \\\\::g" -e "s:/: :g" \
- "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
- || die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen || die
- doman *.[0-8]
- insinto /etc
- doins locale.gen || die
-
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- local a
- keepdir /usr/$(get_libdir)/locale
- for a in $(get_install_abis) ; do
- if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
- dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
- fi
- done
-
- if ! has noinfo ${FEATURES} && [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- einfo "Installing info pages..."
-
- make \
- -C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS} -j1" \
- install_root="${install_root}" \
- info -i || die
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- # Install misc network config files
- insinto /etc
- doins "${WORKDIR}"/extra/etc/*.conf || die
- doinitd "${WORKDIR}"/extra/etc/nscd || die
-
- cd "${S}"
- dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE NEWS NOTES PROJECTS README*
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f "${D}"/etc/localtime
-
- # simple test to make sure our new glibc isnt completely broken.
- # for now, skip the multilib scenario. also make sure we don't
- # test with statically built binaries since they will fail.
- [[ ${CBUILD} != ${CHOST} ]] && return 0
- [[ $(get_libdir) != "lib" ]] && return 0
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-toolchain-glibc_headers_install() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
- # Copy over headers that are not part of install-headers ... these
- # are pretty much taken verbatim from crosstool, see it for more details
- insinto $(alt_headers)/bits
- doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
- insinto $(alt_headers)/gnu
- doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- dosym usr/include /usr/${CTARGET}/sys-include
-}
-
-toolchain-glibc_pkg_postinst() {
- # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
- # isn't removed in unmerge which happens sometimes. See bug #87671
- if ! is_crosscompile && want_linuxthreads && [[ ${ROOT} == "/" ]] ; then
- for libdir in $(get_all_libdirs) ; do
- for f in "${ROOT}"/${libdir}/libpthread-2.* "${ROOT}"/${libdir}/libpthread-0.6* ; do
- if [[ -f ${f} ]] ; then
- rm -f ${f}
- ldconfig
- fi
- done
- done
- fi
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if [[ ! -e ${ROOT}/lib/ld.so.1 ]] && use ppc64 && ! has_multilib_profile ; then
- ## SHOULDN'T THIS BE lib64??
- ln -s ld64.so.1 "${ROOT}"/lib/ld.so.1
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U &> /dev/null
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-
- echo
- einfo "Gentoo's glibc no longer includes mdns."
- einfo "If you want mdns, emerge the sys-auth/nss-mdns package."
- echo
-
- if want_nptl && want_linuxthreads ; then
- einfo "The default behavior of glibc on your system is to use NPTL. If"
- einfo "you want to use linuxthreads for a particular program, start it"
- einfo "by executing 'LD_ASSUME_KERNEL=${LT_KERNEL_VERSION} <program> [<options>]'"
- echo
- fi
-}
-
-### SUPPORT FUNCTIONS ###
-# We need to be able to set alternative headers for
-# compiling for non-native platform
-# Will also become useful for testing kernel-headers without screwing up
-# the whole system.
-# note: intentionally undocumented.
-alt_headers() {
- if [[ -z ${ALT_HEADERS} ]] ; then
- if is_crosscompile ; then
- ALT_HEADERS="/usr/${CTARGET}/usr/include"
- else
- ALT_HEADERS="/usr/include"
- fi
- fi
- echo "${ALT_HEADERS}"
-}
-alt_build_headers() {
- if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS=$(alt_headers)
- tc-is-cross-compiler && ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
- fi
- echo "${ALT_BUILD_HEADERS}"
-}
-
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-alt_usrlibdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/usr/$(get_libdir)
- else
- echo /usr/$(get_libdir)
- fi
-}
-
-setup_flags() {
- # Make sure host make.conf doesn't pollute us
- if is_crosscompile || tc-is-cross-compiler ; then
- CHOST=${CTARGET} strip-unsupported-flags
- fi
-
- # Store our CFLAGS because it's changed depending on which CTARGET
- # we are building when pulling glibc on a multilib profile
- CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
- CFLAGS=${CFLAGS_BASE}
- ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
- ASFLAGS=${ASFLAGS_BASE}
-
- # Over-zealous CFLAGS can often cause problems. What may work for one
- # person may not work for another. To avoid a large influx of bugs
- # relating to failed builds, we strip most CFLAGS out to ensure as few
- # problems as possible.
- strip-flags
- strip-unsupported-flags
- filter-flags -m32 -m64 -mabi=*
-
- unset CBUILD_OPT CTARGET_OPT
- if has_multilib_profile ; then
- CTARGET_OPT=$(get_abi_CTARGET)
- [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
- fi
-
- case $(tc-arch) in
- amd64)
- # Punt this when amd64's 2004.3 is removed
- CFLAGS_x86="-m32"
- ;;
- ppc)
- append-flags "-freorder-blocks"
- ;;
- sparc)
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- filter-flags "-fcall-used-g7"
- append-flags "-fcall-used-g6"
- filter-flags "-mvis"
-
- if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
- case ${ABI} in
- sparc64)
- filter-flags -Wa,-xarch -Wa,-A
-
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparc64b-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9b"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
- else
- CTARGET_OPT="sparc64-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9a"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
- fi
- ;;
- *)
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- else
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- ;;
- esac
- else
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- elif { is_crosscompile && want_nptl; } || is-flag "-mcpu=ultrasparc2" || is-flag "-mcpu=ultrasparc"; then
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- fi
- ;;
- esac
-
- if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
- CBUILD_OPT=${CTARGET_OPT}
- fi
-
- if $(tc-getCC ${CTARGET}) -v 2>&1 | grep -q 'gcc version 3.[0123]'; then
- append-flags -finline-limit=2000
- fi
-
- # We dont want these flags for glibc
- filter-ldflags -pie
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be
- # conservative here. -fno-strict-aliasing is to work around #155906
- filter-flags -O?
- append-flags -O2 -fno-strict-aliasing
-}
-
-check_kheader_version() {
- local header="$(alt_build_headers)/linux/version.h"
-
- [[ -z $1 ]] && return 1
-
- if [[ -f ${header} ]] ; then
- local version=$(grep 'LINUX_VERSION_CODE' ${header} | \
- sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::')
-
- if [[ ${version} -ge "$1" ]] ; then
- return 0
- fi
- fi
-
- return 1
-}
-
-check_nptl_support() {
- local min_kernel_version=$(KV_to_int "${NPTL_KERNEL_VERSION}")
-
- echo
-
- ebegin "Checking gcc for __thread support"
- if ! eend $(want__thread ; echo $?) ; then
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "Please update your binutils/gcc and try again."
- die "No __thread support in gcc!"
- fi
-
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- # Building fails on an non-supporting kernel
- ebegin "Checking kernel version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $([[ $(get_KV) -ge ${min_kernel_version} ]] ; echo $?) ; then
- echo
- eerror "You need a kernel of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "Kernel version too low!"
- fi
- fi
-
- # Building fails with too low linux-headers
- ebegin "Checking linux-headers version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $(check_kheader_version "${min_kernel_version}" ; echo $?) ; then
- echo
- eerror "You need linux-headers of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "linux-headers version too low!"
- fi
-
- echo
-}
-
-want_nptl() {
- want_tls || return 1
- use nptl || return 1
-
- # Only list the arches that cannot do NPTL
- case $(tc-arch) in
- hppa|m68k) return 1;;
- sparc)
- # >= v9 is needed for nptl.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
- ;;
- esac
-
- return 0
-}
-
-want_linuxthreads() {
- ! use nptlonly && return 0
- want_nptl || return 0
- return 1
-}
-
-want_tls() {
- # Archs that can use TLS (Thread Local Storage)
- case $(tc-arch) in
- sparc)
- # 2.3.6 should have tls support on sparc64
- # when using newer binutils
- case ${CTARGET/-*} in
- sparc64*) return 1 ;;
- *) return 0 ;;
- esac
- ;;
- x86)
- # requires i486 or better #106556
- [[ ${CTARGET} == i[4567]86* ]] && return 0
- return 1
- ;;
- esac
-
- return 0
-}
-
-want__thread() {
- want_tls || return 1
-
- # For some reason --with-tls --with__thread is causing segfaults on sparc32.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
-
- [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
-
- echo 'extern __thread int i;' > "${T}"/test-__thread.c
- $(tc-getCC ${CTARGET}) -c "${T}"/test-__thread.c -o "${T}"/test-__thread.o &> /dev/null
- WANT__THREAD=$?
- rm -f "${T}"/test-__thread.[co]
-
- return ${WANT__THREAD}
-}
-
-glibc_do_configure() {
- local myconf
-
- # set addons
- pushd "${S}" > /dev/null
- local ADDONS=$(echo */configure | sed \
- -e 's:/configure::g' \
- -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
- -e 's: \+$::' \
- -e 's! !,!g' \
- -e 's!^!,!' \
- -e '/^,\*$/d')
- popd > /dev/null
-
- if [[ -n ${PPC_CPU_ADDON_VER} ]] && [[ $(tc-arch) == ppc* ]] ; then
- ADDONS="${ADDONS},powerpc-cpu"
- case $(get-flag mcpu) in
- 970|power4|power5|power5+) myconf="${myconf} --with-cpu=$(get-flag mcpu)"
- esac
- fi
-
- use nls || myconf="${myconf} --disable-nls"
- myconf="${myconf} $(use_enable hardened stackguard-randomization)"
- if [[ $(<"${T}"/.ssp.compat) == "yes" ]] ; then
- myconf="${myconf} --enable-old-ssp-compat"
- else
- myconf="${myconf} --disable-old-ssp-compat"
- fi
-
- use glibc-omitfp && myconf="${myconf} --enable-omitfp"
-
- [[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
-
- if [[ $1 == "linuxthreads" ]] ; then
- if want_tls ; then
- myconf="${myconf} --with-tls"
-
- if ! want__thread || use glibc-compat20 || [[ ${LT_KERNEL_VERSION} == 2.[02].* ]] ; then
- myconf="${myconf} --without-__thread"
- else
- myconf="${myconf} --with-__thread"
- fi
- else
- myconf="${myconf} --without-tls --without-__thread"
- fi
-
- myconf="${myconf} --disable-sanity-checks"
- myconf="${myconf} --enable-add-ons=ports,linuxthreads${ADDONS}"
- myconf="${myconf} --enable-kernel=${LT_KERNEL_VERSION}"
- elif [[ $1 == "nptl" ]] ; then
- myconf="${myconf} --with-tls --with-__thread"
- myconf="${myconf} --enable-add-ons=ports,nptl${ADDONS}"
- myconf="${myconf} --enable-kernel=${NPTL_KERNEL_VERSION}"
- else
- die "invalid pthread option"
- fi
-
- # Since SELinux support is only required for nscd, only enable it if:
- # 1. USE selinux
- # 2. ! USE build
- # 3. only for the primary ABI on multilib systems
- if use selinux && ! use build ; then
- if use multilib || has_multilib_profile ; then
- if is_final_abi ; then
- myconf="${myconf} --with-selinux"
- else
- myconf="${myconf} --without-selinux"
- fi
- else
- myconf="${myconf} --with-selinux"
- fi
- else
- myconf="${myconf} --without-selinux"
- fi
-
- myconf="${myconf}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- $(use_enable profile)
- --without-gd
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- --libdir=/usr/$(get_libdir)
- --mandir=/usr/share/man
- --infodir=/usr/share/info
- --libexecdir=/usr/$(get_libdir)/misc/glibc
- ${EXTRA_ECONF}"
-
- # There is no configure option for this and we need to export it
- # since the glibc build will re-run configure on itself
- export libc_cv_slibdir=/$(get_libdir)
-
- has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
-
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- addwrite ${ROOT}/
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- addwrite ${ROOT}/usr
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- addwrite ${ROOT}/usr/X11R6
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-use_multilib() {
- case ${CTARGET} in
- sparc64*|mips64*|x86_64*|powerpc64*|s390x*)
- has_multilib_profile || use multilib ;;
- *) false ;;
- esac
-}
-
-# Setup toolchain variables that would be defined in the profiles for these archs.
-setup_env() {
- # These should not be set, else the zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
- # silly users
- unset LD_RUN_PATH
-
- if is_crosscompile || tc-is-cross-compiler ; then
- multilib_env ${CTARGET}
- if ! use multilib ; then
- MULTILIB_ABIS=${DEFAULT_ABI}
- else
- MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
- fi
-
- # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
- # and fall back on CFLAGS.
- local VAR=CFLAGS_${CTARGET//[-.]/_}
- CFLAGS=${!VAR-${CFLAGS}}
- fi
-
- setup_flags
-
- export ABI=${ABI:-${DEFAULT_ABI:-default}}
-
- if is_crosscompile || tc-is-cross-compiler ; then
- local VAR=CFLAGS_${ABI}
- # We need to export CFLAGS with abi information in them because
- # glibc's configure script checks CFLAGS for some targets (like mips)
- export CFLAGS="${!VAR} ${CFLAGS}"
- fi
-}
-
-### /ECLASS PUNTAGE ###
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- SLOT="2.2"
-fi
-
-# we'll handle stripping ourself #46186
-RESTRICT="strip"
-EMULTILIB_PKG="true"
-
-# 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 )
- nptl? ( || ( >=sys-kernel/mips-headers-${NPTL_KERNEL_VERSION} >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} ) )
- >=sys-devel/binutils-2.15.94
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
-
- if [[ ${CATEGORY} == *-linux* ]] ; then
- if [[ ${CATEGORY} == cross-mips* ]] ; then
- DEPEND="${DEPEND} >=${CATEGORY}/mips-headers-2.6.10"
- else
- DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
- fi
- fi
-else
- DEPEND="${DEPEND} sys-libs/timezone-data"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
- fi
-
- if use glibc-compat20 ; then
- eerror "This version no longer provides compatibility with old broken"
- eerror "applications. If you need this support, call your vendor"
- eerror "and tell them to release an update that isn't broken."
- die "non-TLS symbol errno@glibc_2.0 not supported"
- fi
- if want_linuxthreads ; then
- ewarn "glibc-2.4 is nptl-only!"
- [[ ${CTARGET} == i386-* ]] && eerror "NPTL requires a CHOST of i486 or better"
- die "please add USE='nptl nptlonly' to make.conf"
- fi
-
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- if ! type -p scanelf > /dev/null ; then
- eerror "You do not have pax-utils installed."
- die "install pax-utils"
- fi
-
- # give some sort of warning about the nptl logic changes...
- if want_nptl && want_linuxthreads ; then
- ewarn "Warning! Gentoo's GLIBC with NPTL enabled now behaves like the"
- ewarn "glibc from almost every other distribution out there. This means"
- ewarn "that glibc is compiled -twice-, once with linuxthreads and once"
- ewarn "with nptl. The NPTL version is installed to lib/tls and is still"
- ewarn "used by default. If you do not need nor want the linuxthreads"
- ewarn "fallback, you can disable this behavior by adding nptlonly to"
- ewarn "USE to save yourself some compile time."
-
- ebeep
- epause 5
- fi
-}
-
-src_unpack() {
- setup_env
-
- toolchain-glibc_src_unpack
-
- # Backwards SSP support
- cd "${S}"
-# For now, we force everyone to have the extra symbols
-# einfon "Scanning system for __guard to see if we need SSP compat ... "
-# if [[ -n $(scanelf -qyls__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
- echo "yes" > "${T}"/.ssp.compat
-# else
-# # ok, a quick scan didnt find it, so lets do a deep scan ...
-# if [[ -n $(scanelf -qyRlps__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
-# echo "yes" > "${T}"/.ssp.compat
-# else
-# echo "no" > "${T}"/.ssp.compat
-# fi
-# fi
-# cat "${T}"/.ssp.compat
-
- # Glibc is stupid sometimes, and doesn't realize that with a
- # static C-Only gcc, -lgcc_eh doesn't exist.
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- echo 'int main(){}' > "${T}"/gcc_eh_test.c
- if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
- sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
- fi
-
- # Some configure checks fail on the first emerge through because they
- # try to link. This doesn't work well if we don't have a libc yet.
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- if is_crosscompile && use build; then
- rm "${S}"/sysdeps/sparc/sparc64/elf/configure{,.in}
- rm "${S}"/nptl/sysdeps/pthread/configure{,.in}
- fi
-
- cd "${WORKDIR}"
- find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
- find . -name configure -exec touch {} \;
-
- # Fix permissions on some of the scripts
- chmod u+x "${S}"/scripts/*.sh
-}
-
-src_compile() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Building multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_compile
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_compile
- else
- toolchain-glibc_src_compile
- fi
-}
-
-src_test() {
- setup_env
-
- if [[ -z ${OABI} ]] && has_multilib_profile ; then
- OABI=${ABI}
- einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
- for ABI in $(get_install_abis) ; do
- export ABI
- einfo " Testing ${ABI} glibc"
- src_test
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
-
- want_linuxthreads && toolchain-glibc_src_test linuxthreads
- want_nptl && toolchain-glibc_src_test nptl
-}
-
-src_strip() {
- # Now, strip everything but the thread libs #46186, as well as the dynamic
- # linker, else we cannot set breakpoints in shared libraries due to bugs in
- # gdb. Also want to grab stuff in tls subdir. whee.
-#when new portage supports this ...
-# env \
-# -uRESTRICT \
-# CHOST=${CTARGET} \
-# STRIP_MASK="/*/{,tls/}{ld-,lib{pthread,thread_db}}*" \
-# prepallstrip
- pushd "${D}" > /dev/null
-
- if ! is_crosscompile ; then
- mkdir -p "${T}"/strip-backup
- for x in $(find "${D}" -maxdepth 3 \
- '(' -name 'ld-*' -o -name 'libpthread*' -o -name 'libthread_db*' ')' \
- -a '(' '!' -name '*.a' ')' -type f -printf '%P ')
- do
- mkdir -p "${T}/strip-backup/${x%/*}"
- cp -a -- "${D}/${x}" "${T}/strip-backup/${x}" || die "backing up ${x}"
- done
- fi
- env -uRESTRICT CHOST=${CTARGET} prepallstrip
- if ! is_crosscompile ; then
- cp -a -- "${T}"/strip-backup/* "${D}"/ || die "restoring non-stripped libs"
- fi
-
- popd > /dev/null
-}
-
-src_install() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_install
- else
- toolchain-glibc_src_install
- fi
- [[ -z ${OABI} ]] && src_strip
-}
-
-pkg_preinst() {
- toolchain-glibc_pkg_preinst
-}
-
-pkg_postinst() {
- toolchain-glibc_pkg_postinst
-}
diff --git a/sys-libs/glibc/glibc-2.5-r2.ebuild b/sys-libs/glibc/glibc-2.5-r2.ebuild
deleted file mode 100644
index a1275f939171..000000000000
--- a/sys-libs/glibc/glibc-2.5-r2.ebuild
+++ /dev/null
@@ -1,1250 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.5-r2.ebuild,v 1.21 2009/12/10 01:31:25 vapier Exp $
-
-# 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/
-
-KEYWORDS="-* alpha amd64 arm hppa ia64 mips ppc ppc64 ~s390 sh sparc x86"
-
-BRANCH_UPDATE=""
-
-# Generated man pages
-GLIBC_MANPAGE_VERSION="none"
-
-# Generated stuff in manual subdir
-GLIBC_INFOPAGE_VERSION="none"
-
-# Gentoo patchset
-PATCH_VER="1.6"
-
-GENTOO_TOOLCHAIN_BASE_URI="mirror://gentoo"
-GENTOO_TOOLCHAIN_DEV_URI="http://dev.gentoo.org/~azarah/glibc/XXX http://dev.gentoo.org/~vapier/dist/XXX"
-
-### PUNT OUT TO ECLASS?? ###
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-LICENSE="LGPL-2"
-
-IUSE="build debug nls nptl nptlonly hardened multilib selinux glibc-omitfp profile glibc-compat20"
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- PROVIDE="virtual/libc"
-fi
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-just_headers() {
- is_crosscompile && use crosscompile_opts_headers-only
-}
-
-GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
-
-# Don't set this to :-, - allows BRANCH_UPDATE=""
-BRANCH_UPDATE=${BRANCH_UPDATE-$(get_version_component_range 4)}
-GLIBC_PORTS_VER=${GLIBC_RELEASE_VER}
-#GLIBC_PORTS_VER="20060925"
-GLIBC_LT_VER=${GLIBC_RELEASE_VER}
-#GLIBC_LT_VER="20060605"
-
-# (Recent snapshots fails with 2.6.5 and earlier with NPTL)
-NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-"2.6.9"}
-LT_KERNEL_VERSION=${LT_KERNEL_VERSION:-"2.4.1"}
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-2.6.20}
-
-### SRC_URI ###
-
-# This function handles the basics of setting the SRC_URI for a glibc ebuild.
-# To use, set SRC_URI with:
-#
-# SRC_URI="$(get_glibc_src_uri)"
-#
-# Other than the variables normally set by portage, this function's behavior
-# can be altered by setting the following:
-#
-# GENTOO_TOOLCHAIN_BASE_URI
-# This sets the base URI for all gentoo-specific patch files. Note
-# that this variable is only important for a brief period of time,
-# before your source files get picked up by mirrors. However, it is
-# still highly suggested that you keep files in this location
-# available.
-#
-# BRANCH_UPDATE
-# If set, this variable signals that we should be using the main
-# release tarball (determined by ebuild version) and applying a
-# CVS branch update patch against it. The location of this branch
-# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
-# Just like with SNAPSHOT, this variable is ignored if the ebuild
-# has a _pre suffix.
-#
-# PATCH_VER
-# PATCH_GLIBC_VER
-# This should be set to the version of the gentoo patch tarball.
-# The resulting filename of this tarball will be:
-# glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
-#
-# GLIBC_MANPAGE_VERSION
-# GLIBC_INFOPAGE_VERSION
-# The version of glibc for which we will download pages. This will
-# default to ${GLIBC_RELEASE_VER}, but we may not want to pre-generate man pages
-# for prerelease test ebuilds for example. This allows you to
-# continue using pre-generated manpages from the last stable release.
-# If set to "none", this will prevent the downloading of manpages,
-# which is useful for individual library targets.
-#
-get_glibc_src_uri() {
- GENTOO_TOOLCHAIN_BASE_URI=${GENTOO_TOOLCHAIN_BASE_URI:-"mirror://gentoo"}
-
- GLIBC_SRC_URI="mirror://gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-ports-${GLIBC_PORTS_VER}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-ports-${GLIBC_PORTS_VER}.tar.bz2
- mirror://gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2"
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2}"
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ -n ${GLIBC_LT_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- mirror://gnu/glibc/glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2"
- fi
-
- echo "${GLIBC_SRC_URI}"
-}
-
-SRC_URI=$(get_glibc_src_uri)
-S=${WORKDIR}/glibc-${GLIBC_RELEASE_VER}
-
-### EXPORTED FUNCTIONS ###
-unpack_addon() {
- local addon=$1 ver=${2:-${GLIBC_RELEASE_VER}}
- unpack glibc-${addon}-${ver}.tar.bz2
- mv glibc-${addon}-${ver} ${addon} || die
-}
-toolchain-glibc_src_unpack() {
- # Check NPTL support _before_ we unpack things to save some time
- want_nptl && check_nptl_support
-
- unpack glibc-${GLIBC_RELEASE_VER}.tar.bz2
-
- cd "${S}"
- [[ -n ${GLIBC_LT_VER} ]] && unpack glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2
- unpack_addon libidn
- unpack_addon ports ${GLIBC_PORTS_VER}
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${WORKDIR}"
- unpack glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- # pull out all the addons
- local d
- for d in extra/*/configure ; do
- mv "${d%/configure}" "${S}" || die "moving ${d}"
- done
- fi
-
- # XXX: We should do the branchupdate, before extracting the manpages and
- # infopages else it does not help much (mtimes change if there is a change
- # to them with branchupdate)
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- cd "${S}"
- epatch "${DISTDIR}"/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
-
- # Snapshot date patch
- einfo "Patching version to display snapshot date ..."
- sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- cd "${WORKDIR}"
- unpack glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- cd "${S}"
- unpack glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${S}"
- EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-${PATCH_VER} ..." \
- EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
- EPATCH_SUFFIX="patch" \
- ARCH=$(tc-arch) \
- epatch "${WORKDIR}"/patches
-
- # tag, glibc is it
- [[ -e csu/Banner ]] && die "need new banner location"
- echo "Gentoo patchset ${PATCH_VER}" > csu/Banner
- fi
-
- 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.5/glibc-2.5-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP handler"
- cp -f "${FILESDIR}"/2.5/glibc-2.5-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
-
- gnuconfig_update
-}
-
-toolchain-glibc_src_compile() {
- echo
- local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
- einfo " $(printf '%15s' ${v}:) ${!v}"
- done
- echo
-
- if want_linuxthreads ; then
- glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
- if want_nptl ; then
- # ... and then do the optional nptl build
- unset LD_ASSUME_KERNEL
- glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
-}
-
-toolchain-glibc_headers_compile() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
-
- # Pick out the correct location for build headers
- local myconf="--disable-sanity-checks --enable-hacker-mode"
- myconf="${myconf}
- --enable-add-ons=nptl,ports
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- ${EXTRA_ECONF}"
-
- einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
- CC=gcc \
- CFLAGS="-O1 -pipe" \
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-toolchain-glibc_src_test() {
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-$1 || die "cd build-${ABI}-${CTARGET}-$1"
- unset LD_ASSUME_KERNEL
- make check && return 0
- einfo "make check failed - re-running with --keep-going to get the rest of the results"
- make -k check
- ewarn "make check failed for ${ABI}-${CTARGET}-$1"
- return 1
-}
-
-toolchain-glibc_pkg_preinst() {
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && ! { want_nptl && want_linuxthreads; }; then
- addwrite "${ROOT}"/$(alt_libdir)/
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen
-
- # simple test to make sure our new glibc isnt completely broken.
- # make sure we don't test with statically built binaries since
- # they will fail. also, skip if this glibc is a cross compiler.
- [[ ${ROOT} != "/" ]] && return 0
- is_crosscompile && return 0
- local x striptest
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-toolchain-glibc_src_install() {
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- local GBUILDDIR
- if want_linuxthreads ; then
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
- else
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
- fi
-
- local install_root=${D}
- is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- cd "${D}"/usr/${CTARGET} || die
- rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
-
- local l src_lib
- for l in libc libm librt libpthread libthread_db ; do
- # take care of shared lib first ...
- l=${l}.so
- if [[ -e ${l} ]] ; then
- src_lib=${l}
- else
- src_lib=$(eval echo */${l})
- fi
- cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
- fperms a+rx $(alt_libdir)/tls/${l}
- dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
-
- # then grab the linker script or the symlink ...
- if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
- dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
- else
- sed \
- -e "s:/${l}:/tls/${l}:g" \
- -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
- "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
- fi
-
- # then grab the static lib ...
- src_lib=${src_lib/%.so/.a}
- [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- src_lib=${src_lib/%.a/_nonshared.a}
- if [[ -e ${src_lib} ]] ; then
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- fi
- done
-
- # use the nptl linker instead of the linuxthreads one as the linuxthreads
- # one may lack TLS support and that can be really bad for business
- cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
- fi
-
- # We'll take care of the cache ourselves
- rm -f "${D}"/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- # When cross-compiling for a non-multilib setup, make sure we have
- # lib and a proper symlink setup
- if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
- cd "${D}"$(alt_libdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- cd "${D}"$(alt_usrlibdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- fi
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install some symlink hacks so that when we build
- # a 2nd stage cross-compiler, gcc finds the target system
- # headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym usr/include /usr/${CTARGET}/sys-include
- return 0
- fi
-
- # Everything past this point just needs to be done once ...
- is_final_abi || return 0
-
- # Make sure the non-native interp can be found on multilib systems
- if has_multilib_profile ; then
- case $(tc-arch) in
- amd64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
- dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
- ;;
- ppc64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
- dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
- ;;
- esac
- fi
-
- # Files for Debian-style locale updating
- dodir /usr/share/i18n
- sed \
- -e "/^#/d" \
- -e "/SUPPORTED-LOCALES=/d" \
- -e "s: \\\\::g" -e "s:/: :g" \
- "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
- || die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen || die
- doman *.[0-8]
- insinto /etc
- doins locale.gen || die
-
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- local a
- keepdir /usr/$(get_libdir)/locale
- for a in $(get_install_abis) ; do
- if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
- dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
- fi
- done
-
- if ! has noinfo ${FEATURES} && [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- einfo "Installing info pages..."
-
- make \
- -C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- info -i || die
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- cd "${S}"
-
- # Install misc network config files
- insinto /etc
- doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
- doins "${WORKDIR}"/extra/etc/*.conf || die
- doinitd "${WORKDIR}"/extra/etc/nscd || die
-
- dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f "${D}"/etc/localtime
-}
-
-toolchain-glibc_headers_install() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
- # Copy over headers that are not part of install-headers ... these
- # are pretty much taken verbatim from crosstool, see it for more details
- insinto $(alt_headers)/bits
- doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
- insinto $(alt_headers)/gnu
- doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- dosym usr/include /usr/${CTARGET}/sys-include
-}
-
-toolchain-glibc_pkg_postinst() {
- # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
- # isn't removed in unmerge which happens sometimes. See bug #87671
- if ! is_crosscompile && want_linuxthreads && [[ ${ROOT} == "/" ]] ; then
- for libdir in $(get_all_libdirs) ; do
- for f in "${ROOT}"/${libdir}/libpthread-2.* "${ROOT}"/${libdir}/libpthread-0.6* ; do
- if [[ -f ${f} ]] ; then
- rm -f ${f}
- ldconfig
- fi
- done
- done
- fi
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if [[ ! -e ${ROOT}/lib/ld.so.1 ]] && use ppc64 && ! has_multilib_profile ; then
- ## SHOULDN'T THIS BE lib64??
- ln -s ld64.so.1 "${ROOT}"/lib/ld.so.1
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U &> /dev/null
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-
- echo
- einfo "Gentoo's glibc no longer includes mdns."
- einfo "If you want mdns, emerge the sys-auth/nss-mdns package."
- echo
-
- if want_nptl && want_linuxthreads ; then
- einfo "The default behavior of glibc on your system is to use NPTL. If"
- einfo "you want to use linuxthreads for a particular program, start it"
- einfo "by executing 'LD_ASSUME_KERNEL=${LT_KERNEL_VERSION} <program> [<options>]'"
- echo
- fi
-}
-
-### SUPPORT FUNCTIONS ###
-# We need to be able to set alternative headers for
-# compiling for non-native platform
-# Will also become useful for testing kernel-headers without screwing up
-# the whole system.
-# note: intentionally undocumented.
-alt_headers() {
- if [[ -z ${ALT_HEADERS} ]] ; then
- if is_crosscompile ; then
- ALT_HEADERS="/usr/${CTARGET}/usr/include"
- else
- ALT_HEADERS="/usr/include"
- fi
- fi
- echo "${ALT_HEADERS}"
-}
-alt_build_headers() {
- if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS=$(alt_headers)
- if tc-is-cross-compiler ; then
- ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
- if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
- local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h')
- ALT_BUILD_HEADERS=${header_path%/linux/version.h}
- fi
- fi
- fi
- echo "${ALT_BUILD_HEADERS}"
-}
-
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-alt_usrlibdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/usr/$(get_libdir)
- else
- echo /usr/$(get_libdir)
- fi
-}
-
-setup_flags() {
- # Make sure host make.conf doesn't pollute us
- if is_crosscompile || tc-is-cross-compiler ; then
- CHOST=${CTARGET} strip-unsupported-flags
- fi
-
- # Store our CFLAGS because it's changed depending on which CTARGET
- # we are building when pulling glibc on a multilib profile
- CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
- CFLAGS=${CFLAGS_BASE}
- CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}}
- CXXFLAGS=${CXXFLAGS_BASE}
- ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
- ASFLAGS=${ASFLAGS_BASE}
-
- # Over-zealous CFLAGS can often cause problems. What may work for one
- # person may not work for another. To avoid a large influx of bugs
- # relating to failed builds, we strip most CFLAGS out to ensure as few
- # problems as possible.
- strip-flags
- strip-unsupported-flags
- filter-flags -m32 -m64 -mabi=*
-
- unset CBUILD_OPT CTARGET_OPT
- if has_multilib_profile ; then
- CTARGET_OPT=$(get_abi_CTARGET)
- [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
- fi
-
- case $(tc-arch) in
- amd64)
- # Punt this when amd64's 2004.3 is removed
- CFLAGS_x86="-m32"
- ;;
- ppc)
- append-flags "-freorder-blocks"
- ;;
- sparc)
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- filter-flags "-fcall-used-g7"
- append-flags "-fcall-used-g6"
- filter-flags "-mvis"
-
- if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
- case ${ABI} in
- sparc64)
- filter-flags -Wa,-xarch -Wa,-A
-
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparc64b-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9b"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
- else
- CTARGET_OPT="sparc64-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9a"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
- fi
- ;;
- *)
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- else
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- ;;
- esac
- else
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- elif { is_crosscompile && want_nptl; } || is-flag "-mcpu=ultrasparc2" || is-flag "-mcpu=ultrasparc"; then
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- fi
- ;;
- esac
-
- if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
- CBUILD_OPT=${CTARGET_OPT}
- fi
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be
- # conservative here. -fno-strict-aliasing is to work around #155906
- filter-flags -O?
- append-flags -O2 -fno-strict-aliasing
-
- # building glibc with SSP is fraught with difficulty, especially
- # due to __stack_chk_fail_local which would mean significant changes
- # to the glibc build process. See bug #94325
- filter-flags -fstack-protector
-
- if use hardened && gcc-specs-pie ; then
- # Force PIC macro definition for all compilations since they're all
- # either -fPIC or -fPIE with the default-PIE compiler.
- append-cppflags -DPIC
- else
- # Don't build -fPIE without the default-PIE compiler and the
- # hardened-pie patch
- filter-flags -fPIE
- fi
-}
-
-check_kheader_version() {
- local version=$(
- printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
- $(tc-getCPP ${CTARGET}) -I "$(alt_build_headers)" | \
- tail -n 1
- )
- [[ ${version} -ge "$1" ]]
-}
-
-check_nptl_support() {
- local min_kernel_version=$(KV_to_int "${NPTL_KERNEL_VERSION}")
-
- echo
-
- ebegin "Checking gcc for __thread support"
- if ! eend $(want__thread ; echo $?) ; then
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "Please update your binutils/gcc and try again."
- die "No __thread support in gcc!"
- fi
-
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- # Building fails on an non-supporting kernel
- ebegin "Checking kernel version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $([[ $(get_KV) -ge ${min_kernel_version} ]] ; echo $?) ; then
- echo
- eerror "You need a kernel of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "Kernel version too low!"
- fi
- fi
-
- # Building fails with too low linux-headers
- ebegin "Checking linux-headers version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $(check_kheader_version "${min_kernel_version}" ; echo $?) ; then
- echo
- eerror "You need linux-headers of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "linux-headers version too low!"
- fi
-
- echo
-}
-
-want_nptl() {
- want_tls || return 1
- use nptl || return 1
-
- # Only list the arches that cannot do NPTL
- case $(tc-arch) in
- m68k) return 1;;
- sparc)
- # >= v9 is needed for nptl.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
- ;;
- esac
-
- return 0
-}
-
-want_linuxthreads() {
- ! use nptlonly && return 0
- want_nptl || return 0
- return 1
-}
-
-want_tls() {
- # Archs that can use TLS (Thread Local Storage)
- case $(tc-arch) in
- sparc)
- # 2.3.6 should have tls support on sparc64
- # when using newer binutils
- case ${CTARGET/-*} in
- sparc64*) return 1 ;;
- *) return 0 ;;
- esac
- ;;
- x86)
- # requires i486 or better #106556
- [[ ${CTARGET} == i[4567]86* ]] && return 0
- return 1
- ;;
- esac
-
- return 0
-}
-
-want__thread() {
- want_tls || return 1
-
- # For some reason --with-tls --with__thread is causing segfaults on sparc32.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
-
- [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
-
- echo 'extern __thread int i;' > "${T}"/test-__thread.c
- $(tc-getCC ${CTARGET}) -c "${T}"/test-__thread.c -o "${T}"/test-__thread.o &> /dev/null
- WANT__THREAD=$?
- rm -f "${T}"/test-__thread.[co]
-
- return ${WANT__THREAD}
-}
-
-glibc_do_configure() {
- local myconf
-
- # set addons
- pushd "${S}" > /dev/null
- local ADDONS=$(echo */configure | sed \
- -e 's:/configure::g' \
- -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
- -e 's: \+$::' \
- -e 's! !,!g' \
- -e 's!^!,!' \
- -e '/^,\*$/d')
- popd > /dev/null
-
- use nls || myconf="${myconf} --disable-nls"
- myconf="${myconf} $(use_enable hardened stackguard-randomization)"
- if [[ $(<"${T}"/.ssp.compat) == "yes" ]] ; then
- myconf="${myconf} --enable-old-ssp-compat"
- else
- myconf="${myconf} --disable-old-ssp-compat"
- fi
-
- use glibc-omitfp && myconf="${myconf} --enable-omitfp"
-
- [[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
-
- if [[ $1 == "linuxthreads" ]] ; then
- if want_tls ; then
- myconf="${myconf} --with-tls"
-
- if ! want__thread || use glibc-compat20 || [[ ${LT_KERNEL_VERSION} == 2.[02].* ]] ; then
- myconf="${myconf} --without-__thread"
- else
- myconf="${myconf} --with-__thread"
- fi
- else
- myconf="${myconf} --without-tls --without-__thread"
- fi
-
- myconf="${myconf} --disable-sanity-checks"
- myconf="${myconf} --enable-add-ons=ports,linuxthreads${ADDONS}"
- myconf="${myconf} --enable-kernel=${LT_KERNEL_VERSION}"
- elif [[ $1 == "nptl" ]] ; then
- myconf="${myconf} --with-tls --with-__thread"
- myconf="${myconf} --enable-add-ons=ports,nptl${ADDONS}"
- myconf="${myconf} --enable-kernel=${NPTL_KERNEL_VERSION}"
- else
- die "invalid pthread option"
- fi
-
- # Since SELinux support is only required for nscd, only enable it if:
- # 1. USE selinux
- # 2. ! USE build
- # 3. only for the primary ABI on multilib systems
- if use selinux && ! use build ; then
- if use multilib || has_multilib_profile ; then
- if is_final_abi ; then
- myconf="${myconf} --with-selinux"
- else
- myconf="${myconf} --without-selinux"
- fi
- else
- myconf="${myconf} --with-selinux"
- fi
- else
- myconf="${myconf} --without-selinux"
- fi
-
- myconf="${myconf}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- $(use_enable profile)
- --without-gd
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- --libdir=/usr/$(get_libdir)
- --mandir=/usr/share/man
- --infodir=/usr/share/info
- --libexecdir=/usr/$(get_libdir)/misc/glibc
- ${EXTRA_ECONF}"
-
- # There is no configure option for this and we need to export it
- # since the glibc build will re-run configure on itself
- export libc_cv_slibdir=/$(get_libdir)
-
- has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
-
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- addwrite ${ROOT}/
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- addwrite ${ROOT}/usr
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- addwrite ${ROOT}/usr/X11R6
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-use_multilib() {
- case ${CTARGET} in
- sparc64*|mips64*|x86_64*|powerpc64*|s390x*)
- has_multilib_profile || use multilib ;;
- *) false ;;
- esac
-}
-
-# Setup toolchain variables that would be defined in the profiles for these archs.
-setup_env() {
- # These should not be set, else the zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
- # silly users
- unset LD_RUN_PATH
-
- if is_crosscompile || tc-is-cross-compiler ; then
- multilib_env ${CTARGET}
- if ! use multilib ; then
- MULTILIB_ABIS=${DEFAULT_ABI}
- else
- MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
- fi
-
- # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
- # and fall back on CFLAGS.
- local VAR=CFLAGS_${CTARGET//[-.]/_}
- CFLAGS=${!VAR-${CFLAGS}}
- fi
-
- setup_flags
-
- export ABI=${ABI:-${DEFAULT_ABI:-default}}
-
- if is_crosscompile || tc-is-cross-compiler ; then
- local VAR=CFLAGS_${ABI}
- # We need to export CFLAGS with abi information in them because
- # glibc's configure script checks CFLAGS for some targets (like mips)
- export CFLAGS="${!VAR} ${CFLAGS}"
- fi
-}
-
-### /ECLASS PUNTAGE ###
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- SLOT="2.2"
-fi
-
-# we'll handle stripping ourself #46186
-RESTRICT="strip"
-EMULTILIB_PKG="true"
-
-# 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 )
- nptl? ( || ( >=sys-kernel/mips-headers-${NPTL_KERNEL_VERSION} >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} ) )
- >=sys-devel/binutils-2.15.94
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- >=sys-apps/portage-2.1.2
- selinux? ( !build? ( sys-libs/libselinux ) )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
-
- if [[ ${CATEGORY} == *-linux* ]] ; then
- if [[ ${CATEGORY} == cross-mips* ]] ; then
- DEPEND="${DEPEND} >=${CATEGORY}/mips-headers-2.6.10"
- else
- DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
- fi
- fi
-else
- DEPEND="${DEPEND} >=sys-libs/timezone-data-2007c"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
- fi
-
- if [[ ${CTARGET} == i386-* ]] ; then
- eerror "i386 CHOSTs are no longer supported."
- eerror "Chances are you don't actually want/need i386."
- eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
- die "please fix your CHOST"
- fi
-
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- if ! type -p scanelf > /dev/null ; then
- eerror "You do not have pax-utils installed."
- die "install pax-utils"
- fi
-
- use hardened && ! gcc-specs-pie && \
- ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
-}
-
-src_unpack() {
- setup_env
-
- toolchain-glibc_src_unpack
-
- # Backwards SSP support
- cd "${S}"
-# For now, we force everyone to have the extra symbols
-# einfon "Scanning system for __guard to see if we need SSP compat ... "
-# if [[ -n $(scanelf -qyls__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
- echo "yes" > "${T}"/.ssp.compat
-# else
-# # ok, a quick scan didnt find it, so lets do a deep scan ...
-# if [[ -n $(scanelf -qyRlps__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
-# echo "yes" > "${T}"/.ssp.compat
-# else
-# echo "no" > "${T}"/.ssp.compat
-# fi
-# fi
-# cat "${T}"/.ssp.compat
-
- # Glibc is stupid sometimes, and doesn't realize that with a
- # static C-Only gcc, -lgcc_eh doesn't exist.
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- echo 'int main(){}' > "${T}"/gcc_eh_test.c
- if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
- sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
- fi
-
- cd "${WORKDIR}"
- find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
- find . -name configure -exec touch {} \;
-
- # Fix permissions on some of the scripts
- chmod u+x "${S}"/scripts/*.sh
-}
-
-src_compile() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Building multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_compile
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_compile
- else
- toolchain-glibc_src_compile
- fi
-}
-
-src_test() {
- local ret=0
-
- setup_env
-
- if [[ -z ${OABI} ]] && has_multilib_profile ; then
- OABI=${ABI}
- einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
- for ABI in $(get_install_abis) ; do
- export ABI
- einfo " Testing ${ABI} glibc"
- src_test
- ((ret+=$?))
- done
- ABI=${OABI}
- unset OABI
- [[ ${ret} -ne 0 ]] \
- && die "tests failed" \
- || return 0
- fi
-
- want_linuxthreads && toolchain-glibc_src_test linuxthreads ; ((ret+=$?))
- want_nptl && toolchain-glibc_src_test nptl ; ((ret+=$?))
- return ${ret}
-}
-
-src_strip() {
- # Now, strip everything but the thread libs #46186, as well as the dynamic
- # linker, else we cannot set breakpoints in shared libraries due to bugs in
- # gdb. Also want to grab stuff in tls subdir. whee.
- env \
- -uRESTRICT \
- CHOST=${CTARGET} \
- STRIP_MASK="/*/{,tls/}{ld-,lib{pthread,thread_db}}*" \
- prepallstrip
-}
-
-src_install() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_install
- else
- toolchain-glibc_src_install
- fi
- [[ -z ${OABI} ]] && src_strip
-}
-
-pkg_preinst() {
- toolchain-glibc_pkg_preinst
-}
-
-pkg_postinst() {
- toolchain-glibc_pkg_postinst
-}
diff --git a/sys-libs/glibc/glibc-2.5-r3.ebuild b/sys-libs/glibc/glibc-2.5-r3.ebuild
deleted file mode 100644
index 8632c6828f0c..000000000000
--- a/sys-libs/glibc/glibc-2.5-r3.ebuild
+++ /dev/null
@@ -1,1250 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.5-r3.ebuild,v 1.17 2009/12/10 01:31:26 vapier Exp $
-
-# 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/
-
-KEYWORDS="-* alpha amd64 arm hppa ia64 mips ppc ppc64 ~s390 sh sparc x86"
-
-BRANCH_UPDATE=""
-
-# Generated man pages
-GLIBC_MANPAGE_VERSION="none"
-
-# Generated stuff in manual subdir
-GLIBC_INFOPAGE_VERSION="none"
-
-# Gentoo patchset
-PATCH_VER="1.7"
-
-GENTOO_TOOLCHAIN_BASE_URI="mirror://gentoo"
-GENTOO_TOOLCHAIN_DEV_URI="http://dev.gentoo.org/~azarah/glibc/XXX http://dev.gentoo.org/~vapier/dist/XXX"
-
-### PUNT OUT TO ECLASS?? ###
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-LICENSE="LGPL-2"
-
-IUSE="build debug nls nptl nptlonly hardened multilib selinux glibc-omitfp profile glibc-compat20"
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- PROVIDE="virtual/libc"
-fi
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-just_headers() {
- is_crosscompile && use crosscompile_opts_headers-only
-}
-
-GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
-
-# Don't set this to :-, - allows BRANCH_UPDATE=""
-BRANCH_UPDATE=${BRANCH_UPDATE-$(get_version_component_range 4)}
-GLIBC_PORTS_VER=${GLIBC_RELEASE_VER}
-#GLIBC_PORTS_VER="20060925"
-GLIBC_LT_VER=${GLIBC_RELEASE_VER}
-#GLIBC_LT_VER="20060605"
-
-# (Recent snapshots fails with 2.6.5 and earlier with NPTL)
-NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-"2.6.9"}
-LT_KERNEL_VERSION=${LT_KERNEL_VERSION:-"2.4.1"}
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-2.6.20}
-
-### SRC_URI ###
-
-# This function handles the basics of setting the SRC_URI for a glibc ebuild.
-# To use, set SRC_URI with:
-#
-# SRC_URI="$(get_glibc_src_uri)"
-#
-# Other than the variables normally set by portage, this function's behavior
-# can be altered by setting the following:
-#
-# GENTOO_TOOLCHAIN_BASE_URI
-# This sets the base URI for all gentoo-specific patch files. Note
-# that this variable is only important for a brief period of time,
-# before your source files get picked up by mirrors. However, it is
-# still highly suggested that you keep files in this location
-# available.
-#
-# BRANCH_UPDATE
-# If set, this variable signals that we should be using the main
-# release tarball (determined by ebuild version) and applying a
-# CVS branch update patch against it. The location of this branch
-# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
-# Just like with SNAPSHOT, this variable is ignored if the ebuild
-# has a _pre suffix.
-#
-# PATCH_VER
-# PATCH_GLIBC_VER
-# This should be set to the version of the gentoo patch tarball.
-# The resulting filename of this tarball will be:
-# glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
-#
-# GLIBC_MANPAGE_VERSION
-# GLIBC_INFOPAGE_VERSION
-# The version of glibc for which we will download pages. This will
-# default to ${GLIBC_RELEASE_VER}, but we may not want to pre-generate man pages
-# for prerelease test ebuilds for example. This allows you to
-# continue using pre-generated manpages from the last stable release.
-# If set to "none", this will prevent the downloading of manpages,
-# which is useful for individual library targets.
-#
-get_glibc_src_uri() {
- GENTOO_TOOLCHAIN_BASE_URI=${GENTOO_TOOLCHAIN_BASE_URI:-"mirror://gentoo"}
-
- GLIBC_SRC_URI="mirror://gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-ports-${GLIBC_PORTS_VER}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-ports-${GLIBC_PORTS_VER}.tar.bz2
- mirror://gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2"
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2}"
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ -n ${GLIBC_LT_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- mirror://gnu/glibc/glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2"
- fi
-
- echo "${GLIBC_SRC_URI}"
-}
-
-SRC_URI=$(get_glibc_src_uri)
-S=${WORKDIR}/glibc-${GLIBC_RELEASE_VER}
-
-### EXPORTED FUNCTIONS ###
-unpack_addon() {
- local addon=$1 ver=${2:-${GLIBC_RELEASE_VER}}
- unpack glibc-${addon}-${ver}.tar.bz2
- mv glibc-${addon}-${ver} ${addon} || die
-}
-toolchain-glibc_src_unpack() {
- # Check NPTL support _before_ we unpack things to save some time
- want_nptl && check_nptl_support
-
- unpack glibc-${GLIBC_RELEASE_VER}.tar.bz2
-
- cd "${S}"
- [[ -n ${GLIBC_LT_VER} ]] && unpack glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2
- unpack_addon libidn
- unpack_addon ports ${GLIBC_PORTS_VER}
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${WORKDIR}"
- unpack glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- # pull out all the addons
- local d
- for d in extra/*/configure ; do
- mv "${d%/configure}" "${S}" || die "moving ${d}"
- done
- fi
-
- # XXX: We should do the branchupdate, before extracting the manpages and
- # infopages else it does not help much (mtimes change if there is a change
- # to them with branchupdate)
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- cd "${S}"
- epatch "${DISTDIR}"/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
-
- # Snapshot date patch
- einfo "Patching version to display snapshot date ..."
- sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- cd "${WORKDIR}"
- unpack glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- cd "${S}"
- unpack glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${S}"
- EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-${PATCH_VER} ..." \
- EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
- EPATCH_SUFFIX="patch" \
- ARCH=$(tc-arch) \
- epatch "${WORKDIR}"/patches
-
- # tag, glibc is it
- [[ -e csu/Banner ]] && die "need new banner location"
- echo "Gentoo patchset ${PATCH_VER}" > csu/Banner
- fi
-
- 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.5/glibc-2.5-hardened-inittls-nosysenter.patch
-
- einfo "Installing Hardened Gentoo SSP handler"
- cp -f "${FILESDIR}"/2.5/glibc-2.5-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
-
- gnuconfig_update
-}
-
-toolchain-glibc_src_compile() {
- echo
- local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
- einfo " $(printf '%15s' ${v}:) ${!v}"
- done
- echo
-
- if want_linuxthreads ; then
- glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
- if want_nptl ; then
- # ... and then do the optional nptl build
- unset LD_ASSUME_KERNEL
- glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
-}
-
-toolchain-glibc_headers_compile() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
-
- # Pick out the correct location for build headers
- local myconf="--disable-sanity-checks --enable-hacker-mode"
- myconf="${myconf}
- --enable-add-ons=nptl,ports
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- ${EXTRA_ECONF}"
-
- einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
- CC=gcc \
- CFLAGS="-O1 -pipe" \
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-toolchain-glibc_src_test() {
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-$1 || die "cd build-${ABI}-${CTARGET}-$1"
- unset LD_ASSUME_KERNEL
- make check && return 0
- einfo "make check failed - re-running with --keep-going to get the rest of the results"
- make -k check
- ewarn "make check failed for ${ABI}-${CTARGET}-$1"
- return 1
-}
-
-toolchain-glibc_pkg_preinst() {
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && ! { want_nptl && want_linuxthreads; }; then
- addwrite "${ROOT}"/$(alt_libdir)/
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen
-
- # simple test to make sure our new glibc isnt completely broken.
- # make sure we don't test with statically built binaries since
- # they will fail. also, skip if this glibc is a cross compiler.
- [[ ${ROOT} != "/" ]] && return 0
- is_crosscompile && return 0
- local x striptest
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-toolchain-glibc_src_install() {
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- local GBUILDDIR
- if want_linuxthreads ; then
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
- else
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
- fi
-
- local install_root=${D}
- is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- cd "${D}"/usr/${CTARGET} || die
- rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
-
- local l src_lib
- for l in libc libm librt libpthread libthread_db ; do
- # take care of shared lib first ...
- l=${l}.so
- if [[ -e ${l} ]] ; then
- src_lib=${l}
- else
- src_lib=$(eval echo */${l})
- fi
- cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
- fperms a+rx $(alt_libdir)/tls/${l}
- dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
-
- # then grab the linker script or the symlink ...
- if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
- dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
- else
- sed \
- -e "s:/${l}:/tls/${l}:g" \
- -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
- "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
- fi
-
- # then grab the static lib ...
- src_lib=${src_lib/%.so/.a}
- [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- src_lib=${src_lib/%.a/_nonshared.a}
- if [[ -e ${src_lib} ]] ; then
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- fi
- done
-
- # use the nptl linker instead of the linuxthreads one as the linuxthreads
- # one may lack TLS support and that can be really bad for business
- cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
- fi
-
- # We'll take care of the cache ourselves
- rm -f "${D}"/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- # When cross-compiling for a non-multilib setup, make sure we have
- # lib and a proper symlink setup
- if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
- cd "${D}"$(alt_libdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- cd "${D}"$(alt_usrlibdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- fi
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install some symlink hacks so that when we build
- # a 2nd stage cross-compiler, gcc finds the target system
- # headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym usr/include /usr/${CTARGET}/sys-include
- return 0
- fi
-
- # Everything past this point just needs to be done once ...
- is_final_abi || return 0
-
- # Make sure the non-native interp can be found on multilib systems
- if has_multilib_profile ; then
- case $(tc-arch) in
- amd64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
- dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
- ;;
- ppc64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
- dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
- ;;
- esac
- fi
-
- # Files for Debian-style locale updating
- dodir /usr/share/i18n
- sed \
- -e "/^#/d" \
- -e "/SUPPORTED-LOCALES=/d" \
- -e "s: \\\\::g" -e "s:/: :g" \
- "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
- || die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen || die
- doman *.[0-8]
- insinto /etc
- doins locale.gen || die
-
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- local a
- keepdir /usr/$(get_libdir)/locale
- for a in $(get_install_abis) ; do
- if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
- dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
- fi
- done
-
- if ! has noinfo ${FEATURES} && [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- einfo "Installing info pages..."
-
- make \
- -C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- info -i || die
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- cd "${S}"
-
- # Install misc network config files
- insinto /etc
- doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
- doins "${WORKDIR}"/extra/etc/*.conf || die
- doinitd "${WORKDIR}"/extra/etc/nscd || die
-
- dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f "${D}"/etc/localtime
-}
-
-toolchain-glibc_headers_install() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
- # Copy over headers that are not part of install-headers ... these
- # are pretty much taken verbatim from crosstool, see it for more details
- insinto $(alt_headers)/bits
- doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
- insinto $(alt_headers)/gnu
- doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- dosym usr/include /usr/${CTARGET}/sys-include
-}
-
-toolchain-glibc_pkg_postinst() {
- # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
- # isn't removed in unmerge which happens sometimes. See bug #87671
- if ! is_crosscompile && want_linuxthreads && [[ ${ROOT} == "/" ]] ; then
- for libdir in $(get_all_libdirs) ; do
- for f in "${ROOT}"/${libdir}/libpthread-2.* "${ROOT}"/${libdir}/libpthread-0.6* ; do
- if [[ -f ${f} ]] ; then
- rm -f ${f}
- ldconfig
- fi
- done
- done
- fi
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if [[ ! -e ${ROOT}/lib/ld.so.1 ]] && use ppc64 && ! has_multilib_profile ; then
- ## SHOULDN'T THIS BE lib64??
- ln -s ld64.so.1 "${ROOT}"/lib/ld.so.1
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U &> /dev/null
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-
- echo
- einfo "Gentoo's glibc no longer includes mdns."
- einfo "If you want mdns, emerge the sys-auth/nss-mdns package."
- echo
-
- if want_nptl && want_linuxthreads ; then
- einfo "The default behavior of glibc on your system is to use NPTL. If"
- einfo "you want to use linuxthreads for a particular program, start it"
- einfo "by executing 'LD_ASSUME_KERNEL=${LT_KERNEL_VERSION} <program> [<options>]'"
- echo
- fi
-}
-
-### SUPPORT FUNCTIONS ###
-# We need to be able to set alternative headers for
-# compiling for non-native platform
-# Will also become useful for testing kernel-headers without screwing up
-# the whole system.
-# note: intentionally undocumented.
-alt_headers() {
- if [[ -z ${ALT_HEADERS} ]] ; then
- if is_crosscompile ; then
- ALT_HEADERS="/usr/${CTARGET}/usr/include"
- else
- ALT_HEADERS="/usr/include"
- fi
- fi
- echo "${ALT_HEADERS}"
-}
-alt_build_headers() {
- if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS=$(alt_headers)
- if tc-is-cross-compiler ; then
- ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
- if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
- local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h')
- ALT_BUILD_HEADERS=${header_path%/linux/version.h}
- fi
- fi
- fi
- echo "${ALT_BUILD_HEADERS}"
-}
-
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-alt_usrlibdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/usr/$(get_libdir)
- else
- echo /usr/$(get_libdir)
- fi
-}
-
-setup_flags() {
- # Make sure host make.conf doesn't pollute us
- if is_crosscompile || tc-is-cross-compiler ; then
- CHOST=${CTARGET} strip-unsupported-flags
- fi
-
- # Store our CFLAGS because it's changed depending on which CTARGET
- # we are building when pulling glibc on a multilib profile
- CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
- CFLAGS=${CFLAGS_BASE}
- CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}}
- CXXFLAGS=${CXXFLAGS_BASE}
- ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
- ASFLAGS=${ASFLAGS_BASE}
-
- # Over-zealous CFLAGS can often cause problems. What may work for one
- # person may not work for another. To avoid a large influx of bugs
- # relating to failed builds, we strip most CFLAGS out to ensure as few
- # problems as possible.
- strip-flags
- strip-unsupported-flags
- filter-flags -m32 -m64 -mabi=*
-
- unset CBUILD_OPT CTARGET_OPT
- if has_multilib_profile ; then
- CTARGET_OPT=$(get_abi_CTARGET)
- [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
- fi
-
- case $(tc-arch) in
- amd64)
- # Punt this when amd64's 2004.3 is removed
- CFLAGS_x86="-m32"
- ;;
- ppc)
- append-flags "-freorder-blocks"
- ;;
- sparc)
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- filter-flags "-fcall-used-g7"
- append-flags "-fcall-used-g6"
- filter-flags "-mvis"
-
- if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
- case ${ABI} in
- sparc64)
- filter-flags -Wa,-xarch -Wa,-A
-
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparc64b-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9b"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
- else
- CTARGET_OPT="sparc64-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9a"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
- fi
- ;;
- *)
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- else
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- ;;
- esac
- else
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- elif { is_crosscompile && want_nptl; } || is-flag "-mcpu=ultrasparc2" || is-flag "-mcpu=ultrasparc"; then
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- fi
- ;;
- esac
-
- if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
- CBUILD_OPT=${CTARGET_OPT}
- fi
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be
- # conservative here. -fno-strict-aliasing is to work around #155906
- filter-flags -O?
- append-flags -O2 -fno-strict-aliasing
-
- # building glibc with SSP is fraught with difficulty, especially
- # due to __stack_chk_fail_local which would mean significant changes
- # to the glibc build process. See bug #94325
- filter-flags -fstack-protector
-
- if use hardened && gcc-specs-pie ; then
- # Force PIC macro definition for all compilations since they're all
- # either -fPIC or -fPIE with the default-PIE compiler.
- append-cppflags -DPIC
- else
- # Don't build -fPIE without the default-PIE compiler and the
- # hardened-pie patch
- filter-flags -fPIE
- fi
-}
-
-check_kheader_version() {
- local version=$(
- printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
- $(tc-getCPP ${CTARGET}) -I "$(alt_build_headers)" | \
- tail -n 1
- )
- [[ ${version} -ge "$1" ]]
-}
-
-check_nptl_support() {
- local min_kernel_version=$(KV_to_int "${NPTL_KERNEL_VERSION}")
-
- echo
-
- ebegin "Checking gcc for __thread support"
- if ! eend $(want__thread ; echo $?) ; then
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "Please update your binutils/gcc and try again."
- die "No __thread support in gcc!"
- fi
-
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- # Building fails on an non-supporting kernel
- ebegin "Checking kernel version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $([[ $(get_KV) -ge ${min_kernel_version} ]] ; echo $?) ; then
- echo
- eerror "You need a kernel of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "Kernel version too low!"
- fi
- fi
-
- # Building fails with too low linux-headers
- ebegin "Checking linux-headers version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $(check_kheader_version "${min_kernel_version}" ; echo $?) ; then
- echo
- eerror "You need linux-headers of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "linux-headers version too low!"
- fi
-
- echo
-}
-
-want_nptl() {
- want_tls || return 1
- use nptl || return 1
-
- # Only list the arches that cannot do NPTL
- case $(tc-arch) in
- m68k) return 1;;
- sparc)
- # >= v9 is needed for nptl.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
- ;;
- esac
-
- return 0
-}
-
-want_linuxthreads() {
- ! use nptlonly && return 0
- want_nptl || return 0
- return 1
-}
-
-want_tls() {
- # Archs that can use TLS (Thread Local Storage)
- case $(tc-arch) in
- sparc)
- # 2.3.6 should have tls support on sparc64
- # when using newer binutils
- case ${CTARGET/-*} in
- sparc64*) return 1 ;;
- *) return 0 ;;
- esac
- ;;
- x86)
- # requires i486 or better #106556
- [[ ${CTARGET} == i[4567]86* ]] && return 0
- return 1
- ;;
- esac
-
- return 0
-}
-
-want__thread() {
- want_tls || return 1
-
- # For some reason --with-tls --with__thread is causing segfaults on sparc32.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
-
- [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
-
- echo 'extern __thread int i;' > "${T}"/test-__thread.c
- $(tc-getCC ${CTARGET}) -c "${T}"/test-__thread.c -o "${T}"/test-__thread.o &> /dev/null
- WANT__THREAD=$?
- rm -f "${T}"/test-__thread.[co]
-
- return ${WANT__THREAD}
-}
-
-glibc_do_configure() {
- local myconf
-
- # set addons
- pushd "${S}" > /dev/null
- local ADDONS=$(echo */configure | sed \
- -e 's:/configure::g' \
- -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
- -e 's: \+$::' \
- -e 's! !,!g' \
- -e 's!^!,!' \
- -e '/^,\*$/d')
- popd > /dev/null
-
- use nls || myconf="${myconf} --disable-nls"
- myconf="${myconf} $(use_enable hardened stackguard-randomization)"
- if [[ $(<"${T}"/.ssp.compat) == "yes" ]] ; then
- myconf="${myconf} --enable-old-ssp-compat"
- else
- myconf="${myconf} --disable-old-ssp-compat"
- fi
-
- use glibc-omitfp && myconf="${myconf} --enable-omitfp"
-
- [[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
-
- if [[ $1 == "linuxthreads" ]] ; then
- if want_tls ; then
- myconf="${myconf} --with-tls"
-
- if ! want__thread || use glibc-compat20 || [[ ${LT_KERNEL_VERSION} == 2.[02].* ]] ; then
- myconf="${myconf} --without-__thread"
- else
- myconf="${myconf} --with-__thread"
- fi
- else
- myconf="${myconf} --without-tls --without-__thread"
- fi
-
- myconf="${myconf} --disable-sanity-checks"
- myconf="${myconf} --enable-add-ons=ports,linuxthreads${ADDONS}"
- myconf="${myconf} --enable-kernel=${LT_KERNEL_VERSION}"
- elif [[ $1 == "nptl" ]] ; then
- myconf="${myconf} --with-tls --with-__thread"
- myconf="${myconf} --enable-add-ons=ports,nptl${ADDONS}"
- myconf="${myconf} --enable-kernel=${NPTL_KERNEL_VERSION}"
- else
- die "invalid pthread option"
- fi
-
- # Since SELinux support is only required for nscd, only enable it if:
- # 1. USE selinux
- # 2. ! USE build
- # 3. only for the primary ABI on multilib systems
- if use selinux && ! use build ; then
- if use multilib || has_multilib_profile ; then
- if is_final_abi ; then
- myconf="${myconf} --with-selinux"
- else
- myconf="${myconf} --without-selinux"
- fi
- else
- myconf="${myconf} --with-selinux"
- fi
- else
- myconf="${myconf} --without-selinux"
- fi
-
- myconf="${myconf}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- $(use_enable profile)
- --without-gd
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- --libdir=/usr/$(get_libdir)
- --mandir=/usr/share/man
- --infodir=/usr/share/info
- --libexecdir=/usr/$(get_libdir)/misc/glibc
- ${EXTRA_ECONF}"
-
- # There is no configure option for this and we need to export it
- # since the glibc build will re-run configure on itself
- export libc_cv_slibdir=/$(get_libdir)
-
- has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
-
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- addwrite ${ROOT}/
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- addwrite ${ROOT}/usr
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- addwrite ${ROOT}/usr/X11R6
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-use_multilib() {
- case ${CTARGET} in
- sparc64*|mips64*|x86_64*|powerpc64*|s390x*)
- has_multilib_profile || use multilib ;;
- *) false ;;
- esac
-}
-
-# Setup toolchain variables that would be defined in the profiles for these archs.
-setup_env() {
- # These should not be set, else the zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
- # silly users
- unset LD_RUN_PATH
-
- if is_crosscompile || tc-is-cross-compiler ; then
- multilib_env ${CTARGET}
- if ! use multilib ; then
- MULTILIB_ABIS=${DEFAULT_ABI}
- else
- MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
- fi
-
- # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
- # and fall back on CFLAGS.
- local VAR=CFLAGS_${CTARGET//[-.]/_}
- CFLAGS=${!VAR-${CFLAGS}}
- fi
-
- setup_flags
-
- export ABI=${ABI:-${DEFAULT_ABI:-default}}
-
- if is_crosscompile || tc-is-cross-compiler ; then
- local VAR=CFLAGS_${ABI}
- # We need to export CFLAGS with abi information in them because
- # glibc's configure script checks CFLAGS for some targets (like mips)
- export CFLAGS="${!VAR} ${CFLAGS}"
- fi
-}
-
-### /ECLASS PUNTAGE ###
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- SLOT="2.2"
-fi
-
-# we'll handle stripping ourself #46186
-RESTRICT="strip"
-EMULTILIB_PKG="true"
-
-# 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 )
- nptl? ( || ( >=sys-kernel/mips-headers-${NPTL_KERNEL_VERSION} >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} ) )
- >=sys-devel/binutils-2.15.94
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- >=sys-apps/portage-2.1.2
- selinux? ( !build? ( sys-libs/libselinux ) )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( !build? ( sys-libs/libselinux ) )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
-
- if [[ ${CATEGORY} == *-linux* ]] ; then
- if [[ ${CATEGORY} == cross-mips* ]] ; then
- DEPEND="${DEPEND} >=${CATEGORY}/mips-headers-2.6.10"
- else
- DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
- fi
- fi
-else
- DEPEND="${DEPEND} >=sys-libs/timezone-data-2007c"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
- fi
-
- if [[ ${CTARGET} == i386-* ]] ; then
- eerror "i386 CHOSTs are no longer supported."
- eerror "Chances are you don't actually want/need i386."
- eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
- die "please fix your CHOST"
- fi
-
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- if ! type -p scanelf > /dev/null ; then
- eerror "You do not have pax-utils installed."
- die "install pax-utils"
- fi
-
- use hardened && ! gcc-specs-pie && \
- ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
-}
-
-src_unpack() {
- setup_env
-
- toolchain-glibc_src_unpack
-
- # Backwards SSP support
- cd "${S}"
-# For now, we force everyone to have the extra symbols
-# einfon "Scanning system for __guard to see if we need SSP compat ... "
-# if [[ -n $(scanelf -qyls__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
- echo "yes" > "${T}"/.ssp.compat
-# else
-# # ok, a quick scan didnt find it, so lets do a deep scan ...
-# if [[ -n $(scanelf -qyRlps__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
-# echo "yes" > "${T}"/.ssp.compat
-# else
-# echo "no" > "${T}"/.ssp.compat
-# fi
-# fi
-# cat "${T}"/.ssp.compat
-
- # Glibc is stupid sometimes, and doesn't realize that with a
- # static C-Only gcc, -lgcc_eh doesn't exist.
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- echo 'int main(){}' > "${T}"/gcc_eh_test.c
- if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
- sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
- fi
-
- cd "${WORKDIR}"
- find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
- find . -name configure -exec touch {} \;
-
- # Fix permissions on some of the scripts
- chmod u+x "${S}"/scripts/*.sh
-}
-
-src_compile() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Building multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_compile
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_compile
- else
- toolchain-glibc_src_compile
- fi
-}
-
-src_test() {
- local ret=0
-
- setup_env
-
- if [[ -z ${OABI} ]] && has_multilib_profile ; then
- OABI=${ABI}
- einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
- for ABI in $(get_install_abis) ; do
- export ABI
- einfo " Testing ${ABI} glibc"
- src_test
- ((ret+=$?))
- done
- ABI=${OABI}
- unset OABI
- [[ ${ret} -ne 0 ]] \
- && die "tests failed" \
- || return 0
- fi
-
- want_linuxthreads && toolchain-glibc_src_test linuxthreads ; ((ret+=$?))
- want_nptl && toolchain-glibc_src_test nptl ; ((ret+=$?))
- return ${ret}
-}
-
-src_strip() {
- # Now, strip everything but the thread libs #46186, as well as the dynamic
- # linker, else we cannot set breakpoints in shared libraries due to bugs in
- # gdb. Also want to grab stuff in tls subdir. whee.
- env \
- -uRESTRICT \
- CHOST=${CTARGET} \
- STRIP_MASK="/*/{,tls/}{ld-,lib{pthread,thread_db}}*" \
- prepallstrip
-}
-
-src_install() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_install
- else
- toolchain-glibc_src_install
- fi
- [[ -z ${OABI} ]] && src_strip
-}
-
-pkg_preinst() {
- toolchain-glibc_pkg_preinst
-}
-
-pkg_postinst() {
- toolchain-glibc_pkg_postinst
-}
diff --git a/sys-libs/glibc/glibc-2.6.ebuild b/sys-libs/glibc/glibc-2.6.ebuild
deleted file mode 100644
index f5320cf6c845..000000000000
--- a/sys-libs/glibc/glibc-2.6.ebuild
+++ /dev/null
@@ -1,1273 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.6.ebuild,v 1.23 2009/12/10 01:31:26 vapier Exp $
-
-# 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/
-
-KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
-
-BRANCH_UPDATE=""
-
-# Generated man pages
-GLIBC_MANPAGE_VERSION="none"
-
-# Generated stuff in manual subdir
-GLIBC_INFOPAGE_VERSION="none"
-
-# Gentoo patchset
-PATCH_VER="1.6"
-
-GENTOO_TOOLCHAIN_BASE_URI="mirror://gentoo"
-GENTOO_TOOLCHAIN_DEV_URI="http://dev.gentoo.org/~azarah/glibc/XXX http://dev.gentoo.org/~vapier/dist/XXX"
-
-### PUNT OUT TO ECLASS?? ###
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-LICENSE="LGPL-2"
-
-GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
-
-# Don't set this to :-, - allows BRANCH_UPDATE=""
-BRANCH_UPDATE=${BRANCH_UPDATE-$(get_version_component_range 4)}
-GLIBC_PORTS_VER=${GLIBC_RELEASE_VER}
-GLIBC_LT_VER=""
-
-# (Recent snapshots fails with 2.6.5 and earlier with NPTL)
-NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-"2.6.9"}
-#LT_KERNEL_VERSION=${LT_KERNEL_VERSION:-"2.4.1"}
-
-[[ ${CTARGET} == hppa* ]] && NPTL_KERNEL_VERSION=${NPTL_KERNEL_VERSION:-2.6.20}
-
-IUSE="debug nls hardened multilib selinux glibc-omitfp profile"
-[[ -n ${GLIBC_LT_VER} ]] && IUSE="${IUSE} glibc-compat20 nptl nptlonly"
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- PROVIDE="virtual/libc"
-fi
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-just_headers() {
- is_crosscompile && use crosscompile_opts_headers-only
-}
-
-### SRC_URI ###
-
-# This function handles the basics of setting the SRC_URI for a glibc ebuild.
-# To use, set SRC_URI with:
-#
-# SRC_URI="$(get_glibc_src_uri)"
-#
-# Other than the variables normally set by portage, this function's behavior
-# can be altered by setting the following:
-#
-# GENTOO_TOOLCHAIN_BASE_URI
-# This sets the base URI for all gentoo-specific patch files. Note
-# that this variable is only important for a brief period of time,
-# before your source files get picked up by mirrors. However, it is
-# still highly suggested that you keep files in this location
-# available.
-#
-# BRANCH_UPDATE
-# If set, this variable signals that we should be using the main
-# release tarball (determined by ebuild version) and applying a
-# CVS branch update patch against it. The location of this branch
-# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
-# Just like with SNAPSHOT, this variable is ignored if the ebuild
-# has a _pre suffix.
-#
-# PATCH_VER
-# PATCH_GLIBC_VER
-# This should be set to the version of the gentoo patch tarball.
-# The resulting filename of this tarball will be:
-# glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
-#
-# GLIBC_MANPAGE_VERSION
-# GLIBC_INFOPAGE_VERSION
-# The version of glibc for which we will download pages. This will
-# default to ${GLIBC_RELEASE_VER}, but we may not want to pre-generate man pages
-# for prerelease test ebuilds for example. This allows you to
-# continue using pre-generated manpages from the last stable release.
-# If set to "none", this will prevent the downloading of manpages,
-# which is useful for individual library targets.
-#
-get_glibc_src_uri() {
- GENTOO_TOOLCHAIN_BASE_URI=${GENTOO_TOOLCHAIN_BASE_URI:-"mirror://gentoo"}
-
- GLIBC_SRC_URI="mirror://gnu/glibc/glibc-${GLIBC_RELEASE_VER}.tar.bz2
- mirror://gnu/glibc/glibc-libidn-${GLIBC_RELEASE_VER}.tar.bz2"
-
- if [[ -n ${GLIBC_PORTS_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- mirror://gnu/glibc/glibc-ports-${GLIBC_PORTS_VER}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-ports-${GLIBC_PORTS_VER}.tar.bz2"
- fi
-
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2}"
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- ${GENTOO_TOOLCHAIN_BASE_URI}/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- ${GENTOO_TOOLCHAIN_DEV_URI//XXX/glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2}"
- fi
-
- if [[ -n ${GLIBC_LT_VER} ]] ; then
- GLIBC_SRC_URI="${GLIBC_SRC_URI}
- mirror://gnu/glibc/glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2
- ftp://sources.redhat.com/pub/glibc/snapshots/glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2"
- fi
-
- echo "${GLIBC_SRC_URI}"
-}
-
-SRC_URI=$(get_glibc_src_uri)
-S=${WORKDIR}/glibc-${GLIBC_RELEASE_VER}
-
-### EXPORTED FUNCTIONS ###
-unpack_addon() {
- local addon=$1 ver=${2:-${GLIBC_RELEASE_VER}}
- unpack glibc-${addon}-${ver}.tar.bz2
- mv glibc-${addon}-${ver} ${addon} || die
-}
-toolchain-glibc_src_unpack() {
- # Check NPTL support _before_ we unpack things to save some time
- want_nptl && check_nptl_support
-
- unpack glibc-${GLIBC_RELEASE_VER}.tar.bz2
-
- cd "${S}"
- [[ -n ${GLIBC_LT_VER} ]] && unpack glibc-linuxthreads-${GLIBC_LT_VER}.tar.bz2
- [[ -n ${GLIBC_PORTS_VER} ]] && unpack_addon ports ${GLIBC_PORTS_VER}
- unpack_addon libidn
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${WORKDIR}"
- unpack glibc-${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
- # pull out all the addons
- local d
- for d in extra/*/configure ; do
- mv "${d%/configure}" "${S}" || die "moving ${d}"
- done
- fi
-
- # XXX: We should do the branchupdate, before extracting the manpages and
- # infopages else it does not help much (mtimes change if there is a change
- # to them with branchupdate)
- if [[ -n ${BRANCH_UPDATE} ]] ; then
- cd "${S}"
- epatch "${DISTDIR}"/glibc-${GLIBC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
-
- # Snapshot date patch
- einfo "Patching version to display snapshot date ..."
- sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- cd "${WORKDIR}"
- unpack glibc-manpages-${GLIBC_MANPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- cd "${S}"
- unpack glibc-infopages-${GLIBC_INFOPAGE_VERSION:-${GLIBC_RELEASE_VER}}.tar.bz2
- fi
-
- if [[ -n ${PATCH_VER} ]] ; then
- cd "${S}"
- EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${PATCH_GLIBC_VER:-${GLIBC_RELEASE_VER}}-${PATCH_VER} ..." \
- EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
- EPATCH_SUFFIX="patch" \
- ARCH=$(tc-arch) \
- epatch "${WORKDIR}"/patches
-
- # tag, glibc is it
- [[ -e csu/Banner ]] && die "need new banner location"
- echo "Gentoo patchset ${PATCH_VER}" > csu/Banner
- fi
-
- 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.6/glibc-2.6-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
-
- gnuconfig_update
-}
-
-toolchain-glibc_src_compile() {
- echo
- local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
- einfo " $(printf '%15s' ${v}:) ${!v}"
- done
- echo
-
- if want_linuxthreads ; then
- glibc_do_configure linuxthreads
- einfo "Building GLIBC with linuxthreads..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
- if want_nptl ; then
- # ... and then do the optional nptl build
- unset LD_ASSUME_KERNEL
- glibc_do_configure nptl
- einfo "Building GLIBC with NPTL..."
- make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
- fi
-}
-
-toolchain-glibc_headers_compile() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
-
- # Pick out the correct location for build headers
- local ports="" myconf="--disable-sanity-checks --enable-hacker-mode"
- [[ -n ${GLIBC_PORTS_VER} ]] && ports=",ports"
- myconf="${myconf}
- --enable-add-ons=nptl${ports}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- ${EXTRA_ECONF}"
-
- einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
- CC=gcc \
- CFLAGS="-O1 -pipe" \
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-}
-
-toolchain-glibc_src_test() {
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-$1 || die "cd build-${ABI}-${CTARGET}-$1"
- unset LD_ASSUME_KERNEL
- make check && return 0
- einfo "make check failed - re-running with --keep-going to get the rest of the results"
- make -k check
- ewarn "make check failed for ${ABI}-${CTARGET}-$1"
- return 1
-}
-
-toolchain-glibc_pkg_preinst() {
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && ! { want_nptl && want_linuxthreads; }; then
- addwrite "${ROOT}"/$(alt_libdir)/
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen
-
- # simple test to make sure our new glibc isnt completely broken.
- # make sure we don't test with statically built binaries since
- # they will fail. also, skip if this glibc is a cross compiler.
- [[ ${ROOT} != "/" ]] && return 0
- is_crosscompile && return 0
- local x striptest
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-toolchain-glibc_src_install() {
- # These should not be set, else the
- # zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
-
- local GBUILDDIR
- if want_linuxthreads ; then
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
- else
- GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
- fi
-
- local install_root=${D}
- is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
- if want_linuxthreads ; then
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
- einfo "Installing GLIBC ${ABI} with linuxthreads ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- else # nptlonly
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- einfo "Installing GLIBC ${ABI} with NPTL ..."
- make PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- install || die
- fi
-
- if is_crosscompile ; then
- # punt all the junk not needed by a cross-compiler
- cd "${D}"/usr/${CTARGET} || die
- rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
- fi
-
- if want_linuxthreads && want_nptl ; then
- einfo "Installing NPTL to $(alt_libdir)/tls/..."
- cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
- dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
-
- local l src_lib
- for l in libc libm librt libpthread libthread_db ; do
- # take care of shared lib first ...
- l=${l}.so
- if [[ -e ${l} ]] ; then
- src_lib=${l}
- else
- src_lib=$(eval echo */${l})
- fi
- cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
- fperms a+rx $(alt_libdir)/tls/${l}
- dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
-
- # then grab the linker script or the symlink ...
- if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
- dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
- else
- sed \
- -e "s:/${l}:/tls/${l}:g" \
- -e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
- "${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
- fi
-
- # then grab the static lib ...
- src_lib=${src_lib/%.so/.a}
- [[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- src_lib=${src_lib/%.a/_nonshared.a}
- if [[ -e ${src_lib} ]] ; then
- cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
- fi
- done
-
- # use the nptl linker instead of the linuxthreads one as the linuxthreads
- # one may lack TLS support and that can be really bad for business
- cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
- fi
-
- # We'll take care of the cache ourselves
- rm -f "${D}"/etc/ld.so.cache
-
- # Some things want this, notably ash.
- dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
-
- # Handle includes for different ABIs
- prep_ml_includes $(alt_headers)
-
- # When cross-compiling for a non-multilib setup, make sure we have
- # lib and a proper symlink setup
- if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
- cd "${D}"$(alt_libdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- cd "${D}"$(alt_usrlibdir)/..
- mv $(get_libdir) lib || die
- ln -s lib $(get_libdir) || die
- fi
-
- #################################################################
- # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
- # Make sure we install some symlink hacks so that when we build
- # a 2nd stage cross-compiler, gcc finds the target system
- # headers correctly. See gcc/doc/gccinstall.info
- if is_crosscompile ; then
- dosym usr/include /usr/${CTARGET}/sys-include
- return 0
- fi
-
- # Everything past this point just needs to be done once ...
- is_final_abi || return 0
-
- # Make sure the non-native interp can be found on multilib systems
- if has_multilib_profile ; then
- case $(tc-arch) in
- amd64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
- dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
- ;;
- ppc64)
- [[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
- dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
- ;;
- esac
- fi
-
- # Files for Debian-style locale updating
- dodir /usr/share/i18n
- sed \
- -e "/^#/d" \
- -e "/SUPPORTED-LOCALES=/d" \
- -e "s: \\\\::g" -e "s:/: :g" \
- "${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
- || die "generating /usr/share/i18n/SUPPORTED failed"
- cd "${WORKDIR}"/extra/locale
- dosbin locale-gen || die
- doman *.[0-8]
- insinto /etc
- doins locale.gen || die
-
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- local a
- keepdir /usr/$(get_libdir)/locale
- for a in $(get_install_abis) ; do
- if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
- dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
- fi
- done
-
- if ! has noinfo ${FEATURES} && [[ ${GLIBC_INFOPAGE_VERSION} != "none" ]] ; then
- einfo "Installing info pages..."
-
- make \
- -C "${GBUILDDIR}" \
- PARALLELMFLAGS="${MAKEOPTS}" \
- install_root="${install_root}" \
- info -i || die
- fi
-
- if [[ ${GLIBC_MANPAGE_VERSION} != "none" ]] ; then
- einfo "Installing man pages..."
-
- # Install linuxthreads man pages even if nptl is enabled
- cd "${WORKDIR}"/man
- doman *.3thr
- fi
-
- cd "${S}"
-
- # Install misc network config files
- insinto /etc
- doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
- doins "${WORKDIR}"/extra/etc/*.conf || die
- doinitd "${WORKDIR}"/extra/etc/nscd || die
-
- dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
-
- # Prevent overwriting of the /etc/localtime symlink. We'll handle the
- # creation of the "factory" symlink in pkg_postinst().
- rm -f "${D}"/etc/localtime
-}
-
-toolchain-glibc_headers_install() {
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
- cd "${GBUILDDIR}"
- make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
- # Copy over headers that are not part of install-headers ... these
- # are pretty much taken verbatim from crosstool, see it for more details
- insinto $(alt_headers)/bits
- doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
- insinto $(alt_headers)/gnu
- doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
- # Make sure we install the sys-include symlink so that when
- # we build a 2nd stage cross-compiler, gcc finds the target
- # system headers correctly. See gcc/doc/gccinstall.info
- dosym usr/include /usr/${CTARGET}/sys-include
-}
-
-toolchain-glibc_pkg_postinst() {
- # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
- # isn't removed in unmerge which happens sometimes. See bug #87671
- if ! is_crosscompile && want_linuxthreads && [[ ${ROOT} == "/" ]] ; then
- for libdir in $(get_all_libdirs) ; do
- for f in "${ROOT}"/${libdir}/libpthread-2.* "${ROOT}"/${libdir}/libpthread-0.6* ; do
- if [[ -f ${f} ]] ; then
- rm -f ${f}
- ldconfig
- fi
- done
- done
- fi
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if [[ ! -e ${ROOT}/lib/ld.so.1 ]] && use ppc64 && ! has_multilib_profile ; then
- ## SHOULDN'T THIS BE lib64??
- ln -s ld64.so.1 "${ROOT}"/lib/ld.so.1
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U &> /dev/null
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-
- echo
- einfo "Gentoo's glibc no longer includes mdns."
- einfo "If you want mdns, emerge the sys-auth/nss-mdns package."
- echo
-
- if want_nptl && want_linuxthreads ; then
- einfo "The default behavior of glibc on your system is to use NPTL. If"
- einfo "you want to use linuxthreads for a particular program, start it"
- einfo "by executing 'LD_ASSUME_KERNEL=${LT_KERNEL_VERSION} <program> [<options>]'"
- echo
- fi
-}
-
-### SUPPORT FUNCTIONS ###
-# We need to be able to set alternative headers for
-# compiling for non-native platform
-# Will also become useful for testing kernel-headers without screwing up
-# the whole system.
-# note: intentionally undocumented.
-alt_headers() {
- if [[ -z ${ALT_HEADERS} ]] ; then
- if is_crosscompile ; then
- ALT_HEADERS="/usr/${CTARGET}/usr/include"
- else
- ALT_HEADERS="/usr/include"
- fi
- fi
- echo "${ALT_HEADERS}"
-}
-alt_build_headers() {
- if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS=$(alt_headers)
- if tc-is-cross-compiler ; then
- ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
- if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
- local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h')
- ALT_BUILD_HEADERS=${header_path%/linux/version.h}
- fi
- fi
- fi
- echo "${ALT_BUILD_HEADERS}"
-}
-
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-alt_usrlibdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/usr/$(get_libdir)
- else
- echo /usr/$(get_libdir)
- fi
-}
-
-setup_flags() {
- # Make sure host make.conf doesn't pollute us
- if is_crosscompile || tc-is-cross-compiler ; then
- CHOST=${CTARGET} strip-unsupported-flags
- fi
-
- # Store our CFLAGS because it's changed depending on which CTARGET
- # we are building when pulling glibc on a multilib profile
- CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
- CFLAGS=${CFLAGS_BASE}
- CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}}
- CXXFLAGS=${CXXFLAGS_BASE}
- ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
- ASFLAGS=${ASFLAGS_BASE}
-
- # Over-zealous CFLAGS can often cause problems. What may work for one
- # person may not work for another. To avoid a large influx of bugs
- # relating to failed builds, we strip most CFLAGS out to ensure as few
- # problems as possible.
- strip-flags
- strip-unsupported-flags
- filter-flags -m32 -m64 -mabi=*
-
- unset CBUILD_OPT CTARGET_OPT
- if has_multilib_profile ; then
- CTARGET_OPT=$(get_abi_CTARGET)
- [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
- fi
-
- case $(tc-arch ${CTARGET_OPT}) in
- x86)
- # -march needed for #185404
- local t=${CTARGET_OPT:-${CTARGET}}
- export CFLAGS="-march=${t%%-*} ${CFLAGS}"
- ;;
- amd64)
- # Punt this when amd64's 2004.3 is removed
- CFLAGS_x86="-m32"
- ;;
- ppc)
- append-flags "-freorder-blocks"
- ;;
- sparc)
- # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
- filter-flags "-fcall-used-g7"
- append-flags "-fcall-used-g6"
- filter-flags "-mvis"
-
- if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
- case ${ABI} in
- sparc64)
- filter-flags -Wa,-xarch -Wa,-A
-
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparc64b-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9b"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
- else
- CTARGET_OPT="sparc64-unknown-linux-gnu"
- append-flags "-Wa,-xarch=v9a"
- export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
- fi
- ;;
- *)
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- else
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- ;;
- esac
- else
- if is-flag "-mcpu=ultrasparc3"; then
- CTARGET_OPT="sparcv9b-unknown-linux-gnu"
- elif { is_crosscompile && want_nptl; } || is-flag "-mcpu=ultrasparc2" || is-flag "-mcpu=ultrasparc"; then
- CTARGET_OPT="sparcv9-unknown-linux-gnu"
- fi
- fi
- ;;
- esac
-
- if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
- CBUILD_OPT=${CTARGET_OPT}
- fi
-
- # Lock glibc at -O2 -- linuxthreads needs it and we want to be
- # conservative here. -fno-strict-aliasing is to work around #155906
- filter-flags -O?
- append-flags -O2 -fno-strict-aliasing
-
- # building glibc with SSP is fraught with difficulty, especially
- # due to __stack_chk_fail_local which would mean significant changes
- # to the glibc build process. See bug #94325
- filter-flags -fstack-protector
-
- if use hardened && gcc-specs-pie ; then
- # Force PIC macro definition for all compilations since they're all
- # either -fPIC or -fPIE with the default-PIE compiler.
- append-cppflags -DPIC
- else
- # Don't build -fPIE without the default-PIE compiler and the
- # hardened-pie patch
- filter-flags -fPIE
- fi
-}
-
-check_kheader_version() {
- local version=$(
- printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
- $(tc-getCPP ${CTARGET}) -I "$(alt_build_headers)" | \
- tail -n 1
- )
- [[ ${version} -ge "$1" ]]
-}
-
-check_nptl_support() {
- local min_kernel_version=$(KV_to_int "${NPTL_KERNEL_VERSION}")
-
- echo
-
- ebegin "Checking gcc for __thread support"
- if ! eend $(want__thread ; echo $?) ; then
- echo
- eerror "Could not find a gcc that supports the __thread directive!"
- eerror "Please update your binutils/gcc and try again."
- die "No __thread support in gcc!"
- fi
-
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- # Building fails on an non-supporting kernel
- ebegin "Checking kernel version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $([[ $(get_KV) -ge ${min_kernel_version} ]] ; echo $?) ; then
- echo
- eerror "You need a kernel of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "Kernel version too low!"
- fi
- fi
-
- # Building fails with too low linux-headers
- ebegin "Checking linux-headers version (>=${NPTL_KERNEL_VERSION})"
- if ! eend $(check_kheader_version "${min_kernel_version}" ; echo $?) ; then
- echo
- eerror "You need linux-headers of at least version ${NPTL_KERNEL_VERSION}"
- eerror "for NPTL support!"
- die "linux-headers version too low!"
- fi
-
- echo
-}
-
-want_nptl() {
- [[ -z ${GLIBC_LT_VER} ]] && return 0
- want_tls || return 1
- use nptl || return 1
-
- # Only list the arches that cannot do NPTL
- case $(tc-arch) in
- m68k) return 1;;
- sparc)
- # >= v9 is needed for nptl.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
- ;;
- esac
-
- return 0
-}
-
-want_linuxthreads() {
- [[ -z ${GLIBC_LT_VER} ]] && return 1
- ! use nptlonly && return 0
- want_nptl || return 0
- return 1
-}
-
-want_tls() {
- # Archs that can use TLS (Thread Local Storage)
- case $(tc-arch) in
- sparc)
- # 2.3.6 should have tls support on sparc64
- # when using newer binutils
- case ${CTARGET/-*} in
- sparc64*) return 1 ;;
- *) return 0 ;;
- esac
- ;;
- x86)
- # requires i486 or better #106556
- [[ ${CTARGET} == i[4567]86* ]] && return 0
- return 1
- ;;
- esac
-
- return 0
-}
-
-want__thread() {
- want_tls || return 1
-
- # For some reason --with-tls --with__thread is causing segfaults on sparc32.
- [[ ${PROFILE_ARCH} == "sparc" ]] && return 1
-
- [[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
-
- echo 'extern __thread int i;' > "${T}"/test-__thread.c
- $(tc-getCC ${CTARGET}) -c "${T}"/test-__thread.c -o "${T}"/test-__thread.o &> /dev/null
- WANT__THREAD=$?
- rm -f "${T}"/test-__thread.[co]
-
- return ${WANT__THREAD}
-}
-
-glibc_do_configure() {
- local myconf
-
- # set addons
- pushd "${S}" > /dev/null
- local ADDONS=$(echo */configure | sed \
- -e 's:/configure::g' \
- -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
- -e 's: \+$::' \
- -e 's! !,!g' \
- -e 's!^!,!' \
- -e '/^,\*$/d')
- [[ -d ports ]] && ADDONS="${ADDONS},ports"
- popd > /dev/null
-
- use nls || myconf="${myconf} --disable-nls"
- myconf="${myconf} $(use_enable hardened stackguard-randomization)"
- if [[ $(<"${T}"/.ssp.compat) == "yes" ]] ; then
- myconf="${myconf} --enable-old-ssp-compat"
- else
- myconf="${myconf} --disable-old-ssp-compat"
- fi
-
- use glibc-omitfp && myconf="${myconf} --enable-omitfp"
-
- [[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
-
- if [[ $1 == "linuxthreads" ]] ; then
- if want_tls ; then
- myconf="${myconf} --with-tls"
-
- if ! want__thread || use glibc-compat20 || [[ ${LT_KERNEL_VERSION} == 2.[02].* ]] ; then
- myconf="${myconf} --without-__thread"
- else
- myconf="${myconf} --with-__thread"
- fi
- else
- myconf="${myconf} --without-tls --without-__thread"
- fi
-
- myconf="${myconf} --disable-sanity-checks"
- myconf="${myconf} --enable-add-ons=linuxthreads${ADDONS}"
- myconf="${myconf} --enable-kernel=${LT_KERNEL_VERSION}"
- elif [[ $1 == "nptl" ]] ; then
- myconf="${myconf} --enable-add-ons=nptl${ADDONS}"
- myconf="${myconf} --enable-kernel=${NPTL_KERNEL_VERSION}"
- else
- die "invalid pthread option"
- fi
-
- # Since SELinux support is only required for nscd, only enable it if:
- # 1. USE selinux
- # 2. only for the primary ABI on multilib systems
- if use selinux ; then
- if use multilib || has_multilib_profile ; then
- if is_final_abi ; then
- myconf="${myconf} --with-selinux"
- else
- myconf="${myconf} --without-selinux"
- fi
- else
- myconf="${myconf} --with-selinux"
- fi
- else
- myconf="${myconf} --without-selinux"
- fi
-
- myconf="${myconf}
- --without-cvs
- --enable-bind-now
- --build=${CBUILD_OPT:-${CBUILD}}
- --host=${CTARGET_OPT:-${CTARGET}}
- $(use_enable profile)
- --without-gd
- --with-headers=$(alt_build_headers)
- --prefix=/usr
- --libdir=/usr/$(get_libdir)
- --mandir=/usr/share/man
- --infodir=/usr/share/info
- --libexecdir=/usr/$(get_libdir)/misc/glibc
- ${EXTRA_ECONF}"
-
- # There is no configure option for this and we need to export it
- # since the glibc build will re-run configure on itself
- export libc_cv_slibdir=/$(get_libdir)
-
- has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
-
- local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
- mkdir -p "${GBUILDDIR}"
- cd "${GBUILDDIR}"
- einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
- "${S}"/configure ${myconf} || die "failed to configure glibc"
-
- # since we'll be punting them for cross-compilers, and they can cause
- # problems (ia64+static), we'll just skip building altogether
- is_crosscompile && sed -i '1ibuild-programs = no' config.make
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- addwrite ${ROOT}/
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- addwrite ${ROOT}/usr
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- addwrite ${ROOT}/usr/X11R6
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-use_multilib() {
- case ${CTARGET} in
- sparc64*|mips64*|x86_64*|powerpc64*|s390x*)
- has_multilib_profile || use multilib ;;
- *) false ;;
- esac
-}
-
-# Setup toolchain variables that would be defined in the profiles for these archs.
-setup_env() {
- # These should not be set, else the zoneinfo do not always get installed ...
- unset LANGUAGE LANG LC_ALL
- # silly users
- unset LD_RUN_PATH
-
- if is_crosscompile || tc-is-cross-compiler ; then
- multilib_env ${CTARGET}
- if ! use multilib ; then
- MULTILIB_ABIS=${DEFAULT_ABI}
- else
- MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
- fi
-
- # If the user has CFLAGS_<CTARGET> in their make.conf, use that,
- # and fall back on CFLAGS.
- local VAR=CFLAGS_${CTARGET//[-.]/_}
- CFLAGS=${!VAR-${CFLAGS}}
- fi
-
- setup_flags
-
- export ABI=${ABI:-${DEFAULT_ABI:-default}}
-
- if is_crosscompile || tc-is-cross-compiler ; then
- local VAR=CFLAGS_${ABI}
- # We need to export CFLAGS with abi information in them because
- # glibc's configure script checks CFLAGS for some targets (like mips)
- export CFLAGS="${!VAR} ${CFLAGS}"
- fi
-}
-
-### /ECLASS PUNTAGE ###
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- SLOT="2.2"
-fi
-
-# we'll handle stripping ourself #46186
-RESTRICT="strip"
-EMULTILIB_PKG="true"
-
-# 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
- ${GLIBC_LT_VER:+nptl? (} || ( >=sys-kernel/mips-headers-${NPTL_KERNEL_VERSION} >=sys-kernel/linux-headers-${NPTL_KERNEL_VERSION} ) ${GLIBC_LT_VER:+)}
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- >=sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
-
- if [[ ${CATEGORY} == *-linux* ]] ; then
- if [[ ${CATEGORY} == cross-mips* ]] ; then
- DEPEND="${DEPEND} >=${CATEGORY}/mips-headers-2.6.10"
- else
- DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
- fi
- fi
-else
- DEPEND="${DEPEND} >=sys-libs/timezone-data-2007c"
- RDEPEND="${RDEPEND} sys-libs/timezone-data"
-fi
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if ! is_crosscompile && ! tc-is-cross-compiler ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
- fi
-
- # users have had a chance to phase themselves, time to give em the boot
- if [[ -e ${ROOT}/etc/locale.gen ]] && [[ -e ${ROOT}/etc/locales.build ]] ; then
- eerror "You still haven't deleted ${ROOT}/etc/locales.build."
- eerror "Do so now after making sure ${ROOT}/etc/locale.gen is kosher."
- die "lazy upgrader detected"
- fi
-
- if [[ ${CTARGET} == i386-* ]] ; then
- eerror "i386 CHOSTs are no longer supported."
- eerror "Chances are you don't actually want/need i386."
- eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
- die "please fix your CHOST"
- fi
-
- if [[ -n ${GLIBC_LT_VER} ]] ; then
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- if ! type -p scanelf > /dev/null ; then
- eerror "You do not have pax-utils installed."
- die "install pax-utils"
- fi
-
- use hardened && ! gcc-specs-pie && \
- ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
-}
-
-src_unpack() {
- setup_env
-
- toolchain-glibc_src_unpack
-
- # Backwards SSP support
- cd "${S}"
-# For now, we force everyone to have the extra symbols
-# einfon "Scanning system for __guard to see if we need SSP compat ... "
-# if [[ -n $(scanelf -qyls__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
- echo "yes" > "${T}"/.ssp.compat
-# else
-# # ok, a quick scan didnt find it, so lets do a deep scan ...
-# if [[ -n $(scanelf -qyRlps__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
-# echo "yes" > "${T}"/.ssp.compat
-# else
-# echo "no" > "${T}"/.ssp.compat
-# fi
-# fi
-# cat "${T}"/.ssp.compat
-
- # Glibc is stupid sometimes, and doesn't realize that with a
- # static C-Only gcc, -lgcc_eh doesn't exist.
- # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
- # http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
- echo 'int main(){}' > "${T}"/gcc_eh_test.c
- if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
- sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
- fi
-
- cd "${WORKDIR}"
- find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
- find . -name configure -exec touch {} \;
-
- # Fix permissions on some of the scripts
- chmod u+x "${S}"/scripts/*.sh
-}
-
-src_compile() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Building multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_compile
- done
- ABI=${OABI}
- unset OABI
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_compile
- else
- toolchain-glibc_src_compile
- fi
-}
-
-src_test() {
- local ret=0
-
- setup_env
-
- if [[ -z ${OABI} ]] && has_multilib_profile ; then
- OABI=${ABI}
- einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
- for ABI in $(get_install_abis) ; do
- export ABI
- einfo " Testing ${ABI} glibc"
- src_test
- ((ret+=$?))
- done
- ABI=${OABI}
- unset OABI
- [[ ${ret} -ne 0 ]] \
- && die "tests failed" \
- || return 0
- fi
-
- want_linuxthreads && toolchain-glibc_src_test linuxthreads ; ((ret+=$?))
- want_nptl && toolchain-glibc_src_test nptl ; ((ret+=$?))
- return ${ret}
-}
-
-src_strip() {
- # Now, strip everything but the thread libs #46186, as well as the dynamic
- # linker, else we cannot set breakpoints in shared libraries due to bugs in
- # gdb. Also want to grab stuff in tls subdir. whee.
- env \
- -uRESTRICT \
- CHOST=${CTARGET} \
- STRIP_MASK="/*/{,tls/}libthread_db*" \
- prepallstrip
-}
-
-src_install() {
- setup_env
-
- if [[ -z ${OABI} ]] ; then
- local abilist=""
- if has_multilib_profile ; then
- abilist=$(get_install_abis)
- einfo "Installing multilib glibc for ABIs: ${abilist}"
- elif is_crosscompile || tc-is-cross-compiler ; then
- abilist=${DEFAULT_ABI}
- fi
- if [[ -n ${abilist} ]] ; then
- OABI=${ABI}
- for ABI in ${abilist} ; do
- export ABI
- src_install
- done
- ABI=${OABI}
- unset OABI
- src_strip
- return 0
- fi
- fi
-
- if just_headers ; then
- toolchain-glibc_headers_install
- else
- toolchain-glibc_src_install
- fi
- [[ -z ${OABI} ]] && src_strip
-}
-
-pkg_preinst() {
- toolchain-glibc_pkg_preinst
-}
-
-pkg_postinst() {
- toolchain-glibc_pkg_postinst
-}
diff --git a/sys-libs/glibc/glibc-2.8_p20080602.ebuild b/sys-libs/glibc/glibc-2.8_p20080602.ebuild
deleted file mode 100644
index d174434f2061..000000000000
--- a/sys-libs/glibc/glibc-2.8_p20080602.ebuild
+++ /dev/null
@@ -1,378 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.8_p20080602.ebuild,v 1.17 2009/12/10 01:31:25 vapier Exp $
-
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2"
-KEYWORDS="~alpha ~amd64 ~arm ~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}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-MANPAGE_VER="" # pregenerated manpages
-INFOPAGE_VER="" # pregenerated infopages
-PATCH_VER="3" # 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 glibc-omitfp hardened multilib nls selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl nptlonly}"
-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-} != ${CATEGORY} ]] ; 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} ]]
-}
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- # Why SLOT 2.2 you ask yourself while sippin your tea ?
- # Everyone knows 2.2 > 0, duh.
- SLOT="2.2"
- PROVIDE="virtual/libc"
-fi
-
-# 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:+)}
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- >=sys-apps/sandbox-1.2.18.1-r2
- >=sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; 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://sources.redhat.com/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
- [[ -n ${MANPAGE_VER} ]] && gentoo_uris glibc-manpages-${MANPAGE_VER}.tar.bz2
- [[ -n ${INFOPAGE_VER} ]] && gentoo_uris glibc-infopages-${INFOPAGE_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
-
- 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 || die
- 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 ; }
-
-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
-}
-
-maint_pkg_create() {
- local base="/usr/local/src/gnu/glibc/glibc-${PV:0:1}_${PV:2:1}"
- cd ${base}
- local stamp=$(date +%Y%m%d)
- local d
- for d in libc ports ; do
- #(cd ${d} && cvs up)
- case ${d} in
- libc) tarball="${P}";;
- ports) tarball="${PN}-ports-${PV}";;
- esac
- rm -f ${tarball}*
- ln -sf ${d} ${tarball}
- tar hcf - ${tarball} --exclude-vcs | lzma > "${T}"/${tarball}.tar.lzma
- du -b "${T}"/${tarball}.tar.lzma
- done
-}
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
-
- # Check for broken kernels #262698
- cd "${T}"
- printf '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n' > kern-clo-test.c
- emake kern-clo-test || die
- if ! ./kern-clo-test ; then
- eerror "Your patched vendor kernel is broken. You need to get an"
- eerror "update from whoever is providing the kernel to you."
- eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227"
- die "keeping your system alive, say thank you"
- fi
- fi
-
- # users have had a chance to phase themselves, time to give em the boot
- if [[ -e ${ROOT}/etc/locale.gen ]] && [[ -e ${ROOT}/etc/locales.build ]] ; then
- eerror "You still haven't deleted ${ROOT}/etc/locales.build."
- eerror "Do so now after making sure ${ROOT}/etc/locale.gen is kosher."
- die "lazy upgrader detected"
- fi
-
- if [[ ${CTARGET} == i386-* ]] ; then
- eerror "i386 CHOSTs are no longer supported."
- eerror "Chances are you don't actually want/need i386."
- eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
- die "please fix your CHOST"
- fi
-
- if [[ -n ${LT_VER} ]] ; then
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- use hardened && ! gcc-specs-pie && \
- ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
-
- export LC_ALL=C #252802
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-pkg_preinst() {
- # nothing to do if just installing headers
- just_headers && return
-
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && [[ ! -d ${D}/$(alt_libdir)/tls ]] ; then
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # Shouldnt need to keep this updated
- [[ -e ${ROOT}/etc/locale.gen ]] && rm -f "${D}"/etc/locale.gen
-
- # simple test to make sure our new glibc isnt completely broken.
- # make sure we don't test with statically built binaries since
- # they will fail. also, skip if this glibc is a cross compiler.
- [[ ${ROOT} != "/" ]] && return 0
- [[ -d ${D}/$(get_libdir) ]] || return 0
- cd / #228809
- local x striptest
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-pkg_postinst() {
- # nothing to do if just installing headers
- just_headers && return
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.9_p20081201-r1.ebuild b/sys-libs/glibc/glibc-2.9_p20081201-r1.ebuild
deleted file mode 100644
index d6ff694e71f7..000000000000
--- a/sys-libs/glibc/glibc-2.9_p20081201-r1.ebuild
+++ /dev/null
@@ -1,378 +0,0 @@
-# Copyright 1999-2009 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-r1.ebuild,v 1.9 2009/12/10 01:31:26 vapier Exp $
-
-GLIBC_PATCH_EXCLUDE="${GLIBC_PATCH_EXCLUDE} 1060_all_glibc-nss-deepbind.patch" #252302
-
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2"
-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}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-MANPAGE_VER="" # pregenerated manpages
-INFOPAGE_VER="" # pregenerated infopages
-PATCH_VER="2" # 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 glibc-omitfp hardened multilib nls selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl nptlonly}"
-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-} != ${CATEGORY} ]] ; 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} ]]
-}
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- # Why SLOT 2.2 you ask yourself while sippin your tea ?
- # Everyone knows 2.2 > 0, duh.
- SLOT="2.2"
- PROVIDE="virtual/libc"
-fi
-
-# 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:+)}
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- >=sys-apps/sandbox-1.2.18.1-r2
- >=sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; 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://sources.redhat.com/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
- [[ -n ${MANPAGE_VER} ]] && gentoo_uris glibc-manpages-${MANPAGE_VER}.tar.bz2
- [[ -n ${INFOPAGE_VER} ]] && gentoo_uris glibc-infopages-${INFOPAGE_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
-
- 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 || die
- 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 ; }
-
-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
-}
-
-maint_pkg_create() {
- local base="/usr/local/src/gnu/glibc/glibc-${PV:0:1}_${PV:2:1}"
- cd ${base}
- local stamp=$(date +%Y%m%d)
- local d
- for d in libc ports ; do
- #(cd ${d} && cvs up)
- case ${d} in
- libc) tarball="${P}";;
- ports) tarball="${PN}-ports-${PV}";;
- esac
- rm -f ${tarball}*
- ln -sf ${d} ${tarball}
- tar hcf - ${tarball} --exclude-vcs | lzma > "${T}"/${tarball}.tar.lzma
- du -b "${T}"/${tarball}.tar.lzma
- done
-}
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
-
- # Check for broken kernels #262698
- cd "${T}"
- printf '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n' > kern-clo-test.c
- emake kern-clo-test || die
- if ! ./kern-clo-test ; then
- eerror "Your patched vendor kernel is broken. You need to get an"
- eerror "update from whoever is providing the kernel to you."
- eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227"
- die "keeping your system alive, say thank you"
- fi
- fi
-
- # users have had a chance to phase themselves, time to give em the boot
- if [[ -e ${ROOT}/etc/locale.gen ]] && [[ -e ${ROOT}/etc/locales.build ]] ; then
- eerror "You still haven't deleted ${ROOT}/etc/locales.build."
- eerror "Do so now after making sure ${ROOT}/etc/locale.gen is kosher."
- die "lazy upgrader detected"
- fi
-
- if [[ ${CTARGET} == i386-* ]] ; then
- eerror "i386 CHOSTs are no longer supported."
- eerror "Chances are you don't actually want/need i386."
- eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
- die "please fix your CHOST"
- fi
-
- if [[ -n ${LT_VER} ]] ; then
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- use hardened && ! gcc-specs-pie && \
- ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
-
- export LC_ALL=C #252802
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-pkg_preinst() {
- # nothing to do if just installing headers
- just_headers && return
-
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && [[ ! -d ${D}/$(alt_libdir)/tls ]] ; then
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # simple test to make sure our new glibc isnt completely broken.
- # make sure we don't test with statically built binaries since
- # they will fail. also, skip if this glibc is a cross compiler.
- [[ ${ROOT} != "/" ]] && return 0
- [[ -d ${D}/$(get_libdir) ]] || return 0
- cd / #228809
- local x striptest
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-pkg_postinst() {
- # nothing to do if just installing headers
- just_headers && return
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ... if in a chroot or a diff init package, ignore
- # errors from this step #253697
- /sbin/telinit U 2>/dev/null
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-}
diff --git a/sys-libs/glibc/glibc-2.9_p20081201.ebuild b/sys-libs/glibc/glibc-2.9_p20081201.ebuild
deleted file mode 100644
index d4c9efdefe6d..000000000000
--- a/sys-libs/glibc/glibc-2.9_p20081201.ebuild
+++ /dev/null
@@ -1,375 +0,0 @@
-# Copyright 1999-2009 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.ebuild,v 1.7 2009/12/10 01:31:26 vapier Exp $
-
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
-
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
-
-LICENSE="LGPL-2"
-KEYWORDS="~alpha ~amd64 ~arm ~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}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-MANPAGE_VER="" # pregenerated manpages
-INFOPAGE_VER="" # pregenerated infopages
-PATCH_VER="1" # 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 glibc-omitfp hardened multilib nls selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl nptlonly}"
-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-} != ${CATEGORY} ]] ; 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} ]]
-}
-alt_libdir() {
- if is_crosscompile ; then
- echo /usr/${CTARGET}/$(get_libdir)
- else
- echo /$(get_libdir)
- fi
-}
-
-if is_crosscompile ; then
- SLOT="${CTARGET}-2.2"
-else
- # Why SLOT 2.2 you ask yourself while sippin your tea ?
- # Everyone knows 2.2 > 0, duh.
- SLOT="2.2"
- PROVIDE="virtual/libc"
-fi
-
-# 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:+)}
- >=sys-devel/gcc-config-1.3.12
- >=app-misc/pax-utils-0.1.10
- virtual/os-headers
- nls? ( sys-devel/gettext )
- >=sys-apps/sandbox-1.2.18.1-r2
- >=sys-apps/portage-2.1.2
- selinux? ( sys-libs/libselinux )"
-RDEPEND="nls? ( sys-devel/gettext )
- selinux? ( sys-libs/libselinux )"
-
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; 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://sources.redhat.com/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
- [[ -n ${MANPAGE_VER} ]] && gentoo_uris glibc-manpages-${MANPAGE_VER}.tar.bz2
- [[ -n ${INFOPAGE_VER} ]] && gentoo_uris glibc-infopages-${INFOPAGE_VER}.tar.bz2
-)
-
-# eblit-include [--skip] <function> [version]
-eblit-include() {
- local skipable=false
- [[ $1 == "--skip" ]] && skipable=true && shift
-
- 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 || die
- 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 ; }
-
-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
-}
-
-maint_pkg_create() {
- local base="/usr/local/src/gnu/glibc/glibc-${PV:0:1}_${PV:2:1}"
- cd ${base}
- local stamp=$(date +%Y%m%d)
- local d
- for d in libc ports ; do
- #(cd ${d} && cvs up)
- case ${d} in
- libc) tarball="${P}";;
- ports) tarball="${PN}-ports-${PV}";;
- esac
- rm -f ${tarball}*
- ln -sf ${d} ${tarball}
- tar hcf - ${tarball} --exclude-vcs | lzma > "${T}"/${tarball}.tar.lzma
- du -b "${T}"/${tarball}.tar.lzma
- done
-}
-
-pkg_setup() {
- # prevent native builds from downgrading ... maybe update to allow people
- # to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
- if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
- if has_version '>'${CATEGORY}/${PF} ; then
- eerror "Sanity check to keep you from breaking your system:"
- eerror " Downgrading glibc is not supported and a sure way to destruction"
- die "aborting to save your system"
- fi
-
- # Check for broken kernels #262698
- cd "${T}"
- printf '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n' > kern-clo-test.c
- emake kern-clo-test || die
- if ! ./kern-clo-test ; then
- eerror "Your patched vendor kernel is broken. You need to get an"
- eerror "update from whoever is providing the kernel to you."
- eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227"
- die "keeping your system alive, say thank you"
- fi
- fi
-
- # users have had a chance to phase themselves, time to give em the boot
- if [[ -e ${ROOT}/etc/locale.gen ]] && [[ -e ${ROOT}/etc/locales.build ]] ; then
- eerror "You still haven't deleted ${ROOT}/etc/locales.build."
- eerror "Do so now after making sure ${ROOT}/etc/locale.gen is kosher."
- die "lazy upgrader detected"
- fi
-
- if [[ ${CTARGET} == i386-* ]] ; then
- eerror "i386 CHOSTs are no longer supported."
- eerror "Chances are you don't actually want/need i386."
- eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
- die "please fix your CHOST"
- fi
-
- if [[ -n ${LT_VER} ]] ; then
- if use nptlonly && ! use nptl ; then
- eerror "If you want nptlonly, add nptl to your USE too ;p"
- die "nptlonly without nptl"
- fi
- fi
-
- if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
- ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
- ewarn "This will result in a 50% performance penalty, which is probably not what you want."
- fi
-
- use hardened && ! gcc-specs-pie && \
- ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
-
- export LC_ALL=C #252802
-}
-
-fix_lib64_symlinks() {
- # the original Gentoo/AMD64 devs decided that since 64bit is the native
- # bitdepth for AMD64, lib should be used for 64bit libraries. however,
- # this ignores the FHS and breaks multilib horribly... especially
- # since it wont even work without a lib64 symlink anyways. *rolls eyes*
- # see bug 59710 for more information.
- # Travis Tilley <lv@gentoo.org> (08 Aug 2004)
- if [ -L ${ROOT}/lib64 ] ; then
- ewarn "removing /lib64 symlink and moving lib to lib64..."
- ewarn "dont hit ctrl-c until this is done"
- rm ${ROOT}/lib64
- # now that lib64 is gone, nothing will run without calling ld.so
- # directly. luckily the window of brokenness is almost non-existant
- use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
- # all better :)
- ldconfig
- ln -s lib64 ${ROOT}/lib
- einfo "done! :-)"
- einfo "fixed broken lib64/lib symlink in ${ROOT}"
- fi
- if [ -L ${ROOT}/usr/lib64 ] ; then
- rm ${ROOT}/usr/lib64
- mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
- ln -s lib64 ${ROOT}/usr/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
- fi
- if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
- rm ${ROOT}/usr/X11R6/lib64
- mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
- ln -s lib64 ${ROOT}/usr/X11R6/lib
- einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
- fi
-}
-
-pkg_preinst() {
- # nothing to do if just installing headers
- just_headers && return
-
- # PPC64+others may want to eventually be added to this logic if they
- # decide to be multilib compatible and FHS compliant. note that this
- # chunk of FHS compliance only applies to 64bit archs where 32bit
- # compatibility is a major concern (not IA64, for example).
-
- # amd64's 2005.0 is the first amd64 profile to not need this code.
- # 2005.0 is setup properly, and this is executed as part of the
- # 2004.3 -> 2005.0 upgrade script.
- # It can be removed after 2004.3 has been purged from portage.
- { use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
-
- # it appears that /lib/tls is sometimes not removed. See bug
- # 69258 for more info.
- if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && [[ ! -d ${D}/$(alt_libdir)/tls ]] ; then
- ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
- rm -r "${ROOT}"/$(alt_libdir)/tls || die
- fi
-
- # simple test to make sure our new glibc isnt completely broken.
- # make sure we don't test with statically built binaries since
- # they will fail. also, skip if this glibc is a cross compiler.
- [[ ${ROOT} != "/" ]] && return 0
- [[ -d ${D}/$(get_libdir) ]] || return 0
- cd / #228809
- local x striptest
- for x in date env ls true uname ; do
- x=$(type -p ${x})
- [[ -z ${x} ]] && continue
- striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
- [[ -z ${striptest} ]] && continue
- [[ ${striptest} == *"statically linked"* ]] && continue
- "${D}"/$(get_libdir)/ld-*.so \
- --library-path "${D}"/$(get_libdir) \
- ${x} > /dev/null \
- || die "simple run test (${x}) failed"
- done
-}
-
-pkg_postinst() {
- # nothing to do if just installing headers
- just_headers && return
-
- if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
- # Generate fastloading iconv module configuration file.
- "${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
- fi
-
- if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
- # Reload init ...
- /sbin/telinit U
-
- # if the host locales.gen contains no entries, we'll install everything
- local locale_list="${ROOT}etc/locale.gen"
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
- locale_list="${ROOT}usr/share/i18n/SUPPORTED"
- fi
- local x jobs
- for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
- locale-gen -j ${jobs:-1} --config "${locale_list}"
- fi
-}