summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2009-11-08 20:34:16 +0800
committerZhang Le <r0bertz@gentoo.org>2009-11-08 20:34:16 +0800
commit7f27ecc3b88d9dcb7a74b3f42f50c1bf5680005a (patch)
tree1b6b97303a9dba0d3c5944c86563af4bf9f50002 /sys-libs/glibc
parentadded gcc symlink pointing to portage gcc (diff)
downloadloongson-7f27ecc3b88d9dcb7a74b3f42f50c1bf5680005a.tar.gz
loongson-7f27ecc3b88d9dcb7a74b3f42f50c1bf5680005a.tar.bz2
loongson-7f27ecc3b88d9dcb7a74b3f42f50c1bf5680005a.zip
updated glibc-2.10.1
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Diffstat (limited to 'sys-libs/glibc')
-rw-r--r--sys-libs/glibc/Manifest19
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c315
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch30
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch274
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch168
-rw-r--r--sys-libs/glibc/files/eblits/src_compile.eblit13
-rw-r--r--sys-libs/glibc/files/eblits/src_install.eblit4
-rw-r--r--sys-libs/glibc/files/glibc-mips-fpregdef.h.patch127
-rw-r--r--sys-libs/glibc/files/glibc-mips-getcontext.patch878
-rw-r--r--sys-libs/glibc/glibc-2.10.1.ebuild28
-rw-r--r--sys-libs/glibc/glibc-2.9_p20090420.ebuild231
11 files changed, 830 insertions, 1257 deletions
diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index f405ebc..502406b 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -1,3 +1,7 @@
+AUX 2.10/glibc-2.10-gentoo-chk_fail.c 9407 RMD160 230701dfacfe2481eb49e5384fe4ebb508bd3af2 SHA1 0e9330d57de714dd1ecd7040d3eabf4723cdee7c SHA256 7745c0f5d37b37959b43b41e39762fc35b877161bc5740d9d3e9a83021acbc0e
+AUX 2.10/glibc-2.10-hardened-configure-picdefault.patch 865 RMD160 744bdbfb73f1dbced4cb33cb5aa92f3b41d3b4fb SHA1 21e0f83598f5342032a794315f0e3dac07f647da SHA256 b50b29f85d88011555bbcbe6046e6600be9344f2d78412b14aebdea515420774
+AUX 2.10/glibc-2.10-hardened-inittls-nosysenter.patch 8823 RMD160 163e53f0f4f0bd003ef1c50a4eaaa8f4a82695fe SHA1 df23c6756114e1451e6f120723af1b621037c28e SHA256 dcf78c6524c222dbee907200a8878aff727e29d43a4962b977a16d85752e5c10
+AUX 2.10/glibc-2.10-hardened-ssp-compat.patch 4802 RMD160 02bd17455d64b6661ae5f44329357dc254cdf118 SHA1 b40cf1a8f17e448861746ba39aa20afd66a47b2d SHA256 bd6f0aa8eace0a935731749e101d5fe30210f9edb65f2f5ccd425cef581ddce4
AUX 2.3.1/glibc-2.3.1-ctype-compat-v3.patch 2823 RMD160 f1162b7f313f7ea18fb178157d3bd6205d818e3a SHA1 d1dceb79689e9c627ebd630389ec1948d7a0a6e4 SHA256 0bc07eb47578d5bfb98774b18bf07aee2af44a7ccd947602c223b34e0d88394a
AUX 2.3.1/glibc-2.3.1-fpu-cw-mips.patch 433 RMD160 4eda3122052714ea216ab402ea5a3a7f4654f48e SHA1 afb44c9a12e3d4ee28c61dd62522244c09776da4 SHA256 8e68949febc8b14941d15b9afd914b158db11d282d19c528f75a0b58c379dcce
AUX 2.3.1/glibc-2.3.1-libc_wait-compat.patch 1053 RMD160 429e2065d45c4c68aa5f39eacf6d8ae5fbda63c8 SHA1 001a4af11de2029bcbb01a0afc4051cb4119807a SHA256 db4c92f86d3404ba4cc2f4d28e17517ed09124efcb518394d9c1df27d8540962
@@ -106,15 +110,13 @@ AUX eblits/common.eblit 8751 RMD160 fc6098987e4438de975c95756e1354e2b9719b92 SHA
AUX eblits/pkg_postinst.eblit 1159 RMD160 4b99846819bf0471d1104a8a17dd260796644f9d SHA1 4a2980fede3edebc7960d40db7cf935c7c854859 SHA256 76c403cf5c77a3a3bb7441566335f0c8da2584eaa21f05ab400e7bb00f9db810
AUX eblits/pkg_preinst.eblit 3285 RMD160 990d7ee7cfa1ba79a19bc6c01c05817ebfc0ee96 SHA1 3ee2fe58fa7ca246311cf5ef23fa1ccbe509cf49 SHA256 8bc7dea37213048787ce0bec61e9abe8adabb547b5385024bf2549d0a036239c
AUX eblits/pkg_setup.eblit 2814 RMD160 8352c4b9cc460b7193e17be8bca227db5b6df5ba SHA1 8de7ea78e364521b55574b16036d57e7d35a596f SHA256 b803723f75571649e10e0707a6dbe8b459eabdc149ef155558792db736faa201
-AUX eblits/src_compile.eblit 6134 RMD160 4dd71f64ebaea8eb0ae396af2877a0e9e7965f5c SHA1 18d4a6d2043f2209b5c676e4fe467efd22b900ef SHA256 30d469490537b225c6d68460f055147ce3a554e385f11e346b4d414e3dee1790
+AUX eblits/src_compile.eblit 6401 RMD160 a0df2727a47288db34f2882203b4f1e0fc2ef68a SHA1 dc77021864003881290b114539a8802e15ec2b70 SHA256 bbf3be4a64f67bff8627a15827325ad3ddc9f17a7b52284553d00ad855d1d26a
AUX eblits/src_install-2.6.eblit 7946 RMD160 6cc258a316b78212777ab328a3c0cb73de1616d4 SHA1 94895689b56fd712156e8ac84a2a639d8475da03 SHA256 54081c34217c230d0ff43c5df378897a37576e727fe41ee4d681767110667f3e
-AUX eblits/src_install.eblit 8115 RMD160 671ca7e512d6f17f07f175d5b536485c5b3a90db SHA1 afffdd395316eb0f353e7d0be28509ae1c2d682c SHA256 be2360d0465dce9a1319846c023dc9cedd7a47f58b493c5cf2fc0ff37d699d3e
+AUX eblits/src_install.eblit 8216 RMD160 c3a413720cb8c191787b40f2be8c98af06555b2c SHA1 a64fa57320320651d74dcbe39a4e0e2095199b3b SHA256 bef21da67e052dd8f809510b49564e6bb0047fa6572eae3f1b357ae422990e2c
AUX eblits/src_test.eblit 1162 RMD160 349db09c5f2c2e412a108b8c5371adf946e1a3f0 SHA1 357ef650e1dce62d5d688133426bc62b9085009d SHA256 bac1db2da478f6e6709275c36cc1f9a98fac7fcc2e80bd8831f2077207754962
AUX eblits/src_unpack.eblit 5134 RMD160 fba35312f25e908fa225a7803d0b194e83579d6a SHA1 e6abd0516994a86ca6836872f5acc39c4d2a866d SHA256 1edd30423009f220d98ae39e2d708fd053edfff302bfd9012b8cc4e6d81eca45
AUX fix-sysctl_h.patch 376 RMD160 b5dd68158224b09ddc42986be02351c74f81e0a0 SHA1 5601fbea6961368bcc192aef78e96ee2c5310713 SHA256 3a589f63fd1f3f6c5a00c66a10943d3d64630aefb1eb5b37e7f2a856fcea234a
AUX glibc-2.2.2-test-lfs-timeout.patch 320 RMD160 c8baab8326b4aebf642dd5ab512fbebf2371e9d9 SHA1 df2a868fba86adba184ae9750e9dee3b2ec300a5 SHA256 28e7ebc92ed93a12daf5357f07537be3daed5f4717a075c77a3ad248ec99dcf0
-AUX glibc-mips-fpregdef.h.patch 3168 RMD160 3efa4d418eb6efa71f10a0398dddf03e5f0a43c7 SHA1 690ddca20efaf722b22838539fbd2cb4b9cabcc0 SHA256 b71eec1750b355d5495d632144eedf941d0851c5acb2d0c929f04aa7055156b0
-AUX glibc-mips-getcontext.patch 25255 RMD160 c3c591bc4b8decb2d0a804db141ddaafda01fb7a SHA1 ea001b0ffbff4a7d8970c116e7e0338871f2c9fc SHA256 5452330b56d00c7b69c130644b97feabbe764636181509613cbe952f4f724189
AUX glibc-sec-hotfix-20040804.patch 4319 RMD160 6f7f58794273ed0736653a09e823e8ac3031ed29 SHA1 1d86c62d5c52b59881eab006b36e3a9891607887 SHA256 9d950b2f45cfbdae6df590137e4aae938380673449fe4507536557fb4c797393
AUX glibc-sec-hotfix-20040916.patch 3080 RMD160 3419ab628d16045042f5df9e487386e03c8d979d SHA1 b69cfa5115746f2d38fa301a55d68efe88f7bcff SHA256 9f48a55f4207bdf4a9496680f09661a06d4a4bd11dad11cb0986949c0d3cc35d
AUX locales.build 699 RMD160 2a186105be5b00ec48aedef734e9dba5aee19895 SHA1 02ce7b63d60da7bb4b936969721f78486ffe9788 SHA256 094a5e02148d522be5a5ec2b95fb7305d5503f6d13d1ffa9088e9dad21af1c8a
@@ -123,15 +125,12 @@ AUX nscd.conf 1158 RMD160 50651e89a0cb206b1d37dae8840527694fe561b5 SHA1 5f5166aa
AUX nsswitch.conf 503 RMD160 f375f92f6b41029c93382c39cef896261b140cfc SHA1 42f7f5cc3de75c69bf60d806ac8490106ea63326 SHA256 6c38b8642d5da884327ad678d0351d57be3621562253bd9711394bad87e45e2d
AUX test-__thread.c 53 RMD160 dcc9960f3bf26c935f41dc5c408613963885ad58 SHA1 dcb60595b2730a8a05eb045563f13cd615830acf SHA256 28a7836b810cf21f6071126d6b19dbdbf567f2544f9283700d125ad653d7519e
AUX test-sysctl_h.c 54 RMD160 b7c2e5956e0a232193610701ccc57a8d56615a36 SHA1 d727fbe809fbec9157661fbdb6c8077a68d95044 SHA256 19337cae62f1ebc23ca8d8de8a98e7f03c9dd77a671100995d6e7c8a3833e759
-DIST glibc-2.10.1-patches-1.tar.bz2 81661 RMD160 59ad31a06f2f8b14705754873e4cf9348022684f SHA1 7fcdab040607f92bff49c64ec2902ce469f8282c SHA256 593ee293e62fd1718a96da0c44b3454209b1372fb45679a7ec0ea3b01764737a
+DIST glibc-2.10.1-patches-4.tar.bz2 102202 RMD160 21258fd52330d766c8b39eb52e92571b6aae8539 SHA1 06ca02f03efca2ad3d3856fe49c7818bd4ab46a6 SHA256 32235a6a63f1eeb5c30d88700905cd24e7492b742245cbf1acceed5c7bf8fa7c
DIST glibc-2.10.1.tar.bz2 16106243 RMD160 ca102519ab32714e788a0db5dd43c2f9962c86e9 SHA1 cb478cf9d6e2c905a1a4f4a2cae44a320b8dc50b SHA256 cbad3e637eab613184405a87a2bf08a41991a0e512a3ced60d120effc73de667
DIST glibc-2.9-20081201.tar.bz2 16430489 RMD160 1e1feb4ee9c0892a0544c05adb6dd249544621cf SHA1 5756ca3b543a370c4ec9ffc8038b72bf0aa61c71 SHA256 6f8e515775e20ed48610860d10315adda418a3649b3465f36ee5cd467364a8f6
-DIST glibc-2.9-20090420.tar.bz2 16425607 RMD160 0317e1c28d9423c445a677ac0b44ef2797e99d72 SHA1 b82153137cd167d56dd56f7e39cd613d144e1035 SHA256 80430dada337fb369fb447fa9b931a8da42a27dbd29dc7e8da9371417e3a2f7f
DIST glibc-2.9-patches-5.tar.bz2 101693 RMD160 8cd377be020bf95a30862d77c215c16dc544602f SHA1 103839660f4e55871bf68835f8fec83d9afecdec SHA256 6f61c3e212c82eb118780573ac80d61835ff3a98fbea68b6f03a52009cce7d35
DIST glibc-2.9-ports-20081201.tar.bz2 487663 RMD160 80eb0035ed2e021e79755d4151ccd6d73cd78d8d SHA1 90a6ecbce37aabe6093c4dd0c8817cbf86321627 SHA256 19bb6e89855171d7ae01aef92054dfe4524521fbc13c67bfaa3ee81944210744
-DIST glibc-2.9-ports-20090420.tar.bz2 488016 RMD160 3fb49c136092553bd2872f086040c65b31302dde SHA1 1cba3623bf70dc9594dd8d879b5eb4f2c5448174 SHA256 8c73f9508f6cb7c978e647ee7a89fffd65aab1655fa5671a47a5a416c081a670
DIST glibc-libidn-2.10.1.tar.bz2 102248 RMD160 0fbb3ecc09f59f0b9e90e0669bd9cd6075164173 SHA1 50c1ac0d9ddff6eb83f75aa1c4cb84ba6fffa0cd SHA256 0fa72d1dd06a30642d3bb20a659f4ed0f4af54a205d7102896b68169b38676dc
-DIST glibc-ports-2.10.1.tar.bz2 575344 RMD160 d1915dc73da61d151cd1d2c80c1d8d3929995ce2 SHA1 16ee5186c18d9f1a8c0b2c9629f26d85de59a426 SHA256 95d0050d0ec33b97539adbebc5e9f1fdcc4089c6ebf827e0b659b45c923454d8
-EBUILD glibc-2.10.1.ebuild 7663 RMD160 8c29956a15343c5c10640988d189918a6b58fee2 SHA1 145e36c66a282afe9a7a3e5d9a66960c51020f46 SHA256 77e0228c93b12af1fb900b87d00645c2dd79608c1aa46efbd757272424e88834
+DIST glibc-ports-2.10.1.tar.bz2 584860 RMD160 1f094d4df18306ccb01037d07f0a0e3014fdfc60 SHA1 3cc9eff22d624c5fb6d951bbcb31b40112238fe7 SHA256 b1f1ec9720036a3a33598b8478eef102535444a083d5b5813a6981ed74ab4071
+EBUILD glibc-2.10.1.ebuild 8100 RMD160 be8dc44c4ff0734e7c74c844818ab8fa127facad SHA1 6d5976b5bb8bf58aceae676410fc3d37a884c362 SHA256 0cfca859f2e676e99f900b837b532b6899c4f5c86896ddb4266d1be29a48886e
EBUILD glibc-2.9_p20081201-r2.ebuild 7742 RMD160 3691ca48dac3b748ae383006f774a74b11a2f174 SHA1 963d0a0869fc58b11905b3e6d2f722e43c08ef0c SHA256 836a33062d29377bbb5584f42f06f9e62d15727a6693cc2867dd0b0002340079
-EBUILD glibc-2.9_p20090420.ebuild 7800 RMD160 047516f4a50d9ad8cc51ee2e1198a7a4a17c2d02 SHA1 438316c8cb4c217835f08ddcb52eadb41c8b422d SHA256 4e8a67098d9510bc64fc8cc3063e3e1fd3d4b21f7ac73d34179a6813bdda5bb7
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c b/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c
new file mode 100644
index 0000000..37711e8
--- /dev/null
+++ b/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c
@@ -0,0 +1,315 @@
+/* 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Copyright (C) 2006-2008 Gentoo Foundation Inc.
+ * License terms as above.
+ *
+ * Hardened Gentoo SSP and FORTIFY handler
+ *
+ * An SSP failure handler that does not use functions from the rest of
+ * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures
+ * no possibility of recursion into the handler.
+ *
+ * Direct all bug reports to http://bugs.gentoo.org/
+ *
+ * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
+ * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
+ *
+ * The following people contributed to the glibc-2.3 Hardened
+ * Gentoo SSP and FORTIFY handler, from which this implementation draws much:
+ *
+ * Ned Ludd - <solar[@]gentoo.org>
+ * Alexander Gabert - <pappy[@]gentoo.org>
+ * The PaX Team - <pageexec[@]freemail.hu>
+ * Peter S. Mazinger - <ps.m[@]gmx.net>
+ * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ * Robert Connolly - <robert[@]linuxfromscratch.org>
+ * Cory Visi <cory[@]visi.name>
+ * Mike Frysinger <vapier[@]gentoo.org>
+ * Magnus Granberg <zorry[@]ume.nu>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include <kernel-features.h>
+
+#include <alloca.h>
+/* from sysdeps */
+#include <socketcall.h>
+/* for the stuff in bits/socket.h */
+#include <sys/socket.h>
+#include <sys/un.h>
+
+/* Sanity check on SYSCALL macro names - force compilation
+ * failure if the names used here do not exist
+ */
+#if !defined __NR_socketcall && !defined __NR_socket
+# error Cannot do syscall socket or socketcall
+#endif
+#if !defined __NR_socketcall && !defined __NR_connect
+# error Cannot do syscall connect or socketcall
+#endif
+#ifndef __NR_write
+# error Cannot do syscall write
+#endif
+#ifndef __NR_close
+# error Cannot do syscall close
+#endif
+#ifndef __NR_getpid
+# error Cannot do syscall getpid
+#endif
+#ifndef __NR_kill
+# error Cannot do syscall kill
+#endif
+#ifndef __NR_exit
+# error Cannot do syscall exit
+#endif
+#ifdef SSP_SMASH_DUMPS_CORE
+# define ENABLE_SSP_SMASH_DUMPS_CORE 1
+# if !defined _KERNEL_NSIG && !defined _NSIG
+# error No _NSIG or _KERNEL_NSIG for rt_sigaction
+# endif
+# if !defined __NR_sigaction && !defined __NR_rt_sigaction
+# error Cannot do syscall sigaction or rt_sigaction
+# endif
+/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
+ * of the _kernel_ sigset_t which is not the same as the user sigset_t.
+ * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
+ * some reason.
+ */
+# ifdef _KERNEL_NSIG
+# define _SSP_NSIG _KERNEL_NSIG
+# else
+# define _SSP_NSIG _NSIG
+# endif
+#else
+# define _SSP_NSIG 0
+# define ENABLE_SSP_SMASH_DUMPS_CORE 0
+#endif
+
+/* Define DO_SIGACTION - default to newer rt signal interface but
+ * fallback to old as needed.
+ */
+#ifdef __NR_rt_sigaction
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
+#else
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
+#endif
+
+/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
+#if defined(__NR_socket) && defined(__NR_connect)
+# define USE_OLD_SOCKETCALL 0
+#else
+# define USE_OLD_SOCKETCALL 1
+#endif
+
+/* stub out the __NR_'s so we can let gcc optimize away dead code */
+#ifndef __NR_socketcall
+# define __NR_socketcall 0
+#endif
+#ifndef __NR_socket
+# define __NR_socket 0
+#endif
+#ifndef __NR_connect
+# define __NR_connect 0
+#endif
+#define DO_SOCKET(result, domain, type, protocol) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = domain; \
+ socketargs[1] = type; \
+ socketargs[2] = protocol; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
+ } while (0)
+#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = sockfd; \
+ socketargs[1] = (unsigned long int)serv_addr; \
+ socketargs[2] = addrlen; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
+ } while (0)
+
+#ifndef _PATH_LOG
+# define _PATH_LOG "/dev/log"
+#endif
+
+static const char path_log[] = _PATH_LOG;
+
+/* For building glibc with SSP switched on, define __progname to a
+ * constant if building for the run-time loader, to avoid pulling
+ * in more of libc.so into ld.so
+ */
+#ifdef IS_IN_rtld
+static char *__progname = "<rtld>";
+#else
+extern char *__progname;
+#endif
+
+/* Common handler code, used by chk_fail
+ * Inlined to ensure no self-references to the handler within itself.
+ * Data static to avoid putting more than necessary on the stack,
+ * to aid core debugging.
+ */
+__attribute__ ((__noreturn__ , __always_inline__))
+static inline void
+__hardened_gentoo_chk_fail(char func[], int damaged)
+{
+#define MESSAGE_BUFSIZ 256
+ static pid_t pid;
+ static int plen, i;
+ static char message[MESSAGE_BUFSIZ];
+ static const char msg_ssa[] = ": buffer overflow attack";
+ static const char msg_inf[] = " in function ";
+ static const char msg_ssd[] = "*** buffer overflow detected ***: ";
+ static const char msg_terminated[] = " - terminated\n";
+ static const char msg_report[] = "Report to http://bugs.gentoo.org/\n";
+ static const char msg_unknown[] = "<unknown>";
+ static int log_socket, connect_result;
+ static struct sockaddr_un sock;
+ static unsigned long int socketargs[4];
+
+ /* Build socket address
+ */
+ sock.sun_family = AF_UNIX;
+ i = 0;
+ while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) {
+ sock.sun_path[i] = path_log[i];
+ i++;
+ }
+ sock.sun_path[i] = '\0';
+
+ /* Try SOCK_DGRAM connection to syslog */
+ connect_result = -1;
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ if (connect_result == -1) {
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+ /* Try SOCK_STREAM connection to syslog */
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ }
+
+ /* Build message. Messages are generated both in the old style and new style,
+ * so that log watchers that are configured for the old-style message continue
+ * to work.
+ */
+#define strconcat(str) \
+ {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
+ {\
+ message[plen+i]=str[i];\
+ i++;\
+ }\
+ plen+=i;}
+
+ /* R.Henderson post-gcc-4 style message */
+ plen = 0;
+ strconcat(msg_ssd);
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Dr. Etoh pre-gcc-4 style message */
+ plen = 0;
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_ssa);
+ strconcat(msg_inf);
+ if (func != NULL)
+ strconcat(func)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Direct reports to bugs.gentoo.org */
+ plen=0;
+ strconcat(msg_report);
+ message[plen++]='\0';
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+
+ /* Suicide */
+ pid = INLINE_SYSCALL(getpid, 0);
+
+ if (ENABLE_SSP_SMASH_DUMPS_CORE) {
+ static struct sigaction default_abort_act;
+ /* Remove any user-supplied handler for SIGABRT, before using it */
+ default_abort_act.sa_handler = SIG_DFL;
+ default_abort_act.sa_sigaction = NULL;
+ __sigfillset(&default_abort_act.sa_mask);
+ default_abort_act.sa_flags = 0;
+ if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
+ INLINE_SYSCALL(kill, 2, pid, SIGABRT);
+ }
+
+ /* Note; actions cannot be added to SIGKILL */
+ INLINE_SYSCALL(kill, 2, pid, SIGKILL);
+
+ /* In case the kill didn't work, exit anyway
+ * The loop prevents gcc thinking this routine returns
+ */
+ while (1)
+ INLINE_SYSCALL(exit, 0);
+}
+
+__attribute__ ((__noreturn__))
+void __chk_fail(void)
+{
+ __hardened_gentoo_chk_fail(NULL, 0);
+}
+
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch
new file mode 100644
index 0000000..e75ccc7
--- /dev/null
+++ b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch
@@ -0,0 +1,30 @@
+Prevent default-fPIE from confusing configure into thinking
+PIC code is default. This causes glibc to build both PIC and
+non-PIC code as normal, which on the hardened compiler generates
+PIC and PIE.
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+Fixed for glibc 2.10 by Magnus Granberg <zorry@ume.nu>
+
+--- configure.in
++++ configure.in
+@@ -2145,7 +2145,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
+ libc_cv_pic_default=no
+ fi
+ rm -f conftest.*])
+--- configure
++++ configure
+@@ -7698,7 +7698,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
+ libc_cv_pic_default=no
+ fi
+ rm -f conftest.*
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
new file mode 100644
index 0000000..cb6d8e3
--- /dev/null
+++ b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
@@ -0,0 +1,274 @@
+When building glibc PIE (which is not something upstream support),
+several modifications are necessary to the glibc build process.
+
+First, any syscalls in PIEs must be of the PIC variant, otherwise
+textrels ensue. Then, any syscalls made before the initialisation
+of the TLS will fail on i386, as the sysenter variant on i386 uses
+the TLS, giving rise to a chicken-and-egg situation. This patch
+defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
+version is normally used, and uses the non-sysenter version for the brk
+syscall that is performed by the TLS initialisation. Further, the TLS
+initialisation is moved in this case prior to the initialisation of
+dl_osversion, as that requires further syscalls.
+
+csu/libc-start.c: Move initial TLS initialization to before the
+initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
+
+csu/libc-tls.c: Use the no-sysenter version of sbrk when
+INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
+version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+misc/brk.c: Define a no-sysenter version of brk if
+INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
+Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+Fixed for 2.10 by Magnus Granberg <zorry@ume.nu>
+
+--- csu/libc-start.c
++++ csu/libc-start.c
+@@ -28,6 +28,7 @@
+ extern int __libc_multiple_libcs;
+
+ #include <tls.h>
++#include <sysdep.h>
+ #ifndef SHARED
+ # include <dl-osinfo.h>
+ extern void __pthread_initialize_minimal (void);
+@@ -129,6 +130,11 @@
+ # endif
+ _dl_aux_init (auxvec);
+ # endif
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ /* Do the initial TLS initialization before _dl_osversion,
++ since the latter uses the uname syscall. */
++ __pthread_initialize_minimal ();
++# endif
+ # ifdef DL_SYSDEP_OSCHECK
+ if (!__libc_multiple_libcs)
+ {
+@@ -138,10 +144,12 @@
+ }
+ # endif
+
++# ifndef INTERNAL_SYSCALL_NOSYSENTER
+ /* Initialize the thread library at least a bit since the libgcc
+ functions are using thread functions if these are available and
+ we need to setup errno. */
+ __pthread_initialize_minimal ();
++# endif
+
+ /* Set up the stack checker's canary. */
+ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
+--- csu/libc-tls.c
++++ csu/libc-tls.c
+@@ -23,6 +23,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <sys/param.h>
++#include <sysdep.h>
+
+
+ #ifdef SHARED
+@@ -29,6 +30,9 @@
+ #error makefile bug, this file is for static only
+ #endif
+
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++extern void *__sbrk_nosysenter (intptr_t __delta);
++#endif
+ extern ElfW(Phdr) *_dl_phdr;
+ extern size_t _dl_phnum;
+
+@@ -141,14 +145,26 @@
+
+ The initialized value of _dl_tls_static_size is provided by dl-open.c
+ to request some surplus that permits dynamic loading of modules with
+- IE-model TLS. */
++ IE-model TLS.
++
++ Where the normal sbrk would use a syscall that needs the TLS (i386)
++ use the special non-sysenter version instead. */
+ #if TLS_TCB_AT_TP
+ tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
++# else
+ tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
++# endif
+ #elif TLS_DTV_AT_TP
+ tcb_offset = roundup (tcbsize, align ?: 1);
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
++ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
++# else
+ tlsblock = __sbrk (tcb_offset + memsz + max_align
+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
++# endif
+ tlsblock += TLS_PRE_TCB_SIZE;
+ #else
+ /* In case a model with a different layout for the TCB and DTV
+--- misc/sbrk.c
++++ misc/sbrk.c
+@@ -18,6 +18,7 @@
+ #include <errno.h>
+ #include <stdint.h>
+ #include <unistd.h>
++#include <sysdep.h>
+
+ /* Defined in brk.c. */
+ extern void *__curbrk;
+@@ -29,6 +30,35 @@
+ /* Extend the process's data space by INCREMENT.
+ If INCREMENT is negative, shrink data space by - INCREMENT.
+ Return start of new space allocated, or -1 for errors. */
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ if the SYSENTER version requires the TLS (which it does on i386).
++ Obviously using the TLS before it is initialised is broken. */
++extern int __brk_nosysenter (void *addr);
++void *
++__sbrk_nosysenter (intptr_t increment)
++{
++ void *oldbrk;
++
++ /* If this is not part of the dynamic library or the library is used
++ via dynamic loading in a statically linked program update
++ __curbrk from the kernel's brk value. That way two separate
++ instances of __brk and __sbrk can share the heap, returning
++ interleaved pieces of it. */
++ if (__curbrk == NULL || __libc_multiple_libcs)
++ if (__brk_nosysenter (0) < 0) /* Initialize the break. */
++ return (void *) -1;
++
++ if (increment == 0)
++ return __curbrk;
++
++ oldbrk = __curbrk;
++ if (__brk_nosysenter (oldbrk + increment) < 0)
++ return (void *) -1;
++
++ return oldbrk;
++}
++#endif
+ void *
+ __sbrk (intptr_t increment)
+ {
+--- sysdeps/unix/sysv/linux/i386/brk.c
++++ sysdeps/unix/sysv/linux/i386/brk.c
+@@ -31,6 +31,30 @@
+ linker. */
+ weak_alias (__curbrk, ___brk_addr)
+
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ * if the SYSENTER version requires the TLS (which it does on i386).
++ * Obviously using the TLS before it is initialised is broken. */
++int
++__brk_nosysenter (void *addr)
++{
++ void *__unbounded newbrk;
++
++ INTERNAL_SYSCALL_DECL (err);
++ newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
++ __ptrvalue (addr));
++
++ __curbrk = newbrk;
++
++ if (newbrk < addr)
++ {
++ __set_errno (ENOMEM);
++ return -1;
++ }
++
++ return 0;
++}
++#endif
+ int
+ __brk (void *addr)
+ {
+--- sysdeps/unix/sysv/linux/i386/sysdep.h
++++ sysdeps/unix/sysv/linux/i386/sysdep.h
+@@ -187,7 +187,7 @@
+ /* The original calling convention for system calls on Linux/i386 is
+ to use int $0x80. */
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# if defined SHARED || defined __PIC__
+ # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
+ # else
+ # define ENTER_KERNEL call *_dl_sysinfo
+@@ -358,7 +358,7 @@
+ possible to use more than four parameters. */
+ #undef INTERNAL_SYSCALL
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# if defined SHARED || defined __PIC__
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+ register unsigned int resultvar; \
+@@ -384,6 +384,18 @@
+ : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
+ ASMFMT_##nr(args) : "memory", "cc"); \
+ (int) resultvar; })
++# define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
++ ({ \
++ register unsigned int resultvar; \
++ EXTRAVAR_##nr \
++ asm volatile ( \
++ LOADARGS_NOSYSENTER_##nr \
++ "movl %1, %%eax\n\t" \
++ "int $0x80\n\t" \
++ RESTOREARGS_NOSYSENTER_##nr \
++ : "=a" (resultvar) \
++ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
++ (int) resultvar; })
+ # else
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+@@ -447,12 +459,20 @@
+
+ #define LOADARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k3, %k3\n\t"
+ # define LOADARGS_5 \
+ "movl %%ebx, %4\n\t" \
+ "movl %3, %%ebx\n\t"
++# define LOADARGS_NOSYSENTER_1 \
++ "bpushl .L__X'%k2, %k2\n\t"
++# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1
++# define LOADARGS_NOSYSENTER_3 LOADARGS_3
++# define LOADARGS_NOSYSENTER_4 LOADARGS_3
++# define LOADARGS_NOSYSENTER_5 \
++ "movl %%ebx, %3\n\t" \
++ "movl %2, %%ebx\n\t"
+ # else
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k2, %k2\n\t"
+@@ -474,11 +495,18 @@
+
+ #define RESTOREARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k3, %k3\n\t"
+ # define RESTOREARGS_5 \
+ "movl %4, %%ebx"
++# define RESTOREARGS_NOSYSENTER_1 \
++ "bpopl .L__X'%k2, %k2\n\t"
++# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1
++# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_5 \
++ "movl %3, %%ebx"
+ # else
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k2, %k2\n\t"
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch
new file mode 100644
index 0000000..a1c9eef
--- /dev/null
+++ b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-ssp-compat.patch
@@ -0,0 +1,168 @@
+Add backwards compat support for gcc-3.x ssp ... older ssp versions
+used __guard and __stack_smash_handler symbols while gcc-4.1 and newer
+uses __stack_chk_guard and __stack_chk_fail.
+
+--- config.h.in
++++ config.h.in
+@@ -42,6 +42,9 @@
+ assembler instructions per line. Default is `;' */
+ #undef ASM_LINE_SEP
+
++/* Define if we want to enable support for old ssp symbols */
++#undef ENABLE_OLD_SSP_COMPAT
++
+ /* Define if not using ELF, but `.init' and `.fini' sections are available. */
+ #undef HAVE_INITFINI
+
+--- configure
++++ configure
+@@ -1378,6 +1378,9 @@ Optional Features:
+ --enable-kernel=VERSION compile for compatibility with kernel not older than
+ VERSION
+ --enable-all-warnings enable all useful warnings gcc can issue
++ --disable-old-ssp-compat
++ enable support for older ssp symbols
++ [default=no]
+ --enable-multi-arch enable single DSO with optimizations for multiple
+ architectures
+ --enable-experimental-malloc
+@@ -6462,6 +6465,20 @@ fi
+ $as_echo "$libc_cv_ssp" >&6; }
+
+
++# Check whether --enable-old-ssp-compat or --disable-old-ssp-compat was given.
++if test "${enable_old_ssp_compat+set}" = set; then
++ enableval="$enable_old_ssp_compat"
++ enable_old_ssp_compat=$enableval
++else
++ enable_old_ssp_compat=no
++fi;
++if test "x$enable_old_ssp_compat" = "xyes"; then
++ cat >>confdefs.h <<\_ACEOF
++#define ENABLE_OLD_SSP_COMPAT 1
++_ACEOF
++
++fi
++
+ { $as_echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5
+ $as_echo_n "checking for -fgnu89-inline... " >&6; }
+ if test "${libc_cv_gnu89_inline+set}" = set; then
+--- configure.in
++++ configure.in
+@@ -1641,6 +1641,15 @@ fi
+ rm -f conftest*])
+ AC_SUBST(libc_cv_ssp)
+
++AC_ARG_ENABLE([old-ssp-compat],
++ AC_HELP_STRING([--enable-old-ssp-compat],
++ [enable support for older ssp symbols @<:@default=no@:>@]),
++ [enable_old_ssp_compat=$enableval],
++ [enable_old_ssp_compat=no])
++if test "x$enable_old_ssp_compat" = "xyes"; then
++ AC_DEFINE(ENABLE_OLD_SSP_COMPAT)
++fi
++
+ AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
+ cat > conftest.c <<EOF
+ int foo;
+--- csu/libc-start.c
++++ csu/libc-start.c
+@@ -37,6 +37,9 @@ extern void __pthread_initialize_minimal
+ uintptr_t __stack_chk_guard attribute_relro;
+ # endif
+ #endif
++#ifdef ENABLE_OLD_SSP_COMPAT
++uintptr_t __guard attribute_relro;
++#endif
+
+ #ifdef HAVE_PTR_NTHREADS
+ /* We need atomic operations. */
+@@ -141,6 +145,9 @@ LIBC_START_MAIN (int (*main) (int, char
+
+ /* Set up the stack checker's canary. */
+ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
++#ifdef ENABLE_OLD_SSP_COMPAT
++ __guard = stack_chk_guard;
++#endif
+ # ifdef THREAD_SET_STACK_GUARD
+ THREAD_SET_STACK_GUARD (stack_chk_guard);
+ # else
+--- csu/Versions
++++ csu/Versions
+@@ -17,6 +17,12 @@ libc {
+ # New special glibc functions.
+ gnu_get_libc_release; gnu_get_libc_version;
+ }
++ GLIBC_2.3.2 {
++%ifdef ENABLE_OLD_SSP_COMPAT
++ # global objects and functions for the old propolice patch in gcc
++ __guard;
++%endif
++ }
+ GLIBC_PRIVATE {
+ %if HAVE___THREAD
+ # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
+--- debug/Versions
++++ debug/Versions
+@@ -10,6 +10,12 @@ libc {
+ # These are to support some gcc features.
+ __cyg_profile_func_enter; __cyg_profile_func_exit;
+ }
++%ifdef ENABLE_OLD_SSP_COMPAT
++ GLIBC_2.3.2 {
++ # backwards ssp compat support; alias to __stack_chk_fail
++ __stack_smash_handler;
++ }
++%endif
+ GLIBC_2.3.4 {
+ __chk_fail;
+ __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk; __stpcpy_chk;
+--- elf/rtld.c
++++ elf/rtld.c
+@@ -89,6 +89,9 @@ INTDEF(_dl_argv)
+ in thread local area. */
+ uintptr_t __stack_chk_guard attribute_relro;
+ #endif
++#ifdef ENABLE_OLD_SSP_COMPAT
++uintptr_t __guard attribute_relro;
++#endif
+
+ /* Only exported for architectures that don't store the pointer guard
+ value in thread local area. */
+@@ -1817,6 +1821,9 @@ ERROR: ld.so: object '%s' cannot be load
+
+ /* Set up the stack checker's canary. */
+ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
++#ifdef ENABLE_OLD_SSP_COMPAT
++ __guard = stack_chk_guard;
++#endif
+ #ifdef THREAD_SET_STACK_GUARD
+ THREAD_SET_STACK_GUARD (stack_chk_guard);
+ #else
+--- elf/Versions
++++ elf/Versions
+@@ -43,6 +43,12 @@ ld {
+ # runtime interface to TLS
+ __tls_get_addr;
+ }
++%ifdef ENABLE_OLD_SSP_COMPAT
++ GLIBC_2.3.2 {
++ # backwards ssp compat support
++ __guard;
++ }
++%endif
+ GLIBC_2.4 {
+ # stack canary
+ __stack_chk_guard;
+--- Versions.def
++++ Versions.def
+@@ -109,6 +109,9 @@ ld {
+ GLIBC_2.0
+ GLIBC_2.1
+ GLIBC_2.3
++%ifdef ENABLE_OLD_SSP_COMPAT
++ GLIBC_2.3.2
++%endif
+ GLIBC_2.4
+ GLIBC_PRIVATE
+ }
diff --git a/sys-libs/glibc/files/eblits/src_compile.eblit b/sys-libs/glibc/files/eblits/src_compile.eblit
index 286c29b..9fe9dc9 100644
--- a/sys-libs/glibc/files/eblits/src_compile.eblit
+++ b/sys-libs/glibc/files/eblits/src_compile.eblit
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_compile.eblit,v 1.7 2009/05/02 02:38:25 halcy0n Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_compile.eblit,v 1.10 2009/11/06 00:33:03 vapier Exp $
glibc_do_configure() {
local myconf
@@ -133,9 +133,14 @@ toolchain-glibc_headers_compile() {
# hopefully they don't affect header geneation, so let's hope for
# the best here ...
export \
+ libc_cv_386_tls=yes \
+ libc_cv_asm_cfi_directives=yes \
+ libc_cv_broken_visibility_attribute=no \
+ libc_cv_gcc___thread=yes \
libc_cv_mlong_double_128=yes \
libc_cv_mlong_double_128ibm=yes \
libc_cv_ppc_machine=yes \
+ libc_cv_visibility_attribute=yes \
libc_cv_z_combreloc=yes \
libc_cv_z_execstack=yes \
libc_cv_z_initfirst=yes \
@@ -177,6 +182,12 @@ toolchain-glibc_headers_compile() {
}
eblit-glibc-src_compile() {
+ if is_crosscompile ; then
+ export \
+ libc_cv_c_cleanup=yes \
+ libc_cv_forced_unwind=yes
+ fi
+
if just_headers ; then
toolchain-glibc_headers_compile
return
diff --git a/sys-libs/glibc/files/eblits/src_install.eblit b/sys-libs/glibc/files/eblits/src_install.eblit
index 0d521f4..55e040a 100644
--- a/sys-libs/glibc/files/eblits/src_install.eblit
+++ b/sys-libs/glibc/files/eblits/src_install.eblit
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.7 2008/12/29 09:22:45 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.8 2009/09/18 15:15:07 flameeyes Exp $
toolchain-glibc_src_install() {
local GBUILDDIR
@@ -173,6 +173,8 @@ toolchain-glibc_src_install() {
doins "${WORKDIR}"/extra/etc/*.conf || die
doinitd "${WORKDIR}"/extra/etc/nscd || die
+ sed -i -e "s:@PIDFILE@:$(strings "${D}"/usr/sbin/nscd | grep nscd.pid):" "${D}"/etc/init.d/nscd
+
dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
# Prevent overwriting of the /etc/localtime symlink. We'll handle the
diff --git a/sys-libs/glibc/files/glibc-mips-fpregdef.h.patch b/sys-libs/glibc/files/glibc-mips-fpregdef.h.patch
deleted file mode 100644
index c5262c3..0000000
--- a/sys-libs/glibc/files/glibc-mips-fpregdef.h.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-===================================================================
-RCS file: /cvs/glibc/ports/sysdeps/mips/sys/fpregdef.h,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- ports/sysdeps/mips/sys/fpregdef.h 2001/07/06 04:56:01 1.2
-+++ ports/sysdeps/mips/sys/fpregdef.h 2009/04/15 20:22:41 1.3
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
-+/* Copyright (C) 1991,92,94,95,96,97,98,2009 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
-@@ -19,19 +19,52 @@
- #ifndef _SYS_FPREGDEF_H
- #define _SYS_FPREGDEF_H
-
--/*
-- * These definitions only cover the R3000-ish 16/32 register model.
-- * But we're trying to be R3000 friendly anyway ...
-- */
--#define fv0 $f0 /* return value */
--#define fv0f $f1
-+#include <sgidefs.h>
-+
-+/* Commonalities first, individualities next... */
-+
-+#define fv0 $f0 /* return value */
- #define fv1 $f2
-+
-+#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32
-+#define fs0 $f20 /* callee saved */
-+#define fs1 $f22
-+#define fs2 $f24
-+#define fs3 $f26
-+#define fs4 $f28
-+#define fs5 $f30
-+#endif /* _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32 */
-+
-+#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32
-+#define fa0 $f12 /* argument registers */
-+#define fa1 $f13
-+#define fa2 $f14
-+#define fa3 $f15
-+#define fa4 $f16
-+#define fa5 $f17
-+#define fa6 $f18
-+#define fa7 $f19
-+
-+#define ft0 $f4 /* caller saved */
-+#define ft1 $f5
-+#define ft2 $f6
-+#define ft3 $f7
-+#define ft4 $f8
-+#define ft5 $f9
-+#define ft6 $f10
-+#define ft7 $f11
-+#endif /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */
-+
-+#if _MIPS_SIM == _ABIO32
-+#define fv0f $f1 /* return value, high part */
- #define fv1f $f3
--#define fa0 $f12 /* argument registers */
-+
-+#define fa0 $f12 /* argument registers */
- #define fa0f $f13
- #define fa1 $f14
- #define fa1f $f15
--#define ft0 $f4 /* caller saved */
-+
-+#define ft0 $f4 /* caller saved */
- #define ft0f $f5
- #define ft1 $f6
- #define ft1f $f7
-@@ -43,19 +76,44 @@
- #define ft4f $f17
- #define ft5 $f18
- #define ft5f $f19
--#define fs0 $f20 /* callee saved */
--#define fs0f $f21
--#define fs1 $f22
-+
-+#define fs0f $f21 /* callee saved, high part */
- #define fs1f $f23
--#define fs2 $f24
- #define fs2f $f25
--#define fs3 $f26
- #define fs3f $f27
--#define fs4 $f28
- #define fs4f $f29
--#define fs5 $f30
- #define fs5f $f31
-+#endif /* _MIPS_SIM == _ABIO32 */
-+
-+#if _MIPS_SIM == _ABI64
-+#define ft8 $f20 /* caller saved */
-+#define ft9 $f21
-+#define ft10 $f22
-+#define ft11 $f23
-+#define ft12 $f1
-+#define ft13 $f3
-+
-+#define fs0 $f24 /* callee saved */
-+#define fs1 $f25
-+#define fs2 $f26
-+#define fs3 $f27
-+#define fs4 $f28
-+#define fs5 $f29
-+#define fs6 $f30
-+#define fs7 $f31
-+#endif /* _MIPS_SIM == _ABI64 */
-+
-+#if _MIPS_SIM == _ABIN32
-+#define ft8 $f21 /* caller saved */
-+#define ft9 $f23
-+#define ft10 $f25
-+#define ft11 $f27
-+#define ft12 $f29
-+#define ft13 $f31
-+#define ft14 $f1
-+#define ft15 $f3
-+#endif /* _MIPS_SIM == _ABIN32 */
-
--#define fcr31 $31 /* FPU status register */
-+#define fcr31 $31 /* FPU status register */
-
- #endif /* sys/fpregdef.h */
diff --git a/sys-libs/glibc/files/glibc-mips-getcontext.patch b/sys-libs/glibc/files/glibc-mips-getcontext.patch
deleted file mode 100644
index 72520a7..0000000
--- a/sys-libs/glibc/files/glibc-mips-getcontext.patch
+++ /dev/null
@@ -1,878 +0,0 @@
-/cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/getcontext.S,v --> standard output
-revision 1.1
---- ports/sysdeps/unix/sysv/linux/mips/getcontext.S
-+++ ports/sysdeps/unix/sysv/linux/mips/getcontext.S 2009-04-23 05:41:04.660077000 +0000
-@@ -0,0 +1,149 @@
-+/* Save current context.
-+ Copyright (C) 2009 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
-+
-+ 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, 51 Franklin Street - Fifth Floor, Boston, MA
-+ 02110-1301, USA. */
-+
-+#include <sysdep.h>
-+#include <sys/asm.h>
-+#include <sys/fpregdef.h>
-+#include <sys/regdef.h>
-+
-+#include "ucontext_i.h"
-+
-+/* int getcontext (ucontext_t *ucp) */
-+
-+ .text
-+LOCALSZ = 0
-+MASK = 0x00000000
-+#ifdef __PIC__
-+LOCALSZ = 1 /* save gp */
-+# if _MIPS_SIM != _ABIO32
-+MASK = 0x10000000
-+# endif
-+#endif
-+FRAMESZ = ((LOCALSZ * SZREG) + ALSZ) & ALMASK
-+GPOFF = FRAMESZ - (1 * SZREG)
-+
-+NESTED (__getcontext, FRAMESZ, ra)
-+ .mask MASK, 0
-+ .fmask 0x00000000, 0
-+
-+#ifdef __PIC__
-+ SETUP_GP
-+
-+ move a2, sp
-+# define _SP a2
-+
-+# if _MIPS_SIM != _ABIO32
-+ move a3, gp
-+# define _GP a3
-+# endif
-+
-+ PTR_ADDIU sp, -FRAMESZ
-+ SETUP_GP64 (GPOFF, __getcontext)
-+ SAVE_GP (GPOFF)
-+
-+#else /* ! __PIC__ */
-+# define _SP sp
-+# define _GP gp
-+
-+#endif /* ! __PIC__ */
-+
-+#ifdef PROF
-+ .set noat
-+ move AT, ra
-+ jal _mcount
-+ .set at
-+#endif
-+
-+ /* Store a magic flag. */
-+ li v1, 1
-+ REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
-+
-+ REG_S s0, (16 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s1, (17 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s2, (18 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s3, (19 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s4, (20 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s5, (21 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s6, (22 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s7, (23 * SZREG + MCONTEXT_GREGS)(a0)
-+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
-+ REG_S _GP, (28 * SZREG + MCONTEXT_GREGS)(a0)
-+#endif
-+ REG_S _SP, (29 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S fp, (30 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S ra, (31 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S ra, MCONTEXT_PC(a0)
-+
-+#ifdef __mips_hard_float
-+# if _MIPS_SIM == _ABI64
-+ s.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(a0)
-+
-+# else /* _MIPS_SIM != _ABI64 */
-+ s.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(a0)
-+
-+# endif /* _MIPS_SIM != _ABI64 */
-+
-+ cfc1 v1, fcr31
-+ sw v1, MCONTEXT_FPC_CSR(a0)
-+#endif /* __mips_hard_float */
-+
-+/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
-+ li a3, _NSIG8
-+ PTR_ADDU a2, a0, UCONTEXT_SIGMASK
-+ move a1, zero
-+ li a0, SIG_BLOCK
-+
-+ li v0, SYS_ify (rt_sigprocmask)
-+ syscall
-+ bnez a3, 99f
-+
-+#ifdef __PIC__
-+ RESTORE_GP64
-+ PTR_ADDIU sp, FRAMESZ
-+#endif
-+ move v0, zero
-+ jr ra
-+
-+99:
-+#ifdef __PIC__
-+ PTR_LA t9, JUMPTARGET (__syscall_error)
-+ RESTORE_GP64
-+ PTR_ADDIU sp, FRAMESZ
-+ jr t9
-+
-+#else /* ! __PIC__ */
-+
-+ j JUMPTARGET (__syscall_error)
-+#endif /* ! __PIC__ */
-+PSEUDO_END (__getcontext)
-+
-+weak_alias (__getcontext, getcontext)
-/cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h,v --> standard output
-revision 1.1
---- ports/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h
-+++ ports/sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h 2009-04-23 05:41:05.604193000 +0000
-@@ -0,0 +1,10 @@
-+/* Linux kernel RT signal frame. */
-+typedef struct kernel_rt_sigframe
-+ {
-+ uint32_t rs_ass[4];
-+ uint32_t rs_code[2];
-+ struct siginfo rs_info;
-+ struct ucontext rs_uc;
-+ uint32_t rs_altcode[8] __attribute__ ((__aligned__ (1 << 7)));
-+ }
-+kernel_rt_sigframe_t;
-/cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/makecontext.S,v --> standard output
-revision 1.1
---- ports/sysdeps/unix/sysv/linux/mips/makecontext.S
-+++ ports/sysdeps/unix/sysv/linux/mips/makecontext.S 2009-04-23 05:41:06.433532000 +0000
-@@ -0,0 +1,189 @@
-+/* Modify saved context.
-+ Copyright (C) 2009 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
-+
-+ 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, 51 Franklin Street - Fifth Floor, Boston, MA
-+ 02110-1301, USA. */
-+
-+#include <sysdep.h>
-+#include <sys/asm.h>
-+#include <sys/fpregdef.h>
-+#include <sys/regdef.h>
-+
-+#include "ucontext_i.h"
-+
-+/* int makecontext (ucontext_t *ucp, (void *func) (), int argc, ...) */
-+
-+ .text
-+LOCALSZ = 0
-+ARGSZ = 0
-+MASK = 0x00000000
-+#ifdef __PIC__
-+LOCALSZ = 1 /* save gp */
-+#endif
-+#if _MIPS_SIM != _ABIO32
-+ARGSZ = 5 /* save a3-a7 */
-+# ifdef __PIC__
-+MASK = 0x10000000
-+# endif
-+#endif
-+FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK
-+GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG)
-+#if _MIPS_SIM != _ABIO32
-+A3OFF = FRAMESZ - (5 * SZREG) /* callee-allocated */
-+A4OFF = FRAMESZ - (4 * SZREG)
-+A5OFF = FRAMESZ - (3 * SZREG)
-+A6OFF = FRAMESZ - (2 * SZREG)
-+A7OFF = FRAMESZ - (1 * SZREG)
-+NARGREGS = 8
-+#else
-+A3OFF = FRAMESZ + (3 * SZREG) /* caller-allocated */
-+NARGREGS = 4
-+#endif
-+
-+NESTED (__makecontext, FRAMESZ, ra)
-+ .mask MASK, -(ARGSZ * SZREG)
-+ .fmask 0x00000000, 0
-+
-+98:
-+#ifdef __PIC__
-+ SETUP_GP
-+#endif
-+
-+ PTR_ADDIU sp, -FRAMESZ
-+
-+#ifdef __PIC__
-+ SETUP_GP64 (GPOFF, __makecontext)
-+ SAVE_GP (GPOFF)
-+#endif
-+
-+#ifdef PROF
-+ .set noat
-+ move AT, ra
-+ jal _mcount
-+ .set at
-+#endif
-+
-+ /* Store args to be passed. */
-+ REG_S a3, A3OFF(sp)
-+#if _MIPS_SIM != _ABIO32
-+ REG_S a4, A4OFF(sp)
-+ REG_S a5, A5OFF(sp)
-+ REG_S a6, A6OFF(sp)
-+ REG_S a7, A7OFF(sp)
-+#endif
-+
-+ /* Store a magic flag. */
-+ li v1, 1
-+ REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
-+
-+ /* Set up the stack. */
-+ PTR_L t0, STACK_SP(a0)
-+ PTR_L t2, STACK_SIZE(a0)
-+ PTR_ADDIU t1, sp, A3OFF
-+ PTR_ADDU t0, t2
-+ and t0, ALMASK
-+ blez a2, 2f /* no arguments */
-+
-+ /* Store register arguments. */
-+ PTR_ADDIU t2, a0, MCONTEXT_GREGS + 4 * SZREG
-+ move t3, zero
-+0:
-+ addiu t3, 1
-+ REG_L v1, (t1)
-+ PTR_ADDIU t1, SZREG
-+ REG_S v1, (t2)
-+ PTR_ADDIU t2, SZREG
-+ bgeu t3, a2, 2f /* all done */
-+ bltu t3, NARGREGS, 0b /* next */
-+
-+ /* Make room for stack arguments. */
-+ PTR_SUBU t2, a2, t3
-+ PTR_SLL t2, 3
-+ PTR_SUBU t0, t2
-+ and t0, ALMASK
-+
-+ /* Store stack arguments. */
-+ move t2, t0
-+1:
-+ addiu t3, 1
-+ REG_L v1, (t1)
-+ PTR_ADDIU t1, SZREG
-+ REG_S v1, (t2)
-+ PTR_ADDIU t2, SZREG
-+ bltu t3, a2, 1b /* next */
-+
-+2:
-+#if _MIPS_SIM == _ABIO32
-+ /* Make room for a0-a3 storage. */
-+ PTR_ADDIU t0, -(NARGSAVE * SZREG)
-+#endif
-+ PTR_L v1, UCONTEXT_LINK(a0)
-+#ifdef __PIC__
-+ PTR_ADDIU t9, 99f - 98b
-+#else
-+ PTR_LA t9, 99f
-+#endif
-+ REG_S t0, (29 * SZREG + MCONTEXT_GREGS)(a0) /* sp */
-+ REG_S v1, (16 * SZREG + MCONTEXT_GREGS)(a0) /* s0 */
-+#ifdef __PIC__
-+ REG_S gp, (17 * SZREG + MCONTEXT_GREGS)(a0) /* s1 */
-+#endif
-+ REG_S t9, (31 * SZREG + MCONTEXT_GREGS)(a0) /* ra */
-+ REG_S a1, MCONTEXT_PC(a0)
-+
-+#ifdef __PIC__
-+ RESTORE_GP64
-+ PTR_ADDIU sp, FRAMESZ
-+#endif
-+ jr ra
-+
-+99:
-+#ifdef __PIC__
-+ move gp, s1
-+#endif
-+ move a0, zero
-+ beqz s0, 0f
-+
-+ /* setcontext (ucp) */
-+ move a0, s0
-+#ifdef __PIC__
-+ PTR_LA t9, JUMPTARGET (__setcontext)
-+ jalr t9
-+# if _MIPS_SIM == _ABIO32
-+ move gp, s1
-+# endif
-+#else
-+ jal JUMPTARGET (__setcontext)
-+#endif
-+ move a0, v0
-+
-+0:
-+ /* exit (a0) */
-+#ifdef __PIC__
-+ PTR_LA t9, HIDDEN_JUMPTARGET (exit)
-+ jalr t9
-+#else
-+ jal HIDDEN_JUMPTARGET (exit)
-+#endif
-+
-+ /* You don't exist, you won't feel anything. */
-+1:
-+ lb zero, (zero)
-+ b 1b
-+PSEUDO_END (__makecontext)
-+
-+weak_alias (__makecontext, makecontext)
-===================================================================
-RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/Makefile,v
-retrieving revision 1.16
-retrieving revision 1.17
-diff -u -r1.16 -r1.17
---- ports/sysdeps/unix/sysv/linux/mips/Makefile 2009/01/27 15:32:55 1.16
-+++ ports/sysdeps/unix/sysv/linux/mips/Makefile 2009/04/18 17:32:04 1.17
-@@ -135,3 +135,7 @@
- sysdep-rtld-routines += dl-static
- endif
- endif
-+
-+ifeq ($(subdir),stdlib)
-+gen-as-const-headers += ucontext_i.sym
-+endif
-/cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/setcontext.S,v --> standard output
-revision 1.1
---- ports/sysdeps/unix/sysv/linux/mips/setcontext.S
-+++ ports/sysdeps/unix/sysv/linux/mips/setcontext.S 2009-04-23 05:41:07.124333000 +0000
-@@ -0,0 +1,192 @@
-+/* Set current context.
-+ Copyright (C) 2009 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
-+
-+ 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, 51 Franklin Street - Fifth Floor, Boston, MA
-+ 02110-1301, USA. */
-+
-+#include <sysdep.h>
-+#include <sys/asm.h>
-+#include <sys/fpregdef.h>
-+#include <sys/regdef.h>
-+
-+#include "ucontext_i.h"
-+
-+/* int setcontext (const ucontext_t *ucp) */
-+
-+ .text
-+LOCALSZ = 0
-+ARGSZ = 0
-+MASK = 0x00000000
-+#ifdef __PIC__
-+LOCALSZ = 1 /* save gp */
-+#endif
-+#if _MIPS_SIM != _ABIO32
-+ARGSZ = 1 /* save a0 */
-+# ifdef __PIC__
-+MASK = 0x10000000
-+# endif
-+#endif
-+FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK
-+GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG)
-+#if _MIPS_SIM != _ABIO32
-+A0OFF = FRAMESZ - (1 * SZREG) /* callee-allocated */
-+#else
-+A0OFF = FRAMESZ + (0 * SZREG) /* caller-allocated */
-+#endif
-+
-+NESTED (__setcontext, FRAMESZ, ra)
-+ .mask MASK, -(ARGSZ * SZREG)
-+ .fmask 0x00000000, 0
-+
-+#ifdef __PIC__
-+ SETUP_GP
-+#endif
-+
-+ PTR_ADDIU sp, -FRAMESZ
-+
-+#ifdef __PIC__
-+ SETUP_GP64 (GPOFF, __setcontext)
-+ SAVE_GP (GPOFF)
-+#endif
-+
-+#ifdef PROF
-+ .set noat
-+ move AT, ra
-+ jal _mcount
-+ .set at
-+#endif
-+
-+ /* Check for the magic flag. */
-+ li v0, 1
-+ REG_L v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
-+ bne v0, v1, 98f
-+
-+ REG_S a0, A0OFF(sp)
-+
-+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
-+ li a3, _NSIG8
-+ move a2, zero
-+ PTR_ADDU a1, a0, UCONTEXT_SIGMASK
-+ li a0, SIG_SETMASK
-+
-+ li v0, SYS_ify (rt_sigprocmask)
-+ syscall
-+ bnez a3, 99f
-+
-+ REG_L v0, A0OFF(sp)
-+
-+#ifdef __mips_hard_float
-+# if _MIPS_SIM == _ABI64
-+ l.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(v0)
-+
-+# else /* _MIPS_SIM != _ABI64 */
-+ l.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(v0)
-+
-+# endif /* _MIPS_SIM != _ABI64 */
-+
-+ lw v1, MCONTEXT_FPC_CSR(v0)
-+ ctc1 v1, fcr31
-+#endif /* __mips_hard_float */
-+
-+ /* Note the contents of argument registers will be random
-+ unless makecontext() has been called. */
-+ REG_L a0, (4 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a1, (5 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a2, (6 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a3, (7 * SZREG + MCONTEXT_GREGS)(v0)
-+#if _MIPS_SIM != _ABIO32
-+ REG_L a4, (8 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a5, (9 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a6, (10 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a7, (11 * SZREG + MCONTEXT_GREGS)(v0)
-+#endif
-+
-+ REG_L s0, (16 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s1, (17 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s2, (18 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s3, (19 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s4, (20 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s5, (21 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s6, (22 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s7, (23 * SZREG + MCONTEXT_GREGS)(v0)
-+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
-+ REG_L gp, (28 * SZREG + MCONTEXT_GREGS)(v0)
-+#endif
-+ REG_L sp, (29 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L fp, (30 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L ra, (31 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L t9, MCONTEXT_PC(v0)
-+
-+ move v0, zero
-+ jr t9
-+
-+98:
-+ /* This is a context obtained from a signal handler.
-+ Perform a full restore by pushing the context
-+ passed onto a simulated signal frame on the stack
-+ and call the signal return syscall as if a signal
-+ handler exited normally. */
-+ PTR_ADDIU sp, -((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
-+
-+ /* Only ucontext is referred to from rt_sigreturn,
-+ copy it. */
-+ PTR_ADDIU t1, sp, RT_SIGFRAME_UCONTEXT
-+ li t3, ((UCONTEXT_SIZE + SZREG - 1) / SZREG) - 1
-+0:
-+ REG_L t2, (a0)
-+ PTR_ADDIU a0, SZREG
-+ REG_S t2, (t1)
-+ PTR_ADDIU t1, SZREG
-+ .set noreorder
-+ bgtz t3, 0b
-+ addiu t3, -1
-+ .set reorder
-+
-+/* rt_sigreturn () -- no arguments, sp points to struct rt_sigframe. */
-+ li v0, SYS_ify (rt_sigreturn)
-+ syscall
-+
-+ /* Restore the stack and fall through to the error
-+ path. Successful rt_sigreturn never returns to
-+ its calling place. */
-+ PTR_ADDIU sp, ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
-+99:
-+#ifdef __PIC__
-+ PTR_LA t9, JUMPTARGET (__syscall_error)
-+ RESTORE_GP64
-+ PTR_ADDIU sp, FRAMESZ
-+ jr t9
-+
-+#else /* ! __PIC__ */
-+
-+ j JUMPTARGET (__syscall_error)
-+#endif /* ! __PIC__ */
-+PSEUDO_END (__setcontext)
-+
-+weak_alias (__setcontext, setcontext)
-/cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/swapcontext.S,v --> standard output
-revision 1.1
---- ports/sysdeps/unix/sysv/linux/mips/swapcontext.S
-+++ ports/sysdeps/unix/sysv/linux/mips/swapcontext.S 2009-04-23 05:41:07.842719000 +0000
-@@ -0,0 +1,212 @@
-+/* Save and set current context.
-+ Copyright (C) 2009 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Maciej W. Rozycki <macro@codesourcery.com>.
-+
-+ 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, 51 Franklin Street - Fifth Floor, Boston, MA
-+ 02110-1301, USA. */
-+
-+#include <sysdep.h>
-+#include <sys/asm.h>
-+#include <sys/fpregdef.h>
-+#include <sys/regdef.h>
-+
-+#include "ucontext_i.h"
-+
-+/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
-+
-+ .text
-+LOCALSZ = 0
-+ARGSZ = 0
-+MASK = 0x00000000
-+#ifdef __PIC__
-+LOCALSZ = 1 /* save gp */
-+#endif
-+#if _MIPS_SIM != _ABIO32
-+ARGSZ = 1 /* save a1 */
-+# ifdef __PIC__
-+MASK = 0x10000000
-+# endif
-+#endif
-+FRAMESZ = (((ARGSZ + LOCALSZ) * SZREG) + ALSZ) & ALMASK
-+GPOFF = FRAMESZ - ((ARGSZ + 1) * SZREG)
-+#if _MIPS_SIM != _ABIO32
-+A1OFF = FRAMESZ - (1 * SZREG) /* callee-allocated */
-+#else
-+A1OFF = FRAMESZ + (1 * SZREG) /* caller-allocated */
-+#endif
-+
-+NESTED (__swapcontext, FRAMESZ, ra)
-+ .mask MASK, -(ARGSZ * SZREG)
-+ .fmask 0x00000000, 0
-+
-+#ifdef __PIC__
-+ SETUP_GP
-+
-+ move a2, sp
-+# define _SP a2
-+
-+# if _MIPS_SIM != _ABIO32
-+ move a3, gp
-+# define _GP a3
-+# endif
-+
-+ PTR_ADDIU sp, -FRAMESZ
-+ SETUP_GP64 (GPOFF, __swapcontext)
-+ SAVE_GP (GPOFF)
-+
-+#else /* ! __PIC__ */
-+# define _SP sp
-+# define _GP gp
-+
-+#endif /* ! __PIC__ */
-+
-+#ifdef PROF
-+ .set noat
-+ move AT, ra
-+ jal _mcount
-+ .set at
-+#endif
-+
-+ /* Store a magic flag. */
-+ li v1, 1
-+ REG_S v1, (0 * SZREG + MCONTEXT_GREGS)(a0) /* zero */
-+
-+ REG_S s0, (16 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s1, (17 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s2, (18 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s3, (19 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s4, (20 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s5, (21 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s6, (22 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S s7, (23 * SZREG + MCONTEXT_GREGS)(a0)
-+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
-+ REG_S _GP, (28 * SZREG + MCONTEXT_GREGS)(a0)
-+#endif
-+ REG_S _SP, (29 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S fp, (30 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S ra, (31 * SZREG + MCONTEXT_GREGS)(a0)
-+ REG_S ra, MCONTEXT_PC(a0)
-+
-+#ifdef __mips_hard_float
-+# if _MIPS_SIM == _ABI64
-+ s.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(a0)
-+
-+# else /* _MIPS_SIM != _ABI64 */
-+ s.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(a0)
-+ s.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(a0)
-+
-+# endif /* _MIPS_SIM != _ABI64 */
-+
-+ cfc1 v1, fcr31
-+ sw v1, MCONTEXT_FPC_CSR(a0)
-+#endif /* __mips_hard_float */
-+
-+ REG_S a1, A1OFF(sp)
-+
-+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8) */
-+ li a3, _NSIG8
-+ PTR_ADDU a2, a0, UCONTEXT_SIGMASK
-+ PTR_ADDU a1, a1, UCONTEXT_SIGMASK
-+ li a0, SIG_SETMASK
-+
-+ li v0, SYS_ify (rt_sigprocmask)
-+ syscall
-+ bnez a3, 99f
-+
-+ REG_L v0, A1OFF(sp)
-+
-+#ifdef __mips_hard_float
-+# if _MIPS_SIM == _ABI64
-+ l.d fs0, (24 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs1, (25 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs2, (26 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs3, (27 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs5, (29 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs6, (30 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs7, (31 * SZREG + MCONTEXT_FPREGS)(v0)
-+
-+# else /* _MIPS_SIM != _ABI64 */
-+ l.d fs0, (20 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs1, (22 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs2, (24 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs3, (26 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs4, (28 * SZREG + MCONTEXT_FPREGS)(v0)
-+ l.d fs5, (30 * SZREG + MCONTEXT_FPREGS)(v0)
-+
-+# endif /* _MIPS_SIM != _ABI64 */
-+
-+ lw v1, MCONTEXT_FPC_CSR(v0)
-+ ctc1 v1, fcr31
-+#endif /* __mips_hard_float */
-+
-+ /* Note the contents of argument registers will be random
-+ unless makecontext() has been called. */
-+ REG_L a0, (4 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a1, (5 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a2, (6 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a3, (7 * SZREG + MCONTEXT_GREGS)(v0)
-+#if _MIPS_SIM != _ABIO32
-+ REG_L a4, (8 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a5, (9 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a6, (10 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L a7, (11 * SZREG + MCONTEXT_GREGS)(v0)
-+#endif
-+
-+ REG_L s0, (16 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s1, (17 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s2, (18 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s3, (19 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s4, (20 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s5, (21 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s6, (22 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L s7, (23 * SZREG + MCONTEXT_GREGS)(v0)
-+#if ! defined (__PIC__) || _MIPS_SIM != _ABIO32
-+ REG_L gp, (28 * SZREG + MCONTEXT_GREGS)(v0)
-+#endif
-+ REG_L sp, (29 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L fp, (30 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L ra, (31 * SZREG + MCONTEXT_GREGS)(v0)
-+ REG_L t9, MCONTEXT_PC(v0)
-+
-+ move v0, zero
-+ jr t9
-+
-+99:
-+#ifdef __PIC__
-+ PTR_LA t9, JUMPTARGET (__syscall_error)
-+ RESTORE_GP64
-+ PTR_ADDIU sp, FRAMESZ
-+ jr t9
-+
-+#else /* ! __PIC__ */
-+
-+ j JUMPTARGET (__syscall_error)
-+#endif /* ! __PIC__ */
-+PSEUDO_END (__swapcontext)
-+
-+weak_alias (__swapcontext, swapcontext)
-===================================================================
-RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/sys/ucontext.h,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- ports/sysdeps/unix/sysv/linux/mips/sys/ucontext.h 2006/05/10 18:57:03 1.11
-+++ ports/sysdeps/unix/sysv/linux/mips/sys/ucontext.h 2009/04/18 17:32:04 1.12
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006 Free Software
-+/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006, 2009 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
-@@ -56,12 +56,9 @@
- #if _MIPS_SIM == _ABIO32
- /* Earlier versions of glibc for mips had an entirely different
- definition of mcontext_t, that didn't even resemble the
-- corresponding kernel data structure. Since all legitimate uses of
-- ucontext_t in glibc mustn't have accessed anything beyond
-- uc_mcontext and, even then, taking a pointer to it, casting it to
-- sigcontext_t, and accessing it as such, which is what it has always
-- been, this can still be rectified. Fortunately, makecontext,
-- [gs]etcontext et all have never been implemented. */
-+ corresponding kernel data structure. Fortunately, makecontext,
-+ [gs]etcontext et all were not implemented back then, so this can
-+ still be rectified. */
- typedef struct
- {
- unsigned int regmask;
-/cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/ucontext_i.sym,v --> standard output
-revision 1.1
---- ports/sysdeps/unix/sysv/linux/mips/ucontext_i.sym
-+++ ports/sysdeps/unix/sysv/linux/mips/ucontext_i.sym 2009-04-23 05:41:08.426595000 +0000
-@@ -0,0 +1,52 @@
-+#include <inttypes.h>
-+#include <signal.h>
-+#include <stddef.h>
-+#include <sys/ucontext.h>
-+
-+#include <kernel_rt_sigframe.h>
-+
-+-- Constants used by the rt_sigprocmask call.
-+
-+SIG_BLOCK
-+SIG_SETMASK
-+
-+_NSIG8 (_NSIG / 8)
-+
-+-- Offsets of the fields in the kernel rt_sigframe_t structure.
-+#define rt_sigframe(member) offsetof (kernel_rt_sigframe_t, member)
-+
-+RT_SIGFRAME_UCONTEXT rt_sigframe (rs_uc)
-+
-+RT_SIGFRAME_SIZE sizeof (kernel_rt_sigframe_t)
-+
-+-- Offsets of the fields in the ucontext_t structure.
-+#define ucontext(member) offsetof (ucontext_t, member)
-+#define stack(member) ucontext (uc_stack.member)
-+#define mcontext(member) ucontext (uc_mcontext.member)
-+
-+UCONTEXT_FLAGS ucontext (uc_flags)
-+UCONTEXT_LINK ucontext (uc_link)
-+UCONTEXT_STACK ucontext (uc_stack)
-+UCONTEXT_MCONTEXT ucontext (uc_mcontext)
-+UCONTEXT_SIGMASK ucontext (uc_sigmask)
-+
-+STACK_SP stack (ss_sp)
-+STACK_SIZE stack (ss_size)
-+STACK_FLAGS stack (ss_flags)
-+
-+MCONTEXT_GREGS mcontext (gregs)
-+MCONTEXT_FPREGS mcontext (fpregs)
-+MCONTEXT_MDHI mcontext (mdhi)
-+MCONTEXT_HI1 mcontext (hi1)
-+MCONTEXT_HI2 mcontext (hi2)
-+MCONTEXT_HI3 mcontext (hi3)
-+MCONTEXT_MDLO mcontext (mdlo)
-+MCONTEXT_LO1 mcontext (lo1)
-+MCONTEXT_LO2 mcontext (lo2)
-+MCONTEXT_LO3 mcontext (lo3)
-+MCONTEXT_PC mcontext (pc)
-+MCONTEXT_FPC_CSR mcontext (fpc_csr)
-+MCONTEXT_USED_MATH mcontext (used_math)
-+MCONTEXT_DSP mcontext (dsp)
-+
-+UCONTEXT_SIZE sizeof (ucontext_t)
diff --git a/sys-libs/glibc/glibc-2.10.1.ebuild b/sys-libs/glibc/glibc-2.10.1.ebuild
index f1fef36..a3c2944 100644
--- a/sys-libs/glibc/glibc-2.10.1.ebuild
+++ b/sys-libs/glibc/glibc-2.10.1.ebuild
@@ -1,6 +1,6 @@
# 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.10.1.ebuild,v 1.1 2009/05/18 04:41:59 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.10.1.ebuild,v 1.12 2009/11/06 11:30:55 vapier Exp $
inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
@@ -8,7 +8,7 @@ DESCRIPTION="GNU libc6 (also called glibc2) C library"
HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
LICENSE="LGPL-2"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~alpha ~amd64 ~ia64 s390 ~x86 ~mips"
RESTRICT="strip" # strip ourself #46186
EMULTILIB_PKG="true"
@@ -26,8 +26,8 @@ LIBIDN_VER=${RELEASE_VER}
fi
MANPAGE_VER="" # pregenerated manpages
INFOPAGE_VER="" # pregenerated infopages
-PATCH_VER="1" # Gentoo patchset
-PORTS_VER=${RELEASE_VER} # version of glibc ports addon
+PATCH_VER="4" # Gentoo patchset
+PORTS_VER=${RELEASE_VER} # version of glibc ports addon
LT_VER="" # version of linuxthreads addon
NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
@@ -94,7 +94,8 @@ DEPEND=">=sys-devel/gcc-3.4.4
>=sys-apps/sandbox-1.2.18.1-r2
>=sys-apps/portage-2.1.2
selinux? ( sys-libs/libselinux )"
-RDEPEND="nls? ( sys-devel/gettext )
+RDEPEND="!sys-kernel/ps3-sources
+ nls? ( sys-devel/gettext )
selinux? ( sys-libs/libselinux )"
if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
@@ -124,7 +125,7 @@ SRC_URI=$(
upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
fi
[[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
- [[ -n ${PORTS_VER} ]] && echo http://www.gentoo-cn.org/~zhangle/${TARNAME}-ports-${PORTS_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
@@ -186,12 +187,17 @@ eblit-src_unpack-post() {
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
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
+
+ einfo "Patching Glibc to support older SSP __guard"
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-ssp-compat.patch
- einfo "Installing Hardened Gentoo SSP handler"
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
if use debug ; then
# When using Hardened Gentoo stack handler, have smashes dump core for
@@ -201,6 +207,10 @@ eblit-src_unpack-post() {
-e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
debug/Makefile \
|| die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
fi
# Build nscd with ssp-all
diff --git a/sys-libs/glibc/glibc-2.9_p20090420.ebuild b/sys-libs/glibc/glibc-2.9_p20090420.ebuild
deleted file mode 100644
index af7e4f7..0000000
--- a/sys-libs/glibc/glibc-2.9_p20090420.ebuild
+++ /dev/null
@@ -1,231 +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-r2.ebuild,v 1.6 2009/03/08 20:32:10 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 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="strip" # strip ourself #46186
-EMULTILIB_PKG="true"
-
-# Configuration variables
-if [[ ${PV} == *_p* ]] ; then
-RELEASE_VER=${PV%_p*}
-BRANCH_UPDATE=""
-SNAP_VER=${PV#*_p}
-else
-RELEASE_VER=${PV}
-BRANCH_UPDATE=""
-SNAP_VER=""
-fi
-MANPAGE_VER="" # pregenerated manpages
-INFOPAGE_VER="" # pregenerated infopages
-PATCH_VER="5" # 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} ${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 ftp://sources.redhat.com/pub/glibc/{releases,snapshots}/$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
- [[ $1 == pkg_* ]] && skipable=true
-
- local e v func=$1 ver=$2
- [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
- for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
- e="${FILESDIR}/eblits/${func}${v}.eblit"
- if [[ -e ${e} ]] ; then
- source "${e}"
- return 0
- fi
- done
- ${skipable} && return 0
- die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
-}
-
-# eblit-run-maybe <function>
-# run the specified function if it is defined
-eblit-run-maybe() {
- [[ $(type -t "$@") == "function" ]] && "$@"
-}
-
-# eblit-run <function> [version]
-# aka: src_unpack() { eblit-run src_unpack ; }
-eblit-run() {
- eblit-include --skip common "${*:2}"
- eblit-include "$@"
- eblit-run-maybe eblit-$1-pre
- eblit-${PN}-$1
- eblit-run-maybe eblit-$1-post
-}
-
-src_unpack() { eblit-run src_unpack ; }
-src_compile() { eblit-run src_compile ; }
-src_test() { eblit-run src_test ; }
-src_install() { eblit-run src_install ; }
-
-# FILESDIR might not be available during binpkg install
-for x in setup {pre,post}inst ; do
- e="${FILESDIR}/eblits/pkg_${x}.eblit"
- if [[ -e ${e} ]] ; then
- . "${e}"
- eval "pkg_${x}() { eblit-run pkg_${x} ; }"
- fi
-done
-
-eblit-src_unpack-post() {
- cd "${S}"
- epatch "${FILESDIR}"/glibc-mips-fpregdef.h.patch
- epatch "${FILESDIR}"/glibc-mips-getcontext.patch
- if use hardened ; then
- 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
-}