summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-10-19 14:25:39 -0400
committerMike Frysinger <vapier@gentoo.org>2015-10-19 14:25:39 -0400
commitd9be1c05f0175af34a60d5d9c493677be652d805 (patch)
tree6dacd359a529bc6e356482c89b81649e9e1f5532
parentglibc: drop old-style PROVIDE=virtual/libc (diff)
downloadtoolchain-d9be1c05f0175af34a60d5d9c493677be652d805.tar.gz
toolchain-d9be1c05f0175af34a60d5d9c493677be652d805.tar.bz2
toolchain-d9be1c05f0175af34a60d5d9c493677be652d805.zip
glibc: import 2.1[3456] from main tree
-rw-r--r--sys-libs/glibc/Manifest14
-rw-r--r--sys-libs/glibc/files/2.16/glibc-2.16-hardened-pie.patch39
-rw-r--r--sys-libs/glibc/glibc-2.13-r4.ebuild218
-rw-r--r--sys-libs/glibc/glibc-2.14.1-r3.ebuild246
-rw-r--r--sys-libs/glibc/glibc-2.15-r3.ebuild225
-rw-r--r--sys-libs/glibc/glibc-2.16.0.ebuild223
-rw-r--r--sys-libs/glibc/metadata.xml19
7 files changed, 983 insertions, 1 deletions
diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index 2447207..6129ea1 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -6,8 +6,16 @@ DIST glibc-2.12.1-patches-8.tar.bz2 112063 SHA256 564fe8d9dbf80763c32eca13129ecc
DIST glibc-2.12.1.tar.bz2 15667516 SHA256 759f115c52bc12c5bb453af559dcd456d32138250b7cc96e47804e3d0ec97407 SHA512 e01eaf0c93b20549e159adf7e838458216245c6781d225de908804b275a967712d4f4dfe5b5aefc3e16b75a8593f2aba2f7bc287c89a6c39c9e929cd228766d1 WHIRLPOOL 99061d40d4e1291f3f15c4f25df0a0c7eecf27127a9aeba0c724b636992648b2ff8879b11653081c821f28a82a54dfe4375fc992af1a8de988867965604bbec4
DIST glibc-2.12.2-patches-4.tar.bz2 109270 SHA256 23362824e7ffbcc34c05f82e6f51b30cb502e648efbe7bc6a644cb8384f57330 SHA512 1776dda77964beff33be1a1cb88c410ff6fa4bdb36a1439ee1acb9698dc97c2621b1e44b06632f1b4d34c29dd707d9193e67a54af506e067a219457dcc6b3d04 WHIRLPOOL 7afe99cd94d916dfc993f084ef56d75fbbb1043319b66cecdf621dda263be122c1a0c21962c47235503989a46aba01bd2006fb9fb67ba0aa0c2692aed3be01e1
DIST glibc-2.12.2.tar.bz2 15667759 SHA256 22f8eb3c49b9eb5e88fc249daf8670899adef24eb1f74708fb150a6502fa1216 SHA512 8197ece913e572ce3f7dfa0a33d520418aea2d8b85ccda3100118bca9f650e21fb7a8d14b1b4a5587a252c07e70c6fe85f84605a0be9dec649e92d6028979c40 WHIRLPOOL a2585b83e8ba70dd4fe3a6a47b6b5b86ba92d2dadfd50178d98c7e48ed8d5a906b630e79869b8eed44db7eb333af68d20914e3682cf87035d295d7375120d32d
+DIST glibc-2.13-patches-11.tar.bz2 114949 SHA256 7db753b6ba3f58b77a95d48cf9fd8c54d843ece9b8ecdc01fd9cc787552a6e54 SHA512 ee3f02f12958220b5d97d72dbac0352d97dd225f9538fb8d036ec469c572ec577fb2648bf39f155d823928a01ab37ed8a1540d309b25b8719130d4a9d36447d1 WHIRLPOOL c26acfa64262c130be786bac905775ac0a2b1037b73259d6d4f387d6bcd5c82452e3525e284010fa687a921a8882b17737b87e7f214af546940f41e55f4edf75
+DIST glibc-2.13.tar.bz2 15725729 SHA256 0173c92a0545e6d99a46a4fbed2da00ba26556f5c6198e2f9f1631ed5318dbb2 SHA512 7fdae9acdbe8cbfda008f107ffd1559c0163ff70730a5bc618f1f15b64096a813a3495e0b2d2be7b7206bef3ed9ca67a68fd2004c8275ffeffa38b70c80887e0 WHIRLPOOL cfaeb0831f177926610d2c89bd6bd20735107ac4738ee0485a2d2e14b13c986e68e64c8f9093b89f135c3d7eb94fc2230b9f3837f3841a8bc2bc886ff5415005
DIST glibc-2.14-patches-7.tar.bz2 105702 SHA256 f213848ae57ca7c3bcd0ac87bf04ef638b9c8191a8124394771d758a861bf009 SHA512 ef0c3cfe3b9935ea071fa96084b0fcbaa3865fe12e8c04d312f698dfe0395a8036716f1f9999777bb77eff314c423a056cf6483a9e6dd58b1919ee2fddb153ae WHIRLPOOL 3ed0b83b19b0729e550c959f5c299a639d93f04d285b24bc8ddf2f790cd5a376ed2eac44acb51a357a02f3906a470ef8783e98e8fd3a0e181fec95cca1deb649
+DIST glibc-2.14.1-patches-10.tar.bz2 167926 SHA256 e93815f125a6d1cfbaa6aa920274ea55c12da0bb4719fafd4bc0bfad27322108 SHA512 520a8e5e63daf33f1ac2d475e2d880718a774dc9228fa1d61792eb17d39a5a3d92dafac7963c4eada71ad06e8d34aea34098e08533dbc6844e9649d84b8980ab WHIRLPOOL a0c246425bffb5ce84ac8e5f25614e2ccb90de668365fc1a3ddf187ab8ae954990d12a5924f83ffa56d563b6c70fa1dbb01263d0219c40279f4267301b83646c
+DIST glibc-2.14.1.tar.bz2 15650580 SHA256 6e85a2fa3ebe6b28103361f09d27eeda37a021f24dab73f34064456d5a715b3b SHA512 c83c9d6dae0091b7b6d3c8fb2b9376e58d2574a8016ce1b4d6e870afca3b892e8da2482ddf95d07ae7407a7f4cc84c1f52cb2f975a18c734529ec019204f65b7 WHIRLPOOL 0aee8c43d851375dd18b3b0ec33aad74ab396936f347cbc9f91f182d84ec03d45425be44a7edbc3faa8159dcbf9cbc4a09fa8c70b3da495fff071469fe063959
DIST glibc-2.14.tar.bz2 15630590 SHA256 8404b54651d42133d9a2ab17d30d698e53c5f250b2ad8e5f3d9a208ea7c75d6c SHA512 4647b9999e56d88c669832b58555d4e53a22737d5c1963ae62e89958d9880193d1ad8f37cd4b05464cab79f7a244772eb1484d55788ec4828ff98dac30c8fa80 WHIRLPOOL 3aa97d56fa28bd45fb9a41925f41fe0d74020553ca4aa92293cbc47de2bc8a88b7dcbf368c77f0872d18ab6ba91bdf2b199a0520d946115f821dd4a4728ef2b8
+DIST glibc-2.15-patches-23.tar.bz2 118999 SHA256 11c38082635822eb7b12d538e3b9c38ee71f6a86be6cebb59f5f2c575be93830 SHA512 ff3792a0029ea24990fe2419579472bd02119ed6a2dab28e85089d232029be5f1c18c643bcb9d577dce78a7c682bb5eee1ed3644f086b5cf19230bcf37ce8a4b WHIRLPOOL 110ddb5989bf1b66a487c9ebae03a3e62ac22b7a28b4c70d142e1c56160bdd50b9f5fa6f4dc4a28cfb28d94281c582fcfc1f60df8ae2ef4e8a946b3b06d2b1b1
+DIST glibc-2.15.tar.xz 10280176 SHA256 321ec482abdc27b03244f7b345ee22dc431bc55daf9c000a4e7b040fbdbecb50 SHA512 fc8bc407cd9edfd79bd286d28c84e0b8224e1f57c1d318e73da098a9693257d78970178fd59f487f0321a079fcb772e8e78473fab52f091b2addb0a48fe8dcf7 WHIRLPOOL 061fc0c9915bd821dc31c2fea8e4f9a75b6c7ec0c935ea713d8c087408a8bf3c600179273438f3d9748fe40b946866b2f160e6da6fee4da51e549a30d0f0ebbc
+DIST glibc-2.16.0-patches-12.tar.bz2 95047 SHA256 e8fd08ee1af5ba4c2999657ea7ec3a0669c10fcf36151874a22f9d8e20d535ed SHA512 f377043d51e7b1d9d74af2ae1d40543329b9d6d5e07f7f9d84b1db9773f61864dc1f52253a952b2618bfe170f9cae32fdf748919460605bafaea6bc0c1f1befe WHIRLPOOL 69fe1b2a9ca0f2521bb59089cfccb7393c3fdd335498ab397d17dcb441a8ea0c579a35e3f175025d2c348b72d08ce496a0ed6d577bc1e0b5a65eb5fcef88e04c
+DIST glibc-2.16.0.tar.xz 9990512 SHA256 1edc36aa2a6cb7127971fce8e02eecffe9c7956297ad3ef10dd4c09f486d5924 SHA512 be9acc11b77ab3c01d5766fe626a6a51bc3192ac98f9554fbb5c37120cfc6f636c0b7a80beddc180f13b32ad06051d24c1999fa2e64eeb724d55a9498f0f634e WHIRLPOOL 9bfd4358a4488080e12e08deca5fca59c1555853d1c1978b7d1bb3b480eb8fb125dccab38c55644248ae5e18b0167aec85f8a7850bab9e11f980aae6f171eac3
DIST glibc-2.3.6-patches-1.19.tar.bz2 216069 SHA256 8aa924347c50bd721cc1dd8dc7b0c986136689346d4d78eaea4d9f15a4db2dea SHA512 4fc2ed654ecc1021596d5737a0b2b74cec4c42393f49a8a50f30bdcb1a7f3e58876a6ad384dd8d8ed6ee9b3ca0fce034c1e2c85db2a998db4737a93c572b8e16 WHIRLPOOL 56058d0b11fef5f3845e50cc17cd4acb03cb6e5c59930582fd905f9b3bf17fa566fa6a4c5870e274a8e30a947d767113a2033eda1ca5c785ba8c98aa259c30e1
DIST glibc-2.3.6.tar.bz2 14014977 SHA256 e73ff5eddea95d09238b41d3c9c4d9ccddcf99fcc93d04956599c91c704f4a8e SHA512 e92c15b33c80cbbfee83289840de904f5d795f375daf60dd10bb9cbc3701f3c13f35c46063a4359cd662742a9ced5aca62d20eceb580d29c8e02fb5e3845348b WHIRLPOOL e4c0ff5b368ab63aa4662fc0d7563b8276046212e429ba1db3e2f98406a9229264edce9fbda622742205f01c99d429337fa7e6c04ea3c0670b9e4f34068ec9a6
DIST glibc-2.4-patches-1.19.tar.bz2 132880 SHA256 9ec4cd3df3b8e7f294b3c93138d2f0fd7e8213b4981cfcc9cb58c25f934a23fa SHA512 749b6b3430a6351afc676c590e4ede5baa010865168896478df1cd781c785facd19b4b4a772252ccad70fdcea167df2ccf6c06e3f8bd827e7f5282275ab640bd WHIRLPOOL 366d7c47027ace9513720a9902f10265e177280d26de3fa6651130fd6f3f12dd6d566589340b3338426a9eff1290dd59664bc0c0ab6fd8c89503c6fd123e2073
@@ -38,9 +46,13 @@ DIST glibc-manpages-2.3.6-1.tar.bz2 22216 SHA256 2ba9c7fff2f02f888160dbadd013356
DIST glibc-ports-2.10.1.tar.bz2 584860 SHA256 b1f1ec9720036a3a33598b8478eef102535444a083d5b5813a6981ed74ab4071 SHA512 9319fa98b159f904f263ceb1f073db14caf6af61c7fb723d8e5c210a061d2e1ffd634d87912c07f748e9a309be6062fb0799c06638fcc54f1219e4494143fae9 WHIRLPOOL d94ae024811887d0a46800161d29be371d53827690b80df35a58a38e4a78811784e096335b0cfcd7587c26e392158765a182a91c9252e5b304d12901b2e41a73
DIST glibc-ports-2.11.tar.bz2 599606 SHA256 38d212b1a22ed121c97f2827e7357e3e077084635ebc197246993d328b1b6589 SHA512 55254f538919bcc6e5046ca699ebf6c2d5ff039b4d3d0254361d3185f735b3a6561c6518cf99d25702659e10de7950b445b36d0ba8bb3fae0558ee6edaff41ac WHIRLPOOL 1516a97ac2c7bf06975a1364ab0097e3d90054facd4f5c86e1aa4d6d58e94c6ae7e6c13e998604ee766207ee80a4653fca585cc127057f5540019f691e5ba29c
DIST glibc-ports-2.12.1.tar.bz2 621800 SHA256 3986c166d08c30b83c9cc7d972651550b548386d5a02e4e4c985d9832de83110 SHA512 d7dad77d9d495df2d0605e915e0db0c170d3d5d1e83509a3e48d51f32f6c08cbe133c49dd1f09ee559a503af25756c38dd83725f336ba0ec7d96a15f29ac33cb WHIRLPOOL 561ba89d6ef8702867126a36f657254f3fea1b1ba25acc9140da831fc76ced740fa55c4b4d8d3fbe4be86399e9ff0b9e2a3cd5f160738a3889a3554496ceaca2
+DIST glibc-ports-2.13.tar.bz2 625945 SHA256 b11c4501ae929883447f409c31d65e82822b1c5693075a825a3d54612876ee5a SHA512 39ed578db363dab05e54d5272d3a8a0600493b91985c65a4d043b5a88d617ff46cca2d66d99ae69e92282d8f8a2357e79dcd5b0ae45b505497417d5137866ad6 WHIRLPOOL 766309e315f2f7edbe0b431691ea16f9917dd2f1c8d54b707e819b695f26dedac2d60c3a58499ee1b51a218b982e9930e49f79db096e166576c215a6ccac21e5
+DIST glibc-ports-2.14.1.tar.bz2 630641 SHA256 1c830afb6d4aa166edaa09ec539580377ecbb16ba655d0aad6f5cb5a9a269aa9 SHA512 4ed18be51e2dec4395bf89701b32e443ba02e4e6b26ee1a72684a1f84ef302d58ed8b58f99e4e0ba3f539da0ade668de5881bb2b86fcd065d741448d9c129bae WHIRLPOOL 463aac8660f7f8d9d6e4ee5728aef2948892a54dc250d0543ffb3c2fb636a816384d5984631ab4420b98a51254d62b4b0ad8381a8006ceb1f632de135155939d
DIST glibc-ports-2.14.tar.bz2 631253 SHA256 580a656a55a17ba3db80ab0a9321332cd1f0aaddd7fad76004b524303fb6632d SHA512 843a8daee3210fca86956718bff71f21f6532b7ca3077b4a1964f6d797df0a3dba42a29108715410ae232a48809f166cb051303a567fe16b0c05b9f71aef6225 WHIRLPOOL 156c43e90bb47d939e0852c583d6382021440c5b4c0b3705f60d4ad953866ab92ba1d502e010e7ff2b3a031795393f776dea3cfed317daf426d0360346ff9064
+DIST glibc-ports-2.15.tar.xz 421820 SHA256 fcc271fcc3a808bf0f3aa1d144bc39b8d0d5f730aed6e206b883961515f0d1b9 SHA512 fc3c80a9a7ede0f35054e5be043fff4b967e6ef6678f42e617dd1dd498920edb4e4c785cf8e3cd97fc2914a35a892e0fd7e1aab24f0c3c8d207765a131bf3744 WHIRLPOOL a8a617eacb326615265832f86a7ef39678364b5b65d5c16d58680ec0debfbca6780018b7da9c1a86bdfffcde58aa1258b96ea4bd50b114901b522e62d48ae4a5
+DIST glibc-ports-2.16.0.tar.xz 925916 SHA256 93a10ac3b9ab70ccc59dfe50a4747d48a7e92f9481656f8a37558a2767ac02f3 SHA512 8653ad9f5cf239a55eb2e236f9510ba227e910168efefd74df8e4951f2e1e4bca69598bc23daa6581e0ba94fe334ac625524fb22f0d38c2a07e373eda1db821b WHIRLPOOL 60b0cb559e28bcab9c6625ccd24a13ecfc301cc055d7e18d1324627912b528ca8cc7c2f999e1e979d2685e407879b1bfffdb61f1536d91fa143cffb7ded72a8a
DIST glibc-ports-2.4.tar.bz2 381472 SHA256 2fbbcaad8a9f8560485c398a9066959fe2713c8bc7e653ec476fb56fed21d19a SHA512 c6a37e56aa384cf3f6b74c8a2ccb50fd2f6f494fe65543e18153998ea4bc7fd44806284f263bd14098158680c996f0e45100827b3180a8a791d13d4ace46c294 WHIRLPOOL 2a1558556b0f9ad1ccb47a1f513a7d70d644cef53a382b917db56140f7e9ebbe1f41bb24143c461158fb3047b2b5a60fbb6091f9858619d6acef5c7fb88422fa
DIST glibc-ports-2.5.tar.bz2 409372 SHA256 80c38a005325e7539012bd665fb8e06af9ee9bfc74efb236ebff121265bfd463 SHA512 e9a0630bab9dc262c6bdd1696a79e060b39d55bbc0c6a6e9e3b36fe315aa11c22d008f722efa546fa5ec443c224933bb8b64f90acaf1f9dd886e5126f1a81c0e WHIRLPOOL af1a0f1bc46435a24c9020194a6fdd7067245ada85159f7b3e24e55b7cc88129570834dba532495e40f1646067e93aac1bd60de2d6f2cec9f9ecef2f64c66755
DIST glibc-ports-2.6.1.tar.bz2 431292 SHA256 d094028bc6d6691f56b4efeff7cd7e1c7ca10733e0cb5efc36e8fb08d8324bf1 SHA512 10821599e095a38c10b9e3b757b9919ab29b536eb9a275ca1050aeb63a08d4a429e7e1821f184e8add2d870cff49d9d4f7b445f5337ecb9964dcd92405b53f6c WHIRLPOOL c1813db493da4d7fc22b319bb70e33db59ce055c30de5f860921c08968e6b558794121ac1ba0fbab199e31c532d82a915490c030b056ffadd3bdde2eaee80cce
DIST glibc-ports-2.7.tar.bz2 435392 SHA256 3e481996259af87c3581da23481970a27de679e3c87cfa9a5a59751cd20c7b44 SHA512 4723dafae5c07bc8177bfac888a43c5cf324a066631fcdb702a24a5fd5949332c0465de1fc10e454672333b448f4342a27199422786cd24b689679b4cd1787f9 WHIRLPOOL da9a751ab508162dca9f3f1d116fd25d871c9da1b7416270cb2a16e41a145aa0aa0cfadd7cbb14898b4f77bfe011d4da92967a787783c843ca07894710e367f6
-DIST glibc-powerpc-cpu-addon-v0.01.tgz 22422 SHA256 0ffa9a432fffb9bfed99c529b631a27534ba848c7ec1d707732338b73a4a8ce9
+DIST glibc-powerpc-cpu-addon-v0.01.tgz 22422 SHA256 0ffa9a432fffb9bfed99c529b631a27534ba848c7ec1d707732338b73a4a8ce9 SHA512 8349a0f7a460349430b7b99bc0fe2ee3a7423f3c085b73a7ba930c84e2a65785acf3205cf206e02fdda36afe045085ee5400c792467634d548bf115c5687bdbd WHIRLPOOL c13a7efab5e3438eaaaf8c0df4ba1edda92447b4796957efd394084ff1d9150e5f7b3327ea9884175402dfff0cc1055d8fb45c9a7f5961a4d603264ee5ce9fb4
diff --git a/sys-libs/glibc/files/2.16/glibc-2.16-hardened-pie.patch b/sys-libs/glibc/files/2.16/glibc-2.16-hardened-pie.patch
new file mode 100644
index 0000000..a850a61
--- /dev/null
+++ b/sys-libs/glibc/files/2.16/glibc-2.16-hardened-pie.patch
@@ -0,0 +1,39 @@
+2012-11-11 Magnus Granberg <zorry@gentoo.org>
+
+ #442712
+ * Makeconfig (+link): Set to +link-pie.
+ (+link-static-before-libc): Change $(static-start-installed-name) to
+ S$(static-start-installed-name).
+ (+prector): Set to +prectorS.
+ (+postctor): Set to +postctorS.
+
+--- libc/Makeconfig
++++ libc/Makeconfig
+@@ -447,11 +447,12 @@
+ $(common-objpfx)libc% $(+postinit),$^) \
+ $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
+ endif
+++link = $(+link-pie)
+ # Command for statically linking programs with the C library.
+ ifndef +link-static
+ +link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
+ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+- $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
++ $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
+ $(+preinit) $(+prector) \
+ $(filter-out $(addprefix $(csu-objpfx),start.o \
+ $(start-installed-name))\
+@@ -549,11 +550,10 @@
+ ifeq ($(elf),yes)
+ +preinit = $(addprefix $(csu-objpfx),crti.o)
+ +postinit = $(addprefix $(csu-objpfx),crtn.o)
+-+prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
+-+postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
+-# Variants of the two previous definitions for linking PIE programs.
+ +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
+ +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
+++prector = $(+prectorS)
+++postctor = $(+postctorS)
+ +interp = $(addprefix $(elf-objpfx),interp.os)
+ endif
+ csu-objpfx = $(common-objpfx)csu/
diff --git a/sys-libs/glibc/glibc-2.13-r4.ebuild b/sys-libs/glibc/glibc-2.13-r4.ebuild
new file mode 100644
index 0000000..33a964d
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.13-r4.ebuild
@@ -0,0 +1,218 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND inner-net"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+if [[ ${PV} == *_p* ]] ; then
+RELEASE_VER=${PV%_p*}
+BRANCH_UPDATE=""
+SNAP_VER=${PV#*_p}
+else
+RELEASE_VER=${PV}
+BRANCH_UPDATE=""
+SNAP_VER=""
+fi
+LIBIDN_VER="" # it's integrated into the main tarball now
+PATCH_VER="11" # Gentoo patchset
+PORTS_VER="2.13" # version of glibc ports addon
+LT_VER="" # version of linuxthreads addon
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
+#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
+
+IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
+S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils for as-needed
+# arch: we need to make sure our binutils/gcc supports TLS
+DEPEND=">=sys-devel/gcc-3.4.4
+ arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
+ x86? ( >=sys-devel/gcc-4.3 )
+ amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
+ ppc? ( >=sys-devel/gcc-4.1.0 )
+ ppc64? ( >=sys-devel/gcc-4.1.0 )
+ >=sys-devel/binutils-2.15.94
+ ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
+ >=app-misc/pax-utils-0.1.10
+ virtual/os-headers
+ !<sys-apps/sandbox-1.2.18.1-r2
+ !<sys-apps/portage-2.1.2
+ !<sys-devel/patch-2.6
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ selinux? ( sys-libs/libselinux )"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
+else
+ DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
+ RDEPEND="${RDEPEND}
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
+fi
+
+SRC_URI=$(
+ upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+ }
+ gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+ }
+
+ TARNAME=${PN}
+ if [[ -n ${SNAP_VER} ]] ; then
+ TARNAME="${PN}-${RELEASE_VER}"
+ [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
+ upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
+ else
+ upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
+ fi
+ [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
+ [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
+ [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
+ [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
+ [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+)
+
+# eblit-include [--skip] <function> [version]
+eblit-include() {
+ local skipable=false
+ [[ $1 == "--skip" ]] && skipable=true && shift
+ [[ $1 == pkg_* ]] && skipable=true
+
+ local e v func=$1 ver=$2
+ [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
+ for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
+ e="${FILESDIR}/eblits/${func}${v}.eblit"
+ if [[ -e ${e} ]] ; then
+ source "${e}"
+ return 0
+ fi
+ done
+ ${skipable} && return 0
+ die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
+}
+
+# eblit-run-maybe <function>
+# run the specified function if it is defined
+eblit-run-maybe() {
+ [[ $(type -t "$@") == "function" ]] && "$@"
+}
+
+# eblit-run <function> [version]
+# aka: src_unpack() { eblit-run src_unpack ; }
+eblit-run() {
+ eblit-include --skip common "${*:2}"
+ eblit-include "$@"
+ eblit-run-maybe eblit-$1-pre
+ eblit-${PN}-$1
+ eblit-run-maybe eblit-$1-post
+}
+
+src_unpack() { eblit-run src_unpack ; }
+src_compile() { eblit-run src_compile ; }
+src_test() { eblit-run src_test ; }
+src_install() { eblit-run src_install ; }
+
+# FILESDIR might not be available during binpkg install
+for x in setup {pre,post}inst ; do
+ e="${FILESDIR}/eblits/pkg_${x}.eblit"
+ if [[ -e ${e} ]] ; then
+ . "${e}"
+ eval "pkg_${x}() { eblit-run pkg_${x} ; }"
+ fi
+done
+
+pkg_setup() {
+ eblit-run pkg_setup
+
+ # Static binary sanity check #332927
+ if [[ ${ROOT} == "/" ]] && \
+ has_version "<${CATEGORY}/${P}" && \
+ built_with_use sys-apps/coreutils static
+ then
+ eerror "Please rebuild coreutils with USE=-static, then install"
+ eerror "glibc, then you may rebuild coreutils with USE=static."
+ die "Avoiding system meltdown #332927"
+ fi
+}
+
+eblit-src_unpack-post() {
+ if use hardened ; then
+ cd "${S}"
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
+
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
+ debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
+
+ if use debug ; then
+ # When using Hardened Gentoo stack handler, have smashes dump core for
+ # analysis - debug only, as core could be an information leak
+ # (paranoia).
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
+ fi
+
+ # Build nscd with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ nscd/Makefile \
+ || die "Failed to ensure nscd builds with ssp-all"
+ fi
+}
diff --git a/sys-libs/glibc/glibc-2.14.1-r3.ebuild b/sys-libs/glibc/glibc-2.14.1-r3.ebuild
new file mode 100644
index 0000000..3ce89c2
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.14.1-r3.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND inner-net"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+BRANCH_UPDATE=""
+SNAP_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
+ EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
+ inherit git-2
+ ;;
+*_p*)
+ RELEASE_VER=${PV%_p*}
+ SNAP_VER=${PV#*_p}
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+LIBIDN_VER="" # it's integrated into the main tarball now
+PATCH_VER="10" # Gentoo patchset
+PORTS_VER=${RELEASE_VER} # version of glibc ports addon
+LT_VER="" # version of linuxthreads addon
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
+#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"} # min kernel version linuxthreads requires
+
+IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl linuxthreads}"
+[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils for as-needed
+# arch: we need to make sure our binutils/gcc supports TLS
+DEPEND=">=sys-devel/gcc-3.4.4
+ arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
+ x86? ( >=sys-devel/gcc-4.3 )
+ amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
+ ppc? ( >=sys-devel/gcc-4.1.0 )
+ ppc64? ( >=sys-devel/gcc-4.1.0 )
+ >=sys-devel/binutils-2.15.94
+ ${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
+ >=app-misc/pax-utils-0.1.10
+ virtual/os-headers
+ !<sys-apps/sandbox-1.2.18.1-r2
+ !<sys-apps/portage-2.1.2
+ !<sys-devel/patch-2.6
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ selinux? ( sys-libs/libselinux )"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
+else
+ DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
+ RDEPEND="${RDEPEND}
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
+fi
+
+SRC_URI=$(
+ upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+ }
+ gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+ }
+
+ TARNAME=${PN}
+ if [[ -n ${SNAP_VER} ]] ; then
+ TARNAME="${PN}-${RELEASE_VER}"
+ [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
+ upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
+ elif [[ -z ${EGIT_REPO_URIS} ]] ; then
+ upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
+ fi
+ [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
+ [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
+ [[ -n ${LT_VER} ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
+ [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
+ [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+)
+
+# eblit-include [--skip] <function> [version]
+eblit-include() {
+ local skipable=false
+ [[ $1 == "--skip" ]] && skipable=true && shift
+ [[ $1 == pkg_* ]] && skipable=true
+
+ local e v func=$1 ver=$2
+ [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
+ for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
+ e="${FILESDIR}/eblits/${func}${v}.eblit"
+ if [[ -e ${e} ]] ; then
+ source "${e}"
+ return 0
+ fi
+ done
+ ${skipable} && return 0
+ die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
+}
+
+# eblit-run-maybe <function>
+# run the specified function if it is defined
+eblit-run-maybe() {
+ [[ $(type -t "$@") == "function" ]] && "$@"
+}
+
+# eblit-run <function> [version]
+# aka: src_unpack() { eblit-run src_unpack ; }
+eblit-run() {
+ eblit-include --skip common "${*:2}"
+ eblit-include "$@"
+ eblit-run-maybe eblit-$1-pre
+ eblit-${PN}-$1
+ eblit-run-maybe eblit-$1-post
+}
+
+src_unpack() { eblit-run src_unpack ; }
+src_compile() { eblit-run src_compile ; }
+src_test() { eblit-run src_test ; }
+src_install() { eblit-run src_install ; }
+
+# FILESDIR might not be available during binpkg install
+for x in setup {pre,post}inst ; do
+ e="${FILESDIR}/eblits/pkg_${x}.eblit"
+ if [[ -e ${e} ]] ; then
+ . "${e}"
+ eval "pkg_${x}() { eblit-run pkg_${x} ; }"
+ fi
+done
+
+pkg_setup() {
+ eblit-run pkg_setup
+
+ # Static binary sanity check #332927
+ if [[ ${ROOT} == "/" ]] && \
+ has_version "<${CATEGORY}/${P}" && \
+ built_with_use sys-apps/coreutils static
+ then
+ eerror "Please rebuild coreutils with USE=-static, then install"
+ eerror "glibc, then you may rebuild coreutils with USE=static."
+ die "Avoiding system meltdown #332927"
+ fi
+}
+
+eblit-src_unpack-pre() {
+ GLIBC_PATCH_EXCLUDE+=" 1200_all_glibc-${PV}-x32.patch"
+}
+
+eblit-src_unpack-post() {
+ if use hardened ; then
+ cd "${S}"
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
+
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
+ debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
+
+ if use debug ; then
+ # When using Hardened Gentoo stack handler, have smashes dump core for
+ # analysis - debug only, as core could be an information leak
+ # (paranoia).
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
+ fi
+
+ # Build nscd with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ nscd/Makefile \
+ || die "Failed to ensure nscd builds with ssp-all"
+ fi
+}
+
+eblit-pkg_preinst-post() {
+ if [[ ${CTARGET} == arm* ]] ; then
+ # Backwards compat support for renaming hardfp ldsos #417287
+ local oldso='/lib/ld-linux.so.3'
+ local nldso='/lib/ld-linux-armhf.so.3'
+ if [[ -e ${D}${nldso} ]] ; then
+ if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
+ ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
+ ewarn "Please rebuild all packages using this old ldso as compat"
+ ewarn "support will be dropped in the future."
+ ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
+ fi
+ fi
+ fi
+}
diff --git a/sys-libs/glibc/glibc-2.15-r3.ebuild b/sys-libs/glibc/glibc-2.15-r3.ebuild
new file mode 100644
index 0000000..dd3f36f
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.15-r3.ebuild
@@ -0,0 +1,225 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND inner-net"
+KEYWORDS="alpha amd64 arm -hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+BRANCH_UPDATE=""
+SNAP_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
+ EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
+ inherit git-2
+ ;;
+*_p*)
+ RELEASE_VER=${PV%_p*}
+ SNAP_VER=${PV#*_p}
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+LIBIDN_VER="" # it's integrated into the main tarball now
+PATCH_VER="23" # Gentoo patchset
+PORTS_VER=${RELEASE_VER} # version of glibc ports addon
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib selinux profile vanilla crosscompile_opts_headers-only"
+[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils for as-needed
+# arch: we need to make sure our binutils/gcc supports TLS
+DEPEND=">=sys-devel/gcc-3.4.4
+ arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
+ x86? ( >=sys-devel/gcc-4.3 )
+ amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
+ ppc? ( >=sys-devel/gcc-4.1.0 )
+ ppc64? ( >=sys-devel/gcc-4.1.0 )
+ >=sys-devel/binutils-2.15.94
+ >=app-misc/pax-utils-0.1.10
+ virtual/os-headers
+ !<sys-apps/sandbox-1.2.18.1-r2
+ !<sys-apps/portage-2.1.2
+ !<sys-devel/patch-2.6
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
+else
+ DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
+ RDEPEND="${RDEPEND}
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
+fi
+
+SRC_URI=$(
+ upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+ }
+ gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+ }
+
+ TARNAME=${PN}
+ if [[ -n ${SNAP_VER} ]] ; then
+ TARNAME="${PN}-${RELEASE_VER}"
+ [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
+ upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
+ elif [[ -z ${EGIT_REPO_URIS} ]] ; then
+ upstream_uris ${TARNAME}-${RELEASE_VER}.tar.xz
+ fi
+ [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
+ [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.xz
+ [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
+ [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+)
+
+# eblit-include [--skip] <function> [version]
+eblit-include() {
+ local skipable=false
+ [[ $1 == "--skip" ]] && skipable=true && shift
+ [[ $1 == pkg_* ]] && skipable=true
+
+ local e v func=$1 ver=$2
+ [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
+ for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
+ e="${FILESDIR}/eblits/${func}${v}.eblit"
+ if [[ -e ${e} ]] ; then
+ source "${e}"
+ return 0
+ fi
+ done
+ ${skipable} && return 0
+ die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
+}
+
+# eblit-run-maybe <function>
+# run the specified function if it is defined
+eblit-run-maybe() {
+ [[ $(type -t "$@") == "function" ]] && "$@"
+}
+
+# eblit-run <function> [version]
+# aka: src_unpack() { eblit-run src_unpack ; }
+eblit-run() {
+ eblit-include --skip common "${*:2}"
+ eblit-include "$@"
+ eblit-run-maybe eblit-$1-pre
+ eblit-${PN}-$1
+ eblit-run-maybe eblit-$1-post
+}
+
+src_unpack() { eblit-run src_unpack ; }
+src_compile() { eblit-run src_compile ; }
+src_test() { eblit-run src_test ; }
+src_install() { eblit-run src_install ; }
+
+# FILESDIR might not be available during binpkg install
+for x in setup {pre,post}inst ; do
+ e="${FILESDIR}/eblits/pkg_${x}.eblit"
+ if [[ -e ${e} ]] ; then
+ . "${e}"
+ eval "pkg_${x}() { eblit-run pkg_${x} ; }"
+ fi
+done
+
+eblit-src_unpack-post() {
+ if use hardened ; then
+ cd "${S}"
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ gcc-specs-pie && epatch "${FILESDIR}"/2.12/glibc-2.12-hardened-pie.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
+
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
+ debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
+
+ if use debug ; then
+ # When using Hardened Gentoo stack handler, have smashes dump core for
+ # analysis - debug only, as core could be an information leak
+ # (paranoia).
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
+ fi
+
+ # Build nscd with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ nscd/Makefile \
+ || die "Failed to ensure nscd builds with ssp-all"
+ fi
+}
+
+eblit-pkg_preinst-post() {
+ if [[ ${CTARGET} == arm* ]] ; then
+ # Backwards compat support for renaming hardfp ldsos #417287
+ local oldso='/lib/ld-linux.so.3'
+ local nldso='/lib/ld-linux-armhf.so.3'
+ if [[ -e ${D}${nldso} ]] ; then
+ if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
+ ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
+ ewarn "Please rebuild all packages using this old ldso as compat"
+ ewarn "support will be dropped in the future."
+ ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
+ fi
+ fi
+ fi
+}
diff --git a/sys-libs/glibc/glibc-2.16.0.ebuild b/sys-libs/glibc/glibc-2.16.0.ebuild
new file mode 100644
index 0000000..8fbfc92
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.16.0.ebuild
@@ -0,0 +1,223 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib systemd unpacker multiprocessing
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND inner-net"
+KEYWORDS="~alpha amd64 arm -hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+BRANCH_UPDATE=""
+SNAP_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS=( "git://sourceware.org/git/glibc.git" "git://sourceware.org/git/glibc-ports.git" )
+ EGIT_SOURCEDIRS=( "${S}" "${S}/ports" )
+ inherit git-2
+ ;;
+*_p*)
+ RELEASE_VER=${PV%_p*}
+ SNAP_VER=${PV#*_p}
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+LIBIDN_VER="" # it's integrated into the main tarball now
+PATCH_VER="12" # Gentoo patchset
+PORTS_VER=${RELEASE_VER} # version of glibc ports addon
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.16"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib selinux suid systemtap profile vanilla crosscompile_opts_headers-only"
+[[ -n ${RELEASE_VER} ]] && S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.16/2.6.20}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.20
+ >=${CATEGORY}/gcc-4.3
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.20
+ >=sys-devel/gcc-4.3
+ virtual/os-headers
+ !vanilla? ( >=sys-libs/timezone-data-2012c )"
+ RDEPEND+="
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
+fi
+
+SRC_URI=$(
+ upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+ }
+ gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+ }
+
+ TARNAME=${PN}
+ if [[ -n ${SNAP_VER} ]] ; then
+ TARNAME="${PN}-${RELEASE_VER}"
+ [[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
+ upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
+ elif [[ -z ${EGIT_REPO_URIS} ]] ; then
+ upstream_uris ${TARNAME}-${RELEASE_VER}.tar.xz
+ fi
+ [[ -n ${LIBIDN_VER} ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
+ [[ -n ${PORTS_VER} ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.xz
+ [[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
+ [[ -n ${PATCH_VER} ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+)
+
+# eblit-include [--skip] <function> [version]
+eblit-include() {
+ local skipable=false
+ [[ $1 == "--skip" ]] && skipable=true && shift
+ [[ $1 == pkg_* ]] && skipable=true
+
+ local e v func=$1 ver=$2
+ [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
+ for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
+ e="${FILESDIR}/eblits/${func}${v}.eblit"
+ if [[ -e ${e} ]] ; then
+ source "${e}"
+ return 0
+ fi
+ done
+ ${skipable} && return 0
+ die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
+}
+
+# eblit-run-maybe <function>
+# run the specified function if it is defined
+eblit-run-maybe() {
+ [[ $(type -t "$@") == "function" ]] && "$@"
+}
+
+# eblit-run <function> [version]
+# aka: src_unpack() { eblit-run src_unpack ; }
+eblit-run() {
+ eblit-include --skip common "${*:2}"
+ eblit-include "$@"
+ eblit-run-maybe eblit-$1-pre
+ eblit-${PN}-$1
+ eblit-run-maybe eblit-$1-post
+}
+
+src_unpack() { eblit-run src_unpack ; }
+src_compile() { eblit-run src_compile ; }
+src_test() { eblit-run src_test ; }
+src_install() { eblit-run src_install ; }
+
+# FILESDIR might not be available during binpkg install
+for x in setup {pre,post}inst ; do
+ e="${FILESDIR}/eblits/pkg_${x}.eblit"
+ if [[ -e ${e} ]] ; then
+ . "${e}"
+ eval "pkg_${x}() { eblit-run pkg_${x} ; }"
+ fi
+done
+
+eblit-src_unpack-post() {
+ if use hardened ; then
+ cd "${S}"
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ gcc-specs-pie && epatch "${FILESDIR}"/2.16/glibc-2.16-hardened-pie.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
+
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
+ debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
+
+ if use debug ; then
+ # When using Hardened Gentoo stack handler, have smashes dump core for
+ # analysis - debug only, as core could be an information leak
+ # (paranoia).
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
+ fi
+
+ # Build nscd with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ nscd/Makefile \
+ || die "Failed to ensure nscd builds with ssp-all"
+ fi
+}
+
+eblit-pkg_preinst-post() {
+ if [[ ${CTARGET} == arm* ]] ; then
+ # Backwards compat support for renaming hardfp ldsos #417287
+ local oldso='/lib/ld-linux.so.3'
+ local nldso='/lib/ld-linux-armhf.so.3'
+ if [[ -e ${D}${nldso} ]] ; then
+ if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
+ ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
+ ewarn "Please rebuild all packages using this old ldso as compat"
+ ewarn "support will be dropped in the future."
+ ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
+ fi
+ fi
+ fi
+}
diff --git a/sys-libs/glibc/metadata.xml b/sys-libs/glibc/metadata.xml
new file mode 100644
index 0000000..d12c261
--- /dev/null
+++ b/sys-libs/glibc/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>toolchain</herd>
+<use>
+ <flag name='debug'>When USE=hardened, allow fortify/stack violations to dump core (SIGABRT) and not kill self (SIGKILL)</flag>
+ <flag name='gd'>build memusage and memusagestat tools</flag>
+ <flag name='glibc-compat20'>Enable the glibc-compat addon</flag>
+ <flag name='glibc-omitfp'>Configure with --enable-omitfp which lets the build system determine when it is safe to use -fomit-frame-pointer</flag>
+ <flag name='linuxthreads'>Build linuxthreads support (only for kernels older than linux-2.6)</flag>
+ <flag name='nptlonly'>Disables building the linuxthreads fallback in glibc ebuilds that support building both linuxthread and nptl</flag>
+ <flag name='nscd'>Build, and enable support for, the Name Service Cache Daemon</flag>
+ <flag name='suid'>Make internal pt_chown helper setuid -- not needed if using Linux and have /dev/pts mounted with gid=5</flag>
+ <flag name='systemtap'>enable systemtap static probe points</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:gnu:glibc</remote-id>
+</upstream>
+</pkgmetadata>