Gentoo Archives: gentoo-commits

From: Yuta SATOH <nigoro.gentoo@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoo-bsd:master commit in: sys-freebsd/freebsd-lib/, sys-freebsd/freebsd-lib/files/
Date: Thu, 29 Nov 2012 14:07:59
Message-Id: 1354197533.a2bc3d1ad023569fa6211d656ed51379d87aa007.yuta_satoh@gentoo
1 commit: a2bc3d1ad023569fa6211d656ed51379d87aa007
2 Author: Yuta SATOH <nigoro <AT> gentoo <DOT> gr <DOT> jp>
3 AuthorDate: Thu Nov 29 13:58:53 2012 +0000
4 Commit: Yuta SATOH <nigoro.gentoo <AT> 0x100 <DOT> com>
5 CommitDate: Thu Nov 29 13:58:53 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bsd.git;a=commit;h=a2bc3d1a
7
8 added freebsd-lib -- fixed build fails on x86-fbsd, bug 444920
9
10 ---
11 sys-freebsd/freebsd-lib/Manifest | 35 ++
12 .../files/freebsd-lib-6.0-flex-2.5.31.patch | 13 +
13 .../files/freebsd-lib-6.0-gccfloat.patch | 16 +
14 .../freebsd-lib/files/freebsd-lib-6.0-pmc.patch | 13 +
15 .../freebsd-lib/files/freebsd-lib-6.1-csu.patch | 20 +
16 .../files/freebsd-lib-6.2-bluetooth.patch | 11 +
17 .../files/freebsd-lib-7.0-CVE-2008-1391.patch | 11 +
18 .../files/freebsd-lib-7.1-types.h-fix.patch | 15 +
19 .../files/freebsd-lib-7.2-rtldnoload.patch | 30 ++
20 .../freebsd-lib/files/freebsd-lib-8.0-gcc45.patch | 28 +
21 .../freebsd-lib/files/freebsd-lib-8.0-log2.patch | 21 +
22 .../files/freebsd-lib-8.0-rpcsec_gss.patch | 12 +
23 .../files/freebsd-lib-8.2-liblink.patch | 19 +
24 .../files/freebsd-lib-8.2-nlm_syscall.patch | 10 +
25 .../files/freebsd-lib-9.0-liblink.patch | 21 +
26 .../files/freebsd-lib-9.0-opieincludes.patch | 122 +++++
27 .../files/freebsd-lib-9.0-trylock-adaptive.patch | 14 +
28 .../freebsd-lib/files/freebsd-lib-bsdxml.patch | 13 +
29 .../files/freebsd-lib-bsdxml2expat.patch | 26 +
30 .../freebsd-lib/files/freebsd-lib-includes.patch | 13 +
31 .../freebsd-lib/files/freebsd-lib-new_as.patch | 68 +++
32 .../files/freebsd-sources-9.0-sysctluint.patch | 13 +
33 sys-freebsd/freebsd-lib/files/libmap.conf | 8 +
34 sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in | 11 +
35 sys-freebsd/freebsd-lib/files/libusb.pc.in | 11 +
36 .../freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild | 528 ++++++++++++++++++++
37 26 files changed, 1102 insertions(+), 0 deletions(-)
38
39 diff --git a/sys-freebsd/freebsd-lib/Manifest b/sys-freebsd/freebsd-lib/Manifest
40 new file mode 100644
41 index 0000000..ee2fab9
42 --- /dev/null
43 +++ b/sys-freebsd/freebsd-lib/Manifest
44 @@ -0,0 +1,35 @@
45 +AUX freebsd-lib-6.0-flex-2.5.31.patch 421 SHA256 1d46cf13e1059ae3731ba5555764e020fcf4de7db5abf039fac83423e05d53c4 SHA512 c16a99b85e7908e77915796245741cbfcfb30ab1f4f0a8d565c28256b25d1532209ed27328d8b1571f61677251830f1fb6bbec17a8104686f56afd87f3226dec WHIRLPOOL 177f7ee5764f79fcdab768b13016e809f677cfd57a06ebb5e1bbafc6520f309b328908716ee02a8155f35566faefa95b67b064dafa8de9a7d2a19bde92b386b0
46 +AUX freebsd-lib-6.0-gccfloat.patch 542 SHA256 d549125f174c86c2d5e7e1f1c99cf1303b84e91ce8ee51db8c962be48b7a7951 SHA512 810745085c601757397b6d0338dba1631e4f623c3bae8a588e9f0b5c7cd9a9416d832093f97925fcef27ffcf20929bef8a5bcbeecf7a583c0a7eb6ce71f39495 WHIRLPOOL dee1bcf99935ae9ead0d5f498049a46ee89416f06eb7361901c69f40d0151ae1d3647a7dbb1c58b1aca7f541169b20d622019bc20b12953ba0c06fba56fd375e
47 +AUX freebsd-lib-6.0-pmc.patch 338 SHA256 36ca464f0aa1ed8784c8f1edc4a3580704c9a7813963684305250d806000075f SHA512 33187ec853ddf0c39680af60b669e60d3e213eba20a2e1ba995c991f04c053c5adcc5169b92c5d1d4cfbc7e03b72af2df4a5349361b41c56ca4a9b91e81bb327 WHIRLPOOL 1744ed829c1775c01b5d1b827b5677b6b5d731cff376da4d8e7ab8facbb0c465131a34157d77186bfcf1a1097f515e3909d1e753aa2b8e72efaf7feae319361f
48 +AUX freebsd-lib-6.1-csu.patch 655 SHA256 e6fe72a4183227b275815a75eec9639321046dc1e02b80c507ae6bf902a58cf1 SHA512 926d8aafd6f517a0fb97af61746d53bafab7fe7003f71181c43b4f9b31e7652624d060a350cc23d83ca7da7c1be2dcc048bb00a581c3524f0f2b7b06de6100b4 WHIRLPOOL fada1ac622c48e1e5af34245bdb17507b2b317938265f722c8cbdbbce3d14bbe76f39a231c0e7237bd229a8c0687952643c6f56e65ffc56b18508969fad837f7
49 +AUX freebsd-lib-6.2-bluetooth.patch 243 SHA256 4c90cb6d45fa24a07e21255949f219cc561a94011f645c58bce2a68027db6658 SHA512 60d938a6f1162f106ec93c4122707a4dd9ca6afc73be4d90871db745ad084ca1d229e7460f4faa9885c4f6d192a41cb8be7cf671b0c8ec720eccd1c7af994bbc WHIRLPOOL df2ab6e6d9223c7e2369fb8baf19638cb897343b6ba571c7b9294be7d335068b7978690b2cd50174b4ee0215f2409322a9cc2a374140fc14dff460e181c05578
50 +AUX freebsd-lib-7.0-CVE-2008-1391.patch 344 SHA256 662a6f26d99257221fa686423fd9fe22862b827cd9ae146c2add5e5ac85290cc SHA512 58c785bfaa3da9c570643a6ca1ddffdfc933eb9fce7576975a8217a5e9e74d4db9be2b3d99f5e0e73d0788fbc5cf2c9a5d179e1780c8c23fabfd4edc4e07db2c WHIRLPOOL ac3c19fc14d05f3726b503549ca784904ccffd88fe98a94d57942d2642e5e376239fbd4bcd8fb1af3e6442d6a9c20033f8fbb225fe4f422caef8f8cf4660345c
51 +AUX freebsd-lib-7.1-types.h-fix.patch 371 SHA256 9e745fcfe046c405a365d8d0db8763867f0a618952f7d6bab4c76a8c82273473 SHA512 133ab13e98c3f2dc5f96cd5e45cd11c4da9757f4ea64831a6e17b309bc4692e4213b48c7ab6dd634f1feb069ca2dfc3a8afe1585d0d1425b5304fd7494cd342f WHIRLPOOL d284dd82244a108e4677be143cfc302c18f18e5b39c39fcaa8915c61053d94bf7171e48028f40d25f8058f8ec910c3e55a3753ccecb46bbabbb0e5ba86e808e3
52 +AUX freebsd-lib-7.2-rtldnoload.patch 1037 SHA256 b9ba0e322f15d8761bb33cf9199b95cc61d6a9b5129d08399f49c89fdeaa095b SHA512 0bde6c62f05e356c7992862f0da1a14e7e7fb18c27563fc9ef39ae83ab751a885e624aa9dafe185c8499c6f4b06234f2458d8df22cce5588c051f9d909ef7ee2 WHIRLPOOL 780753118034ae6732940e3c100654382244dd739762d2b4e22bdad4392b0dc4be53e82b80a2e9599aea4d2003c8306a23f05308a99e08fae6ef7a5a2d8ae573
53 +AUX freebsd-lib-8.0-gcc45.patch 1264 SHA256 5288e313beffa0e50fc0301e859c59f1a95302d546d27eae50b97c4a98c81c4d SHA512 12b81def4e7690cf5b910f31466b06c3fdf58f38a41f63dd359582d8f480e8081b54fd4997c6595e9e1a8912f991ba1b8d04989e270f242dd547d72c9ad5ea57 WHIRLPOOL 0cb37d909a02492a1ca700a5b990e4b6ce42a7f7d55e14a5a3fe685d28f360a10e95d97bd489f1dae0b152e168e9d901bfc13bf08bc91d8dfa1d263d4dba9abf
54 +AUX freebsd-lib-8.0-log2.patch 667 SHA256 dc421c3d92790da46360225de2dd4d707c314e962ecb95650799ee12f166a214 SHA512 72f99ecc4632ba9b5ea8f26cbe7311a2ada1822c1c3ccf2c6690d72fb91748e7e70915f33e0f29087125c4027ef084c1d37638fc423bde533595e8d4910084c3 WHIRLPOOL dbe9a686efa26dab9ca129ed39ddab49556490fee22b43f6aa07bd9cbebfa24bd8ccb6e30f0d213bab857571a022bcd1b110d47bd85c6f70462441772bfeb243
55 +AUX freebsd-lib-8.0-rpcsec_gss.patch 298 SHA256 775ec2ee12c49f134938fa8264c04c6b2bf95f8001371f20b85058c25ff1c472 SHA512 2dd63be1a31a1e78fff38a3061469148b673423d958223a459d157accd3a2d1b1f4e568910c49979b0a214322c4e7371f2710ef78fab7d161545fec2a78dc702 WHIRLPOOL 884b76cd6d5d01f801b2fb13f53cfa6ed26dd0b9b2a5062ac9dbe63a6813bfe737e4c3f98b3d94c32dfb6ce3cc19cd5c8760c81250f4b2d5980a4f084d7dc54b
56 +AUX freebsd-lib-8.2-liblink.patch 510 SHA256 38f967683e9d335ff7860150b2e6ae4d749266937ba195c6747d42d64c8e31ee SHA512 52a050078dc71163709e6dbe6d1c3177adbc51cb9b30a6990194ddd32f5b54e107b758801f0ff5632c4fe800c6734d63d42e53378a78caa0072847060fbb0dee WHIRLPOOL c0b95cb074ff6fd7699a03dfe31572a5edbde2b59c8aac3431fb85a0a0d71ad28566500951e0fb96ed9a8d3081abca7ec507c26e12e988f0ff2ece51bb0df2d1
57 +AUX freebsd-lib-8.2-nlm_syscall.patch 385 SHA256 4b26be44718cb3deb7fb295d403e892ed73ceba7ba43499a889bd49a5e43852b SHA512 1c871dc00da4b6d1106720954014f60933c99508dfc34fe08ae37b2f67ca05f70ac5e1bb75d0d1d119c7750405871ee3fb6e95ebd3ec378fc84e819cc0c4c9fd WHIRLPOOL 4d335910c00f21d2d8d5f80cd99c5316e5c485f935eefb782398e2e308e20a2cd4da0e1acf74c07a2c6d8ff446b3757cc416c0bee7e1be9d9cae0843a45e0748
58 +AUX freebsd-lib-9.0-liblink.patch 627 SHA256 41f0b7f92f2a8f0a3e422447b830d7dec70a068573086484d5efd6826b7c4c3c SHA512 0c570fea9cc386afe4b742985cf7de4d49370be3f34b2059dee76869d8e64bd52db0a07e61fac8924848d12d0e6d510ad6a266ce8ef76e2be885d81d909ab616 WHIRLPOOL b59e3bb0aaede34492d1940a77b11c7e5192643122f18ee6ad363053f9dec2600218ca416dd153e1d0b3bb6621d6f9e2ec50621e6e7f4b610abbd69993dc428a
59 +AUX freebsd-lib-9.0-opieincludes.patch 4495 SHA256 0868e7454053170c3399f1a03a68f3e70410c79db865e7e2f2b51f5961b5718b SHA512 a3828985f7da9e72ad44d88640952d56079693024bc11b4e3cca86b6f455a9e4756ba76f9e6d4c15960898f39e1dac7bc833e3241082f532c7fbd6d7d6f9418b WHIRLPOOL e0180dd0086c054e9f6895ecfe34bfb21d0e1db483dfc63ad411c651954c4703996d9b537a9566133a01770f2cf0f331727865013413181728c3b21740735473
60 +AUX freebsd-lib-9.0-trylock-adaptive.patch 439 SHA256 af501c40124e628c2f739d88a4efa7ef3513694bd79ab44db30e4b3f73864612 SHA512 ceeeea302294db5a25b5534685dce563778572010f0072ecb300a66550ee8cc241e0ae5523e32fd5424560e82d913c37aefe06c2a6725e951ba4ad5df73a1a68 WHIRLPOOL d2a65eab4b03a7fb65e2dd6f03c2e60fe1248412e28a0829757e6cb733d1f487ee79959680f1db8af20fc409a165c5f4aea3038171e7b82aee7d38c29552531e
61 +AUX freebsd-lib-bsdxml.patch 339 SHA256 c1ac47d6c7176475f0f4b86bb17288a980b44a799fb6f4e7b1920f69e0447dc9 SHA512 8d14ebc848426cf600cf2206f60b91d3a5e555c738be8bb84707dcf2455be98ea3dd0a6929495b93027f71097ff0232cc85c16be4d5381a167ee0aae5a14d542 WHIRLPOOL dbafb2f98b56cac9c3ec1377c7fae40935ca3c8b1116665ce36b82a55242dbead24dc4fc38d0268cf5af82e7f908543f1376fdd3f7d847bd92dc51438a3934ee
62 +AUX freebsd-lib-bsdxml2expat.patch 708 SHA256 0c3ec3657155c5032479181119c488d43a479ab0dfe7a7d7ed0dabce16853e85 SHA512 d3b321062886ee636a09af4b8714ae90317c17eb954a3d491cd21ca90605e26491033df4d6f02a517eda423783db74dad16adf7ee1bdc5557392cc70218ee9c7 WHIRLPOOL 5c262c59aee9e642d3a8929a453b56c7a55ba60f3011d6ac07b750a30297eb992a564ba4db18714b7eac58bbe3ded1ff4249150128947d25dd1344e59e16c9cb
63 +AUX freebsd-lib-includes.patch 316 SHA256 be4dd4c905715c2d165be282cf377f799b32ccb76986947bc0bf1b5730b57b06 SHA512 31b7f368a4d3998e42486cb944a001a8371c365276eac94fa8712e29dbe9a13a7756a2fd77fbff87a1f7f4c19b32721c74bbb099f611d46a8c78b73f92d9255e WHIRLPOOL 8c4c2c6d1e9556303520c4cd8f6996f0f24c8b45985d4326db880c187b6db30e914a6e47b40ea4a79d7a309fdd579b39232329daf74758412ac518b0a9d0a317
64 +AUX freebsd-lib-new_as.patch 1494 SHA256 6021f34246dcf768a94ffe7273ea2f5590adf6d82ce7fb555234f8012bdbd982 SHA512 f53aa3833179c701a8c0fc6c48c3ab9d1a2694a1c30287ae08e9ea94ddf8c547f7bfe632908b9c3a3ffc4541ed2bf41277a309ffbb7d3eea58d389198d884adb WHIRLPOOL 738b312f04f8a51ab7182c4fde21bfa18d90c9a85486cd071724a61c2ecdb58cb3cdf4c52c50219baab91f15ccebf7de7700267952da65ec52e7c71eab3f954b
65 +AUX freebsd-sources-9.0-sysctluint.patch 403 SHA256 884fbc5d6d3766ea3d4609946f56072f36f95368dc13ee316c330a46d42f0c9e SHA512 f3a87cb187858bc6fd1bafda3c3bd7bbda52b07239a50a7c1aa201df2c52a58d4809e196b8799b1949c8ca1a556519d454ad1789358540e3a96cd480fc0a504c WHIRLPOOL 1fd9852d59378b3fa8682886085f4f63ccd2a57806161b9a3ccb0cbe0c465be2e5620ed57942a8687656859e1a9df17c7d298ea66ec037514bbe7707783aa9f8
66 +AUX libmap.conf 201 SHA256 36a1bd56965f171cbb058f6e1762801e3b92c083fe36f6fe046bd669beed9742 SHA512 abc358dff495fe96b9ed549bacb5278577ca4da46b89b87e9211a2f6acdd455111df02ba11b797287f839af6cc22f8810e8ac1dc52154acc8b22364e667b3c49 WHIRLPOOL 0827a0ea9b8a2faed019d13356a793b2b572e54d6f8ebf32a9f12214759153433e21f7d8fdedf43e038ac1925432c1f4843441db47d29895eda51781f1fedb5e
67 +AUX libusb-1.0.pc.in 207 SHA256 edf35e887cbfed2df288825434c467e0a946eeb21e0d631f55940bb177c2ba15 SHA512 93289cecfc298a31fd4fd0848bf25a63048a7549bd81792d7bd158731246221c24ec9f469a918430da56873a0936fb2b372cedaaa32a38ccd5323de0f9a89b93 WHIRLPOOL 7c81b0df4548a9391b4e1420186f1e970aa9e2e73a89e817adbff9de52b8797cbd8a4d8b3ca01f782f86e4b1e48fad72a08b5bff49d5ee6ffaa5135c015ca5ae
68 +AUX libusb.pc.in 208 SHA256 9bfe398a335f8b9b1c3dd167ab0c9206fe3bdd4e1da318ece977e20f3c2d7c56 SHA512 e9c6d5f04057cf8c13f69a3d8e07bdd517fdb01d572a69a1beb397766311b3c53894b108caaaea740bfc27b227a9620621dac5846bff1a367fbf9954f38bb40c WHIRLPOOL e80e76a8a564655d924a7148a841c7c7cf0be0ea3bdbd76e95e5004124543826e5d925dfe791f4b040e042a10923865bb517499d9f5be39611fedbcceebe32d8
69 +DIST freebsd-cddl-9.1_rc3.tar.bz2 899359 SHA256 9b9df1bbe109f760fa8dc46655362a6527e4c6b2e0d5c814de2f3a6f8c8d110d SHA512 73c5392c22450853ca745a4e12546b71070ae59dcec82e069d79109eda9b48525f74c15d3d7a936a4ea382dc7c390a1c3739fc3b09c16ccff7bc48992240abcf WHIRLPOOL e60c993e277a54d299731c2230fb40b1c1290c2db267e5e9fddb433a39361550a71a85544e27320259eadb7794137bc2aab366654ad6683e8e5aaa4efd3dc71f
70 +DIST freebsd-contrib-9.1_rc3.tar.bz2 54754779 SHA256 90613296d804b3632902fb6fe180e6c2525ef29ba02a11efc3d73657b0476a8b SHA512 6564c77b02f472e063c439d2cbfd3bbdbd7d6507d9591eb020d0748fafa9eaaab1927f06c379f2b059f515cb2f77e13c5337f856866f0210be34d9a803885f20 WHIRLPOOL a2db66d867c4c65c7f95d627e38ea3615b650bd0eadda722e2f5e38cb34167c7c822dbe5a87b02d16bb11f37605e306764aef50368b54a8beb8cd39537702ea0
71 +DIST freebsd-crypto-9.1_rc3.tar.bz2 5680339 SHA256 67bcd36ac7ca4148d5706021c30739f337ad8e865d811613cbdc00e556d787d7 SHA512 b45085bd62c9c0063c0fd8805b2094e5cf4b0478645792ad5b79df450fb069cc6bb472996bc4958696450cd5884927eb14c7c7ea98e8c19863338866487f6eac WHIRLPOOL a0ef0c3cec5fcac47b8e5baab97a0e81b48fa18e5360773b01606a91c3488c6e5031691c4db4c37e47746c7e755c5bf4178ec8149114fb4940dc63f60a24424b
72 +DIST freebsd-etc-9.1_rc3.tar.bz2 207784 SHA256 c6d6b208077ccff739484b2b473892ee1a650c52029beff2d2b435da6dd469b7 SHA512 15153dfefa59aea78b017b9af2295a6ad488c805080dd613c0955fc9797881a3636570074cfd4adf3f4d13119ab05ccec83107b0fc809fbb8b7dab6a7a2333b3 WHIRLPOOL 6234b73f300db3e9ed8f37124892333fe80d6b39e48d4ac101cce6219db7c2a13992af56d18caffcaef8501873b2703780bdb890472e8717e1ace294f0a2ecb3
73 +DIST freebsd-gnu-9.1_rc3.tar.bz2 795216 SHA256 43f493dbf3ccfea445cff838bf9b9887ed4f9d5437278529fee306444a3ea8e4 SHA512 0679f100f83e7347d00b2749aeb57a9582404a5f9160b170f5fcac715e8f401738cf89025e23b2c036b67be2a4030e283105dc707bf745e9cd4c199cd7a2689d WHIRLPOOL 9b4a12009c0826c891907d2312bc4eef4466b8124c9c00b70775556487a1a6e88676528a682ca29c3e36cdad13d61065b955d886a79885147cfc7731186ae8f4
74 +DIST freebsd-include-9.1_rc3.tar.bz2 146460 SHA256 427fdc76ffb4fb38a2e909d492328be48cf08c62e2f2243c0d11faefd2006c85 SHA512 e7c584beaa2c574079a2c05509bee100d03d66b823de4473d8319f594810f66b3ad524297c21bef83106e4c9f3100fedabc8da0b131a9c41d9728a65a09d9486 WHIRLPOOL 26a2e5e6c1d17493b5b8e14453fdfcf36917b759e50f844762dd5d2701e8c93fe1a26550173f5ad1455304a9504a73872e9e3026b21d7debfbc2570752f32f44
75 +DIST freebsd-lib-9.1_rc3.tar.bz2 3205238 SHA256 da7001a8c23fcc614b230414cb830c12d7b238c38a15c905c695c5a1621c10f8 SHA512 761219c55b0ac067685057b519e506869fba6c472179f9d151b0e12eeacad11004ec2ec504953ace7139694c934785555e98bc16b41a248470241464599e6914 WHIRLPOOL 653258d8752cfc401a632ca59a05cce02821cf1ca279696463c6c0f71e761853617b9b0f51b1849e89b4067dc1799b1b4c528644bcd42b260af0f851caccc63e
76 +DIST freebsd-libexec-9.1_rc3.tar.bz2 305301 SHA256 4cf56ff81096112b33276f619e823c8426bc1c97904f183b431e2e98c29ef698 SHA512 3122faf7f88934c05bee6c6d5faa24998d27c35e11bf4f809af26d7b8ad0a26519715b7a29f303ba878e3e8897742486a0a86a123d00b9deb60246c8cac4e1a7 WHIRLPOOL 1b10d85d2d426457189143350b375c7a1723ff8067c37200cce15f18fa6d963b94fdd0339e91d01ed16b87e4338761e33c7afb022e50b3bbff8dbcc3a45f5b73
77 +DIST freebsd-sys-9.1_rc3.tar.bz2 32605500 SHA256 5194ac93850aff4f10978b739573ab8ee54a95a0b2d4e46f754314ae381b442b SHA512 17cd41ea66bf1d2e10b56001e6e1c80db78e1572aff4ad1ac945bc24d38dfef612e1a4b7eead8bc50b94df798b0bde3dcc13a0596860322569272b3239a30b9b WHIRLPOOL 8628c5a97675b3fe4ebfcb92c4fb6d5aebaa3a11551e4f16004a6ffb23b3d10334b623c70f255762038bf1fc80a7a27abd587f10ac9706ac1bb0b22adda266b8
78 +DIST freebsd-usbin-9.1_rc3.tar.bz2 2669370 SHA256 de606bb756c413e85a302bc91033952f1beb8066ef555db26d79943bf128aa74 SHA512 3a002d5b7cd98f1139a8bd949633434e8aec8352c3d49bca9c72b3744d60ea63a9fd5e651eedb3d439405bcfa197bfd05d5e658428e57b01e021ba1ab0304d7e WHIRLPOOL 43f066d202d053383f9f7d4b19dd06b22d9c19ad79f258905e5dc2dc9451c936c128b512d3e8cdf90c70f8a19230a536d7c119b2f45a234f04bb9dde2d87fc52
79 +EBUILD freebsd-lib-9.1_rc3-r1.ebuild 17056 SHA256 536292268d9e271f00a001459a0432f43a04405e1c8ad4f1e20d3734ca418862 SHA512 da4f02c675d1ee0a1eee67701b26e92b528d654bc7a7f91b24fa64f8e47b360ea10aac474041f0331f9cd64c4f3127ff9b056ce111dcbfe25ec95373cf97b3d1 WHIRLPOOL bde30163ee3d59407743858528d4dcb2250970a8256e8acf7512257e274b385397579b128876ec37c26db7a2cadad5a4ab808397cc2259c89e42a49c0b0a5e2f
80
81 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-flex-2.5.31.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-flex-2.5.31.patch
82 new file mode 100644
83 index 0000000..00de8a6
84 --- /dev/null
85 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-flex-2.5.31.patch
86 @@ -0,0 +1,13 @@
87 +Index: fbsd-6/lib/libipsec/policy_token.l
88 +===================================================================
89 +--- fbsd-6.orig/lib/libipsec/policy_token.l
90 ++++ fbsd-6/lib/libipsec/policy_token.l
91 +@@ -138,8 +138,6 @@ void
92 + __policy__strbuffer__init__(msg)
93 + char *msg;
94 + {
95 +- if (yy_current_buffer)
96 +- yy_delete_buffer(yy_current_buffer);
97 + strbuffer = (YY_BUFFER_STATE)yy_scan_string(msg);
98 + yy_switch_to_buffer(strbuffer);
99 +
100
101 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-gccfloat.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-gccfloat.patch
102 new file mode 100644
103 index 0000000..a3e7d5e
104 --- /dev/null
105 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-gccfloat.patch
106 @@ -0,0 +1,16 @@
107 +This patch is needed to avoid inclusion of GCC's float.h that defines
108 +LDBL_MANT_DIG at 53 (while the source file checks for 113 or 64.
109 +
110 +Index: freebsd-6.0_beta4/lib/msun/src/s_fmal.c
111 +===================================================================
112 +--- freebsd-6.0_beta4.orig/lib/msun/src/s_fmal.c
113 ++++ freebsd-6.0_beta4/lib/msun/src/s_fmal.c
114 +@@ -28,7 +28,7 @@
115 + __FBSDID("$FreeBSD: src/lib/msun/src/s_fmal.c,v 1.2 2005/03/18 02:27:59 das Exp $");
116 +
117 + #include <fenv.h>
118 +-#include <float.h>
119 ++#include <machine/float.h>
120 + #include <math.h>
121 +
122 + /*
123
124 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-pmc.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-pmc.patch
125 new file mode 100644
126 index 0000000..2f6de46
127 --- /dev/null
128 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-pmc.patch
129 @@ -0,0 +1,13 @@
130 +Index: freebsd-6.0_beta4/lib/libpmc/Makefile
131 +===================================================================
132 +--- freebsd-6.0_beta4.orig/lib/libpmc/Makefile
133 ++++ freebsd-6.0_beta4/lib/libpmc/Makefile
134 +@@ -9,6 +9,8 @@ WARNS?= 6
135 +
136 + MAN= pmc.3 pmclog.3
137 +
138 ++CFLAGS+= -I${.CURDIR}
139 ++
140 + MLINKS+= \
141 + pmc.3 pmc_allocate.3 \
142 + pmc.3 pmc_attach.3 \
143
144 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.1-csu.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.1-csu.patch
145 new file mode 100644
146 index 0000000..075f278
147 --- /dev/null
148 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.1-csu.patch
149 @@ -0,0 +1,20 @@
150 +--- lib/csu/amd64/Makefile.orig 2006-07-04 07:49:58 -0300
151 ++++ lib/csu/amd64/Makefile 2006-07-04 07:50:15 -0300
152 +@@ -16,6 +16,7 @@
153 + ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.CURDIR}/crt1.c
154 +
155 + realinstall:
156 ++ ${INSTALL} -d ${DESTDIR}${LIBDIR}
157 + ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
158 + ${OBJS} ${DESTDIR}${LIBDIR}
159 +
160 +--- lib/csu/sparc64/Makefile.orig 2006-10-06 15:13:55 +0100
161 ++++ lib/csu/sparc64/Makefile 2006-10-06 15:15:06 +0100
162 +@@ -15,6 +15,7 @@
163 + ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC}
164 +
165 + realinstall:
166 ++ ${INSTALL} -d ${DESTDIR}${LIBDIR}
167 + ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
168 + ${OBJS} ${DESTDIR}${LIBDIR}
169 +
170
171 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.2-bluetooth.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.2-bluetooth.patch
172 new file mode 100644
173 index 0000000..a9b8435
174 --- /dev/null
175 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.2-bluetooth.patch
176 @@ -0,0 +1,11 @@
177 +--- lib/libsdp/Makefile 2007-06-15 12:04:37 +0200
178 ++++ lib.sdp/libsdp/Makefile 2007-06-15 12:26:14 +0200
179 +@@ -5,7 +5,7 @@
180 + MAN= sdp.3
181 +
182 + WARNS?= 2
183 +-CFLAGS+= -I${.CURDIR}
184 ++CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libbluetooth
185 +
186 + SHLIB_MAJOR= 2
187 +
188
189 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-7.0-CVE-2008-1391.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.0-CVE-2008-1391.patch
190 new file mode 100644
191 index 0000000..2b8d401
192 --- /dev/null
193 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.0-CVE-2008-1391.patch
194 @@ -0,0 +1,11 @@
195 +--- lib/libc/stdlib/strfmon.c 2008/04/22 13:23:34
196 ++++ lib/libc/stdlib/strfmon.c 2008/04/24 07:49:00
197 +@@ -65,6 +65,8 @@
198 + #define GET_NUMBER(VAR) do { \
199 + VAR = 0; \
200 + while (isdigit((unsigned char)*fmt)) { \
201 ++ if (VAR > INT_MAX / 10) \
202 ++ goto e2big_error; \
203 + VAR *= 10; \
204 + VAR += *fmt - '0'; \
205 + if (VAR < 0) \
206
207 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-types.h-fix.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-types.h-fix.patch
208 new file mode 100644
209 index 0000000..8de5df2
210 --- /dev/null
211 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-types.h-fix.patch
212 @@ -0,0 +1,15 @@
213 +Fixes a compile error if XOPEN_SOURCE 600 is defined.
214 +
215 +See: http://www.mailinglistarchive.com/freebsd-current@×××××××.org/msg15011.html
216 +
217 +--- sys/sys/types.h.orig
218 ++++ sys/sys/types.h
219 +@@ -46,7 +46,7 @@
220 +
221 + #include <sys/_pthreadtypes.h>
222 +
223 +-#if __BSD_VISIBLE
224 ++#ifndef _POSIX_SOURCE
225 + typedef unsigned char u_char;
226 + typedef unsigned short u_short;
227 + typedef unsigned int u_int;
228
229 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-7.2-rtldnoload.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.2-rtldnoload.patch
230 new file mode 100644
231 index 0000000..77bbe2e
232 --- /dev/null
233 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.2-rtldnoload.patch
234 @@ -0,0 +1,30 @@
235 +Backported from 8.0.
236 +Even if RTLD_NOLOAD is not standard, dev-libs/nss expects it.
237 +Since it has made it to 8.0 we can afford backporting it.
238 +
239 +--- include/dlfcn.h.old 2010-01-10 18:42:04 +0100
240 ++++ include/dlfcn.h 2010-01-10 18:42:19 +0100
241 +@@ -47,6 +47,7 @@
242 + #define RTLD_GLOBAL 0x100 /* Make symbols globally available. */
243 + #define RTLD_LOCAL 0 /* Opposite of RTLD_GLOBAL, and the default. */
244 + #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */
245 ++#define RTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */
246 +
247 + /*
248 + * Request arguments for dlinfo().
249 +--- lib/libc/gen/dlopen.3.old 2010-01-10 18:43:15 +0100
250 ++++ lib/libc/gen/dlopen.3 2010-01-10 18:45:27 +0100
251 +@@ -141,6 +141,13 @@
252 + With this flag
253 + .Fn dlopen
254 + will return to the caller only in the case of error.
255 ++.It Dv RTLD_NOLOAD
256 ++Only return valid handle for the object if it is already loaded in
257 ++the process address space, otherwise
258 ++.Dv NULL
259 ++is returned.
260 ++Other mode flags may be specified, which will be applied for promotion
261 ++for the found object.
262 + .El
263 + .Pp
264 + If
265
266 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-gcc45.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-gcc45.patch
267 new file mode 100644
268 index 0000000..2ddb9ea
269 --- /dev/null
270 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-gcc45.patch
271 @@ -0,0 +1,28 @@
272 +diff -Nur work.orig/include/rpcsvc/nis.x work/include/rpcsvc/nis.x
273 +--- work.orig/include/rpcsvc/nis.x 2009-10-25 10:10:29.000000000 +0900
274 ++++ work/include/rpcsvc/nis.x 2011-04-13 21:25:13.000000000 +0900
275 +@@ -399,10 +399,7 @@
276 + %#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
277 + %#define WORLD_DEFAULT (NIS_READ_ACC)
278 + %#define GROUP_DEFAULT (NIS_READ_ACC << 8)
279 +-%#define OWNER_DEFAULT ((NIS_READ_ACC +\
280 +- NIS_MODIFY_ACC +\
281 +- NIS_CREATE_ACC +\
282 +- NIS_DESTROY_ACC) << 16)
283 ++%#define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC + NIS_DESTROY_ACC) << 16)
284 + %#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
285 + %
286 + %/* Result manipulation defines ... */
287 +@@ -431,10 +428,8 @@
288 + % * these definitions they take an nis_object *, and an int and return
289 + % * a u_char * for Value, and an int for length.
290 + % */
291 +-%#define ENTRY_VAL(obj, col) \
292 +- (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
293 +-%#define ENTRY_LEN(obj, col) \
294 +- (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
295 ++%#define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
296 ++%#define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
297 + %
298 + %#ifdef __cplusplus
299 + %}
300
301 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-log2.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-log2.patch
302 new file mode 100644
303 index 0000000..a9fd189
304 --- /dev/null
305 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-log2.patch
306 @@ -0,0 +1,21 @@
307 +log2 and log2f are required by C99 and are not implemented.
308 +Workaround the deficiency.
309 +
310 +--- lib/msun/src/math.h.old 2010-03-14 17:02:25.000000000 +0100
311 ++++ lib/msun/src/math.h 2010-03-14 17:07:03.000000000 +0100
312 +@@ -203,6 +203,7 @@
313 + double frexp(double, int *); /* fundamentally !__pure2 */
314 + double ldexp(double, int);
315 + double log(double);
316 ++#define log2(x) log(x)/log(2.0)
317 + double log10(double);
318 + double modf(double, double *); /* fundamentally !__pure2 */
319 +
320 +@@ -319,6 +320,7 @@
321 + float log10f(float);
322 + float log1pf(float);
323 + float logf(float);
324 ++#define log2f(x) logf(x)/logf(2.0)
325 + float modff(float, float *); /* fundamentally !__pure2 */
326 +
327 + float powf(float, float);
328
329 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-rpcsec_gss.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-rpcsec_gss.patch
330 new file mode 100644
331 index 0000000..a7de06f
332 --- /dev/null
333 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-rpcsec_gss.patch
334 @@ -0,0 +1,12 @@
335 +Without this linking fails during a stage3 build.
336 +
337 +--- lib/librpcsec_gss/Makefile.orig
338 ++++ lib/librpcsec_gss/Makefile
339 +@@ -8,6 +8,7 @@
340 +
341 + DPADD+= ${LIBGSSAPI}
342 + LDADD+= -lgssapi
343 ++LDFLAGS+= -L${.OBJDIR}/../libgssapi
344 +
345 + VERSION_DEF= ${.CURDIR}/../libc/Versions.def
346 + SYMBOL_MAPS= ${.CURDIR}/Symbol.map
347
348 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-8.2-liblink.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.2-liblink.patch
349 new file mode 100644
350 index 0000000..c8be7f4
351 --- /dev/null
352 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.2-liblink.patch
353 @@ -0,0 +1,19 @@
354 +--- lib/libproc/Makefile.old 2011-07-06 00:58:04.000000000 +0000
355 ++++ lib/libproc/Makefile 2011-07-06 00:58:58.000000000 +0000
356 +@@ -18,5 +18,6 @@
357 + WARNS?= 6
358 +
359 + WITHOUT_MAN= yes
360 ++LDADD=-lelf
361 +
362 + .include <bsd.lib.mk>
363 +--- lib/librtld_db/Makefile.old 2011-07-06 00:58:12.000000000 +0000
364 ++++ lib/librtld_db/Makefile 2011-07-06 00:59:27.000000000 +0000
365 +@@ -10,5 +10,7 @@
366 + INCS= rtld_db.h
367 +
368 + CFLAGS+= -I${.CURDIR}
369 ++LDADD=-lutil -lproc
370 ++LDFLAGS+=-L${.CURDIR}/../libutil -L${.CURDIR}/../libproc
371 +
372 + .include <bsd.lib.mk>
373
374 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-8.2-nlm_syscall.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.2-nlm_syscall.patch
375 new file mode 100644
376 index 0000000..556ade5
377 --- /dev/null
378 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.2-nlm_syscall.patch
379 @@ -0,0 +1,10 @@
380 +--- include/unistd.h 2010/12/20 20:39:49 216602
381 ++++ include/unistd.h 2010/12/20 21:12:18 216603
382 +@@ -529,6 +529,7 @@
383 + #define _MKTEMP_DECLARED
384 + #endif
385 + int nfssvc(int, void *);
386 ++int nlm_syscall(int, int, int, char **);
387 + int profil(char *, size_t, vm_offset_t, int);
388 + int rcmd(char **, int, const char *, const char *, const char *, int *);
389 + int rcmd_af(char **, int, const char *,
390
391 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-liblink.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-liblink.patch
392 new file mode 100644
393 index 0000000..f8e4707
394 --- /dev/null
395 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-liblink.patch
396 @@ -0,0 +1,21 @@
397 +diff -uNr lib.ol/libproc/Makefile lib/libproc/Makefile
398 +--- lib.ol/libproc/Makefile 2011-11-02 14:02:17.000000000 +0000
399 ++++ lib/libproc/Makefile 2011-11-02 14:03:09.000000000 +0000
400 +@@ -16,5 +16,6 @@
401 + SHLIB_MAJOR= 2
402 +
403 + WITHOUT_MAN=
404 ++LDADD+=-lelf
405 +
406 + .include <bsd.lib.mk>
407 +diff -uNr lib.ol/librtld_db/Makefile lib/librtld_db/Makefile
408 +--- lib.ol/librtld_db/Makefile 2011-11-02 14:02:13.000000000 +0000
409 ++++ lib/librtld_db/Makefile 2011-11-02 14:04:00.000000000 +0000
410 +@@ -10,5 +10,7 @@
411 + INCS= rtld_db.h
412 +
413 + CFLAGS+= -I${.CURDIR}
414 ++LDADD+=-lutil -lproc
415 ++LDFLAGS+=-L${.OBJDIR}/../libutil -L${.OBJDIR}/../libproc
416 +
417 + .include <bsd.lib.mk>
418
419 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-opieincludes.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-opieincludes.patch
420 new file mode 100644
421 index 0000000..bf77a0a
422 --- /dev/null
423 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-opieincludes.patch
424 @@ -0,0 +1,122 @@
425 +Fixes warnings like:
426 +/var/tmp/portage/sys-freebsd/freebsd-lib-9.0-r2/work/lib/libopie/../../contrib/opie/libopie/randomchallenge.c:43:5:
427 +warning: incompatible implicit declaration of built-in function ‘strcpy’
428 +
429 +diff -uNr contrib.old/opie/libopie/accessfile.c contrib/opie/libopie/accessfile.c
430 +--- contrib.old/opie/libopie/accessfile.c 2012-05-25 08:54:33.000000000 -0400
431 ++++ contrib/opie/libopie/accessfile.c 2012-05-25 09:12:34.000000000 -0400
432 +@@ -46,6 +46,7 @@
433 + #ifdef DEBUG
434 + #include <syslog.h>
435 + #endif /* DEBUG */
436 ++#include <ctype.h>
437 +
438 + #include "opie.h"
439 +
440 +diff -uNr contrib.old/opie/libopie/generator.c contrib/opie/libopie/generator.c
441 +--- contrib.old/opie/libopie/generator.c 2012-05-25 08:54:33.000000000 -0400
442 ++++ contrib/opie/libopie/generator.c 2012-05-25 08:58:10.000000000 -0400
443 +@@ -50,6 +50,7 @@
444 + #include <syslog.h>
445 + #endif /* DEBUG */
446 + #include "opie.h"
447 ++#include <stdio.h>
448 +
449 + static char *algids[] = { NULL, NULL, NULL, "sha1", "md4", "md5" };
450 +
451 +diff -uNr contrib.old/opie/libopie/lookup.c contrib/opie/libopie/lookup.c
452 +--- contrib.old/opie/libopie/lookup.c 2012-05-25 08:54:33.000000000 -0400
453 ++++ contrib/opie/libopie/lookup.c 2012-05-25 09:15:08.000000000 -0400
454 +@@ -14,6 +14,7 @@
455 + #include "opie_cfg.h"
456 + #include <stdio.h>
457 + #include "opie.h"
458 ++#include <string.h>
459 +
460 + int opielookup FUNCTION((opie, principal), struct opie *opie AND char *principal)
461 + {
462 +diff -uNr contrib.old/opie/libopie/newseed.c contrib/opie/libopie/newseed.c
463 +--- contrib.old/opie/libopie/newseed.c 2012-05-25 08:54:33.000000000 -0400
464 ++++ contrib/opie/libopie/newseed.c 2012-05-25 09:14:37.000000000 -0400
465 +@@ -36,6 +36,9 @@
466 + #include <syslog.h>
467 + #endif /* DEBUG */
468 + #include "opie.h"
469 ++#include <stdio.h>
470 ++#include <stdlib.h>
471 ++#include <time.h>
472 +
473 + int opienewseed FUNCTION((seed), char *seed)
474 + {
475 +diff -uNr contrib.old/opie/libopie/parsechallenge.c contrib/opie/libopie/parsechallenge.c
476 +--- contrib.old/opie/libopie/parsechallenge.c 2012-05-25 08:54:33.000000000 -0400
477 ++++ contrib/opie/libopie/parsechallenge.c 2012-05-25 09:15:54.000000000 -0400
478 +@@ -20,6 +20,8 @@
479 + #include <string.h>
480 + #endif /* HAVE_STRING_H */
481 + #include "opie.h"
482 ++#include <stdlib.h>
483 ++#include <ctype.h>
484 +
485 + struct algorithm {
486 + char *name;
487 +diff -uNr contrib.old/opie/libopie/passwd.c contrib/opie/libopie/passwd.c
488 +--- contrib.old/opie/libopie/passwd.c 2012-05-25 08:54:33.000000000 -0400
489 ++++ contrib/opie/libopie/passwd.c 2012-05-25 09:13:45.000000000 -0400
490 +@@ -22,6 +22,7 @@
491 +
492 + #include "opie_cfg.h"
493 + #include "opie.h"
494 ++#include <string.h>
495 +
496 + int opiepasswd FUNCTION((old, flags, principal, n, seed, ks), struct opie *old AND int flags AND char *principal AND int n AND char *seed AND char *ks)
497 + {
498 +diff -uNr contrib.old/opie/libopie/randomchallenge.c contrib/opie/libopie/randomchallenge.c
499 +--- contrib.old/opie/libopie/randomchallenge.c 2012-05-25 08:54:33.000000000 -0400
500 ++++ contrib/opie/libopie/randomchallenge.c 2012-05-25 09:00:27.000000000 -0400
501 +@@ -28,6 +28,9 @@
502 +
503 + #include "opie_cfg.h"
504 + #include "opie.h"
505 ++#include <stdio.h>
506 ++#include <string.h>
507 ++#include <stdlib.h>
508 +
509 + static char *algids[] = { 0, 0, 0, "sha1", "md4", "md5" };
510 +
511 +diff -uNr contrib.old/opie/libopie/verify.c contrib/opie/libopie/verify.c
512 +--- contrib.old/opie/libopie/verify.c 2012-05-25 08:54:33.000000000 -0400
513 ++++ contrib/opie/libopie/verify.c 2012-05-25 09:12:09.000000000 -0400
514 +@@ -25,6 +25,7 @@
515 + #include <string.h>
516 + #endif /* HAVE_STRING_H */
517 + #include "opie.h"
518 ++#include <ctype.h>
519 +
520 + #define RESPONSE_STANDARD 0
521 + #define RESPONSE_WORD 1
522 +diff -uNr contrib.old/opie/libopie/version.c contrib/opie/libopie/version.c
523 +--- contrib.old/opie/libopie/version.c 2012-05-25 08:54:33.000000000 -0400
524 ++++ contrib/opie/libopie/version.c 2012-05-25 09:13:15.000000000 -0400
525 +@@ -19,6 +19,8 @@
526 + */
527 + #include "opie_cfg.h"
528 + #include "opie.h"
529 ++#include <stdio.h>
530 ++#include <stdlib.h>
531 +
532 + VOIDRET opieversion FUNCTION_NOARGS
533 + {
534 +diff -uNr contrib.old/opie/opie.h contrib/opie/opie.h
535 +--- contrib.old/opie/opie.h 2012-05-25 08:54:33.000000000 -0400
536 ++++ contrib/opie/opie.h 2012-05-25 09:21:28.000000000 -0400
537 +@@ -158,6 +158,9 @@
538 + int __opiereadrec __P((struct opie *));
539 + int __opiewriterec __P((struct opie *));
540 + int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts));
541 ++VOIDRET opiehashlen FUNCTION((algorithm, in, out, n), int algorithm AND VOIDPTR in AND struct opie_otpkey *out AND int n);
542 ++int opieinsecure FUNCTION_NOARGS;
543 ++int opienewseed FUNCTION((seed), char *seed);
544 + __END_DECLS
545 +
546 + #define opiestrncpy(dst, src, n) \
547
548 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-trylock-adaptive.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-trylock-adaptive.patch
549 new file mode 100644
550 index 0000000..e72b171
551 --- /dev/null
552 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-trylock-adaptive.patch
553 @@ -0,0 +1,14 @@
554 +http://www.freebsd.org/cgi/query-pr.cgi?pr=168317
555 +
556 +Index: lib/libthr/thread/thr_mutex.c
557 +===================================================================
558 +--- lib/libthr/thread/thr_mutex.c (revision 235924)
559 ++++ lib/libthr/thread/thr_mutex.c (working copy)
560 +@@ -538,6 +538,7 @@
561 + switch (PMUTEX_TYPE(m->m_flags)) {
562 + case PTHREAD_MUTEX_ERRORCHECK:
563 + case PTHREAD_MUTEX_NORMAL:
564 ++ case PTHREAD_MUTEX_ADAPTIVE_NP:
565 + ret = EBUSY;
566 + break;
567 +
568
569 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml.patch
570 new file mode 100644
571 index 0000000..ec90def
572 --- /dev/null
573 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml.patch
574 @@ -0,0 +1,13 @@
575 +diff -u lib/libgeom/Makefile lib.xml/libgeom/Makefile
576 +--- lib/libgeom/Makefile 2004-03-07 16:07:57 +0000
577 ++++ lib.xml/libgeom/Makefile 2005-05-06 10:38:41 +0000
578 +@@ -8,7 +8,8 @@
579 + SRCS+= geom_ctl.c
580 + INCS= libgeom.h
581 +
582 +-CFLAGS += -I${.CURDIR}
583 ++CFLAGS += -I${.CURDIR} -I${.CURDIR}/../libexpat
584 ++LDFLAGS += -L${.CURDIR}/../libexpat
585 +
586 + WARNS?= 3
587 +
588
589 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml2expat.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml2expat.patch
590 new file mode 100644
591 index 0000000..1b4e791
592 --- /dev/null
593 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml2expat.patch
594 @@ -0,0 +1,26 @@
595 +diff -ur lib/libgeom.old/Makefile lib/libgeom/Makefile
596 +--- lib/libgeom.old/Makefile 2011-07-10 14:23:51.000000000 +0000
597 ++++ lib/libgeom/Makefile 2011-07-10 15:12:39.000000000 +0000
598 +@@ -13,8 +13,8 @@
599 +
600 + WARNS?= 3
601 +
602 +-DPADD= ${LIBBSDXML} ${LIBSBUF}
603 +-LDADD= -lbsdxml -lsbuf
604 ++DPADD= ${LIBSBUF}
605 ++LDADD= -lexpat -lsbuf
606 +
607 + MAN= libgeom.3
608 +
609 +diff -ur lib/libgeom.old/geom_xml2tree.c lib/libgeom/geom_xml2tree.c
610 +--- lib/libgeom.old/geom_xml2tree.c 2010-12-21 17:09:25.000000000 +0000
611 ++++ lib/libgeom/geom_xml2tree.c 2011-07-10 15:12:52.000000000 +0000
612 +@@ -43,7 +43,7 @@
613 + #include <sys/sbuf.h>
614 + #include <sys/sysctl.h>
615 + #include <err.h>
616 +-#include <bsdxml.h>
617 ++#include <expat.h>
618 + #include <libgeom.h>
619 +
620 + struct mystate {
621
622 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-includes.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-includes.patch
623 new file mode 100644
624 index 0000000..c2cf142
625 --- /dev/null
626 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-includes.patch
627 @@ -0,0 +1,13 @@
628 +Fix headers dependencies so that they can be included alone.
629 +
630 +--- include/ifaddrs.h.old 2009-05-15 13:50:10 +0000
631 ++++ include/ifaddrs.h 2009-05-15 13:50:23 +0000
632 +@@ -28,6 +28,8 @@
633 + #ifndef _IFADDRS_H_
634 + #define _IFADDRS_H_
635 +
636 ++#include <sys/types.h>
637 ++
638 + struct ifaddrs {
639 + struct ifaddrs *ifa_next;
640 + char *ifa_name;
641
642 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-new_as.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-new_as.patch
643 new file mode 100644
644 index 0000000..c9288a4
645 --- /dev/null
646 +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-new_as.patch
647 @@ -0,0 +1,68 @@
648 +--- lib/msun/i387/fenv.c.orig 2007-01-05 04:15:26 -0300
649 ++++ lib/msun/i387/fenv.c 2008-06-14 00:49:30 -0300
650 +@@ -152,7 +152,8 @@
651 + int
652 + feupdateenv(const fenv_t *envp)
653 + {
654 +- int mxcsr, status;
655 ++ int mxcsr;
656 ++ short status;
657 +
658 + __fnstsw(&status);
659 + if (__HAS_SSE())
660 +--- lib/msun/i387/fenv.h.orig 2007-01-06 18:46:23 -0300
661 ++++ lib/msun/i387/fenv.h 2008-06-14 01:06:40 -0300
662 +@@ -134,7 +134,8 @@
663 + static __inline int
664 + fegetexceptflag(fexcept_t *__flagp, int __excepts)
665 + {
666 +- int __mxcsr, __status;
667 ++ int __mxcsr;
668 ++ short __status;
669 +
670 + __fnstsw(&__status);
671 + if (__HAS_SSE())
672 +@@ -151,7 +152,8 @@
673 + static __inline int
674 + fetestexcept(int __excepts)
675 + {
676 +- int __mxcsr, __status;
677 ++ int __mxcsr;
678 ++ short __status;
679 +
680 + __fnstsw(&__status);
681 + if (__HAS_SSE())
682 +--- lib/msun/amd64/fenv.c.orig 2007-01-05 04:15:26 -0300
683 ++++ lib/msun/amd64/fenv.c 2008-06-14 01:02:41 -0300
684 +@@ -101,7 +101,8 @@
685 + int
686 + feupdateenv(const fenv_t *envp)
687 + {
688 +- int mxcsr, status;
689 ++ int mxcsr;
690 ++ short status;
691 +
692 + __fnstsw(&status);
693 + __stmxcsr(&mxcsr);
694 +--- lib/msun/amd64/fenv.h.orig 2007-01-06 18:46:23 -0300
695 ++++ lib/msun/amd64/fenv.h 2008-06-14 01:08:23 -0300
696 +@@ -110,7 +110,8 @@
697 + static __inline int
698 + fegetexceptflag(fexcept_t *__flagp, int __excepts)
699 + {
700 +- int __mxcsr, __status;
701 ++ int __mxcsr;
702 ++ short __status;
703 +
704 + __stmxcsr(&__mxcsr);
705 + __fnstsw(&__status);
706 +@@ -124,7 +125,8 @@
707 + static __inline int
708 + fetestexcept(int __excepts)
709 + {
710 +- int __mxcsr, __status;
711 ++ int __mxcsr;
712 ++ short __status;
713 +
714 + __stmxcsr(&__mxcsr);
715 + __fnstsw(&__status);
716
717 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-sources-9.0-sysctluint.patch b/sys-freebsd/freebsd-lib/files/freebsd-sources-9.0-sysctluint.patch
718 new file mode 100644
719 index 0000000..751a77c
720 --- /dev/null
721 +++ b/sys-freebsd/freebsd-lib/files/freebsd-sources-9.0-sysctluint.patch
722 @@ -0,0 +1,13 @@
723 +u_int is defined in sys/types.h
724 +makes header usable alone.
725 +
726 +--- sys/sys/sysctl.h.old 2012-05-25 11:08:53.000000000 -0400
727 ++++ sys/sys/sysctl.h 2012-05-25 11:09:16.000000000 -0400
728 +@@ -788,6 +788,7 @@
729 + struct sysctl_req *);
730 + #else /* !_KERNEL */
731 + #include <sys/cdefs.h>
732 ++#include <sys/types.h> /* for u_int */
733 +
734 + __BEGIN_DECLS
735 + int sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
736
737 diff --git a/sys-freebsd/freebsd-lib/files/libmap.conf b/sys-freebsd/freebsd-lib/files/libmap.conf
738 new file mode 100644
739 index 0000000..7a879f9
740 --- /dev/null
741 +++ b/sys-freebsd/freebsd-lib/files/libmap.conf
742 @@ -0,0 +1,8 @@
743 +# /etc/libmap.conf
744 +
745 +# Ensure that libthr does all threading
746 +libpthread.so.2 libthr.so.2
747 +libpthread.so libthr.so
748 +libc_r.so.6 libthr.so.2
749 +libc_r.so libthr.so
750 +
751
752 diff --git a/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in b/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in
753 new file mode 100644
754 index 0000000..058ecb4
755 --- /dev/null
756 +++ b/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in
757 @@ -0,0 +1,11 @@
758 +prefix=/usr
759 +exec_prefix=${prefix}
760 +libdir=@LIBDIR@
761 +includedir=${prefix}/include
762 +
763 +Name: libusb
764 +Description: USB access library (FreeBSD version)
765 +Version: 1.0.1
766 +Libs: -L${libdir} -lusb
767 +Cflags: -I${includedir}
768 +
769
770 diff --git a/sys-freebsd/freebsd-lib/files/libusb.pc.in b/sys-freebsd/freebsd-lib/files/libusb.pc.in
771 new file mode 100644
772 index 0000000..f63c6e3
773 --- /dev/null
774 +++ b/sys-freebsd/freebsd-lib/files/libusb.pc.in
775 @@ -0,0 +1,11 @@
776 +prefix=/usr
777 +exec_prefix=${prefix}
778 +libdir=@LIBDIR@
779 +includedir=${prefix}/include
780 +
781 +Name: libusb
782 +Description: USB access library (FreeBSD version)
783 +Version: 0.1.12
784 +Libs: -L${libdir} -lusb
785 +Cflags: -I${includedir}
786 +
787
788 diff --git a/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild b/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild
789 new file mode 100644
790 index 0000000..aca6bd9
791 --- /dev/null
792 +++ b/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild
793 @@ -0,0 +1,528 @@
794 +# Copyright 1999-2012 Gentoo Foundation
795 +# Distributed under the terms of the GNU General Public License v2
796 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild,v 1.1 2012/11/09 20:58:00 ryao Exp $
797 +
798 +EAPI=2
799 +
800 +inherit bsdmk freebsd flag-o-matic multilib toolchain-funcs eutils
801 +
802 +DESCRIPTION="FreeBSD's base system libraries"
803 +SLOT="0"
804 +KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
805 +
806 +# Crypto is needed to have an internal OpenSSL header
807 +# sys is needed for libalias, probably we can just extract that instead of
808 +# extracting the whole tarball
809 +SRC_URI="mirror://gentoo/${LIB}.tar.bz2
810 + mirror://gentoo/${CONTRIB}.tar.bz2
811 + mirror://gentoo/${CRYPTO}.tar.bz2
812 + mirror://gentoo/${LIBEXEC}.tar.bz2
813 + mirror://gentoo/${ETC}.tar.bz2
814 + mirror://gentoo/${INCLUDE}.tar.bz2
815 + mirror://gentoo/${USBIN}.tar.bz2
816 + mirror://gentoo/${GNU}.tar.bz2
817 + build? (
818 + mirror://gentoo/${SYS}.tar.bz2 )
819 + zfs? (
820 + mirror://gentoo/${CDDL}.tar.bz2 )"
821 +
822 +if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then
823 + RDEPEND="ssl? ( dev-libs/openssl )
824 + hesiod? ( net-dns/hesiod )
825 + kerberos? ( virtual/krb5 )
826 + usb? ( !dev-libs/libusb !dev-libs/libusbx )
827 + userland_GNU? ( sys-apps/mtree )
828 + zfs? ( =sys-freebsd/freebsd-cddl-${RV}* )
829 + >=dev-libs/expat-2.0.1
830 + !sys-libs/libutempter
831 + !sys-freebsd/freebsd-headers"
832 + DEPEND="${RDEPEND}
833 + >=sys-devel/flex-2.5.31-r2
834 + =sys-freebsd/freebsd-sources-${RV}*
835 + !bootstrap? ( app-arch/bzip2 )"
836 +else
837 + SRC_URI="${SRC_URI}
838 + mirror://gentoo/${SYS}.tar.bz2"
839 +fi
840 +
841 +DEPEND="${DEPEND}
842 + =sys-freebsd/freebsd-mk-defs-${RV}*"
843 +
844 +S="${WORKDIR}/lib"
845 +
846 +export CTARGET=${CTARGET:-${CHOST}}
847 +if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then
848 + export CTARGET=${CATEGORY/cross-}
849 +fi
850 +
851 +IUSE="atm bluetooth ssl hesiod ipv6 kerberos usb netware
852 + build bootstrap crosscompile_opts_headers-only zfs
853 + userland_GNU userland_BSD multilib"
854 +
855 +pkg_setup() {
856 + [ -c /dev/zero ] || \
857 + die "You forgot to mount /dev; the compiled libc would break."
858 +
859 + if ! use ssl && use kerberos; then
860 + eerror "If you want kerberos support you need to enable ssl support, too."
861 + fi
862 +
863 + use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
864 + use bluetooth || mymakeopts="${mymakeopts} WITHOUT_BLUETOOTH= "
865 + use hesiod || mymakeopts="${mymakeopts} WITHOUT_HESIOD= "
866 + use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6_SUPPORT= "
867 + use kerberos || mymakeopts="${mymakeopts} WITHOUT_KERBEROS_SUPPORT= "
868 + use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
869 + use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= "
870 + use usb || mymakeopts="${mymakeopts} WITHOUT_USB= "
871 + use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= "
872 +
873 + mymakeopts="${mymakeopts} WITHOUT_BIND= WITHOUT_BIND_LIBS= WITHOUT_SENDMAIL= WITHOUT_CLANG= "
874 +
875 + if [ "${CTARGET}" != "${CHOST}" ]; then
876 + mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})"
877 + mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})"
878 + fi
879 +}
880 +
881 +PATCHES=(
882 + "${FILESDIR}/${PN}-6.0-pmc.patch"
883 + "${FILESDIR}/${PN}-6.0-gccfloat.patch"
884 + "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch"
885 + "${FILESDIR}/${PN}-6.1-csu.patch"
886 + "${FILESDIR}/${PN}-8.0-rpcsec_gss.patch"
887 + "${FILESDIR}/${PN}-9.0-liblink.patch"
888 + "${FILESDIR}/${PN}-bsdxml2expat.patch" )
889 +
890 +# Here we disable and remove source which we don't need or want
891 +# In order:
892 +# - ncurses stuff
893 +# - libexpat creates a bsdxml library which is the same as expat
894 +# - archiving libraries (have their own ebuild)
895 +# - sendmail libraries (they are installed by sendmail)
896 +# - SNMP library and dependency (have their own ebuilds)
897 +# - Clang (compiler_rt and blocksruntime)
898 +#
899 +# The rest are libraries we already have somewhere else because
900 +# they are contribution.
901 +# Note: libtelnet is an internal lib used by telnet and telnetd programs
902 +# as it's not used in freebsd-lib package itself, it's pointless building
903 +# it here.
904 +REMOVE_SUBDIRS="ncurses \
905 + libexpat \
906 + libz libbz2 libarchive liblzma \
907 + libsm libsmdb libsmutil \
908 + libbegemot libbsnmp \
909 + libcompiler_rt libblocksruntime \
910 + libpam libpcap bind libwrap libmagic \
911 + libcom_err libtelnet
912 + libelf libedit"
913 +
914 +# Are we building a cross-compiler?
915 +is_crosscompile() {
916 + [ "${CATEGORY#*cross-}" != "${CATEGORY}" ]
917 +}
918 +
919 +src_prepare() {
920 + sed -i.bak -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc"
921 +
922 + # Upstream Display Managers default to using VT7
923 + # We should make FreeBSD allow this by default
924 + local x=
925 + for x in "${WORKDIR}"/etc/etc.*/ttys ; do
926 + sed -i.bak \
927 + -e '/ttyv5[[:space:]]/ a\
928 +# Display Managers default to VT7.\
929 +# If you use the xdm init script, keep ttyv6 commented out\
930 +# unless you force a different VT for the DM being used.' \
931 + -e '/^ttyv[678][[:space:]]/ s/^/# /' "${x}" \
932 + || die "Failed to sed ${x}"
933 + rm "${x}".bak
934 + done
935 +
936 + # This one is here because it also
937 + # patches "${WORKDIR}/include"
938 + cd "${WORKDIR}"
939 + epatch "${FILESDIR}/${PN}-includes.patch"
940 + epatch "${FILESDIR}/${PN}-8.0-gcc45.patch"
941 + epatch "${FILESDIR}/${PN}-9.0-opieincludes.patch"
942 +
943 + # Don't install the hesiod man page or header
944 + rm "${WORKDIR}"/include/hesiod.h || die
945 + sed -i.bak -e 's:hesiod.h::' "${WORKDIR}"/include/Makefile || die
946 + sed -i.bak -e 's:hesiod.c::' -e 's:hesiod.3::' \
947 + "${WORKDIR}"/lib/libc/net/Makefile.inc || die
948 +
949 + # Fix the Makefiles of these few libraries that will overwrite our LDADD.
950 + cd "${S}"
951 + for dir in libradius libtacplus libcam libdevstat libfetch libgeom libmemstat libopie \
952 + libsmb; do sed -i.bak -e 's:LDADD=:LDADD+=:g' "${dir}/Makefile" || \
953 + die "Problem fixing \"${dir}/Makefile"
954 + done
955 + # Call LD with LDFLAGS, rename them to RAW_LDFLAGS
956 + sed -e 's/LDFLAGS/RAW_LDFLAGS/g' \
957 + -i "${S}/csu/i386-elf/Makefile" \
958 + -i "${S}/csu/ia64/Makefile" || die
959 + if use build; then
960 + cd "${WORKDIR}"
961 + # This patch has to be applied on ${WORKDIR}/sys, so we do it here since it
962 + # shouldn't be a symlink to /usr/src/sys (which should be already patched)
963 + epatch "${FILESDIR}"/${PN}-7.1-types.h-fix.patch
964 + epatch "${FILESDIR}"/freebsd-sources-9.0-sysctluint.patch
965 + return 0
966 + fi
967 +
968 + if ! is_crosscompile ; then
969 + ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys" || die "Couldn't make sys symlink!"
970 + else
971 + sed -i.bak -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \
972 + "${S}/libc/rpc/Makefile.inc" \
973 + "${S}/libc/yp/Makefile.inc"
974 + fi
975 +
976 + if install --version 2> /dev/null | grep -q GNU; then
977 + sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
978 + fi
979 +
980 + # Let arch-specific includes to be found
981 + local machine
982 + machine=$(tc-arch-kernel ${CTARGET})
983 + ln -s "${WORKDIR}/sys/${machine}/include" "${WORKDIR}/include/machine" || \
984 + die "Couldn't make ${machine}/include symlink."
985 +
986 + cd "${S}"
987 + use bootstrap && dummy_mk libstand
988 + # Try to fix sed calls for GNU sed. Do it only with GNU userland and force
989 + # BSD's sed on BSD.
990 + if use userland_GNU; then
991 + find . -name Makefile -exec sed -ibak 's/sed -i /sed -i/' {} \;
992 + fi
993 +}
994 +
995 +get_csudir() {
996 + if [ -d "${WORKDIR}/lib/csu/$1-elf" ]; then
997 + echo "lib/csu/$1-elf"
998 + else
999 + echo "lib/csu/$1"
1000 + fi
1001 +}
1002 +
1003 +bootstrap_csu() {
1004 + local csudir="$(get_csudir $(tc-arch-kernel ${CTARGET}))"
1005 + export RAW_LDFLAGS=$(raw-ldflags)
1006 + cd "${WORKDIR}/${csudir}" || die "Missing ${csudir}."
1007 + freebsd_src_compile
1008 +
1009 + CFLAGS="${CFLAGS} -B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}"
1010 + append-ldflags "-B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}"
1011 +}
1012 +
1013 +# Compile libssp_nonshared.a and add it's path to LDFLAGS.
1014 +bootstrap_libssp_nonshared() {
1015 + cd "${WORKDIR}/gnu/lib/libssp/libssp_nonshared/" || die "missing libssp."
1016 + freebsd_src_compile
1017 + append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/libssp/libssp_nonshared/"
1018 + export LDADD="-lssp_nonshared"
1019 +}
1020 +
1021 +# What to build for a non-native build: cross-compiler, non-native abi in
1022 +# multilib. We also need the csu but this has to be handled separately.
1023 +NON_NATIVE_SUBDIRS="lib/libc lib/msun gnu/lib/libssp/libssp_nonshared lib/libthr lib/libutil"
1024 +
1025 +# Subdirs for a native build:
1026 +NATIVE_SUBDIRS="lib gnu/lib/libssp/libssp_nonshared gnu/lib/libregex"
1027 +
1028 +# Is my $ABI native ?
1029 +is_native_abi() {
1030 + is_crosscompile && return 1
1031 + use multilib || return 0
1032 + [ "${ABI}" = "${DEFAULT_ABI}" ]
1033 +}
1034 +
1035 +# Do we need to bootstrap the csu and libssp_nonshared?
1036 +need_bootstrap() {
1037 + is_crosscompile || use build || ! is_native_abi || has_version "<${CATEGORY}/${P}"
1038 +}
1039 +
1040 +# Get the subdirs we are building.
1041 +get_subdirs() {
1042 + local ret=""
1043 + if is_native_abi ; then
1044 + # If we are building for the native ABI, build everything
1045 + ret="${NATIVE_SUBDIRS}"
1046 + elif is_crosscompile ; then
1047 + # With a cross-compiler we only build the very core parts.
1048 + ret="${NON_NATIVE_SUBDIRS}"
1049 + if [ "${EBUILD_PHASE}" = "install" ]; then
1050 + # Add the csu dir first when installing. We treat it separately for
1051 + # compiling.
1052 + ret="$(get_csudir $(tc-arch-kernel ${CTARGET})) ${ret}"
1053 + fi
1054 + elif use build ; then
1055 + # For the non-native ABIs we only build the csu parts and very core
1056 + # libraries for now.
1057 + ret="gnu/lib/libssp/libssp_nonshared"
1058 + if [ "${EBUILD_PHASE}" = "install" ]; then
1059 + ret="$(get_csudir $(tc-arch-kernel ${CHOST})) ${ret}"
1060 + fi
1061 + else
1062 + # Only build the csu parts and core libraries for now.
1063 + ret="gnu/lib/libssp/libssp_nonshared"
1064 + if [ "${EBUILD_PHASE}" = "install" ]; then
1065 + ret="$(get_csudir $(tc-arch-kernel ${CHOST})) ${ret}"
1066 + fi
1067 + # Finally, with a non-native ABI without USE=build, we build everything
1068 + # too.
1069 + #ret="${NATIVE_SUBDIRS}"
1070 + fi
1071 + echo "${ret}"
1072 +}
1073 +
1074 +# Bootstrap the core libraries and setup the flags so that the other parts can
1075 +# build against it.
1076 +do_bootstrap() {
1077 + einfo "Bootstrapping on ${CHOST} for ${CTARGET}"
1078 + if ! is_crosscompile ; then
1079 + # Pre-install headers, but not when building a cross-compiler since we
1080 + # assume they have been installed in the previous pass.
1081 + einfo "Pre-installing includes in include_proper_${ABI}"
1082 + mkdir "${WORKDIR}/include_proper_${ABI}" || die
1083 + CTARGET="${CHOST}" install_includes "/include_proper_${ABI}"
1084 + CFLAGS="${CFLAGS} -isystem ${WORKDIR}/include_proper_${ABI}"
1085 + fi
1086 + bootstrap_csu
1087 + bootstrap_libssp_nonshared
1088 +}
1089 +
1090 +# Compile it. Assume we have the toolchain setup correctly.
1091 +do_compile() {
1092 + export MAKEOBJDIRPREFIX="${WORKDIR}/${CHOST}"
1093 + mkdir "${MAKEOBJDIRPREFIX}" || die "Could not create ${MAKEOBJDIRPREFIX}."
1094 + need_bootstrap && do_bootstrap
1095 +
1096 + export RAW_LDFLAGS=$(raw-ldflags)
1097 +
1098 + # Everything is now setup, build it!
1099 + for i in $(get_subdirs) ; do
1100 + einfo "Building in ${i}... with CC=${CC} and CFLAGS=${CFLAGS}"
1101 + cd "${WORKDIR}/${i}/" || die "missing ${i}."
1102 + freebsd_src_compile || die "make ${i} failed"
1103 + done
1104 +}
1105 +
1106 +src_compile() {
1107 + # Does not work with GNU sed
1108 + # Force BSD's sed on BSD.
1109 + if use userland_BSD ; then
1110 + export ESED=/usr/bin/sed
1111 + unalias sed
1112 + fi
1113 +
1114 + cd "${WORKDIR}/include"
1115 + $(freebsd_get_bmake) CC="$(tc-getCC)" || die "make include failed"
1116 +
1117 + use crosscompile_opts_headers-only && return 0
1118 +
1119 + # Bug #270098
1120 + append-flags $(test-flags -fno-strict-aliasing)
1121 +
1122 + # Bug #324445
1123 + append-flags $(test-flags -fno-strict-overflow)
1124 +
1125 + # strip flags and do not do it later, we only add safe, and in fact
1126 + # needed flags after all
1127 + strip-flags
1128 + export NOFLAGSTRIP=yes
1129 + if is_crosscompile ; then
1130 + export YACC='yacc -by'
1131 + CHOST=${CTARGET} tc-export CC LD CXX RANLIB
1132 + mymakeopts="${mymakeopts} NLS="
1133 + append-flags "-I/usr/${CTARGET}/usr/include"
1134 + append-ldflags "-L${WORKDIR}/${CHOST}/${WORKDIR}/lib/libc"
1135 + fi
1136 +
1137 + if is_crosscompile ; then
1138 + do_compile
1139 + else
1140 + for ABI in $(get_all_abis) ; do
1141 + # First, save the variables: CFLAGS, CXXFLAGS, LDFLAGS and mymakeopts.
1142 + for i in CFLAGS CXXFLAGS LDFLAGS mymakeopts ; do
1143 + export ${i}_SAVE="${!i}"
1144 + done
1145 +
1146 + multilib_toolchain_setup ${ABI}
1147 +
1148 + local target="$(tc-arch-kernel ${CHOST})"
1149 + mymakeopts="${mymakeopts} TARGET=${target} MACHINE=${target} MACHINE_ARCH=${target}"
1150 + CFLAGADD=""
1151 + if ! is_native_abi ; then
1152 + mymakeopts="${mymakeopts} COMPAT_32BIT="
1153 + fi
1154 + need_bootstrap || CFLAGS="${CFLAGS} -isystem /usr/include";
1155 +
1156 + einfo "Building for ABI ${ABI} and TARGET=$(tc-arch-kernel ${CHOST})"
1157 +
1158 + CTARGET="${CHOST}" do_compile
1159 +
1160 + # Restore the variables now.
1161 + for i in CFLAGS CXXFLAGS LDFLAGS mymakeopts ; do
1162 + ii="${i}_SAVE"
1163 + export ${i}="${!ii}"
1164 + done
1165 + done
1166 + fi
1167 +}
1168 +
1169 +gen_libc_ldscript() {
1170 + # Parameters:
1171 + # $1 = target libdir
1172 + # $2 = source libc dir
1173 + # $3 = source libssp_nonshared dir
1174 +
1175 + # Clear the symlink.
1176 + rm -f "${D}/$2/libc.so" || die
1177 +
1178 + # Move the library if needed
1179 + if [ "$1" != "$2" ] ; then
1180 + mv "${D}/$2/libc.so.7" "${D}/$1/" || die
1181 + fi
1182 +
1183 + # Generate libc.so ldscript for inclusion of libssp_nonshared.a when linking
1184 + # this is done to avoid having to touch gcc spec file as it is currently
1185 + # done on FreeBSD upstream, mostly because their binutils aren't able to
1186 + # cope with linker scripts yet.
1187 + # Taken from toolchain-funcs.eclass:
1188 + local output_format
1189 + output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
1190 + [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
1191 +
1192 + cat > "${D}/$2/libc.so" <<-END_LDSCRIPT
1193 +/* GNU ld script
1194 + SSP (-fstack-protector) requires __stack_chk_fail_local to be local.
1195 + GCC invokes this symbol in a non-PIC way, which results in TEXTRELs if
1196 + this symbol was provided by a shared libc. So we link in
1197 + libssp_nonshared.a from here.
1198 + */
1199 +${output_format}
1200 +GROUP ( /$1/libc.so.7 /$3/libssp_nonshared.a )
1201 +END_LDSCRIPT
1202 +}
1203 +
1204 +do_install() {
1205 + export MAKEOBJDIRPREFIX="${WORKDIR}/${CHOST}"
1206 + for i in $(get_subdirs) ; do
1207 + einfo "Installing in ${i}..."
1208 + cd "${WORKDIR}/${i}/" || die "missing ${i}."
1209 + freebsd_src_install || die "Install ${i} failed"
1210 + done
1211 +}
1212 +
1213 +src_install() {
1214 + [ "${CTARGET}" = "${CHOST}" ] \
1215 + && INCLUDEDIR="/usr/include" \
1216 + || INCLUDEDIR="/usr/${CTARGET}/usr/include"
1217 + dodir ${INCLUDEDIR}
1218 + einfo "Installing for ${CTARGET} in ${CHOST}.."
1219 + install_includes ${INCLUDEDIR}
1220 +
1221 + use crosscompile_opts_headers-only && return 0
1222 + local mylibdir=$(get_libdir)
1223 +
1224 + if is_crosscompile ; then
1225 + mymakeopts="${mymakeopts} NO_MAN= \
1226 + INCLUDEDIR=/usr/${CTARGET}/usr/include \
1227 + SHLIBDIR=/usr/${CTARGET}/usr/lib \
1228 + LIBDIR=/usr/${CTARGET}/usr/lib"
1229 +
1230 + dosym "usr/include" "/usr/${CTARGET}/sys-include"
1231 + do_install
1232 + else
1233 + if ! use multilib ; then
1234 + # Set SHLIBDIR and LIBDIR for multilib
1235 + mymakeopts="${mymakeopts} SHLIBDIR=/usr/${mylibdir} LIBDIR=/usr/${mylibdir}"
1236 + do_install
1237 + else
1238 + for ABI in $(get_all_abis) ; do
1239 + mymakeopts_SAVE="${mymakeopts}"
1240 + multilib_toolchain_setup ${ABI}
1241 + mymakeopts="${mymakeopts} SHLIBDIR=/usr/$(get_libdir) LIBDIR=/usr/$(get_libdir)"
1242 + do_install
1243 + mymakeopts="${mymakeopts_SAVE}"
1244 + done
1245 + fi
1246 + fi
1247 +
1248 + # Don't install the rest of the configuration files if crosscompiling
1249 + if is_crosscompile ; then
1250 + # This is to get it stripped with the correct tools, otherwise it gets
1251 + # stripped with the host strip.
1252 + # And also get the correct OUTPUT_FORMAT in the libc ldscript.
1253 + export CHOST=${CTARGET}
1254 + gen_libc_ldscript "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib"
1255 + return 0
1256 + fi
1257 +
1258 + cd "${WORKDIR}/etc/"
1259 + insinto /etc
1260 + doins auth.conf nls.alias mac.conf netconfig
1261 +
1262 + # Install ttys file
1263 + local MACHINE="$(tc-arch-kernel)"
1264 + doins "etc.${MACHINE}"/*
1265 +
1266 + # Generate ldscripts for core libraries that will go in /
1267 + gen_usr_ldscript -a alias cam geom ipsec jail kiconv \
1268 + kvm m md procstat sbuf thr ufs util
1269 +
1270 + gen_libc_ldscript "${mylibdir}" "usr/${mylibdir}" "usr/${mylibdir}"
1271 +
1272 + # Install a libusb.pc for better compat with Linux's libusb
1273 + if use usb ; then
1274 + dodir /usr/$(get_libdir)/pkgconfig
1275 + sed -e "s:@LIBDIR@:/usr/$(get_libdir):" "${FILESDIR}/libusb.pc.in" > "${D}/usr/$(get_libdir)/pkgconfig/libusb.pc" || die
1276 + sed -e "s:@LIBDIR@:/usr/$(get_libdir):" "${FILESDIR}/libusb-1.0.pc.in" > "${D}/usr/$(get_libdir)/pkgconfig/libusb1.0.pc" || die
1277 + fi
1278 +}
1279 +
1280 +install_includes()
1281 +{
1282 + local INCLUDEDIR="$1"
1283 +
1284 + # The idea is to be called from either install or unpack.
1285 + # During unpack it's required to install them as portage's user.
1286 + if [[ "${EBUILD_PHASE}" == "install" ]]; then
1287 + local DESTDIR="${D}"
1288 + BINOWN="root"
1289 + BINGRP="wheel"
1290 + else
1291 + local DESTDIR="${WORKDIR}"
1292 + [[ -z "${USER}" ]] && USER="portage"
1293 + BINOWN="${USER}"
1294 + [[ -z "${GROUPS}" ]] && GROUPS="portage"
1295 + BINGRP="${GROUPS}"
1296 + fi
1297 +
1298 + # Must exist before we use it.
1299 + [[ -d "${DESTDIR}${INCLUDEDIR}" ]] || die "dodir or mkdir ${INCLUDEDIR} before using install_includes."
1300 + cd "${WORKDIR}/include"
1301 +
1302 + local MACHINE="$(tc-arch-kernel)"
1303 +
1304 + einfo "Installing includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
1305 + $(freebsd_get_bmake) installincludes \
1306 + MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \
1307 + DESTDIR="${DESTDIR}" \
1308 + INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
1309 + BINGRP="${BINGRP}" || die "install_includes() failed"
1310 + einfo "includes installed ok."
1311 + EXTRA_INCLUDES="lib/librtld_db lib/libutil lib/msun gnu/lib/libregex"
1312 + for i in $EXTRA_INCLUDES; do
1313 + einfo "Installing $i includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
1314 + cd "${WORKDIR}/$i" || die
1315 + $(freebsd_get_bmake) installincludes DESTDIR="${DESTDIR}" \
1316 + MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \
1317 + INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
1318 + BINGRP="${BINGRP}" || die "problem installing $i includes."
1319 + einfo "$i includes installed ok."
1320 + done
1321 +}