Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 66358 | Differences between
and this patch

Collapse All | Expand All

(-)Manifest (-80 / +90 lines)
Lines 1-122 Link Here
1
MD5 7cf88dee2671dcc30659d07241b8d918 glibc-2.2.5-r9.ebuild 10915
1
MD5 8a3cfe23218f1ddeb48e23024d787957 glibc-2.3.4.20040808.ebuild 21705
2
MD5 04144530b9b38f1f2921c5ab90cad25b glibc-2.3.4.20041002.ebuild 25822
3
MD5 db4e2904bb402d0e066e24e56366e182 glibc-2.3.3.20040420-r2.ebuild 21772
2
MD5 69d5deb42d1f5687791ceaa46ef56215 glibc-2.3.2-r11.ebuild 20433
4
MD5 69d5deb42d1f5687791ceaa46ef56215 glibc-2.3.2-r11.ebuild 20433
5
MD5 731c90bb30252bfe5d87ba369bc0fc77 glibc-2.3.4.20040619-r2.ebuild 21004
6
MD5 3a56459d2c3bf3c4c7915c57c5e81163 glibc-2.3.4.20040808-r1.ebuild 21809
3
MD5 0def963a028a28e5da9ee21a22c5f3b6 glibc-2.3.3.20040420-r1.ebuild 21667
7
MD5 0def963a028a28e5da9ee21a22c5f3b6 glibc-2.3.3.20040420-r1.ebuild 21667
4
MD5 5ddcb90cbbcf07775bcaade32c13602e glibc-2.3.4.20040619-r1.ebuild 20900
8
MD5 5ddcb90cbbcf07775bcaade32c13602e glibc-2.3.4.20040619-r1.ebuild 20900
5
MD5 567094e03359ffc1c95af7356395228d metadata.xml 162
6
MD5 8a3cfe23218f1ddeb48e23024d787957 glibc-2.3.4.20040808.ebuild 21705
7
MD5 ae59b26eb78368846b88ed0425a8c1ca ChangeLog 54928
9
MD5 ae59b26eb78368846b88ed0425a8c1ca ChangeLog 54928
8
MD5 ae02fcbadfe4e9ee08d7996c23d99c56 glibc-2.3.4.20041002.ebuild 25720
10
MD5 7f29cbf68c8b97ec4d69ca32fa8341f3 glibc-2.3.2-r12.ebuild 20545
11
MD5 567094e03359ffc1c95af7356395228d metadata.xml 162
12
MD5 7cf88dee2671dcc30659d07241b8d918 glibc-2.2.5-r9.ebuild 10915
13
MD5 bedcd868a9462009158714238594173c files/nscd 964
14
MD5 135f8145885a2f4f9876fe973f33ddf6 files/glibc-2.2.4-string2.h.diff 5221
15
MD5 d688e44731d6e4b757382d7646c492c3 files/glibc-xdr_security.patch 6612
16
MD5 bbe355d94c5a36e11f543d12b70b5702 files/glibc-sec-hotfix-20040916.patch 3080
9
MD5 9cc1e6b6f749dba7c8759bd07266f7d9 files/digest-glibc-2.2.5-r9 143
17
MD5 9cc1e6b6f749dba7c8759bd07266f7d9 files/digest-glibc-2.2.5-r9 143
10
MD5 2d5306ef875573750af642a9f93b634a files/digest-glibc-2.3.2-r11 312
18
MD5 2013443f5192d4b999953ba4248d288c files/nscd.conf 1158
11
MD5 42af7e35fe2404a49954f91fd1aee891 files/digest-glibc-2.3.3.20040420-r1 312
12
MD5 470f57fe18dd0a94cb4a4d6cf51528af files/digest-glibc-2.3.4.20040619-r1 307
13
MD5 2f05d3181e9a9ded61e074147af47e8e files/digest-glibc-2.3.4.20040808 382
19
MD5 2f05d3181e9a9ded61e074147af47e8e files/digest-glibc-2.3.4.20040808 382
14
MD5 e4393f4721a207750581d6265d5f7f40 files/fix-sysctl_h.patch 376
20
MD5 c549158f070bb029a4775c00af300a87 files/digest-glibc-2.3.4.20041002 382
15
MD5 52cfc7627fc62dfb26d8d163aac361f6 files/glibc-2.2.2-test-lfs-timeout.patch 320
21
MD5 52cfc7627fc62dfb26d8d163aac361f6 files/glibc-2.2.2-test-lfs-timeout.patch 320
16
MD5 135f8145885a2f4f9876fe973f33ddf6 files/glibc-2.2.4-string2.h.diff 5221
17
MD5 b712a49b5113fccb4c8b0ada2a30d390 files/glibc-manpages-2.2.5.tar.bz2 14610
22
MD5 b712a49b5113fccb4c8b0ada2a30d390 files/glibc-manpages-2.2.5.tar.bz2 14610
18
MD5 184eddb92615fb991dce41b9edbfa690 files/glibc-manpages-2.3.2.tar.bz2 14700
19
MD5 13701e6cc0de584680502c0cd958f2cf files/glibc-sec-hotfix-20040804.patch 4319
23
MD5 13701e6cc0de584680502c0cd958f2cf files/glibc-sec-hotfix-20040804.patch 4319
20
MD5 bbe355d94c5a36e11f543d12b70b5702 files/glibc-sec-hotfix-20040916.patch 3080
24
MD5 184eddb92615fb991dce41b9edbfa690 files/glibc-manpages-2.3.2.tar.bz2 14700
21
MD5 d688e44731d6e4b757382d7646c492c3 files/glibc-xdr_security.patch 6612
25
MD5 42af7e35fe2404a49954f91fd1aee891 files/digest-glibc-2.3.3.20040420-r1 312
26
MD5 42af7e35fe2404a49954f91fd1aee891 files/digest-glibc-2.3.3.20040420-r2 312
22
MD5 c4300e2f8808cb38a308745ed8b77367 files/locales.build 602
27
MD5 c4300e2f8808cb38a308745ed8b77367 files/locales.build 602
23
MD5 bedcd868a9462009158714238594173c files/nscd 964
24
MD5 2013443f5192d4b999953ba4248d288c files/nscd.conf 1158
25
MD5 d8830438ea871dbfd1acf7a3d0299159 files/test-__thread.c 53
26
MD5 4404ee4b6e3017819d8f36082e0265e5 files/test-sysctl_h.c 54
28
MD5 4404ee4b6e3017819d8f36082e0265e5 files/test-sysctl_h.c 54
27
MD5 c549158f070bb029a4775c00af300a87 files/digest-glibc-2.3.4.20041002 382
29
MD5 2d5306ef875573750af642a9f93b634a files/digest-glibc-2.3.2-r11 312
28
MD5 f75ebd335c4b882013cc12229d39c9f7 files/2.2.5/glibc-2.2.5-alpha-gcc3-fix.diff 475
30
MD5 2d5306ef875573750af642a9f93b634a files/digest-glibc-2.3.2-r12 312
29
MD5 843eaa26ae2c49e894aa365b6f463546 files/2.2.5/glibc-2.2.5-alpha-pcdyn-fix.diff 471
31
MD5 e4393f4721a207750581d6265d5f7f40 files/fix-sysctl_h.patch 376
30
MD5 5182f441608833569cb9e78536baf8af files/2.2.5/glibc-2.2.5-arm-errlist-fix.diff 2210
32
MD5 d8830438ea871dbfd1acf7a3d0299159 files/test-__thread.c 53
31
MD5 56a7a0273e0666eb40b0c6b45d62881d files/2.2.5/glibc-2.2.5-arm-sysdeps-fix.diff 362
33
MD5 470f57fe18dd0a94cb4a4d6cf51528af files/digest-glibc-2.3.4.20040619-r1 307
34
MD5 470f57fe18dd0a94cb4a4d6cf51528af files/digest-glibc-2.3.4.20040619-r2 307
35
MD5 2f05d3181e9a9ded61e074147af47e8e files/digest-glibc-2.3.4.20040808-r1 382
32
MD5 93c2f3cb1c07d9a39da245b065c74f6c files/2.2.5/glibc-2.2.5-divdi3.diff 9752
36
MD5 93c2f3cb1c07d9a39da245b065c74f6c files/2.2.5/glibc-2.2.5-divdi3.diff 9752
33
MD5 b12e1a7de85cd82bcb341863643c9ffd files/2.2.5/glibc-2.2.5-dns-network-overflow.diff 365
34
MD5 7481046043f42ecf4ac0a218abc896fc files/2.2.5/glibc-2.2.5-gcc311.patch 534
37
MD5 7481046043f42ecf4ac0a218abc896fc files/2.2.5/glibc-2.2.5-gcc311.patch 534
35
MD5 1c3b30834a25149e4738eead113462ad files/2.2.5/glibc-2.2.5-getgrouplist.patch 708
38
MD5 e6dc1e4d7839d2bb08c6865466791183 files/2.2.5/glibc-2.2.5-sunrpc-overflow.diff 2460
39
MD5 e9d9d086e8ed29ed49252d4cd0050f66 files/2.2.5/glibc-2.2.5.restrict_arr.patch 762
40
MD5 a12b84b5af2808f5c0223259f7a9610c files/2.2.5/glibc-2.2.5-sparc-mathinline.patch 1014
36
MD5 b07a316cbba4ddc1e1bb094a3056f12f files/2.2.5/glibc-2.2.5-ppc-semctl.diff 1337
41
MD5 b07a316cbba4ddc1e1bb094a3056f12f files/2.2.5/glibc-2.2.5-ppc-semctl.diff 1337
42
MD5 1c3b30834a25149e4738eead113462ad files/2.2.5/glibc-2.2.5-getgrouplist.patch 708
43
MD5 56a7a0273e0666eb40b0c6b45d62881d files/2.2.5/glibc-2.2.5-arm-sysdeps-fix.diff 362
44
MD5 843eaa26ae2c49e894aa365b6f463546 files/2.2.5/glibc-2.2.5-alpha-pcdyn-fix.diff 471
45
MD5 5182f441608833569cb9e78536baf8af files/2.2.5/glibc-2.2.5-arm-errlist-fix.diff 2210
46
MD5 993732f56fdecf36f672198112fc5d5c files/2.2.5/glibc-2.2.5-threadsig.diff 636
47
MD5 a50da56218f9aabc347d7e1130961cec files/2.2.5/glibc-2.2.5.divbyzero.patch 1694
48
MD5 b12e1a7de85cd82bcb341863643c9ffd files/2.2.5/glibc-2.2.5-dns-network-overflow.diff 365
37
MD5 c34a3c6bf21274a506090f05b7ea60ff files/2.2.5/glibc-2.2.5-ppc-sqrtl.diff 715
49
MD5 c34a3c6bf21274a506090f05b7ea60ff files/2.2.5/glibc-2.2.5-ppc-sqrtl.diff 715
38
MD5 c7783e49497814c3d86bd63bbed2a9b3 files/2.2.5/glibc-2.2.5-sandbox.diff 438
50
MD5 c7783e49497814c3d86bd63bbed2a9b3 files/2.2.5/glibc-2.2.5-sandbox.diff 438
39
MD5 a12b84b5af2808f5c0223259f7a9610c files/2.2.5/glibc-2.2.5-sparc-mathinline.patch 1014
40
MD5 6bdfb930ffdfdeb6b2ee823fefe42513 files/2.2.5/glibc-2.2.5-sparc-misc.diff 12252
51
MD5 6bdfb930ffdfdeb6b2ee823fefe42513 files/2.2.5/glibc-2.2.5-sparc-misc.diff 12252
41
MD5 96914104dbdc2807c84549c3d20cb47c files/2.2.5/glibc-2.2.5-sparc32-semctl.patch 6311
52
MD5 f75ebd335c4b882013cc12229d39c9f7 files/2.2.5/glibc-2.2.5-alpha-gcc3-fix.diff 475
42
MD5 6afbd6fe65c0e2034587ba6d1da427a3 files/2.2.5/glibc-2.2.5-sparc64-fixups.diff 1407
53
MD5 6afbd6fe65c0e2034587ba6d1da427a3 files/2.2.5/glibc-2.2.5-sparc64-fixups.diff 1407
43
MD5 e6dc1e4d7839d2bb08c6865466791183 files/2.2.5/glibc-2.2.5-sunrpc-overflow.diff 2460
54
MD5 96914104dbdc2807c84549c3d20cb47c files/2.2.5/glibc-2.2.5-sparc32-semctl.patch 6311
44
MD5 993732f56fdecf36f672198112fc5d5c files/2.2.5/glibc-2.2.5-threadsig.diff 636
45
MD5 a50da56218f9aabc347d7e1130961cec files/2.2.5/glibc-2.2.5.divbyzero.patch 1694
46
MD5 e9d9d086e8ed29ed49252d4cd0050f66 files/2.2.5/glibc-2.2.5.restrict_arr.patch 762
47
MD5 941f13d27badc76c1e3704c59acaff26 files/2.3.1/glibc-2.3.1-ctype-compat-v3.patch 2823
48
MD5 4f8ecd70003c5ca153ff7c204c54c1cf files/2.3.1/glibc-2.3.1-elf-machine-rela-mips.patch 1246
49
MD5 afaf2540d2803ac066eb2555f2019a6f files/2.3.1/glibc-2.3.1-exit-syscall-mips.patch 633
55
MD5 afaf2540d2803ac066eb2555f2019a6f files/2.3.1/glibc-2.3.1-exit-syscall-mips.patch 633
50
MD5 67b125cec4f1f0d26ce4df706451fee6 files/2.3.1/glibc-2.3.1-fpu-cw-mips.patch 433
56
MD5 4f8ecd70003c5ca153ff7c204c54c1cf files/2.3.1/glibc-2.3.1-elf-machine-rela-mips.patch 1246
51
MD5 235976914abfab3408d8d63cb4ffebe2 files/2.3.1/glibc-2.3.1-inline-syscall-mips.patch 7753
57
MD5 941f13d27badc76c1e3704c59acaff26 files/2.3.1/glibc-2.3.1-ctype-compat-v3.patch 2823
52
MD5 1c4e567ed001f9489e11ee06c1ced0b7 files/2.3.1/glibc-2.3.1-libc_wait-compat.patch 1053
58
MD5 1c4e567ed001f9489e11ee06c1ced0b7 files/2.3.1/glibc-2.3.1-libc_wait-compat.patch 1053
53
MD5 23bbb51d1008f3009e6f1867b284c9bc files/2.3.1/glibc-2.3.1-libgcc-compat-mips.patch 5222
59
MD5 67b125cec4f1f0d26ce4df706451fee6 files/2.3.1/glibc-2.3.1-fpu-cw-mips.patch 433
54
MD5 f15c6dec40cefa86dae48a7dcb3b779a files/2.3.1/glibc-2.3.1-librt-mips.patch 396
60
MD5 f15c6dec40cefa86dae48a7dcb3b779a files/2.3.1/glibc-2.3.1-librt-mips.patch 396
55
MD5 d84791059f1b4e7b157b3bbefe783208 files/2.3.1/glibc-2.3.1-stack_end-compat.patch 751
61
MD5 d84791059f1b4e7b157b3bbefe783208 files/2.3.1/glibc-2.3.1-stack_end-compat.patch 751
62
MD5 235976914abfab3408d8d63cb4ffebe2 files/2.3.1/glibc-2.3.1-inline-syscall-mips.patch 7753
56
MD5 dc18731db5bd28b8bd2074fc9177fd35 files/2.3.1/glibc23-07-hppa-atomicity.dpatch 2519
63
MD5 dc18731db5bd28b8bd2074fc9177fd35 files/2.3.1/glibc23-07-hppa-atomicity.dpatch 2519
64
MD5 23bbb51d1008f3009e6f1867b284c9bc files/2.3.1/glibc-2.3.1-libgcc-compat-mips.patch 5222
65
MD5 a505a59f53c5e068728d0aba44007a10 files/2.3.2/glibc-2.3.2-gcc33-sscanf.patch 671
66
MD5 9bc5a914b9625c662544785a4a685086 files/2.3.2/glibc-2.3.2-redhat-nptl-fixes.patch 1077
57
MD5 080146d608b878d517b5cf4c29f0ef08 files/2.3.2/glibc-2.3.2-alpha-crti.patch 378
67
MD5 080146d608b878d517b5cf4c29f0ef08 files/2.3.2/glibc-2.3.2-alpha-crti.patch 378
58
MD5 9ef93639d5016677d41e5ec986fcb7f5 files/2.3.2/glibc-2.3.2-alpha-pwrite.patch 918
68
MD5 1a926f1adc2f321abb31b1e11024e3ac files/2.3.2/glibc-2.3.2-dl-reloc-calc-fix.patch 1405
69
MD5 578d3e5ff83cca218279a7a094fd0dad files/2.3.2/glibc-2.3.2-propolice-guard-functions-v2.patch 5107
70
MD5 0e3ced9c3c484f502dcade7ffffa15f4 files/2.3.2/ssp.c 3935
71
MD5 3d32067de612f477862e9b24c158a7ce files/2.3.2/glibc-2.3.2-rtld-assert-fix.patch 1153
72
MD5 175bde9b0017d4deb63cf55f38173e11 files/2.3.2/glibc-2.3.2-got-fix.diff 752
73
MD5 bfb5e3c2c46359a8c426e98fe0e39838 files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch 6344
74
MD5 d21659e6aa8802290d6734ec118bbb81 files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch 5310
59
MD5 afa967d5fea8e467dda9c588f5600ed1 files/2.3.2/glibc-2.3.2-amd64-nomultilib.patch 506
75
MD5 afa967d5fea8e467dda9c588f5600ed1 files/2.3.2/glibc-2.3.2-amd64-nomultilib.patch 506
60
MD5 523558956091d4ffcd33b72c57ac4bac files/2.3.2/glibc-2.3.2-arm-bus-defines.patch 276
76
MD5 0e27dbd2a3b85a0e14625294296fad9a files/2.3.2/glibc-2.3.2-propolice-guard-functions-v3.patch 1986
61
MD5 cfce14f1f90a3903ed076a5209198ce5 files/2.3.2/glibc-2.3.2-armformat.patch 416
77
MD5 9ef93639d5016677d41e5ec986fcb7f5 files/2.3.2/glibc-2.3.2-alpha-pwrite.patch 918
62
MD5 855edac3c5abd21b4617408d4e3b5ae3 files/2.3.2/glibc-2.3.2-cispeed-cospeed-fix.patch 2424
78
MD5 0bfc56be86acec8ec52fe29249e267a4 files/2.3.2/glibc-2.3.2-owl-malloc-unlink-sanity-check.diff 1425
79
MD5 f62924cbf762eb230514a9859522f5e7 files/2.3.2/glibc-2.3.2-nptl-fix-include.patch 247
63
MD5 2f6605aae9bc4e538af783c0b2be3a7f files/2.3.2/glibc-2.3.2-decc-compaq.patch 1422
80
MD5 2f6605aae9bc4e538af783c0b2be3a7f files/2.3.2/glibc-2.3.2-decc-compaq.patch 1422
64
MD5 1a926f1adc2f321abb31b1e11024e3ac files/2.3.2/glibc-2.3.2-dl-reloc-calc-fix.patch 1405
81
MD5 28e19b397fa1dac1fa02cd2534196b53 files/2.3.2/glibc-2.3.2-tempfile.patch 5975
82
MD5 cfce14f1f90a3903ed076a5209198ce5 files/2.3.2/glibc-2.3.2-armformat.patch 416
65
MD5 8d75a288ff9aa450717048b43497c82c files/2.3.2/glibc-2.3.2-dl_execstack-PaX-support.patch 1945
83
MD5 8d75a288ff9aa450717048b43497c82c files/2.3.2/glibc-2.3.2-dl_execstack-PaX-support.patch 1945
66
MD5 0c85c7ef9fbb066ad30ce8b6eb1c6228 files/2.3.2/glibc-2.3.2-fix-omitted-operand-in-mathinline_h.patch 680
84
MD5 523558956091d4ffcd33b72c57ac4bac files/2.3.2/glibc-2.3.2-arm-bus-defines.patch 276
67
MD5 026be2442305eef0a3e3ff897a14768e files/2.3.2/glibc-2.3.2-framestate-USING_SJLJ_EXCEPTIONS.patch 440
85
MD5 026be2442305eef0a3e3ff897a14768e files/2.3.2/glibc-2.3.2-framestate-USING_SJLJ_EXCEPTIONS.patch 440
68
MD5 62f7e62583aaa70645d9c847b6a84299 files/2.3.2/glibc-2.3.2-frandom-detect.patch 1770
86
MD5 4e99301d9cb2865f14d82595f3b7bc0a files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch 4398
69
MD5 a505a59f53c5e068728d0aba44007a10 files/2.3.2/glibc-2.3.2-gcc33-sscanf.patch 671
70
MD5 175bde9b0017d4deb63cf55f38173e11 files/2.3.2/glibc-2.3.2-got-fix.diff 752
71
MD5 cd0306085902d8629f2a77061cacdfd2 files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch 4445
87
MD5 cd0306085902d8629f2a77061cacdfd2 files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch 4445
88
MD5 3eeb5a5b2f01b1fdb7a4af923e5b0cec files/2.3.2/glibc-2.3.2-s390-deprecated-ustat-fixup.patch 6638
89
MD5 ba477be20da9885349e4599de7a08c18 files/2.3.2/glibc-2.3.2-redhat-linuxthreads-fixes.patch 2532
72
MD5 15ac94e1ccc48f31120960dfe006818a files/2.3.2/glibc-2.3.2-iconvconfig-name_insert.patch 2262
90
MD5 15ac94e1ccc48f31120960dfe006818a files/2.3.2/glibc-2.3.2-iconvconfig-name_insert.patch 2262
73
MD5 45b1fda5b64866e837a825d0add0b31c files/2.3.2/glibc-2.3.2-ipv6-bytestring-fix.patch 4088
91
MD5 62f7e62583aaa70645d9c847b6a84299 files/2.3.2/glibc-2.3.2-frandom-detect.patch 1770
74
MD5 bfb5e3c2c46359a8c426e98fe0e39838 files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch 6344
92
MD5 a3eb98943bc9db66df33bfc08dea4c2e files/2.3.2/glibc-2.3.2-pt_pax.diff 1470
93
MD5 0c85c7ef9fbb066ad30ce8b6eb1c6228 files/2.3.2/glibc-2.3.2-fix-omitted-operand-in-mathinline_h.patch 680
75
MD5 03cbfe983ca93434ae6698f13d14c0e8 files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch 741
94
MD5 03cbfe983ca93434ae6698f13d14c0e8 files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch 741
76
MD5 4e99301d9cb2865f14d82595f3b7bc0a files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch 4398
95
MD5 855edac3c5abd21b4617408d4e3b5ae3 files/2.3.2/glibc-2.3.2-cispeed-cospeed-fix.patch 2424
77
MD5 df41c3a20ead370c2208599cf4251f3d files/2.3.2/glibc-2.3.2-mips-fix-nested-entend-pairs.patch 612
96
MD5 df41c3a20ead370c2208599cf4251f3d files/2.3.2/glibc-2.3.2-mips-fix-nested-entend-pairs.patch 612
78
MD5 d21659e6aa8802290d6734ec118bbb81 files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch 5310
79
MD5 f62924cbf762eb230514a9859522f5e7 files/2.3.2/glibc-2.3.2-nptl-fix-include.patch 247
80
MD5 0bfc56be86acec8ec52fe29249e267a4 files/2.3.2/glibc-2.3.2-owl-malloc-unlink-sanity-check.diff 1425
81
MD5 578d3e5ff83cca218279a7a094fd0dad files/2.3.2/glibc-2.3.2-propolice-guard-functions-v2.patch 5107
82
MD5 0e27dbd2a3b85a0e14625294296fad9a files/2.3.2/glibc-2.3.2-propolice-guard-functions-v3.patch 1986
83
MD5 b27417338a4cd9906e2917701f0be575 files/2.3.2/glibc-2.3.2-propolice-guard-functions.patch 5069
84
MD5 a3eb98943bc9db66df33bfc08dea4c2e files/2.3.2/glibc-2.3.2-pt_pax.diff 1470
85
MD5 ba477be20da9885349e4599de7a08c18 files/2.3.2/glibc-2.3.2-redhat-linuxthreads-fixes.patch 2532
86
MD5 9bc5a914b9625c662544785a4a685086 files/2.3.2/glibc-2.3.2-redhat-nptl-fixes.patch 1077
87
MD5 3d32067de612f477862e9b24c158a7ce files/2.3.2/glibc-2.3.2-rtld-assert-fix.patch 1153
88
MD5 3eeb5a5b2f01b1fdb7a4af923e5b0cec files/2.3.2/glibc-2.3.2-s390-deprecated-ustat-fixup.patch 6638
89
MD5 7b6054c2e8ec654341690586bc2028c5 files/2.3.2/glibc-2.3.2-signal-ssp.diff 1431
90
MD5 0e3ced9c3c484f502dcade7ffffa15f4 files/2.3.2/ssp.c 3935
91
MD5 250d09cb52d2c3c7f6b0c4e0a1bf47f2 files/2.3.2/sysmacros.h 2443
97
MD5 250d09cb52d2c3c7f6b0c4e0a1bf47f2 files/2.3.2/sysmacros.h 2443
92
MD5 0e27dbd2a3b85a0e14625294296fad9a files/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch 1986
98
MD5 45b1fda5b64866e837a825d0add0b31c files/2.3.2/glibc-2.3.2-ipv6-bytestring-fix.patch 4088
93
MD5 1b5df7c58ad160593192704cece47347 files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch 1791
99
MD5 7b6054c2e8ec654341690586bc2028c5 files/2.3.2/glibc-2.3.2-signal-ssp.diff 1431
94
MD5 62f7e62583aaa70645d9c847b6a84299 files/2.3.3/glibc-2.3.3-frandom-detect.patch 1770
100
MD5 b27417338a4cd9906e2917701f0be575 files/2.3.2/glibc-2.3.2-propolice-guard-functions.patch 5069
95
MD5 ec83f3d86f23243a1fb334b8872d454f files/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch 2329
96
MD5 0bfc56be86acec8ec52fe29249e267a4 files/2.3.3/glibc-2.3.3-owl-malloc-unlink-sanity-check.diff 1425
101
MD5 0bfc56be86acec8ec52fe29249e267a4 files/2.3.3/glibc-2.3.3-owl-malloc-unlink-sanity-check.diff 1425
97
MD5 69d86fa55810b4d327d0cb35042c034f files/2.3.3/glibc-2.3.3-ssp-gcc34-after-frandom.patch 538
102
MD5 62f7e62583aaa70645d9c847b6a84299 files/2.3.3/glibc-2.3.3-frandom-detect.patch 1770
98
MD5 175bde9b0017d4deb63cf55f38173e11 files/2.3.3/glibc-2.3.3_pre20040117-got-fix.diff 752
99
MD5 a3eb98943bc9db66df33bfc08dea4c2e files/2.3.3/glibc-2.3.3_pre20040117-pt_pax.diff 1470
100
MD5 7b6054c2e8ec654341690586bc2028c5 files/2.3.3/glibc-2.3.3_pre20040117-signal-ssp.diff 1431
101
MD5 86626ba8df9cac083bb3e1cfe23ec07e files/2.3.3/glibc-2.3.3_pre20040420-mips-dl-machine-calls.diff 1497
102
MD5 ab91cb5bad07e1e79f990d4933741d42 files/2.3.3/glibc-2.3.3_pre20040420-mips-incl-sgidefs.diff 8287
103
MD5 ca1d4648f72e5fea2858fdb6ea3d39a0 files/2.3.3/mips-addabi.diff 1720
103
MD5 ca1d4648f72e5fea2858fdb6ea3d39a0 files/2.3.3/mips-addabi.diff 1720
104
MD5 f9343413b90877edfcaeedf89b3dec77 files/2.3.3/mips-nolib3264.diff 1166
104
MD5 5c114e8c8bc9c5e8178df8987b367efa files/2.3.3/ssp.c 4053
105
MD5 ff0a2716aebc6fb8a2e3b3f2c9be8bba files/2.3.3/glibc-2.3.3-tempfile.patch 1787
105
MD5 847afe57e19abff1d5c49f6bb7084a3d files/2.3.3/mips-syscall.h.diff 1199
106
MD5 847afe57e19abff1d5c49f6bb7084a3d files/2.3.3/mips-syscall.h.diff 1199
106
MD5 84fa9a725c22975d735a2f91543a5cca files/2.3.3/mips-sysify.diff 2138
107
MD5 7b6054c2e8ec654341690586bc2028c5 files/2.3.3/glibc-2.3.3_pre20040117-signal-ssp.diff 1431
108
MD5 0e27dbd2a3b85a0e14625294296fad9a files/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch 1986
107
MD5 81d95470c5766e56e27ad8b6967d2a16 files/2.3.3/semtimedop.diff 602
109
MD5 81d95470c5766e56e27ad8b6967d2a16 files/2.3.3/semtimedop.diff 602
108
MD5 ae9425cd4199cccd69c6d22633583dc1 files/2.3.3/ssp.c 4041
110
MD5 a3eb98943bc9db66df33bfc08dea4c2e files/2.3.3/glibc-2.3.3_pre20040117-pt_pax.diff 1470
109
MD5 89a6d0d924c8b05c4e06bdffb7c69b41 files/2.3.4/glibc-2.3.4-arm-ioperm.patch 4037
111
MD5 f9343413b90877edfcaeedf89b3dec77 files/2.3.3/mips-nolib3264.diff 1166
110
MD5 03e0e9a2235886c0abbe98bdafd0d5ce files/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch 382
112
MD5 86626ba8df9cac083bb3e1cfe23ec07e files/2.3.3/glibc-2.3.3_pre20040420-mips-dl-machine-calls.diff 1497
111
MD5 659a9d64935d67a5938d0cb4e5fe4899 files/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch 2310
113
MD5 69d86fa55810b4d327d0cb35042c034f files/2.3.3/glibc-2.3.3-ssp-gcc34-after-frandom.patch 538
112
MD5 16f18501efd56811e724231470dc5d00 files/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch 2562
114
MD5 84fa9a725c22975d735a2f91543a5cca files/2.3.3/mips-sysify.diff 2138
115
MD5 175bde9b0017d4deb63cf55f38173e11 files/2.3.3/glibc-2.3.3_pre20040117-got-fix.diff 752
116
MD5 ec83f3d86f23243a1fb334b8872d454f files/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch 2329
117
MD5 ab91cb5bad07e1e79f990d4933741d42 files/2.3.3/glibc-2.3.3_pre20040420-mips-incl-sgidefs.diff 8287
118
MD5 1b5df7c58ad160593192704cece47347 files/2.3.3/glibc-2.3.3-dl_execstack-PaX-support.patch 1791
119
MD5 bbe355d94c5a36e11f543d12b70b5702 files/2.3.4/glibc-sec-hotfix-20040916.patch 3080
120
MD5 1185022e9a50560d1bf9116a0461e011 files/2.3.4/mips-sysdep-cancel.diff 2402
113
MD5 207e313566b3fc24e0a5ca2ffd2da1d9 files/2.3.4/glibc-2.3.4-nptl-altivec.patch 6140
121
MD5 207e313566b3fc24e0a5ca2ffd2da1d9 files/2.3.4/glibc-2.3.4-nptl-altivec.patch 6140
114
MD5 7960564130a698073bdd3597a781e39b files/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch 3304
122
MD5 659a9d64935d67a5938d0cb4e5fe4899 files/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch 2310
115
MD5 340825c77e38e88e0ceaa12f154cbfa3 files/2.3.4/glibc-2.3.4.20040808-i386-got-fix.diff 4203
123
MD5 340825c77e38e88e0ceaa12f154cbfa3 files/2.3.4/glibc-2.3.4.20040808-i386-got-fix.diff 4203
116
MD5 e109c03013bd08a2b96e2c2ca9017a4b files/2.3.4/glibc-gentoo-libdir.patch 1347
117
MD5 1185022e9a50560d1bf9116a0461e011 files/2.3.4/mips-sysdep-cancel.diff 2402
118
MD5 9ee1438ba6ac30363130330c996dbb84 files/2.3.4/glibc-2.3.4-dl_execstack-PaX-support.patch 1443
124
MD5 9ee1438ba6ac30363130330c996dbb84 files/2.3.4/glibc-2.3.4-dl_execstack-PaX-support.patch 1443
119
MD5 bbe355d94c5a36e11f543d12b70b5702 files/2.3.4/glibc-sec-hotfix-20040916.patch 3080
125
MD5 7960564130a698073bdd3597a781e39b files/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch 3304
126
MD5 89a6d0d924c8b05c4e06bdffb7c69b41 files/2.3.4/glibc-2.3.4-arm-ioperm.patch 4037
127
MD5 e78cc048b738241cda35941e87da7b66 files/2.3.4/glibc-2.3.3-mdns-resolver.diff 10379
128
MD5 03e0e9a2235886c0abbe98bdafd0d5ce files/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch 382
120
MD5 7fca8a203196513f13e519903dedbfd5 files/2.3.4/glibc-2.3.4-getcontext.patch 9854
129
MD5 7fca8a203196513f13e519903dedbfd5 files/2.3.4/glibc-2.3.4-getcontext.patch 9854
121
MD5 d490f38bd9ca9c48a9799f1e48629f6e files/2.3.4/glibc-2.3.4-mips-generate-syscall_h.patch 8230
130
MD5 d490f38bd9ca9c48a9799f1e48629f6e files/2.3.4/glibc-2.3.4-mips-generate-syscall_h.patch 8230
122
MD5 e78cc048b738241cda35941e87da7b66 files/2.3.4/glibc-2.3.3-mdns-resolver.diff 10379
131
MD5 e109c03013bd08a2b96e2c2ca9017a4b files/2.3.4/glibc-gentoo-libdir.patch 1347
132
MD5 16f18501efd56811e724231470dc5d00 files/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch 2562
(-)glibc-2.3.2-r12.ebuild (+689 lines)
Added Link Here
1
# Copyright 1999-2004 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.2-r11.ebuild,v 1.14 2004/09/29 05:24:47 vapier Exp $
4
5
inherit eutils flag-o-matic gcc
6
7
# Branch update support.  Following will disable:
8
#  BRANCH_UPDATE=
9
BRANCH_UPDATE="20031115"
10
11
12
# Minimum kernel version for --enable-kernel
13
export MIN_KV="2.4.1"
14
# Minimum kernel version for enabling TLS and NPTL ...
15
# NOTE: do not change this if you do not know what
16
#       you are doing !
17
export MIN_NPTL_KV="2.6.0"
18
19
MY_PV="${PV/_}"
20
S="${WORKDIR}/${P%_*}"
21
DESCRIPTION="GNU libc6 (also called glibc2) C library"
22
HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
23
SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${MY_PV}.tar.bz2
24
	ftp://sources.redhat.com/pub/glibc/snapshots/glibc-${MY_PV}.tar.bz2
25
	http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${MY_PV}.tar.bz2
26
	ftp://sources.redhat.com/pub/glibc/snapshots/glibc-linuxthreads-${MY_PV}.tar.bz2
27
	mirror://gentoo/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2
28
	hppa? ( mirror://gentoo/${P}-hppa-patches-p1.tar.bz2 )"
29
30
LICENSE="LGPL-2"
31
SLOT="2.2"
32
KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~s390"
33
IUSE="nls pic build nptl debug"
34
RESTRICT="nostrip" # we'll handle stripping ourself #46186
35
36
# We need new cleanup attribute support from gcc for NPTL among things ...
37
DEPEND=">=sys-devel/gcc-3.2.3-r1
38
	x86? ( nptl? ( >=sys-devel/gcc-3.3.1-r1 ) )
39
	>=sys-devel/binutils-2.14.90.0.6-r1
40
	virtual/os-headers
41
	nls? ( sys-devel/gettext )"
42
RDEPEND="virtual/os-headers
43
	sys-apps/baselayout
44
	nls? ( sys-devel/gettext )"
45
PDEPEND="ppc? ( >=sys-kernel/linux-headers-2.4.22 )"
46
PROVIDE="virtual/glibc virtual/libc"
47
48
# Try to get a kernel source tree with version equal or greater
49
# than $1.  We basically just try a few default locations.  The
50
# version need to be that which KV_to_int() returns ...
51
get_KHV() {
52
	local headers=
53
54
	[ -z "$1" ] && return 1
55
56
	# - First check if linux-headers are installed (or symlink
57
	#   to current kernel ...)
58
	# - Ok, do we have access to the current kernel's headers ?
59
	# - Last option ... maybe its a weird bootstrap with /lib
60
	#   binded to the chroot ...
61
62
	# We do not really support more than 2 arguments ...
63
	if [ -n "$2" ]
64
	then
65
		headers="$2"
66
	else
67
		# We try to find the current kernel's headers first,
68
		# as we would rather build against linux 2.5 headers ...
69
		headers="/lib/modules/`uname -r`/build/include \
70
		         ${ROOT}/lib/modules/`uname -r`/build/include \
71
				 /usr/src/linux/include \
72
				 ${ROOT}/usr/src/linux/include \
73
		         ${ROOT}/usr/include"
74
	fi
75
76
	for x in ${headers}
77
	do
78
		local header="${x}/linux/version.h"
79
80
		if [ -f ${header} ]
81
		then
82
83
			local version="`grep 'LINUX_VERSION_CODE' ${header} | \
84
				sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
85
86
			if [ "${version}" -ge "$1" ]
87
			then
88
				echo "${x}"
89
90
				return 0
91
			fi
92
		fi
93
	done
94
95
	return 1
96
}
97
98
use_nptl() {
99
	# Enable NPTL support if:
100
	# - We have 'nptl' in USE
101
	# - We have linux-2.5 or later kernel (should prob check for 2.4.20 ...)
102
	if use nptl && [ "`get_KV`" -ge "`KV_to_int ${MIN_NPTL_KV}`"  ]
103
	then
104
		# Enable NPTL support if:
105
		# - We have 'x86' in USE and:
106
		#   - a CHOST of "i486-pc-linux-gnu"
107
		#   - a CHOST of "i586-pc-linux-gnu"
108
		#   - a CHOST of "i686-pc-linux-gnu"
109
		# - Or we have 'alpha' in USE
110
		# - Or we have 'amd64' in USE
111
		# - Or we have 'mips' in USE
112
		# - Or we have 'ppc' in USE
113
		case ${ARCH} in
114
			"x86")
115
				if [ "${CHOST/-*}" = "i486" -o \
116
				     "${CHOST/-*}" = "i586" -o \
117
					 "${CHOST/-*}" = "i686" ]
118
				then
119
					return 0
120
				fi
121
				;;
122
			"alpha"|"amd64"|"mips"|"ppc"|"sparc")
123
				return 0
124
				;;
125
			*)
126
				return 1
127
				;;
128
		esac
129
	fi
130
131
	return 1
132
}
133
134
glibc_setup() {
135
	# Check if we are going to downgrade, we don't like that
136
	#local old_version
137
	#
138
	#old_version="`best_version glibc`"
139
	#old_version="${old_version/sys-libs\/glibc-/}"
140
	#
141
	#if [ "$old_version" ]; then
142
	#	if [ `python -c "import portage; print int(portage.vercmp(\"${PV}\",\"$old_version\"))"` -lt 0 ]; then
143
	#		if [ "${FORCE_DOWNGRADE}" ]; then
144
	#			ewarn "downgrading glibc, still not recommended, but we'll do as you wish"
145
	#		else
146
	#			eerror "Downgrading glibc is not supported and we strongly recommend that"
147
	#			eerror "you don't do it as it WILL break all applications compiled against"
148
	#			eerror "the new version (most likely including python and portage)."
149
	#			eerror "If you are REALLY sure that you want to do it set "
150
	#			eerror "     FORCE_DOWNGRADE=1"
151
	#			eerror "when you try it again."
152
	#			die "glibc downgrade"
153
	#		fi
154
	#	fi
155
	#fi
156
157
	# We need gcc 3.2 or later ...
158
	if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ]
159
	then
160
		echo
161
		eerror "As of glibc-2.3, gcc-3.2 or later is needed"
162
		eerror "for the build to succeed."
163
		die "GCC too old"
164
	fi
165
166
	echo
167
168
	if use_nptl
169
	then
170
		# The use_nptl should have already taken care of kernel version,
171
		# arch and CHOST, so now just check if we can find suitable kernel
172
		# source tree or headers ....
173
		einfon "Checking for sufficient version kernel headers ... "
174
		if ! get_KHV "`KV_to_int ${MIN_NPTL_KV}`" &> /dev/null
175
		then
176
			echo "no"
177
			echo
178
			eerror "Could not find a kernel source tree or headers with"
179
			eerror "version ${MIN_NPTL_KV} or later!  Please correct this"
180
			eerror "and try again."
181
			die "Insufficient kernel headers present!"
182
		else
183
			echo "yes"
184
		fi
185
	fi
186
187
	if [ "$(KV_to_int $(uname -r))" -gt "`KV_to_int '2.5.68'`" ]
188
	then
189
		local KERNEL_HEADERS="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")"
190
191
		einfon "Checking kernel headers for broken sysctl.h ... "
192
		if ! gcc -I"${KERNEL_HEADERS}" \
193
		         -c ${FILESDIR}/test-sysctl_h.c -o ${T}/test1.o &> /dev/null
194
		then
195
			echo "yes"
196
			echo
197
			eerror "Your version of:"
198
			echo
199
			eerror "  ${KERNEL_HEADERS}/linux/sysctl.h"
200
			echo
201
			eerror "is broken (from a user space perspective).  Please apply"
202
			eerror "the following patch:"
203
			echo
204
			eerror "*******************************************************"
205
			cat ${FILESDIR}/fix-sysctl_h.patch
206
			eerror "*******************************************************"
207
			echo
208
			einfo "To fix, just do this:"
209
			einfo "cd ${KERNEL_HEADERS}/linux/"
210
			einfo "patch -p3 < ${FILESDIR}/fix-sysctl_h.patch"
211
			echo
212
			die "Broken linux/sysctl.h header included in kernel sources!"
213
		else
214
			echo "no"
215
		fi
216
	fi
217
218
	if use_nptl
219
	then
220
		einfon "Checking gcc for __thread support ... "
221
		if ! gcc -c ${FILESDIR}/test-__thread.c -o ${T}/test2.o &> /dev/null
222
		then
223
			echo "no"
224
			echo
225
			eerror "Could not find a gcc that supports the __thread directive!"
226
			eerror "please update to gcc-3.2.2-r1 or later, and try again."
227
			die "No __thread support in gcc!"
228
		else
229
			echo "yes"
230
		fi
231
232
	elif use nptl &> /dev/null
233
	then
234
		echo
235
		# Just tell the user not to expect too much ...
236
		ewarn "You have \"nptl\" in your USE, but your kernel version or"
237
		ewarn "architecture does not support it!"
238
	fi
239
240
	echo
241
}
242
243
src_unpack() {
244
245
	unpack glibc-${MY_PV}.tar.bz2
246
247
	# we only need to check this one time. Bug #61856
248
	glibc_setup
249
250
	# Extract pre-made man pages.  Otherwise we need perl, which is a no-no.
251
	mkdir -p ${S}/man; cd ${S}/man
252
	use_nptl || tar xjf ${FILESDIR}/glibc-manpages-${MY_PV}.tar.bz2
253
254
	cd ${S}
255
	# Extract our threads package ...
256
	if (! use_nptl) && [ -z "${BRANCH_UPDATE}" ]
257
	then
258
		unpack glibc-linuxthreads-${MY_PV}.tar.bz2
259
	fi
260
261
	if [ -n "${BRANCH_UPDATE}" ]
262
	then
263
		epatch ${DISTDIR}/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2
264
	fi
265
266
	if use_nptl
267
	then
268
		epatch ${FILESDIR}/2.3.2/${P}-redhat-nptl-fixes.patch
269
	else
270
		epatch ${FILESDIR}/2.3.2/${P}-redhat-linuxthreads-fixes.patch
271
	fi
272
273
	# To circumvent problems with propolice __guard and
274
	# __guard_setup__stack_smash_handler
275
	#
276
	#  http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml
277
	if [ "${ARCH}" != "hppa" -a "${ARCH}" != "hppa64" ]
278
	then
279
		cd ${S}; epatch ${FILESDIR}/${PV}/${P}-propolice-guard-functions-v2.patch
280
	fi
281
282
	# With latest versions of glibc, a lot of apps failed on a PaX enabled
283
	# system with:
284
	#
285
	#  cannot enable executable stack as shared object requires: Permission denied
286
	#
287
	# This is due to PaX 'exec-protecting' the stack, and ld.so then trying
288
	# to make the stack executable due to some libraries not containing the
289
	# PT_GNU_STACK section.  Bug #32960.  <azarah@gentoo.org> (12 Nov 2003).
290
	epatch ${FILESDIR}/2.3.2/${PN}-2.3.2-dl_execstack-PaX-support.patch
291
292
	# This next patch fixes a test that will timeout due to ReiserFS' slow handling of sparse files
293
#	cd ${S}/io; epatch ${FILESDIR}/glibc-2.2.2-test-lfs-timeout.patch
294
295
	# This add back glibc 2.2 compadibility.  See bug #8766 and #9586 for more info,
296
	# and also:
297
	#
298
	#  http://lists.debian.org/debian-glibc/2002/debian-glibc-200210/msg00093.html
299
	#
300
	# We should think about remoing it in the future after things have settled.
301
	#
302
	# Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it.
303
	#
304
	# <azarah@gentoo.org> (26 Oct 2002).
305
	cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-ctype-compat-v3.patch
306
307
	# One more compat issue which breaks sun-jdk-1.3.1.  See bug #8766 for more
308
	# info, and also:
309
	#
310
	#   http://sources.redhat.com/ml/libc-alpha/2002-04/msg00143.html
311
	#
312
	# Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it.
313
	#
314
	# <azarah@gentoo.org> (30 Oct 2002).
315
	cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libc_wait-compat.patch
316
317
	# One more compat issue ... libc_stack_end is missing from ld.so.
318
	# Got this one from diffing redhat glibc tarball .. would help if
319
	# they used patches and not modified tarball ...
320
	#
321
	# <azarah@gentoo.org> (7 Nov 2002).
322
#	cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-stack_end-compat.patch
323
324
	# The mathinline.h header omits the middle term of a ?: expression.  This
325
	# is a gcc extension, but since the ISO standard forbids it, it's a
326
	# GLIBC bug (bug #27142).  See also:
327
	#
328
	#   http://bugs.gentoo.org/show_bug.cgi?id=27142
329
	#
330
	cd ${S}; epatch ${FILESDIR}/${PV}/${P}-fix-omitted-operand-in-mathinline_h.patch
331
332
	# We do not want name_insert() in iconvconfig.c to be defined inside
333
	# write_output() as it causes issues with PaX.
334
	cd ${S}; epatch ${FILESDIR}/${PV}/${P}-iconvconfig-name_insert.patch
335
336
	# Fix broken reverse resolving for IPv6 addresses, bug #42492.
337
	cd ${S}; epatch ${FILESDIR}/${PV}/${P}-ipv6-bytestring-fix.patch
338
339
	# Improved handled temporary files. bug #66358
340
	epatch ${FILESDIR}/${PV}/glibc-2.3.2-tempfile.patch
341
342
	# A few patches only for the MIPS platform.  Descriptions of what they
343
	# do can be found in the patch headers.
344
	# <tuxus@gentoo.org> thx <dragon@gentoo.org> (11 Jan 2003)
345
	# <kumba@gentoo.org> remove tst-rndseek-mips & ulps-mips patches
346
	if [ "${ARCH}" = "mips" ]
347
	then
348
		cd ${S}
349
		epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-fpu-cw-mips.patch
350
		epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libgcc-compat-mips.patch
351
		epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-librt-mips.patch
352
		epatch ${FILESDIR}/2.3.2/${P}-mips-add-n32-n64-sysdep-cancel.patch
353
		epatch ${FILESDIR}/2.3.2/${P}-mips-configure-for-n64-symver.patch
354
		epatch ${FILESDIR}/2.3.2/${P}-mips-pread-linux2.5.patch
355
		epatch ${FILESDIR}/2.3.2/${P}-mips-fix-nested-entend-pairs.patch
356
	fi
357
358
	if [ "${ARCH}" = "alpha" ]
359
	then
360
		cd ${S}
361
		# Fix compatability with compaq compilers by ifdef'ing out some
362
		# 2.3.2 additions.
363
		# <taviso@gentoo.org> (14 Jun 2003).
364
		epatch ${FILESDIR}/2.3.2/${P}-decc-compaq.patch
365
366
		# Fix compilation with >=gcc-3.2.3 (01 Nov 2003 agriffis)
367
		epatch ${FILESDIR}/2.3.2/${P}-alpha-pwrite.patch
368
		epatch ${FILESDIR}/2.3.2/${P}-alpha-crti.patch
369
	fi
370
371
	if [ "${ARCH}" = "amd64" ]
372
	then
373
		cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-amd64-nomultilib.patch
374
	fi
375
376
	if [ "${ARCH}" = "ia64" ]
377
	then
378
		# The basically problem is glibc doesn't store information about
379
		# what the kernel interface is so that it can't efficiently set up
380
		# parameters for system calls.  This patch from H.J. Lu fixes it:
381
		#
382
		#   http://sources.redhat.com/ml/libc-alpha/2003-09/msg00165.html
383
		#
384
		cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-ia64-LOAD_ARGS-fixup.patch
385
	fi
386
387
	if [ "${ARCH}" = "hppa" ]
388
	then
389
		cd ${WORKDIR}
390
		unpack ${P}-hppa-patches-p1.tar.bz2
391
		cd ${S}
392
		EPATCH_EXCLUDE="010* 020* 030* 040* 050* 055*"
393
		for i in ${EPATCH_EXCLUDE}
394
		do
395
			rm -f ${WORKDIR}/${P}-hppa-patches/$i
396
		done
397
		for i in ${WORKDIR}/${P}-hppa-patches/*
398
		do
399
			einfo Applying `basename $i`...
400
			patch -p1 < $i
401
		done
402
		einfo Applying glibc23-07-hppa-atomicity.dpatch...
403
		patch -p 1 < ${FILESDIR}/2.3.1/glibc23-07-hppa-atomicity.dpatch
404
	fi
405
406
	if [ "${ARCH}" = "s390" ]
407
	then
408
		# The deprecated ustat.h causes problems on s390
409
		#
410
		#   http://sources.redhat.com/ml/bug-glibc/2003-08/msg00020.html
411
		#
412
		# Closes Bug 47415
413
		cd ${S}/sysdeps/unix/sysv/linux; epatch ${FILESDIR}/2.3.2/${P}-s390-deprecated-ustat-fixup.patch
414
	fi
415
416
	if [ "${ARCH}" == "arm" ]
417
	then
418
		cd ${S}
419
		# sjlj exceptions causes undefined frame variables (ported from cvs)
420
		epatch ${FILESDIR}/2.3.2/${P}-framestate-USING_SJLJ_EXCEPTIONS.patch
421
		# BUS_ISA is needed in ioperm.c but is defined in linux/input.h
422
		epatch ${FILESDIR}/2.3.2/${P}-arm-bus-defines.patch
423
		# armformat fixes the linker script creation (taken from netwinder.org glibc rpm)
424
		epatch ${FILESDIR}/2.3.2/${P}-armformat.patch
425
	fi
426
427
	# Fix info leakage #59526
428
	cd ${S}; epatch ${FILESDIR}/glibc-sec-hotfix-20040804.patch
429
430
	# Fix permissions on some of the scripts
431
	chmod u+x ${S}/scripts/*.sh
432
}
433
434
setup_flags() {
435
	# Over-zealous CFLAGS can often cause problems.  What may work for one person may not
436
	# work for another.  To avoid a large influx of bugs relating to failed builds, we
437
	# strip most CFLAGS out to ensure as few problems as possible.
438
	strip-flags
439
	strip-unsupported-flags
440
441
	# -freorder-blocks for all but ia64 s390 s390x
442
	use ppc || append-flags "-freorder-blocks"
443
444
	# Sparc/Sparc64 support
445
	if use sparc
446
	then
447
448
		# Both sparc and sparc64 can use -fcall-used-g6.  -g7 is bad, though.
449
		replace-flags "-fcall-used-g7" ""
450
		append-flags "-fcall-used-g6"
451
452
		# Sparc64 Only support...
453
		if [ "${PROFILE_ARCH}" = "sparc64" ]
454
		then
455
456
			# Get rid of -mcpu options, the CHOST will fix this up
457
			replace-flags "-mcpu=ultrasparc" ""
458
			replace-flags "-mcpu=v9" ""
459
460
			# Get rid of flags known to fail
461
			replace-flags "-mvis" ""
462
463
			# Setup the CHOST properly to insure "sparcv9"
464
			# This passes -mcpu=ultrasparc -Wa,-Av9a to the compiler
465
			[ "${CHOST}" == "sparc-unknown-linux-gnu" ] && \
466
				export CHOST="sparcv9-unknown-linux-gnu"
467
		fi
468
	fi
469
470
	# We don't want these flags for glibc
471
	filter-flags -fomit-frame-pointer -malign-double
472
	filter-ldflags -pie
473
474
	# Lock glibc at -O2 -- linuxthreads needs it and we want to be conservative here
475
	append-flags -O2
476
	export LDFLAGS="${LDFLAGS//-Wl,--relax}"
477
}
478
479
src_compile() {
480
	local myconf=
481
	local myconf_nptl=
482
483
	setup_flags
484
485
	# These should not be set, else the
486
	# zoneinfo do not always get installed ...
487
	unset LANGUAGE LANG LC_ALL
488
489
	use nls || myconf="${myconf} --disable-nls"
490
491
	if use_nptl
492
	then
493
		local kernelheaders="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")"
494
495
		# NTPL and Thread Local Storage support.
496
		myconf="${myconf} --with-tls --with-__thread \
497
		                       --enable-add-ons=nptl \
498
		                       --enable-kernel=${MIN_NPTL_KV} \
499
		                       --with-headers=${kernelheaders}"
500
	else
501
		myconf="${myconf} --without-__thread \
502
		                  --enable-add-ons=linuxthreads"
503
504
		# If we build for the build system we use the kernel headers from the target
505
		# We also now set it without "build" as well, else it might use the
506
		# current kernel's headers, which might just fail (the linux-headers
507
		# package is usually well tested...)
508
#		( use build || use sparc ) \
509
#			&& myconf="${myconf} --with-headers=${ROOT}usr/include"
510
		myconf="${myconf} --with-headers=${ROOT}usr/include"
511
512
		# If kernel version and headers in ${ROOT}/usr/include are ok,
513
		# then enable --enable-kernel=${MIN_KV} ...
514
		if [ "`get_KV`" -ge "`KV_to_int ${MIN_KV}`" -a \
515
		     -n "$(get_KHV "`KV_to_int ${MIN_KV}`" "${ROOT}/usr/include")" ]
516
		then
517
			myconf="${myconf} --enable-kernel=${MIN_KV}"
518
		else
519
			myconf="${myconf} --enable-kernel=2.2.5"
520
		fi
521
	fi
522
523
	# some silly people set LD_RUN_PATH and that breaks things.
524
	# see bug 19043
525
	unset LD_RUN_PATH
526
527
	einfo "Configuring GLIBC..."
528
	rm -rf ${S}/buildhere
529
	mkdir -p ${S}/buildhere
530
	cd ${S}/buildhere
531
	../configure --build=${CHOST} \
532
		--host=${CHOST} \
533
		--with-gd=no \
534
		--without-cvs \
535
		--disable-profile \
536
		--prefix=/usr \
537
		--mandir=/usr/share/man \
538
		--infodir=/usr/share/info \
539
		--libexecdir=/usr/lib/misc \
540
		${myconf} || die
541
542
	einfo "Building GLIBC..."
543
	cd ${S}/buildhere
544
	make PARALLELMFLAGS="${MAKEOPTS}" || die
545
#	einfo "Doing GLIBC checks..."
546
#	make check
547
}
548
549
src_install() {
550
	local buildtarget="buildhere"
551
552
	setup_flags
553
554
	# These should not be set, else the
555
	# zoneinfo do not always get installed ...
556
	unset LANGUAGE LANG LC_ALL
557
558
	einfo "Installing GLIBC..."
559
	make PARALLELMFLAGS="${MAKEOPTS}" \
560
		install_root=${D} \
561
		install -C ${buildtarget} || die
562
	# now, strip everything but the thread libs #46186
563
	mkdir ${T}/thread-backup
564
	mv ${D}/lib/lib{pthread,thread_db}* ${T}/thread-backup/
565
	env -uRESTRICT prepallstrip
566
	mv ${T}/thread-backup/* ${D}/lib/
567
568
	# If librt.so is a symlink, change it into linker script (Redhat)
569
	if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ]
570
	then
571
		local LIBRTSO="`cd ${D}/lib; echo librt.so.*`"
572
		local LIBPTHREADSO="`cd ${D}/lib; echo libpthread.so.*`"
573
574
		rm -f ${D}/usr/lib/librt.so
575
		cat > ${D}/usr/lib/librt.so <<EOF
576
/* GNU ld script
577
	librt.so.1 needs libpthread.so.0 to come before libc.so.6*
578
	in search scope.  */
579
EOF
580
		grep "OUTPUT_FORMAT" ${D}/usr/lib/libc.so >> ${D}/usr/lib/librt.so
581
		echo "GROUP ( /lib/${LIBPTHREADSO} /lib/${LIBRTSO} )" \
582
			>> ${D}/usr/lib/librt.so
583
584
		for x in ${D}/usr/lib/librt.so.[1-9]
585
		do
586
			[ -L "${x}" ] && rm -f ${x}
587
		done
588
	fi
589
590
	if ! use build
591
	then
592
		if ! has noinfo ${FEATURES} ; then
593
			einfo "Installing Info pages..."
594
			make PARALLELMFLAGS="${MAKEOPTS}" \
595
				install_root=${D} \
596
				info -C ${buildtarget} || die
597
		fi
598
599
		einfo "Installing Locale data..."
600
		make PARALLELMFLAGS="${MAKEOPTS}" \
601
			install_root=${D} \
602
			localedata/install-locales -C ${buildtarget} || die
603
604
		# Compatibility hack: this locale has vanished from glibc,
605
		# but some other programs are still using it.
606
		keepdir /usr/lib/locale/ru_RU/LC_MESSAGES
607
608
		einfo "Installing man pages and docs..."
609
		# Install linuxthreads man pages
610
		use_nptl || {
611
			dodir /usr/share/man/man3
612
			doman ${S}/man/*.3thr
613
		}
614
615
		# Install nscd config file
616
		insinto /etc ; doins ${FILESDIR}/nscd.conf
617
		exeinto /etc/init.d ; doexe ${FILESDIR}/nscd
618
619
		dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE \
620
			NEWS NOTES PROJECTS README*
621
	else
622
		rm -rf ${D}/usr/share ${D}/usr/lib/gconv
623
624
		einfo "Installing Timezone data..."
625
		make PARALLELMFLAGS="${MAKEOPTS}" \
626
			install_root=${D} \
627
			timezone/install-others -C ${buildtarget} || die
628
	fi
629
630
	if use pic
631
	then
632
		find ${S}/${buildtarget}/ -name "soinit.os" -exec cp {} ${D}/lib/soinit.o \;
633
		find ${S}/${buildtarget}/ -name "sofini.os" -exec cp {} ${D}/lib/sofini.o \;
634
		find ${S}/${buildtarget}/ -name "*_pic.a" -exec cp {} ${D}/lib \;
635
		find ${S}/${buildtarget}/ -name "*.map" -exec cp {} ${D}/lib \;
636
		for i in ${D}/lib/*.map
637
		do
638
			mv ${i} ${i%.map}_pic.map
639
		done
640
	fi
641
642
	# Is this next line actually needed or does the makefile get it right?
643
	# It previously has 0755 perms which was killing things.
644
	fperms 4755 /usr/lib/misc/pt_chown
645
646
	# Currently libraries in  /usr/lib/gconv do not get loaded if not
647
	# in search path ...
648
#	insinto /etc/env.d
649
#	doins ${FILESDIR}/03glibc
650
651
	rm -f ${D}/etc/ld.so.cache
652
653
	# Prevent overwriting of the /etc/localtime symlink.  We'll handle the
654
	# creation of the "factory" symlink in pkg_postinst().
655
	rm -f ${D}/etc/localtime
656
657
	# Some things want this, notably ash.
658
	dosym /usr/lib/libbsd-compat.a /usr/lib/libbsd.a
659
}
660
661
pkg_postinst() {
662
	# Correct me if I am wrong here, but my /etc/localtime is a file
663
	# created by zic ....
664
	# I am thinking that it should only be recreated if no /etc/localtime
665
	# exists, or if it is an invalid symlink.
666
	#
667
	# For invalid symlink:
668
	#   -f && -e  will fail
669
	#   -L will succeed
670
	#
671
	if [ ! -e ${ROOT}/etc/localtime ]
672
	then
673
		echo "Please remember to set your timezone using the zic command."
674
		rm -f ${ROOT}/etc/localtime
675
		ln -s ../usr/share/zoneinfo/Factory ${ROOT}/etc/localtime
676
	fi
677
678
	if [ -x ${ROOT}/usr/sbin/iconvconfig ]
679
	then
680
		# Generate fastloading iconv module configuration file.
681
		${ROOT}/usr/sbin/iconvconfig --prefix=${ROOT}
682
	fi
683
684
	# Reload init ...
685
	if [ "${ROOT}" = "/" ]
686
	then
687
		/sbin/init U &> /dev/null
688
	fi
689
}
(-)glibc-2.3.3.20040420-r2.ebuild (+731 lines)
Added Link Here
1
# Copyright 1999-2004 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.3.20040420-r1.ebuild,v 1.7 2004/09/29 05:24:47 vapier Exp $
4
5
inherit eutils flag-o-matic gcc
6
7
# Branch update support.  Following will disable:
8
#  BRANCH_UPDATE=
9
BRANCH_UPDATE="20040420"
10
11
12
# Minimum kernel version for --enable-kernel
13
export MIN_KV="2.4.1"
14
# Minimum kernel version for enabling TLS and NPTL ...
15
# NOTE: do not change this if you do not know what
16
#       you are doing !
17
export MIN_NPTL_KV="2.6.0"
18
19
#MY_PV="${PV/_}"
20
MY_PV="2.3.2"
21
#S="${WORKDIR}/${P%_*}"
22
S="${WORKDIR}/${PN}-${MY_PV}"
23
DESCRIPTION="GNU libc6 (also called glibc2) C library"
24
HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
25
SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${MY_PV}.tar.bz2
26
	ftp://sources.redhat.com/pub/glibc/snapshots/glibc-${MY_PV}.tar.bz2
27
	http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${MY_PV}.tar.bz2
28
	ftp://sources.redhat.com/pub/glibc/snapshots/glibc-linuxthreads-${MY_PV}.tar.bz2
29
	mirror://gentoo/${PN}-2.3.3-branch-update-${BRANCH_UPDATE}.patch.bz2
30
	hppa? ( mirror://gentoo/${PN}-${MY_PV}-hppa-patches-p1.tar.bz2 )"
31
32
LICENSE="LGPL-2"
33
SLOT="2.2"
34
#KEYWORDS="~x86 ~mips ~sparc ~amd64 -hppa ~ia64 ~ppc" # breaks on ~alpha
35
KEYWORDS="~x86 ~ppc ~sparc"
36
IUSE="nls pic build nptl erandom debug hardened"
37
38
# We need new cleanup attribute support from gcc for NPTL among things ...
39
DEPEND=">=sys-devel/gcc-3.2.3-r1
40
	nptl? ( >=sys-devel/gcc-3.3.1-r1 )
41
	>=sys-devel/binutils-2.14.90.0.6-r1
42
	virtual/os-headers
43
	nls? ( sys-devel/gettext )"
44
RDEPEND="virtual/os-headers
45
	sys-apps/baselayout
46
	nls? ( sys-devel/gettext )"
47
PROVIDE="virtual/glibc virtual/libc"
48
49
50
# Try to get a kernel source tree with version equal or greater
51
# than $1.  We basically just try a few default locations.  The
52
# version need to be that which KV_to_int() returns ...
53
get_KHV() {
54
	local headers=
55
56
	[ -z "$1" ] && return 1
57
58
	# - First check if linux-headers are installed (or symlink
59
	#   to current kernel ...)
60
	# - Ok, do we have access to the current kernel's headers ?
61
	# - Last option ... maybe its a weird bootstrap with /lib
62
	#   binded to the chroot ...
63
64
	# We do not really support more than 2 arguments ...
65
	if [ -n "$2" ]
66
	then
67
		headers="$2"
68
	else
69
		# Things should be pretty stable kernel side now, so try
70
		# /usr/include first, then the current kernel's headers.
71
		headers="${ROOT}/usr/include \
72
		         /lib/modules/`uname -r`/build/include \
73
		         ${ROOT}/lib/modules/`uname -r`/build/include \
74
				 /usr/src/linux/include \
75
				 ${ROOT}/usr/src/linux/include"
76
	fi
77
78
	for x in ${headers}
79
	do
80
		local header="${x}/linux/version.h"
81
82
		if [ -f ${header} ]
83
		then
84
85
			local version="`grep 'LINUX_VERSION_CODE' ${header} | \
86
				sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
87
88
			if [ "${version}" -ge "$1" ]
89
			then
90
				echo "${x}"
91
92
				return 0
93
			fi
94
		fi
95
	done
96
97
	return 1
98
}
99
100
use_nptl() {
101
	# Enable NPTL support if:
102
	# - We have 'nptl' in USE
103
	# - We have linux-2.5 or later kernel (should prob check for 2.4.20 ...)
104
	if use nptl && [ "`get_KV`" -ge "`KV_to_int ${MIN_NPTL_KV}`"  ]
105
	then
106
		# Enable NPTL support if:
107
		# - We have 'x86' in USE and:
108
		#   - a CHOST of "i486-pc-linux-gnu"
109
		#   - a CHOST of "i586-pc-linux-gnu"
110
		#   - a CHOST of "i686-pc-linux-gnu"
111
		# - Or we have 'alpha' in USE
112
		# - Or we have 'amd64' in USE
113
		# - Or we have 'mips' in USE
114
		# - Or we have 'ppc' in USE
115
		case ${ARCH} in
116
			"x86")
117
				if [ "${CHOST/-*}" = "i486" -o \
118
				     "${CHOST/-*}" = "i586" -o \
119
					 "${CHOST/-*}" = "i686" ]
120
				then
121
					return 0
122
				fi
123
				;;
124
			"alpha"|"amd64"|"ia64"|"mips"|"ppc"|"sparc")
125
				return 0
126
				;;
127
			*)
128
				return 1
129
				;;
130
		esac
131
	fi
132
133
	return 1
134
}
135
136
glibc_setup() {
137
	# Check if we are going to downgrade, we don't like that
138
	#local old_version
139
	#
140
	#old_version="`best_version glibc`"
141
	#old_version="${old_version/sys-libs\/glibc-/}"
142
	#
143
	#if [ "$old_version" ]; then
144
	# The vercmp fails if this ebuild is -r[0-9..] Please fix.
145
	#	if [ `python -c "import portage; print int(portage.vercmp(\"${PV}\",\"$old_version\"))"` -lt 0 ]; then
146
	#		if [ "${FORCE_DOWNGRADE}" ]; then
147
	#			ewarn "downgrading glibc, still not recommended, but we'll do as you wish"
148
	#		else
149
	#			eerror "Downgrading glibc is not supported and we strongly recommend that"
150
	#			eerror "you don't do it as it WILL break all applications compiled against"
151
	#			eerror "the new version (most likely including python and portage)."
152
	#			eerror "If you are REALLY sure that you want to do it set "
153
	#			eerror "     FORCE_DOWNGRADE=1"
154
	#			eerror "when you try it again."
155
	#			die "glibc downgrade"
156
	#		fi
157
	#	fi
158
	#fi
159
160
	# We need gcc 3.2 or later ...
161
	if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ]
162
	then
163
		echo
164
		eerror "As of glibc-2.3, gcc-3.2 or later is needed"
165
		eerror "for the build to succeed."
166
		die "GCC too old"
167
	fi
168
169
	echo
170
171
	if use_nptl
172
	then
173
		# The use_nptl should have already taken care of kernel version,
174
		# arch and CHOST, so now just check if we can find suitable kernel
175
		# source tree or headers ....
176
		einfon "Checking for sufficient version kernel headers ... "
177
		if ! get_KHV "`KV_to_int ${MIN_NPTL_KV}`" &> /dev/null
178
		then
179
			echo "no"
180
			echo
181
			eerror "Could not find a kernel source tree or headers with"
182
			eerror "version ${MIN_NPTL_KV} or later!  Please correct this"
183
			eerror "and try again."
184
			die "Insufficient kernel headers present!"
185
		else
186
			echo "yes"
187
		fi
188
	fi
189
190
	if [ "$(KV_to_int $(uname -r))" -gt "`KV_to_int '2.5.68'`" ]
191
	then
192
		local KERNEL_HEADERS="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")"
193
194
		einfon "Checking kernel headers for broken sysctl.h ... "
195
		if ! gcc -I"${KERNEL_HEADERS}" \
196
		         -c ${FILESDIR}/test-sysctl_h.c -o ${T}/test1.o &> /dev/null
197
		then
198
			echo "yes"
199
			echo
200
			eerror "Your version of:"
201
			echo
202
			eerror "  ${KERNEL_HEADERS}/linux/sysctl.h"
203
			echo
204
			eerror "is broken (from a user space perspective).  Please apply"
205
			eerror "the following patch:"
206
			echo
207
			eerror "*******************************************************"
208
			cat ${FILESDIR}/fix-sysctl_h.patch
209
			eerror "*******************************************************"
210
			echo
211
			einfo "To fix, just do this:"
212
			einfo "cd ${KERNEL_HEADERS}/linux/"
213
			einfo "patch -p3 < ${FILESDIR}/fix-sysctl_h.patch"
214
			echo
215
			die "Broken linux/sysctl.h header included in kernel sources!"
216
		else
217
			echo "no"
218
		fi
219
	fi
220
221
	if use_nptl
222
	then
223
		einfon "Checking gcc for __thread support ... "
224
		if ! gcc -c ${FILESDIR}/test-__thread.c -o ${T}/test2.o &> /dev/null
225
		then
226
			echo "no"
227
			echo
228
			eerror "Could not find a gcc that supports the __thread directive!"
229
			eerror "please update to gcc-3.2.2-r1 or later, and try again."
230
			die "No __thread support in gcc!"
231
		else
232
			echo "yes"
233
		fi
234
235
	elif use nptl &> /dev/null
236
	then
237
		echo
238
		# Just tell the user not to expect too much ...
239
		ewarn "You have \"nptl\" in your USE, but your kernel version or"
240
		ewarn "architecture does not support it!"
241
	fi
242
243
	echo
244
}
245
246
src_unpack() {
247
248
	local LOCAL_P="${PN}-${MY_PV}"
249
250
	# we only need to check this one time. Bug #61856
251
	glibc_setup
252
253
	unpack glibc-${MY_PV}.tar.bz2
254
255
	# Extract pre-made man pages.  Otherwise we need perl, which is a no-no.
256
	mkdir -p ${S}/man; cd ${S}/man
257
	use_nptl || tar xjf ${FILESDIR}/glibc-manpages-${MY_PV}.tar.bz2
258
259
	cd ${S}
260
	# Extract our threads package ...
261
	if ! use_nptl && [ -z "${BRANCH_UPDATE}" ]
262
	then
263
		unpack glibc-linuxthreads-${MY_PV}.tar.bz2
264
	fi
265
266
	if [ -n "${BRANCH_UPDATE}" ]
267
	then
268
		epatch ${DISTDIR}/${PN}-2.3.3-branch-update-${BRANCH_UPDATE}.patch.bz2
269
	fi
270
271
	if use_nptl
272
	then
273
		epatch ${FILESDIR}/2.3.2/${LOCAL_P}-redhat-nptl-fixes.patch
274
	else
275
		epatch ${FILESDIR}/2.3.2/${LOCAL_P}-redhat-linuxthreads-fixes.patch
276
	fi
277
278
	epatch ${FILESDIR}/glibc-sec-hotfix-20040804.patch
279
280
	# To circumvent problems with propolice __guard and
281
	# __guard_setup__stack_smash_handler
282
	#
283
	#  http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml
284
	if [ "${ARCH}" != "hppa" -a "${ARCH}" != "hppa64" ]
285
	then
286
		cd ${S}
287
		epatch ${FILESDIR}/2.3.3/${LOCAL_P}-propolice-guard-functions-v3.patch
288
		cp ${FILESDIR}/2.3.3/ssp.c ${S}/sysdeps/unix/sysv/linux || \
289
			die "failed to copy ssp.c to ${S}/sysdeps/unix/sysv/linux/"
290
		# gcc 3.4 nukes ssp without this patch
291
		if [ "`gcc-major-version`" -ge "3" -a "`gcc-minor-version`" -ge "4" ]
292
		then
293
			epatch ${FILESDIR}/2.3.3/glibc-2.3.3-ssp-gcc34-after-frandom.patch
294
		fi
295
	fi
296
297
	# sparc fails when building the components for the normal crt1.o
298
	# with -K PIC automatically via hardened PIE and SSP specs files
299
	if use sparc && use hardened
300
	then
301
		einfo "adding crt1.o bugfix for hardened gcc on sparc glibc"
302
		sed -i "s|CPPFLAGS += -DHAVE_INITFINI|CPPFLAGS += -DHAVE_INITFINI -fno-pie -fno-PIE|" \
303
			"${WORKDIR}/glibc-2.3.2/csu/Makefile"
304
305
		# check if it worked
306
		grep -q "CPPFLAGS += -DHAVE_INITFINI -fno-pie -fno-PIE" \
307
			"${WORKDIR}/glibc-2.3.2/csu/Makefile"
308
309
		if [ $? -ne 0 ]
310
		then
311
			eerror "sed failure: could not add sparc crt1.o PIC bugfix"
312
			exit 1
313
		fi
314
	fi
315
316
	# patch this regardless of architecture, although it's ssp-related
317
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-frandom-detect.patch
318
319
	#
320
	# *** PaX related patches starts here ***
321
	#
322
323
	# localedef contains nested function trampolines, which trigger
324
	# segfaults under PaX -solar
325
	# Debian Bug (#231438, #198099)
326
	epatch ${FILESDIR}/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch
327
328
329
	# With latest versions of glibc, a lot of apps failed on a PaX enabled
330
	# system with:
331
	#
332
	#  cannot enable executable stack as shared object requires: Permission denied
333
	#
334
	# This is due to PaX 'exec-protecting' the stack, and ld.so then trying
335
	# to make the stack executable due to some libraries not containing the
336
	# PT_GNU_STACK section.  Bug #32960.  <azarah@gentoo.org> (12 Nov 2003).
337
	cd ${S}; epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-dl_execstack-PaX-support.patch
338
339
	# Program header support for PaX.
340
	cd ${S}; epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040117-pt_pax.diff
341
342
	# Suppress unresolvable relocation against symbol `main' in Scrt1.o
343
	# can be reproduced with compiling net-dns/bind-9.2.2-r3 using -pie
344
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040117-got-fix.diff
345
346
	#
347
	# *** PaX related patches ends here ***
348
	#
349
350
	# Improved handled temporary files. bug #66358
351
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-tempfile.patch
352
353
	# Fix an assert when running libc.so from commandline, bug #34733.
354
#	cd ${S}; epatch ${FILESDIR}/2.3.2/${PN}-2.3.2-rtld-assert-fix.patch
355
356
	# This next patch fixes a test that will timeout due to ReiserFS' slow handling of sparse files
357
#	cd ${S}/io; epatch ${FILESDIR}/glibc-2.2.2-test-lfs-timeout.patch
358
359
	# This add back glibc 2.2 compadibility.  See bug #8766 and #9586 for more info,
360
	# and also:
361
	#
362
	#  http://lists.debian.org/debian-glibc/2002/debian-glibc-200210/msg00093.html
363
	#
364
	# We should think about remoing it in the future after things have settled.
365
	#
366
	# Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it.
367
	#
368
	# <azarah@gentoo.org> (26 Oct 2002).
369
	cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-ctype-compat-v3.patch
370
371
	# One more compat issue which breaks sun-jdk-1.3.1.  See bug #8766 for more
372
	# info, and also:
373
	#
374
	#   http://sources.redhat.com/ml/libc-alpha/2002-04/msg00143.html
375
	#
376
	# Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it.
377
	#
378
	# <azarah@gentoo.org> (30 Oct 2002).
379
	cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libc_wait-compat.patch
380
381
	# One more compat issue ... libc_stack_end is missing from ld.so.
382
	# Got this one from diffing redhat glibc tarball .. would help if
383
	# they used patches and not modified tarball ...
384
	#
385
	# <azarah@gentoo.org> (7 Nov 2002).
386
#	cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-stack_end-compat.patch
387
388
	# The mathinline.h header omits the middle term of a ?: expression.  This
389
	# is a gcc extension, but since the ISO standard forbids it, it's a
390
	# GLIBC bug (bug #27142).  See also:
391
	#
392
	#   http://bugs.gentoo.org/show_bug.cgi?id=27142
393
	#
394
#	cd ${S}; epatch ${FILESDIR}/2.3.2/${LOCAL_P}-fix-omitted-operand-in-mathinline_h.patch
395
396
	# We do not want name_insert() in iconvconfig.c to be defined inside
397
	# write_output() as it causes issues with trampolines/PaX.
398
	cd ${S}; epatch ${FILESDIR}/2.3.2/${LOCAL_P}-iconvconfig-name_insert.patch
399
400
	# A few patches only for the MIPS platform.  Descriptions of what they
401
	# do can be found in the patch headers.
402
	# <tuxus@gentoo.org> thx <dragon@gentoo.org> (11 Jan 2003)
403
	# <kumba@gentoo.org> remove tst-rndseek-mips & ulps-mips patches
404
	if [ "${ARCH}" = "mips" ]
405
	then
406
		cd ${S}
407
		epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-fpu-cw-mips.patch
408
		epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-librt-mips.patch
409
		epatch ${FILESDIR}/2.3.2/${LOCAL_P}-mips-add-n32-n64-sysdep-cancel.patch
410
		epatch ${FILESDIR}/2.3.2/${LOCAL_P}-mips-configure-for-n64-symver.patch
411
		epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040420-mips-dl-machine-calls.diff
412
		epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040420-mips-incl-sgidefs.diff
413
		epatch ${FILESDIR}/2.3.3/mips-addabi.diff
414
		epatch ${FILESDIR}/2.3.3/mips-syscall.h.diff
415
		epatch ${FILESDIR}/2.3.3/semtimedop.diff
416
		epatch ${FILESDIR}/2.3.3/mips-sysify.diff
417
#####		epatch ${FILESDIR}/2.3.3/mips-n32n64regs.diff
418
	fi
419
420
	if [ "${ARCH}" = "alpha" ]
421
	then
422
		cd ${S}
423
		# Fix compatability with compaq compilers by ifdef'ing out some
424
		# 2.3.2 additions.
425
		# <taviso@gentoo.org> (14 Jun 2003).
426
		epatch ${FILESDIR}/2.3.2/${LOCAL_P}-decc-compaq.patch
427
428
		# Fix compilation with >=gcc-3.2.3 (01 Nov 2003 agriffis)
429
#		epatch ${FILESDIR}/2.3.2/${LOCAL_P}-alpha-pwrite.patch
430
	fi
431
432
	if [ "${ARCH}" = "amd64" ]
433
	then
434
		cd ${S}; epatch ${FILESDIR}/2.3.2/${LOCAL_P}-amd64-nomultilib.patch
435
	fi
436
437
	if [ "${ARCH}" = "ia64" ]
438
	then
439
		# The basically problem is glibc doesn't store information about
440
		# what the kernel interface is so that it can't efficiently set up
441
		# parameters for system calls.  This patch from H.J. Lu fixes it:
442
		#
443
		#   http://sources.redhat.com/ml/libc-alpha/2003-09/msg00165.html
444
		#
445
		#cd ${S}; epatch ${FILESDIR}/2.3.2/${LOCAL_P}-ia64-LOAD_ARGS-fixup.patch
446
		:
447
	fi
448
449
	if [ "${ARCH}" = "hppa" ]
450
	then
451
		local x=
452
453
		cd ${WORKDIR}
454
		unpack ${LOCAL_P}-hppa-patches-p1.tar.bz2
455
		cd ${S}
456
		EPATCH_EXCLUDE="0[123459]0* 055* 1[2379]0* 200* 230*"
457
		for x in ${EPATCH_EXCLUDE}
458
		do
459
			rm -f ${WORKDIR}/${LOCAL_P}-hppa-patches/${x}
460
		done
461
		for x in ${WORKDIR}/${LOCAL_P}-hppa-patches/*
462
		do
463
			epatch ${x}
464
		done
465
		epatch ${FILESDIR}/2.3.1/glibc23-07-hppa-atomicity.dpatch
466
	fi
467
468
	cd ${S}
469
	epatch ${FILESDIR}/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch
470
471
	# Fix permissions on some of the scripts
472
	chmod u+x ${S}/scripts/*.sh
473
}
474
475
setup_flags() {
476
	# Over-zealous CFLAGS can often cause problems.  What may work for one person may not
477
	# work for another.  To avoid a large influx of bugs relating to failed builds, we
478
	# strip most CFLAGS out to ensure as few problems as possible.
479
	strip-flags
480
	strip-unsupported-flags
481
482
	# -freorder-blocks for all but ia64 s390 s390x
483
	use ppc || append-flags "-freorder-blocks"
484
485
	# Sparc/Sparc64 support
486
	if use sparc
487
	then
488
489
		# Both sparc and sparc64 can use -fcall-used-g6.  -g7 is bad, though.
490
		replace-flags "-fcall-used-g7" ""
491
		append-flags "-fcall-used-g6"
492
493
		# Sparc64 Only support...
494
		if [ "${PROFILE_ARCH}" = "sparc64" ]
495
		then
496
497
			# Get rid of -mcpu options, the CHOST will fix this up
498
			replace-flags "-mcpu=ultrasparc" ""
499
			replace-flags "-mcpu=v9" ""
500
501
			# Get rid of flags known to fail
502
			replace-flags "-mvis" ""
503
504
			# Setup the CHOST properly to insure "sparcv9"
505
			# This passes -mcpu=ultrasparc -Wa,-Av9a to the compiler
506
			[ "${CHOST}" == "sparc-unknown-linux-gnu" ] && \
507
				export CHOST="sparcv9-unknown-linux-gnu"
508
		fi
509
	fi
510
511
	if [ "`gcc-major-version`" -ge "3" -a "`gcc-minor-version`" -ge "4" ]; then
512
		# broken in 3.4.x
513
		replace-flags -march=pentium-m -mtune=pentium3
514
	fi
515
516
	# We don't want these flags for glibc
517
	filter-flags -fomit-frame-pointer -malign-double
518
	filter-ldflags -pie
519
520
	# Lock glibc at -O2 -- linuxthreads needs it and we want to be conservative here
521
	append-flags -O2
522
	export LDFLAGS="${LDFLAGS//-Wl,--relax}"
523
}
524
525
src_compile() {
526
	local myconf=
527
	local myconf_nptl=
528
529
	setup_flags
530
531
	# These should not be set, else the
532
	# zoneinfo do not always get installed ...
533
	unset LANGUAGE LANG LC_ALL
534
535
	use nls || myconf="${myconf} --disable-nls"
536
537
	use erandom || myconf="${myconf} --disable-dev-erandom"
538
539
	if use_nptl
540
	then
541
		local kernelheaders="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")"
542
543
		# NTPL and Thread Local Storage support.
544
		myconf="${myconf} --with-tls --with-__thread \
545
		                       --enable-add-ons=nptl \
546
		                       --enable-kernel=${MIN_NPTL_KV} \
547
		                       --with-headers=${kernelheaders}"
548
	else
549
		myconf="${myconf} --without-__thread \
550
		                  --enable-add-ons=linuxthreads"
551
552
		# If we build for the build system we use the kernel headers from the target
553
		# We also now set it without "build" as well, else it might use the
554
		# current kernel's headers, which might just fail (the linux-headers
555
		# package is usually well tested...)
556
#		( use build || use sparc ) \
557
#			&& myconf="${myconf} --with-headers=${ROOT}usr/include"
558
		myconf="${myconf} --with-headers=${ROOT}usr/include"
559
560
		# If kernel version and headers in ${ROOT}/usr/include are ok,
561
		# then enable --enable-kernel=${MIN_KV} ...
562
		if [ "`get_KV`" -ge "`KV_to_int ${MIN_KV}`" -a \
563
		     -n "$(get_KHV "`KV_to_int ${MIN_KV}`" "${ROOT}/usr/include")" ]
564
		then
565
			myconf="${myconf} --enable-kernel=${MIN_KV}"
566
		else
567
			myconf="${myconf} --enable-kernel=2.2.5"
568
		fi
569
	fi
570
571
	# some silly people set LD_RUN_PATH and that breaks things.
572
	# see bug 19043
573
	unset LD_RUN_PATH
574
575
	einfo "Configuring GLIBC..."
576
	rm -rf ${S}/buildhere
577
	mkdir -p ${S}/buildhere
578
	cd ${S}/buildhere
579
	../configure --build=${CHOST} \
580
		--host=${CHOST} \
581
		--with-gd=no \
582
		--without-cvs \
583
		--disable-profile \
584
		--prefix=/usr \
585
		--mandir=/usr/share/man \
586
		--infodir=/usr/share/info \
587
		--libexecdir=/usr/lib/misc \
588
		${myconf} || die
589
590
	einfo "Building GLIBC..."
591
	cd ${S}/buildhere
592
	make PARALLELMFLAGS="${MAKEOPTS}" || die
593
#	einfo "Doing GLIBC checks..."
594
#	make check
595
}
596
597
src_install() {
598
	local buildtarget="buildhere"
599
600
	setup_flags
601
602
	# These should not be set, else the
603
	# zoneinfo do not always get installed ...
604
	unset LANGUAGE LANG LC_ALL
605
606
	einfo "Installing GLIBC..."
607
	make PARALLELMFLAGS="${MAKEOPTS}" \
608
		install_root=${D} \
609
		install -C ${buildtarget} || die
610
611
	# If librt.so is a symlink, change it into linker script (Redhat)
612
	if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ]
613
	then
614
		local LIBRTSO="`cd ${D}/lib; echo librt.so.*`"
615
		local LIBPTHREADSO="`cd ${D}/lib; echo libpthread.so.*`"
616
617
		rm -f ${D}/usr/lib/librt.so
618
		cat > ${D}/usr/lib/librt.so <<EOF
619
/* GNU ld script
620
	librt.so.1 needs libpthread.so.0 to come before libc.so.6*
621
	in search scope.  */
622
EOF
623
		grep "OUTPUT_FORMAT" ${D}/usr/lib/libc.so >> ${D}/usr/lib/librt.so
624
		echo "GROUP ( /lib/${LIBPTHREADSO} /lib/${LIBRTSO} )" \
625
			>> ${D}/usr/lib/librt.so
626
627
		for x in ${D}/usr/lib/librt.so.[1-9]
628
		do
629
			[ -L "${x}" ] && rm -f ${x}
630
		done
631
	fi
632
633
	if ! use build
634
	then
635
		einfo "Installing Info pages..."
636
		make PARALLELMFLAGS="${MAKEOPTS}" \
637
			install_root=${D} \
638
			info -C ${buildtarget} || die
639
640
		einfo "Installing Locale data..."
641
		make PARALLELMFLAGS="${MAKEOPTS}" \
642
			install_root=${D} \
643
			localedata/install-locales -C ${buildtarget} || die
644
645
		# Compatibility hack: this locale has vanished from glibc,
646
		# but some other programs are still using it.
647
		keepdir /usr/lib/locale/ru_RU/LC_MESSAGES
648
649
		einfo "Installing man pages and docs..."
650
		# Install linuxthreads man pages
651
		use_nptl || {
652
			dodir /usr/share/man/man3
653
			doman ${S}/man/*.3thr
654
		}
655
656
		# Install nscd config file
657
		insinto /etc ; doins ${FILESDIR}/nscd.conf
658
		exeinto /etc/init.d ; doexe ${FILESDIR}/nscd
659
660
		dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE \
661
			NEWS NOTES PROJECTS README*
662
	else
663
		rm -rf ${D}/usr/share ${D}/usr/lib/gconv
664
665
		einfo "Installing Timezone data..."
666
		make PARALLELMFLAGS="${MAKEOPTS}" \
667
			install_root=${D} \
668
			timezone/install-others -C ${buildtarget} || die
669
	fi
670
671
	if use pic
672
	then
673
		find ${S}/${buildtarget}/ -name "soinit.os" -exec cp {} ${D}/lib/soinit.o \;
674
		find ${S}/${buildtarget}/ -name "sofini.os" -exec cp {} ${D}/lib/sofini.o \;
675
		find ${S}/${buildtarget}/ -name "*_pic.a" -exec cp {} ${D}/lib \;
676
		find ${S}/${buildtarget}/ -name "*.map" -exec cp {} ${D}/lib \;
677
		for i in ${D}/lib/*.map
678
		do
679
			mv ${i} ${i%.map}_pic.map
680
		done
681
	fi
682
683
	# Is this next line actually needed or does the makefile get it right?
684
	# It previously has 0755 perms which was killing things.
685
	fperms 4711 /usr/lib/misc/pt_chown
686
687
	# Currently libraries in  /usr/lib/gconv do not get loaded if not
688
	# in search path ...
689
#	insinto /etc/env.d
690
#	doins ${FILESDIR}/03glibc
691
692
	rm -f ${D}/etc/ld.so.cache
693
694
	# Prevent overwriting of the /etc/localtime symlink.  We'll handle the
695
	# creation of the "factory" symlink in pkg_postinst().
696
	rm -f ${D}/etc/localtime
697
698
	# Some things want this, notably ash.
699
	dosym /usr/lib/libbsd-compat.a /usr/lib/libbsd.a
700
}
701
702
pkg_postinst() {
703
	# Correct me if I am wrong here, but my /etc/localtime is a file
704
	# created by zic ....
705
	# I am thinking that it should only be recreated if no /etc/localtime
706
	# exists, or if it is an invalid symlink.
707
	#
708
	# For invalid symlink:
709
	#   -f && -e  will fail
710
	#   -L will succeed
711
	#
712
	if [ ! -e ${ROOT}/etc/localtime ]
713
	then
714
		echo "Please remember to set your timezone using the zic command."
715
		rm -f ${ROOT}/etc/localtime
716
		ln -s ../usr/share/zoneinfo/Factory ${ROOT}/etc/localtime
717
	fi
718
719
	if [ -x ${ROOT}/usr/sbin/iconvconfig ]
720
	then
721
		# Generate fastloading iconv module configuration file.
722
		${ROOT}/usr/sbin/iconvconfig --prefix=${ROOT}
723
	fi
724
725
	# Reload init ...
726
	if [ "${ROOT}" = "/" ]
727
	then
728
		/sbin/init U &> /dev/null
729
	fi
730
}
731
(-)glibc-2.3.4.20040619-r2.ebuild (+757 lines)
Added Link Here
1
# Copyright 1999-2004 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.4.20040619-r1.ebuild,v 1.19 2004/09/29 05:24:47 vapier Exp $
4
5
inherit eutils flag-o-matic gcc
6
7
# Branch update support.  Following will disable:
8
#  BRANCH_UPDATE=
9
BRANCH_UPDATE="20040619"
10
11
12
# Minimum kernel version we support
13
# (Recent snapshots fails with 2.6.5 and earlier)
14
MIN_KERNEL_VERSION="2.6.5"
15
16
17
if [ -z "${BRANCH_UPDATE}" ]; then
18
	BASE_PV="${NEW_PV}"
19
	NEW_PV="${NEW_PV}"
20
else
21
	BASE_PV="2.3.2"
22
	NEW_PV="${PV%.*}"
23
fi
24
25
26
S="${WORKDIR}/${PN}-${BASE_PV}"
27
DESCRIPTION="GNU libc6 (also called glibc2) C library"
28
HOMEPAGE="http://sources.redhat.com/glibc/"
29
30
HPPA_PATCHES=2004-06-04
31
32
SRC_URI="http://ftp.gnu.org/gnu/${PN}/${PN}-${BASE_PV}.tar.bz2
33
	ftp://sources.redhat.com/pub/${PN}/snapshots/${PN}-${BASE_PV}.tar.bz2
34
	mirror://gentoo/${PN}-manpages-${NEW_PV}.tar.bz2
35
	hppa? ( http://parisc-linux.org/~carlos/glibc-work/glibc-hppa-patches-${HPPA_PATCHES}.tar.gz )"
36
if [ -z "${BRANCH_UPDATE}" ]; then
37
	SRC_URI="${SRC_URI}
38
		http://ftp.gnu.org/gnu/${PN}/${PN}-linuxthreads-${BASE_PV}.tar.bz2
39
		ftp://sources.redhat.com/pub/${PN}/snapshots/${PN}-linuxthreads-${BASE_PV}.tar.bz2"
40
else
41
	SRC_URI="${SRC_URI}
42
		mirror://gentoo/${PN}-${NEW_PV}-branch-update-${BRANCH_UPDATE}.patch.bz2"
43
fi
44
45
LICENSE="LGPL-2"
46
SLOT="2.2"
47
KEYWORDS="-* ~x86 ~mips ~amd64 ~hppa ~ppc ~ia64"
48
IUSE="userlocales pic build nptl erandom hardened makecheck multilib debug n32 n64"
49
RESTRICT="nostrip" # we'll handle stripping ourself #46186
50
51
# We need new cleanup attribute support from gcc for NPTL among things ...
52
# We also need linux26-headers if using NPTL. Including kernel headers is
53
# incredibly unreliable, and this new linux-headers release from plasmaroo
54
# should work with userspace apps, at least on amd64 and ppc64.
55
DEPEND=">=sys-devel/gcc-3.2.3-r1
56
	nptl? ( >=sys-devel/gcc-3.3.1-r1 )
57
	>=sys-devel/binutils-2.14.90.0.6-r1
58
	virtual/os-headers
59
	nptl? ( =sys-kernel/linux26-headers-2.6* )
60
	nls? ( sys-devel/gettext )"
61
RDEPEND="virtual/os-headers
62
	sys-apps/baselayout
63
	nls? ( sys-devel/gettext )"
64
65
PROVIDE="virtual/glibc virtual/libc"
66
67
68
# Theoretical cross-compiler support
69
[ -z "${CCHOST}" ] && CCHOST="${CHOST}"
70
71
# We need to be able to set alternative headers for
72
# compiling for non-native platform
73
# Will also become useful for testing kernel-headers without screwing up
74
# whole system
75
[ -z "${ALT_HEADERS}" ] && ALT_HEADERS="${ROOT}/usr/include"
76
77
78
setup_flags() {
79
	# Over-zealous CFLAGS can often cause problems.  What may work for one person may not
80
	# work for another.  To avoid a large influx of bugs relating to failed builds, we
81
	# strip most CFLAGS out to ensure as few problems as possible.
82
	strip-flags
83
	strip-unsupported-flags
84
85
	# -freorder-blocks for all but ppc
86
	use ppc || append-flags "-freorder-blocks"
87
88
	# Sparc/Sparc64 support
89
	if use sparc; then
90
		# Both sparc and sparc64 can use -fcall-used-g6.  -g7 is bad, though.
91
		filter-flags "-fcall-used-g7"
92
		append-flags "-fcall-used-g6"
93
94
		# Sparc64 Only support...
95
		if [ "${PROFILE_ARCH}" = "sparc64" ]; then
96
			# Get rid of -mcpu options (the CHOST will fix this up) and flags known to fail
97
			filter-flags "-mcpu=ultrasparc -mcpu=v9 -mvis"
98
99
			# Setup the CHOST properly to insure "sparcv9"
100
			# This passes -mcpu=ultrasparc -Wa,-Av9a to the compiler
101
			if [ "${CHOST}" = "sparc-unknown-linux-gnu" ]; then
102
				export CHOST="sparcv9-unknown-linux-gnu"
103
				export CCHOST="sparcv9-unknown-linux-gnu"
104
			fi
105
		fi
106
	fi
107
108
	if [ "`gcc-major-version`" -ge "3" -a "`gcc-minor-version`" -ge "4" ]; then
109
		# broken in 3.4.x
110
		replace-flags -march=pentium-m -mtune=pentium3
111
	fi
112
113
	# We don't want these flags for glibc
114
	filter-flags -fomit-frame-pointer -malign-double
115
	filter-ldflags -pie
116
117
	# Lock glibc at -O2 -- linuxthreads needs it and we want to be conservative here
118
	append-flags -O2
119
	export LDFLAGS="${LDFLAGS//-Wl,--relax}"
120
}
121
122
123
check_kheader_version() {
124
	local header="${ALT_HEADERS}/linux/version.h"
125
126
	[ -z "$1" ] && return 1
127
128
	if [ -f "${header}" ]; then
129
		local version="`grep 'LINUX_VERSION_CODE' ${header} | \
130
			sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
131
132
		if [ "${version}" -ge "$1" ]; then
133
			return 0
134
		fi
135
	fi
136
137
	return 1
138
}
139
140
141
check_nptl_support() {
142
	local min_kernel_version="$(KV_to_int "${MIN_KERNEL_VERSION}")"
143
144
	echo
145
146
	einfon "Checking gcc for __thread support ... "
147
	if ! gcc -c ${FILESDIR}/test-__thread.c -o ${T}/test2.o &> /dev/null; then
148
		echo "no"
149
		echo
150
		eerror "Could not find a gcc that supports the __thread directive!"
151
		eerror "please update to gcc-3.2.2-r1 or later, and try again."
152
		die "No __thread support in gcc!"
153
	else
154
		echo "yes"
155
	fi
156
157
	# Building fails on an non-supporting kernel
158
	einfon "Checking kernel version (>=${MIN_KERNEL_VERSION}) ... "
159
	if [ "`get_KV`" -lt "${min_kernel_version}" ]; then
160
		echo "no"
161
		echo
162
		eerror "You need a kernel of at least version ${MIN_KERNEL_VERSION}"
163
		eerror "for NPTL support!"
164
		die "Kernel version too low!"
165
	else
166
		echo "yes"
167
	fi
168
169
	# Building fails with too low linux-headers
170
	einfon "Checking linux-headers version (>=${MIN_KERNEL_VERSION}) ... "
171
	if ! check_kheader_version "${min_kernel_version}"; then
172
		echo "no"
173
		echo
174
		eerror "You need linux-headers of at least version ${MIN_KERNEL_VERSION}"
175
		eerror "for NPTL support!"
176
		die "linux-headers version too low!"
177
	else
178
		echo "yes"
179
	fi
180
181
	echo
182
}
183
184
185
want_nptl() {
186
	if use nptl; then
187
		# Archs that can use NPTL
188
		if use amd64 || use alpha || use ia64 || use ppc || \
189
		   use ppc64 || use s390 || use sparc; then
190
			return 0
191
		fi
192
193
		# Specific x86 CHOSTS that can use NPTL
194
		if use x86; then
195
			case "${CHOST/-*}" in
196
				i486|i586|i686)	return 0 ;;
197
			esac
198
		fi
199
	fi
200
201
	return 1
202
}
203
204
205
want_tls() {
206
	# Archs that can use TLS (Thread Local Storage)
207
	if use amd64 || use alpha || use ia64 || use ppc || \
208
	   use ppc64 || use s390 || use sparc; then
209
		return 0
210
	fi
211
212
	# Specific x86 CHOSTS that can use TLS
213
	if use x86; then
214
		case "${CHOST/-*}" in
215
			i486|i586|i686)	return 0 ;;
216
		esac
217
218
	fi
219
220
	return 1
221
}
222
223
224
do_makecheck() {
225
	ATIME=`mount | awk '{ print $3,$6 }' | grep ^\/\  | grep noatime`
226
	if [ "$ATIME" = "" ]; then
227
		cd ${WORKDIR}/build
228
		make check || die
229
	else
230
		ewarn "remounting / without noatime option so that make check"
231
		ewarn "does not fail!"
232
		epause 2
233
		mount / -o remount,atime
234
		cd ${WORKDIR}/build
235
		make check || die
236
		einfo "remounting / with noatime"
237
		mount / -o remount,noatime
238
	fi
239
}
240
241
242
install_locales() {
243
	unset LANGUAGE LANG LC_ALL
244
	cd ${WORKDIR}/build
245
	make PARALLELMFLAGS="${MAKEOPTS}" \
246
		install_root=${D} localedata/install-locales || die
247
	keepdir /usr/lib/locale/ru_RU/LC_MESSAGES
248
}
249
250
251
setup_locales() {
252
	if use !userlocales || use makecheck; then
253
		einfo "makecheck in USE or userlocales not enabled, installing -ALL- locales..."
254
		install_locales || die
255
	elif [ -e /etc/locales.build ]; then
256
		einfo "Installing locales in /etc/locales.build..."
257
		echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
258
		cat /etc/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
259
			>> SUPPORTED.locales
260
		cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
261
		install_locales || die
262
	elif [ -e ${FILESDIR}/locales.build ]; then
263
		einfo "Installing locales in ${FILESDIR}/locales.build..."
264
		echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
265
		cat ${FILESDIR}/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
266
			>> SUPPORTED.locales
267
		cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
268
		install_locales || die
269
	else
270
		einfo "Installing -ALL- locales..."
271
		install_locales || die
272
	fi
273
}
274
275
276
glibc_setup() {
277
	# genone this block of code breaks things. 
278
	# Check if we are going to downgrade, we don't like that
279
	#local old_version
280
281
	#old_version="`best_version glibc`"
282
	#old_version="${old_version/sys-libs\/glibc-/}"
283
	# 
284
	#if [ "$old_version" ]; then
285
	#	if [ `python -c "import portage; print int(portage.vercmp(\"${PV}\",\"$old_version\"))"` -lt 0 ]; then
286
	#		if [ "${FORCE_DOWNGRADE}" ]; then
287
	#			ewarn "downgrading glibc, still not recommended, but we'll do as you wish"
288
	#		else
289
	#			eerror "Downgrading glibc is not supported and we strongly recommend that"
290
	#			eerror "you don't do it as it WILL break all applications compiled against"
291
	#			eerror "the new version (most likely including python and portage)."
292
	#			eerror "If you are REALLY sure that you want to do it set "
293
	#			eerror "     FORCE_DOWNGRADE=1"
294
	#			eerror "when you try it again."
295
	#			die "glibc downgrade"
296
	#		fi
297
	#	fi
298
	#fi
299
300
	# We need gcc 3.2 or later ...
301
	if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ]; then
302
		echo
303
		eerror "As of glibc-2.3, gcc-3.2 or later is needed"
304
		eerror "for the build to succeed."
305
		die "GCC too old"
306
	fi
307
	echo
308
309
	hasq sandbox $FEATURES && use makecheck && die "sandbox breaks make check. either take makecheck out of USE or set FEATURES=-sandbox"
310
}
311
312
313
do_arch_amd64_patches() {
314
	cd ${S};
315
	epatch ${FILESDIR}/2.3.2/${PN}-2.3.2-amd64-nomultilib.patch
316
}
317
318
319
do_arch_alpha_patches() {
320
	cd ${S}
321
322
	# Fix compatability with compaq compilers by ifdef'ing out some
323
	# 2.3.2 additions.
324
	# <taviso@gentoo.org> (14 Jun 2003).
325
	epatch ${FILESDIR}/2.3.2/${PN}-2.3.2-decc-compaq.patch
326
327
	# Fix compilation with >=gcc-3.2.3 (01 Nov 2003 agriffis)
328
#	epatch ${FILESDIR}/2.3.2/${LOCAL_P}-alpha-pwrite.patch
329
}
330
331
332
do_arch_arm_patches() {
333
	cd ${S};
334
335
	# Any needed patches for arm go here
336
	epatch ${FILESDIR}/2.3.4/${PN}-2.3.4-arm-ioperm.patch
337
}
338
339
340
do_arch_hppa_patches() {
341
	einfo "Applying hppa specific path of ${HPPA_PATCHES} ..."
342
	cd ${T}
343
	unpack glibc-hppa-patches-${HPPA_PATCHES}.tar.gz
344
	cd ${S}
345
	export EPATCH_OPTS=-p1
346
	for i in ${T}/glibc-hppa-patches-${HPPA_PATCHES}/*.diff
347
	do
348
		epatch ${i}
349
	done
350
351
	use hardened && epatch ${FILESDIR}/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch
352
353
}
354
355
356
do_arch_ia64_patches() {
357
	cd ${S};
358
359
	# The basically problem is glibc doesn't store information about
360
	# what the kernel interface is so that it can't efficiently set up
361
	# parameters for system calls.  This patch from H.J. Lu fixes it:
362
	#
363
	#   http://sources.redhat.com/ml/libc-alpha/2003-09/msg00165.html
364
365
#	epatch ${FILESDIR}/2.3.2/${LOCAL_P}-ia64-LOAD_ARGS-fixup.patch
366
}
367
368
369
do_arch_mips_patches() {
370
	cd ${S}
371
372
	# A few patches only for the MIPS platform.  Descriptions of what they
373
	# do can be found in the patch headers.
374
	# <tuxus@gentoo.org> thx <dragon@gentoo.org> (11 Jan 2003)
375
	# <kumba@gentoo.org> remove tst-rndseek-mips & ulps-mips patches
376
	# <iluxa@gentoo.org> add n32/n64 patches, remove pread patch
377
	epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-fpu-cw-mips.patch
378
	epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-librt-mips.patch
379
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040420-mips-dl-machine-calls.diff
380
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040420-mips-incl-sgidefs.diff
381
	epatch ${FILESDIR}/2.3.3/mips-addabi.diff
382
	epatch ${FILESDIR}/2.3.3/mips-syscall.h.diff
383
	epatch ${FILESDIR}/2.3.3/semtimedop.diff
384
	epatch ${FILESDIR}/2.3.3/mips-sysify.diff
385
386
	if use n32 || use n64; then
387
		epatch ${FILESDIR}/2.3.4/mips-sysdep-cancel.diff
388
	fi
389
390
	# Need to install into /lib for n32-only userland for now.
391
	# Propper solution is to make all userland /lib{32|64}-aware.
392
	use multilib || epatch ${FILESDIR}/2.3.3/mips-nolib3264.diff
393
}
394
395
396
do_arch_ppc_patches() {
397
	cd ${S};
398
	# Any needed patches for ppc go here
399
}
400
401
402
do_arch_ppc64_patches() {
403
	cd ${S};
404
	# Any needed patches for ppc64 go here
405
}
406
407
408
do_arch_s390_patches() {
409
	cd ${S};
410
411
	# Any needed patches for s390 go here
412
}
413
414
415
do_arch_sparc_patches() {
416
	cd ${S};
417
418
	# Any needed patches for sparc go here
419
}
420
421
422
do_arch_x86_patches() {
423
	cd ${S};
424
425
	# Any needed patches for x86 go here
426
}
427
428
429
do_pax_patches() {
430
	cd ${S}
431
432
	# localedef contains nested function trampolines, which trigger
433
	# segfaults under PaX -solar
434
	# Debian Bug (#231438, #198099)
435
	epatch ${FILESDIR}/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch
436
437
	# With latest versions of glibc, a lot of apps failed on a PaX enabled
438
	# system with:
439
	#
440
	#  cannot enable executable stack as shared object requires: Permission denied
441
	#
442
	# This is due to PaX 'exec-protecting' the stack, and ld.so then trying
443
	# to make the stack executable due to some libraries not containing the
444
	# PT_GNU_STACK section.  Bug #32960.  <azarah@gentoo.org> (12 Nov 2003).
445
	use mips || epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-dl_execstack-PaX-support.patch
446
447
	# Program header support for PaX.
448
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040117-pt_pax.diff
449
450
	# Suppress unresolvable relocation against symbol `main' in Scrt1.o
451
	# can be reproduced with compiling net-dns/bind-9.2.2-r3 using -pie
452
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040117-got-fix.diff
453
}
454
455
456
do_hardened_fixes() {
457
	# this patch is needed to compile nptl with a hardened gcc
458
	has_hardened && want_nptl && \
459
		epatch ${FILESDIR}/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch
460
}
461
462
463
do_ssp_patches() {
464
	# To circumvent problems with propolice __guard and
465
	# __guard_setup__stack_smash_handler
466
	#
467
	#  http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml
468
	if [ "${ARCH}" != "hppa" ] && [ "${ARCH}" != "hppa64" ]; then
469
		epatch ${FILESDIR}/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch
470
		cp ${FILESDIR}/2.3.3/ssp.c ${S}/sysdeps/unix/sysv/linux || \
471
			die "failed to copy ssp.c to ${S}/sysdeps/unix/sysv/linux/"
472
	fi
473
474
	# patch this regardless of architecture, although it's ssp-related
475
	epatch ${FILESDIR}/2.3.3/glibc-2.3.3-frandom-detect.patch
476
}
477
478
479
src_unpack() {
480
481
	# we only need to check this one time. Bug #61856
482
	glibc_setup
483
484
	# Check NPTL support _before_ we unpack things to save some time
485
	want_nptl && check_nptl_support
486
487
	unpack ${PN}-${BASE_PV}.tar.bz2
488
489
	# Extract pre-made man pages.
490
	# Otherwise we need perl, which is bad (especially for stage1 bootstrap)
491
	mkdir -p ${S}/man
492
	cd ${S}/man
493
	unpack ${PN}-manpages-${NEW_PV}.tar.bz2
494
	cd ${S}
495
	# Remove all info files, as newer versions have about 10 libc info pages,
496
	# but older release tarballs have about 50, giving us a lot of unneeded
497
	# crap laying around ...
498
	rm -f ${S}/manual/*.info*
499
500
	if (! want_nptl) && [ -z "${BRANCH_UPDATE}" ]; then
501
		unpack ${PN}-linuxthreads-${BASE_PV}.tar.bz2
502
	else
503
		rm -rf ${S}/linuxthreads
504
	fi
505
506
	if [ -n "${BRANCH_UPDATE}" ]; then
507
		epatch ${DISTDIR}/${PN}-${NEW_PV}-branch-update-${BRANCH_UPDATE}.patch.bz2
508
509
		# Snapshot date patch
510
		einfo "Patching version to display snapshot date ..."
511
		sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
512
	fi
513
	# Version patch
514
	sed -i -e "s:\(#define VERSION\).*:\1 \"${NEW_PV}\":" version.h
515
516
	epatch ${FILESDIR}/glibc-sec-hotfix-20040804.patch
517
518
	# SSP support in glibc (where it belongs)
519
	do_ssp_patches
520
521
522
	# PaX-related Patches
523
	do_pax_patches
524
525
	# disable binutils -as-needed. <-- this has nothing todo with hardened.
526
	sed -e 's/^have-as-needed.*/have-as-needed = no/' -i ${S}/config.make.in
527
528
	# hardened toolchain/relro/nptl/security/etc fixes
529
	do_hardened_fixes
530
531
532
	# Arch specific patching
533
	use amd64	&& do_arch_amd64_patches
534
	use alpha	&& do_arch_alpha_patches
535
	use arm		&& do_arch_arm_patches
536
	use hppa	&& do_arch_hppa_patches
537
	use ia64	&& do_arch_ia64_patches
538
	use mips	&& do_arch_mips_patches
539
	use ppc		&& do_arch_ppc_patches
540
	use ppc64	&& do_arch_ppc64_patches
541
	use s390	&& do_arch_s390_patches
542
	use sparc	&& do_arch_sparc_patches
543
	use x86		&& do_arch_x86_patches
544
545
	# RH bug #227
546
	epatch ${FILESDIR}/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch
547
548
	# Remaining patches
549
	cd ${S}
550
551
	# Improved handled temporary files. bug #66358
552
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-tempfile.patch
553
554
	# Fix permissions on some of the scripts
555
	chmod u+x ${S}/scripts/*.sh
556
}
557
558
src_compile() {
559
	setup_flags
560
561
	# These should not be set, else the
562
	# zoneinfo do not always get installed ...
563
	unset LANGUAGE LANG LC_ALL
564
565
	use nls || myconf="${myconf} --disable-nls"
566
	use erandom || myconf="${myconf} --disable-dev-erandom"
567
	use hardened && myconf="${myconf} --enable-bind-now"
568
569
	if want_nptl && want_tls; then
570
		myconf="${myconf} \
571
		--enable-add-ons=nptl \
572
		--with-tls --with-__thread \
573
		--enable-kernel=2.6.0"
574
	else
575
		myconf="${myconf} --enable-add-ons=linuxthreads --without-__thread"
576
	fi
577
578
	# this can be tricky sometimes... if it breaks glibc for you, you should
579
	# add a block in the want_tls logic. if it breaks linuxthreads, but nptl
580
	# works... make sure to add 'use !nptl' to that logic.
581
	want_tls || myconf="${myconf} --without-tls"
582
	want_tls && myconf="${myconf} --with-tls"
583
584
	# some silly people set LD_RUN_PATH and that breaks things.
585
	# see bug 19043
586
	unset LD_RUN_PATH
587
588
	einfo "Configuring GLIBC..."
589
	rm -rf ${WORKDIR}/build
590
	mkdir -p ${WORKDIR}/build
591
	cd ${WORKDIR}/build
592
	${S}/configure \
593
		--build=${CHOST} \
594
		--host=${CCHOST} \
595
		--disable-profile \
596
		--without-gd \
597
		--without-cvs \
598
		--with-headers=${ALT_HEADERS} \
599
		--prefix=/usr \
600
		--mandir=/usr/share/man \
601
		--infodir=/usr/share/info \
602
		--libexecdir=/usr/lib/misc \
603
		${myconf} || die
604
605
	einfo "Building GLIBC..."
606
	make PARALLELMFLAGS="${MAKEOPTS}" || die
607
}
608
609
src_install() {
610
	setup_flags
611
612
	# These should not be set, else the
613
	# zoneinfo do not always get installed ...
614
	unset LANGUAGE LANG LC_ALL
615
616
	cd ${WORKDIR}/build
617
618
	einfo "Installing GLIBC..."
619
	make PARALLELMFLAGS="${MAKEOPTS}" \
620
		install_root=${D} \
621
		install || die
622
	# now, strip everything but the thread libs #46186
623
	mkdir ${T}/thread-backup
624
	mv ${D}/lib/lib{pthread,thread_db}* ${T}/thread-backup/
625
	env -uRESTRICT prepallstrip
626
	mv ${T}/thread-backup/* ${D}/lib/
627
628
	# If librt.so is a symlink, change it into linker script (Redhat)
629
	if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ]; then
630
		local LIBRTSO="`cd ${D}/lib; echo librt.so.*`"
631
		local LIBPTHREADSO="`cd ${D}/lib; echo libpthread.so.*`"
632
633
		rm -f ${D}/usr/lib/librt.so
634
		cat > ${D}/usr/lib/librt.so <<EOF
635
/* GNU ld script
636
	librt.so.1 needs libpthread.so.0 to come before libc.so.6*
637
	in search scope.  */
638
EOF
639
		grep "OUTPUT_FORMAT" ${D}/usr/lib/libc.so >> ${D}/usr/lib/librt.so
640
		echo "GROUP ( /lib/${LIBPTHREADSO} /lib/${LIBRTSO} )" \
641
			>> ${D}/usr/lib/librt.so
642
643
		for x in ${D}/usr/lib/librt.so.[1-9]; do
644
			[ -L "${x}" ] && rm -f ${x}
645
		done
646
	fi
647
648
	if ! use build; then
649
		cd ${WORKDIR}/build
650
651
		if ! has noinfo ${FEATURES} ; then
652
			einfo "Installing Info pages..."
653
			make PARALLELMFLAGS="${MAKEOPTS}" \
654
				install_root=${D} \
655
				info -i
656
		fi
657
658
		setup_locales
659
660
		einfo "Installing man pages and docs..."
661
		# Install linuxthreads man pages even if nptl is enabled
662
		dodir /usr/share/man/man3
663
		doman ${S}/man/*.3thr
664
665
		# Install nscd config file
666
		insinto /etc ; doins ${FILESDIR}/nscd.conf
667
		exeinto /etc/init.d ; doexe ${FILESDIR}/nscd
668
669
		cd ${S}
670
		dodoc BUGS ChangeLog* CONFORMANCE FAQ INTERFACE \
671
			NEWS NOTES PROJECTS README*
672
	else
673
		rm -rf ${D}/usr/share ${D}/usr/lib/gconv
674
675
		einfo "Installing Timezone data..."
676
		make PARALLELMFLAGS="${MAKEOPTS}" \
677
			install_root=${D} \
678
			timezone/install-others -C ${WORKDIR}/build || die
679
	fi
680
681
	if use pic && ! use amd64 ; then
682
		find ${S}/${buildtarget}/ -name "soinit.os" -exec cp {} ${D}/lib/soinit.o \;
683
		find ${S}/${buildtarget}/ -name "sofini.os" -exec cp {} ${D}/lib/sofini.o \;
684
		find ${S}/${buildtarget}/ -name "*_pic.a" -exec cp {} ${D}/lib \;
685
		find ${S}/${buildtarget}/ -name "*.map" -exec cp {} ${D}/lib \;
686
687
		for i in ${D}/lib/*.map; do
688
			mv ${i} ${i%.map}_pic.map
689
		done
690
	fi
691
692
	# Is this next line actually needed or does the makefile get it right?
693
	# It previously has 0755 perms which was killing things.
694
	fperms 4711 /usr/lib/misc/pt_chown
695
696
	# Currently libraries in  /usr/lib/gconv do not get loaded if not
697
	# in search path ...
698
#	insinto /etc/env.d
699
#	doins ${FILESDIR}/03glibc
700
701
	rm -f ${D}/etc/ld.so.cache
702
703
	# Prevent overwriting of the /etc/localtime symlink.  We'll handle the
704
	# creation of the "factory" symlink in pkg_postinst().
705
	rm -f ${D}/etc/localtime
706
707
	# Some things want this, notably ash.
708
	dosym /usr/lib/libbsd-compat.a /usr/lib/libbsd.a
709
710
	# This is our new config file for building locales
711
	insinto /etc
712
	doins ${FILESDIR}/locales.build
713
714
	if use makecheck; then
715
		local OLD_SANDBOX_ON="${SANDBOX_ON}"
716
		# make check will fail if sandbox is enabled.  Do not do it
717
		# globally though, else we might fail to find sandbox violations ...
718
		SANDBOX_ON="0"
719
		do_makecheck
720
		SANDBOX_ON="${OLD_SANDBOX_ON}"
721
	fi
722
}
723
724
pkg_postinst() {
725
	# Correct me if I am wrong here, but my /etc/localtime is a file
726
	# created by zic ....
727
	# I am thinking that it should only be recreated if no /etc/localtime
728
	# exists, or if it is an invalid symlink.
729
	#
730
	# For invalid symlink:
731
	#   -f && -e  will fail
732
	#   -L will succeed
733
	#
734
	if [ ! -e "${ROOT}/etc/localtime" ]; then
735
		echo "Please remember to set your timezone using the zic command."
736
		rm -f ${ROOT}/etc/localtime
737
		ln -s ../usr/share/zoneinfo/Factory ${ROOT}/etc/localtime
738
	fi
739
740
	if [ -x "${ROOT}/usr/sbin/iconvconfig" ]; then
741
		# Generate fastloading iconv module configuration file.
742
		${ROOT}/usr/sbin/iconvconfig --prefix=${ROOT}
743
	fi
744
745
	if [ ! -e "${ROOT}/ld.so.1" ] && use ppc64
746
	then
747
		pushd ${ROOT}
748
		cd ${ROOT}/lib
749
		ln -s ld64.so.1 ld.so.1
750
		popd
751
	fi
752
753
	# Reload init ...
754
	if [ "${ROOT}" = "/" ]; then
755
		/sbin/init U &> /dev/null
756
	fi
757
}
(-)glibc-2.3.4.20040808-r1.ebuild (+771 lines)
Added Link Here
1
# Copyright 1999-2004 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.4.20040808.ebuild,v 1.25 2004/10/01 22:39:18 kumba Exp $
4
5
inherit eutils flag-o-matic gcc
6
7
# Branch update support.  Following will disable:
8
#  BRANCH_UPDATE=
9
BRANCH_UPDATE="20040808"
10
11
12
# Minimum kernel version we support
13
# (Recent snapshots fails with 2.6.5 and earlier)
14
MIN_KERNEL_VERSION="2.6.5"
15
16
17
if [ -z "${BRANCH_UPDATE}" ]; then
18
	BASE_PV="${NEW_PV}"
19
	NEW_PV="${NEW_PV}"
20
else
21
	BASE_PV="2.3.3"
22
	NEW_PV="${PV%.*}"
23
fi
24
25
26
S="${WORKDIR}/${PN}-${BASE_PV}"
27
DESCRIPTION="GNU libc6 (also called glibc2) C library"
28
HOMEPAGE="http://sources.redhat.com/glibc/"
29
30
HPPA_PATCHES=2004-08-24
31
32
SRC_URI="http://dev.gentoo.org/~lv/${PN}-${BASE_PV}.tar.bz2
33
	http://dev.gentoo.org/~lv/${PN}-manpages-${NEW_PV}.tar.bz2
34
	http://dev.gentoo.org/~lv/glibc-infopages-${NEW_PV}.tar.bz2
35
	hppa? ( http://parisc-linux.org/~carlos/glibc-work/glibc-hppa-patches-${HPPA_PATCHES}.tar.gz )"
36
37
[ ! -z "${BRANCH_UPDATE}" ] && SRC_URI="${SRC_URI}
38
	http://dev.gentoo.org/~lv/${PN}-${NEW_PV}-branch-update-${BRANCH_UPDATE}.patch.bz2"
39
40
LICENSE="LGPL-2"
41
SLOT="2.2"
42
KEYWORDS="-* ~x86 ~amd64 ~hppa ~ppc64 ~ppc ~mips"
43
IUSE="nls pic build nptl erandom hardened makecheck multilib debug userlocales"
44
RESTRICT="nostrip" # we'll handle stripping ourself #46186
45
46
# We need new cleanup attribute support from gcc for NPTL among things ...
47
# We also need linux26-headers if using NPTL. Including kernel headers is
48
# incredibly unreliable, and this new linux-headers release from plasmaroo
49
# should work with userspace apps, at least on amd64 and ppc64.
50
DEPEND=">=sys-devel/gcc-3.2.3-r1
51
	nptl? ( >=sys-devel/gcc-3.3.1-r1 )
52
	>=sys-devel/binutils-2.14.90.0.6-r1
53
	virtual/os-headers
54
	nptl? ( >=sys-kernel/linux26-headers-2.6.5 )
55
	nls? ( sys-devel/gettext )"
56
RDEPEND="virtual/os-headers
57
	sys-apps/baselayout
58
	nls? ( sys-devel/gettext )"
59
60
PROVIDE="virtual/glibc virtual/libc"
61
62
63
# (very) Theoretical cross-compiler support
64
[ -z "${CCHOST}" ] && CCHOST="${CHOST}"
65
66
# We need to be able to set alternative headers for
67
# compiling for non-native platform
68
# Will also become useful for testing kernel-headers without screwing up
69
# whole system
70
[ -z "${ALT_HEADERS}" ] && ALT_HEADERS="${ROOT}/usr/include"
71
72
73
setup_flags() {
74
	# Over-zealous CFLAGS can often cause problems.  What may work for one person may not
75
	# work for another.  To avoid a large influx of bugs relating to failed builds, we
76
	# strip most CFLAGS out to ensure as few problems as possible.
77
	strip-flags
78
	strip-unsupported-flags
79
80
	# -freorder-blocks for all but ppc
81
	use ppc || append-flags "-freorder-blocks"
82
83
	# Sparc/Sparc64 support
84
	if use sparc; then
85
		# Both sparc and sparc64 can use -fcall-used-g6.  -g7 is bad, though.
86
		filter-flags "-fcall-used-g7"
87
		append-flags "-fcall-used-g6"
88
89
		# Sparc64 Only support...
90
		if [ "${PROFILE_ARCH}" = "sparc64" ]; then
91
			# Get rid of -mcpu options (the CHOST will fix this up) and flags known to fail
92
			filter-flags "-mcpu=ultrasparc -mcpu=v9 -mvis"
93
94
			# Setup the CHOST properly to insure "sparcv9"
95
			# This passes -mcpu=ultrasparc -Wa,-Av9a to the compiler
96
			if [ "${CHOST}" = "sparc-unknown-linux-gnu" ]; then
97
				export CHOST="sparcv9-unknown-linux-gnu"
98
				export CCHOST="sparcv9-unknown-linux-gnu"
99
			fi
100
		fi
101
	fi
102
103
	if [ "`gcc-major-version`" -ge "3" -a "`gcc-minor-version`" -ge "4" ]; then
104
		# broken in 3.4.x
105
		replace-flags -march=pentium-m -mtune=pentium3
106
		ewarn "-march=pentium-m seems to be broken in gcc 3.4, changing to -mtune=pentium3"
107
	fi
108
109
	# We don't want these flags for glibc
110
	filter-flags -fomit-frame-pointer -malign-double
111
	filter-ldflags -pie
112
113
	# Lock glibc at -O2 -- linuxthreads needs it and we want to be conservative here
114
	append-flags -O2
115
	export LDFLAGS="${LDFLAGS//-Wl,--relax}"
116
}
117
118
119
check_kheader_version() {
120
	local header="${ALT_HEADERS}/linux/version.h"
121
122
	[ -z "$1" ] && return 1
123
124
	if [ -f "${header}" ]; then
125
		local version="`grep 'LINUX_VERSION_CODE' ${header} | \
126
			sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`"
127
128
		if [ "${version}" -ge "$1" ]; then
129
			return 0
130
		fi
131
	fi
132
133
	return 1
134
}
135
136
137
check_nptl_support() {
138
	local min_kernel_version="$(KV_to_int "${MIN_KERNEL_VERSION}")"
139
140
	echo
141
142
	einfon "Checking gcc for __thread support ... "
143
	if ! gcc -c ${FILESDIR}/test-__thread.c -o ${T}/test2.o &> /dev/null; then
144
		echo "no"
145
		echo
146
		eerror "Could not find a gcc that supports the __thread directive!"
147
		eerror "please update to gcc-3.2.2-r1 or later, and try again."
148
		die "No __thread support in gcc!"
149
	else
150
		echo "yes"
151
	fi
152
153
	# Building fails on an non-supporting kernel
154
	einfon "Checking kernel version (>=${MIN_KERNEL_VERSION}) ... "
155
	if [ "`get_KV`" -lt "${min_kernel_version}" ]; then
156
		echo "no"
157
		echo
158
		eerror "You need a kernel of at least version ${MIN_KERNEL_VERSION}"
159
		eerror "for NPTL support!"
160
		die "Kernel version too low!"
161
	else
162
		echo "yes"
163
	fi
164
165
	# Building fails with too low linux-headers
166
	einfon "Checking linux-headers version (>=${MIN_KERNEL_VERSION}) ... "
167
	if ! check_kheader_version "${min_kernel_version}"; then
168
		echo "no"
169
		echo
170
		eerror "You need linux-headers of at least version ${MIN_KERNEL_VERSION}"
171
		eerror "for NPTL support!"
172
		die "linux-headers version too low!"
173
	else
174
		echo "yes"
175
	fi
176
177
	echo
178
}
179
180
181
want_nptl() {
182
	if use nptl; then
183
		# Archs that can use NPTL
184
		if use amd64 || use alpha || use ia64 || use ppc || \
185
		   use ppc64 || use s390 || use sparc; then
186
			return 0
187
		fi
188
189
		# Specific x86 CHOSTS that can use NPTL
190
		if use x86; then
191
			case "${CHOST/-*}" in
192
				i486|i586|i686)	return 0 ;;
193
			esac
194
		fi
195
	fi
196
197
	return 1
198
}
199
200
201
want_tls() {
202
	# Archs that can use TLS (Thread Local Storage)
203
	if use amd64 || use alpha || use ia64 || use ppc || \
204
	   use ppc64 || use s390 || use sparc; then
205
		return 0
206
	fi
207
208
	# Specific x86 CHOSTS that can use TLS
209
	if use x86; then
210
		case "${CHOST/-*}" in
211
			i486|i586|i686)	return 0 ;;
212
		esac
213
214
	fi
215
216
	return 1
217
}
218
219
220
do_makecheck() {
221
	ATIME=`mount | awk '{ print $3,$6 }' | grep ^\/\  | grep noatime`
222
	if [ "$ATIME" = "" ]; then
223
		cd ${WORKDIR}/build
224
		make check || die
225
	else
226
		ewarn "remounting / without noatime option so that make check"
227
		ewarn "does not fail!"
228
		epause 2
229
		mount / -o remount,atime
230
		cd ${WORKDIR}/build
231
		make check || die
232
		einfo "remounting / with noatime"
233
		mount / -o remount,noatime
234
	fi
235
}
236
237
238
install_locales() {
239
	unset LANGUAGE LANG LC_ALL
240
	cd ${WORKDIR}/build
241
	make PARALLELMFLAGS="${MAKEOPTS}" \
242
		install_root=${D} localedata/install-locales || die
243
	keepdir /usr/lib/locale/ru_RU/LC_MESSAGES
244
}
245
246
247
setup_locales() {
248
	if use !userlocales || use makecheck; then
249
		einfo "makecheck in USE or userlocales not enabled, installing -ALL- locales..."
250
		install_locales || die
251
	elif [ -e /etc/locales.build ]; then
252
		einfo "Installing locales in /etc/locales.build..."
253
		echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
254
		cat /etc/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
255
			>> SUPPORTED.locales
256
		cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
257
		install_locales || die
258
	elif [ -e ${FILESDIR}/locales.build ]; then
259
		einfo "Installing locales in ${FILESDIR}/locales.build..."
260
		echo 'SUPPORTED-LOCALES=\' > SUPPORTED.locales
261
		cat ${FILESDIR}/locales.build | grep -v -e ^$ -e ^\# | sed 's/$/\ \\/g' \
262
			>> SUPPORTED.locales
263
		cat SUPPORTED.locales > ${S}/localedata/SUPPORTED || die
264
		install_locales || die
265
	else
266
		einfo "Installing -ALL- locales..."
267
		install_locales || die
268
	fi
269
}
270
271
272
pkg_setup() {
273
	# We need gcc 3.2 or later ...
274
	if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ]; then
275
		echo
276
		eerror "As of glibc-2.3, gcc-3.2 or later is needed"
277
		eerror "for the build to succeed."
278
		die "GCC too old"
279
	fi
280
	echo
281
282
	hasq sandbox $FEATURES && use makecheck && die "sandbox breaks make check. either take makecheck out of USE or set FEATURES=-sandbox"
283
}
284
285
286
do_arch_amd64_patches() {
287
	cd ${S};
288
	# CONF_LIBDIR support
289
	epatch ${FILESDIR}/2.3.4/glibc-gentoo-libdir.patch
290
	sed -i -e "s:@GENTOO_LIBDIR@:$(get_libdir):g" ${S}/sysdeps/unix/sysv/linux/configure
291
}
292
293
294
do_arch_alpha_patches() {
295
	cd ${S}
296
297
	# Fix compatability with compaq compilers by ifdef'ing out some
298
	# 2.3.2 additions.
299
	# <taviso@gentoo.org> (14 Jun 2003).
300
	epatch ${FILESDIR}/2.3.2/${PN}-2.3.2-decc-compaq.patch
301
302
	# Fix compilation with >=gcc-3.2.3 (01 Nov 2003 agriffis)
303
#	epatch ${FILESDIR}/2.3.2/${LOCAL_P}-alpha-pwrite.patch
304
}
305
306
307
do_arch_arm_patches() {
308
	cd ${S};
309
310
	# Any needed patches for arm go here
311
	epatch ${FILESDIR}/2.3.4/${PN}-2.3.4-arm-ioperm.patch
312
}
313
314
315
do_arch_hppa_patches() {
316
	einfo "Applying hppa specific path of ${HPPA_PATCHES} ..."
317
	cd ${T}
318
	unpack glibc-hppa-patches-${HPPA_PATCHES}.tar.gz
319
	cd ${S}
320
	export EPATCH_OPTS=-p1
321
	for i in ${T}/glibc-hppa-patches-${HPPA_PATCHES}/*.diff
322
	do
323
		epatch ${i}
324
	done
325
326
	use hardened && epatch ${FILESDIR}/2.3.4/glibc-2.3.4-hppa-hardened-disable__init_arrays.patch
327
328
}
329
330
331
do_arch_ia64_patches() {
332
	cd ${S};
333
334
	# The basically problem is glibc doesn't store information about
335
	# what the kernel interface is so that it can't efficiently set up
336
	# parameters for system calls.  This patch from H.J. Lu fixes it:
337
	#
338
	#   http://sources.redhat.com/ml/libc-alpha/2003-09/msg00165.html
339
340
#	epatch ${FILESDIR}/2.3.2/${LOCAL_P}-ia64-LOAD_ARGS-fixup.patch
341
}
342
343
344
do_arch_mips_patches() {
345
	cd ${S}
346
347
	# A few patches only for the MIPS platform.  Descriptions of what they
348
	# do can be found in the patch headers.
349
	# <tuxus@gentoo.org> thx <dragon@gentoo.org> (11 Jan 2003)
350
	# <kumba@gentoo.org> remove tst-rndseek-mips & ulps-mips patches
351
	# <iluxa@gentoo.org> add n32/n64 patches, remove pread patch
352
	epatch ${FILESDIR}/2.3.3/mips-addabi.diff
353
	epatch ${FILESDIR}/2.3.3/mips-syscall.h.diff
354
	epatch ${FILESDIR}/2.3.3/mips-sysify.diff
355
356
	# Need to install into /lib for n32-only userland for now.
357
	# Propper solution is to make all userland /lib{32|64}-aware.
358
	use multilib || epatch ${FILESDIR}/2.3.3/mips-nolib3264.diff
359
360
	# Found this on Google (yay google!) and it fixes glibc not building
361
	# a correct bits/syscall.h from 2.6.x headers.  It possibly breaks older
362
	# headers (2.4.x?), so for now, only use it on n32.
363
	use n32 && epatch ${FILESDIR}/2.3.4/glibc-2.3.4-mips-generate-syscall_h.patch
364
}
365
366
367
do_arch_ppc_patches() {
368
	cd ${S};
369
	epatch ${FILESDIR}/2.3.4/glibc-2.3.4-getcontext.patch
370
	# Any needed patches for ppc go here
371
}
372
373
374
do_arch_ppc64_patches() {
375
	cd ${S};
376
	epatch ${FILESDIR}/2.3.4/glibc-2.3.4-getcontext.patch
377
	# Any needed patches for ppc64 go here
378
}
379
380
381
do_arch_s390_patches() {
382
	cd ${S};
383
384
	# Any needed patches for s390 go here
385
}
386
387
388
do_arch_sparc_patches() {
389
	cd ${S};
390
391
	# Any needed patches for sparc go here
392
}
393
394
395
do_arch_x86_patches() {
396
	cd ${S};
397
	# CONF_LIBDIR support
398
	epatch ${FILESDIR}/2.3.4/glibc-gentoo-libdir.patch
399
	sed -i -e "s:@GENTOO_LIBDIR@:$(get_libdir):g" ${S}/sysdeps/unix/sysv/linux/configure
400
}
401
402
403
do_pax_patches() {
404
	cd ${S}
405
406
	# localedef contains nested function trampolines, which trigger
407
	# segfaults under PaX -solar
408
	# Debian Bug (#231438, #198099)
409
	epatch ${FILESDIR}/2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch
410
411
	# With latest versions of glibc, a lot of apps failed on a PaX enabled
412
	# system with:
413
	#
414
	#  cannot enable executable stack as shared object requires: Permission denied
415
	#
416
	# This is due to PaX 'exec-protecting' the stack, and ld.so then trying
417
	# to make the stack executable due to some libraries not containing the
418
	# PT_GNU_STACK section.  Bug #32960.  <azarah@gentoo.org> (12 Nov 2003).
419
	use mips || epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-dl_execstack-PaX-support.patch
420
421
	# Program header support for PaX.
422
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3_pre20040117-pt_pax.diff
423
424
	# Suppress unresolvable relocation against symbol `main' in Scrt1.o
425
	# can be reproduced with compiling net-dns/bind-9.2.2-r3 using -pie
426
	epatch ${FILESDIR}/2.3.4/glibc-2.3.4.20040808-i386-got-fix.diff
427
}
428
429
430
do_hardened_fixes() {
431
	# this patch is needed to compile nptl with a hardened gcc
432
	has_hardened && want_nptl && \
433
		epatch ${FILESDIR}/2.3.4/glibc-2.3.4-hardened-sysdep-shared.patch
434
}
435
436
437
do_ssp_patches() {
438
	# To circumvent problems with propolice __guard and
439
	# __guard_setup__stack_smash_handler
440
	#
441
	#  http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml
442
	if [ "${ARCH}" != "hppa" ] && [ "${ARCH}" != "hppa64" ]; then
443
		epatch ${FILESDIR}/2.3.3/glibc-2.3.2-propolice-guard-functions-v3.patch
444
		cp ${FILESDIR}/2.3.3/ssp.c ${S}/sysdeps/unix/sysv/linux || \
445
			die "failed to copy ssp.c to ${S}/sysdeps/unix/sysv/linux/"
446
	fi
447
448
	# patch this regardless of architecture, although it's ssp-related
449
	epatch ${FILESDIR}/2.3.3/glibc-2.3.3-frandom-detect.patch
450
}
451
452
453
src_unpack() {
454
	# Check NPTL support _before_ we unpack things to save some time
455
	want_nptl && check_nptl_support
456
457
	unpack ${PN}-${BASE_PV}.tar.bz2
458
459
	# Extract pre-made man pages.
460
	# Otherwise we need perl, which is bad (especially for stage1 bootstrap)
461
	mkdir -p ${S}/man
462
	cd ${S}/man
463
	unpack ${PN}-manpages-${NEW_PV}.tar.bz2
464
	cd ${S}
465
466
	if [ -n "${BRANCH_UPDATE}" ]; then
467
		epatch ${DISTDIR}/${PN}-${NEW_PV}-branch-update-${BRANCH_UPDATE}.patch.bz2
468
469
		# Snapshot date patch
470
		einfo "Patching version to display snapshot date ..."
471
		sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
472
	fi
473
	# Version patch
474
	sed -i -e "s:\(#define VERSION\).*:\1 \"${NEW_PV}\":" version.h
475
476
	# pre-generated info pages
477
	unpack glibc-infopages-2.3.4.tar.bz2
478
479
	epatch ${FILESDIR}/glibc-sec-hotfix-20040804.patch
480
481
	# SSP support in glibc (where it belongs)
482
	do_ssp_patches
483
484
485
	# PaX-related Patches
486
	do_pax_patches
487
488
	# disable binutils -as-needed
489
	sed -e 's/^have-as-needed.*/have-as-needed = no/' -i ${S}/config.make.in
490
491
	# hardened toolchain/relro/nptl/security/etc fixes
492
	do_hardened_fixes
493
494
495
	# Arch specific patching
496
	use amd64	&& do_arch_amd64_patches
497
	use alpha	&& do_arch_alpha_patches
498
	use arm		&& do_arch_arm_patches
499
	use hppa	&& do_arch_hppa_patches
500
	use ia64	&& do_arch_ia64_patches
501
	use mips	&& do_arch_mips_patches
502
	use ppc		&& do_arch_ppc_patches
503
	use ppc64	&& do_arch_ppc64_patches
504
	use s390	&& do_arch_s390_patches
505
	use sparc	&& do_arch_sparc_patches
506
	use x86		&& do_arch_x86_patches
507
508
509
	# Remaining patches
510
	cd ${S}
511
512
	# Improved handled temporary files. bug #66358
513
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-tempfile.patch
514
515
	# fix for http://sources.redhat.com/bugzilla/show_bug.cgi?id=227
516
	epatch ${FILESDIR}/2.3.4/glibc-2.3.4-ld.so-brk-fix.patch
517
518
	# fix for using nptl's pthread.h with g++
519
	epatch ${FILESDIR}/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch
520
521
	# Fix permissions on some of the scripts
522
	chmod u+x ${S}/scripts/*.sh
523
}
524
525
src_compile() {
526
	setup_flags
527
528
	# These should not be set, else the
529
	# zoneinfo do not always get installed ...
530
	unset LANGUAGE LANG LC_ALL
531
532
	use nls || myconf="${myconf} --disable-nls"
533
	use erandom || myconf="${myconf} --disable-dev-erandom"
534
535
	if want_nptl && want_tls; then
536
		myconf="${myconf} \
537
		--enable-add-ons=nptl \
538
		--with-tls --with-__thread \
539
		--enable-kernel=2.6.0"
540
	else
541
		myconf="${myconf} --enable-add-ons=linuxthreads --without-__thread"
542
	fi
543
544
	# this can be tricky sometimes... if it breaks glibc for you, you should
545
	# add a block in the want_tls logic. if it breaks linuxthreads, but nptl
546
	# works... make sure to add 'use !nptl' to that logic.
547
	want_tls || myconf="${myconf} --without-tls"
548
	want_tls && myconf="${myconf} --with-tls"
549
550
	# some silly people set LD_RUN_PATH and that breaks things.
551
	# see bug 19043
552
	unset LD_RUN_PATH
553
554
	einfo "Configuring GLIBC..."
555
	rm -rf ${WORKDIR}/build
556
	mkdir -p ${WORKDIR}/build
557
	cd ${WORKDIR}/build
558
	${S}/configure \
559
		--build=${CHOST} \
560
		--host=${CCHOST} \
561
		--disable-profile \
562
		--without-gd \
563
		--without-cvs \
564
		--with-headers=${ALT_HEADERS} \
565
		--prefix=/usr \
566
		--mandir=/usr/share/man \
567
		--infodir=/usr/share/info \
568
		--libexecdir=/usr/lib/misc \
569
		--enable-bind-now \
570
		${myconf} || die
571
572
	einfo "Building GLIBC..."
573
	make PARALLELMFLAGS="${MAKEOPTS}" || die
574
}
575
576
src_install() {
577
	setup_flags
578
579
	# These should not be set, else the
580
	# zoneinfo do not always get installed ...
581
	unset LANGUAGE LANG LC_ALL
582
583
	cd ${WORKDIR}/build
584
585
	einfo "Installing GLIBC..."
586
	make PARALLELMFLAGS="${MAKEOPTS}" \
587
		install_root=${D} \
588
		install || die
589
	# now, strip everything but the thread libs #46186
590
	mkdir ${T}/thread-backup
591
	mv ${D}/lib/lib{pthread,thread_db}* ${T}/thread-backup/
592
	env -uRESTRICT prepallstrip
593
	mv ${T}/thread-backup/* ${D}/lib/
594
595
	# If librt.so is a symlink, change it into linker script (Redhat)
596
	if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ]; then
597
		local LIBRTSO="`cd ${D}/lib; echo librt.so.*`"
598
		local LIBPTHREADSO="`cd ${D}/lib; echo libpthread.so.*`"
599
600
		rm -f ${D}/usr/lib/librt.so
601
		cat > ${D}/usr/lib/librt.so <<EOF
602
/* GNU ld script
603
	librt.so.1 needs libpthread.so.0 to come before libc.so.6*
604
	in search scope.  */
605
EOF
606
		grep "OUTPUT_FORMAT" ${D}/usr/lib/libc.so >> ${D}/usr/lib/librt.so
607
		echo "GROUP ( /lib/${LIBPTHREADSO} /lib/${LIBRTSO} )" \
608
			>> ${D}/usr/lib/librt.so
609
610
		for x in ${D}/usr/lib/librt.so.[1-9]; do
611
			[ -L "${x}" ] && rm -f ${x}
612
		done
613
	fi
614
615
	if ! use build; then
616
		cd ${WORKDIR}/build
617
618
		if ! has noinfo ${FEATURES} ; then
619
			einfo "Installing Info pages..."
620
			make PARALLELMFLAGS="${MAKEOPTS}" \
621
				install_root=${D} \
622
				info -i
623
		fi
624
625
		setup_locales
626
627
		einfo "Installing man pages and docs..."
628
		# Install linuxthreads man pages even if nptl is enabled
629
		dodir /usr/share/man/man3
630
		doman ${S}/man/*.3thr
631
632
		# Install nscd config file
633
		insinto /etc
634
		doins ${FILESDIR}/nscd.conf
635
636
		cd ${S}
637
		dodoc BUGS ChangeLog* CONFORMANCE COPYING* FAQ INTERFACE \
638
			NEWS NOTES PROJECTS README*
639
	else
640
		rm -rf ${D}/usr/share ${D}/usr/lib/gconv
641
642
		einfo "Installing Timezone data..."
643
		make PARALLELMFLAGS="${MAKEOPTS}" \
644
			install_root=${D} \
645
			timezone/install-others -C ${WORKDIR}/build || die
646
	fi
647
648
	if use pic && ! use amd64 ; then
649
		find ${S}/${buildtarget}/ -name "soinit.os" -exec cp {} ${D}/lib/soinit.o \;
650
		find ${S}/${buildtarget}/ -name "sofini.os" -exec cp {} ${D}/lib/sofini.o \;
651
		find ${S}/${buildtarget}/ -name "*_pic.a" -exec cp {} ${D}/lib \;
652
		find ${S}/${buildtarget}/ -name "*.map" -exec cp {} ${D}/lib \;
653
654
		for i in ${D}/lib/*.map; do
655
			mv ${i} ${i%.map}_pic.map
656
		done
657
	fi
658
659
	# Is this next line actually needed or does the makefile get it right?
660
	# It previously has 0755 perms which was killing things.
661
	fperms 4711 /usr/lib/misc/pt_chown
662
663
	# Currently libraries in  /usr/lib/gconv do not get loaded if not
664
	# in search path ...
665
#	insinto /etc/env.d
666
#	doins ${FILESDIR}/03glibc
667
668
	rm -f ${D}/etc/ld.so.cache
669
670
	# Prevent overwriting of the /etc/localtime symlink.  We'll handle the
671
	# creation of the "factory" symlink in pkg_postinst().
672
	rm -f ${D}/etc/localtime
673
674
	# Some things want this, notably ash.
675
	dosym /usr/lib/libbsd-compat.a /usr/lib/libbsd.a
676
677
	# This is our new config file for building locales
678
	insinto /etc
679
	doins ${FILESDIR}/locales.build
680
681
	# this whole section is useless, it fails if sandbox is LOADED, not if it's
682
	# enabled. but forcing sandbox not to load isnt an option...
683
	if use makecheck; then
684
		local OLD_SANDBOX_ON="${SANDBOX_ON}"
685
		# make check will fail if sandbox is enabled.  Do not do it
686
		# globally though, else we might fail to find sandbox violations ...
687
		SANDBOX_ON="0"
688
		do_makecheck
689
		SANDBOX_ON="${OLD_SANDBOX_ON}"
690
	fi
691
}
692
693
fix_lib64_symlinks() {
694
	# the original Gentoo/AMD64 devs decided that since 64bit is the native
695
	# bitdepth for AMD64, lib should be used for 64bit libraries. however,
696
	# this ignores the FHS and breaks multilib horribly... especially
697
	# since it wont even work without a lib64 symlink anyways. *rolls eyes*
698
	# see bug 59710 for more information.
699
	# Travis Tilley <lv@gentoo.org> (08 Aug 2004)
700
	if [ -L ${ROOT}/lib64 ] ; then
701
		ewarn "removing /lib64 symlink and moving lib to lib64..."
702
		ewarn "dont hit ctrl-c until this is done"
703
		addwrite ${ROOT}/
704
		rm ${ROOT}/lib64
705
		# now that lib64 is gone, nothing will run without calling ld.so
706
		# directly. luckily the window of brokenness is almost non-existant
707
		/lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
708
		# all better :)
709
		ldconfig
710
		ln -s lib64 ${ROOT}/lib
711
		einfo "done! :-)"
712
		einfo "fixed broken lib64/lib symlink in ${ROOT}"
713
	fi
714
	if [ -L ${ROOT}/usr/lib64 ] ; then
715
		addwrite ${ROOT}/usr
716
		rm ${ROOT}/usr/lib64
717
		mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
718
		ln -s lib64 ${ROOT}/usr/lib
719
		einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
720
	fi
721
	if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
722
		addwrite ${ROOT}/usr/X11R6
723
		rm ${ROOT}/usr/X11R6/lib64
724
		mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
725
		ln -s lib64 ${ROOT}/usr/X11R6/lib
726
		einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
727
	fi
728
}
729
730
pkg_preinst() {
731
	# PPC64+others may want to eventually be added to this logic if they
732
	# decide to be multilib compatible and FHS compliant. note that this 
733
	# chunk of FHS compliance only applies to 64bit archs where 32bit
734
	# compatibility is a major concern (not IA64, for example).
735
	use amd64 && [ "$(get_libdir)" == "lib64" ] && fix_lib64_symlinks
736
}
737
738
pkg_postinst() {
739
	# Correct me if I am wrong here, but my /etc/localtime is a file
740
	# created by zic ....
741
	# I am thinking that it should only be recreated if no /etc/localtime
742
	# exists, or if it is an invalid symlink.
743
	#
744
	# For invalid symlink:
745
	#   -f && -e  will fail
746
	#   -L will succeed
747
	#
748
	if [ ! -e "${ROOT}/etc/localtime" ]; then
749
		echo "Please remember to set your timezone using the zic command."
750
		rm -f ${ROOT}/etc/localtime
751
		ln -s ../usr/share/zoneinfo/Factory ${ROOT}/etc/localtime
752
	fi
753
754
	if [ -x "${ROOT}/usr/sbin/iconvconfig" ]; then
755
		# Generate fastloading iconv module configuration file.
756
		${ROOT}/usr/sbin/iconvconfig --prefix=${ROOT}
757
	fi
758
759
	if [ ! -e "${ROOT}/ld.so.1" ] && use ppc64
760
	then
761
		pushd ${ROOT}
762
		cd ${ROOT}/lib
763
		ln -s ld64.so.1 ld.so.1
764
		popd
765
	fi
766
767
	# Reload init ...
768
	if [ "${ROOT}" = "/" ]; then
769
		/sbin/init U &> /dev/null
770
	fi
771
}
(-)glibc-2.3.4.20041002.ebuild (+3 lines)
Lines 546-551 src_unpack() { Link Here
546
	# multicast DNS aka rendezvous support
546
	# multicast DNS aka rendezvous support
547
	epatch ${FILESDIR}/2.3.4/glibc-2.3.3-mdns-resolver.diff
547
	epatch ${FILESDIR}/2.3.4/glibc-2.3.3-mdns-resolver.diff
548
548
549
	# Improved handled temporary files. bug #66358
550
	epatch ${FILESDIR}/2.3.3/${PN}-2.3.3-tempfile.patch
551
549
	# Fix permissions on some of the scripts
552
	# Fix permissions on some of the scripts
550
	chmod u+x ${S}/scripts/*.sh
553
	chmod u+x ${S}/scripts/*.sh
551
}
554
}
(-)files/digest-glibc-2.3.2-r12 (+4 lines)
Added Link Here
1
MD5 ede969aad568f48083e413384f20753c glibc-2.3.2.tar.bz2 13377170
2
MD5 894b8969cfbdf787c73e139782167607 glibc-linuxthreads-2.3.2.tar.bz2 216310
3
MD5 29fe849eca3e5aa2a2eb9e4055d93748 glibc-2.3.2-branch-update-20031115.patch.bz2 1692480
4
MD5 c7c27c0821245d98a0568a475c08f4e9 glibc-2.3.2-hppa-patches-p1.tar.bz2 18793
(-)files/digest-glibc-2.3.3.20040420-r2 (+4 lines)
Added Link Here
1
MD5 ede969aad568f48083e413384f20753c glibc-2.3.2.tar.bz2 13377170
2
MD5 894b8969cfbdf787c73e139782167607 glibc-linuxthreads-2.3.2.tar.bz2 216310
3
MD5 099115aef35f56dc357116c262fd7785 glibc-2.3.3-branch-update-20040420.patch.bz2 2435254
4
MD5 c7c27c0821245d98a0568a475c08f4e9 glibc-2.3.2-hppa-patches-p1.tar.bz2 18793
(-)files/digest-glibc-2.3.4.20040619-r2 (+4 lines)
Added Link Here
1
MD5 ede969aad568f48083e413384f20753c glibc-2.3.2.tar.bz2 13377170
2
MD5 2a138a32ffdb52fc1be54088d5d49420 glibc-manpages-2.3.4.tar.bz2 14759
3
MD5 28a88631cf36695dd1149155708beeab glibc-hppa-patches-2004-06-04.tar.gz 9528
4
MD5 c9c4a17c9b9adb362cb46d9014177197 glibc-2.3.4-branch-update-20040619.patch.bz2 2515781
(-)files/digest-glibc-2.3.4.20040808-r1 (+5 lines)
Added Link Here
1
MD5 84dabbf0b9b5370793a416687d7b5252 glibc-2.3.3.tar.bz2 13298567
2
MD5 2a138a32ffdb52fc1be54088d5d49420 glibc-manpages-2.3.4.tar.bz2 14759
3
MD5 eabe1f4779fc27cde985b0713f930827 glibc-infopages-2.3.4.tar.bz2 1175502
4
MD5 dc09b4c1a29f69232441f7f5abbcc7b9 glibc-hppa-patches-2004-08-24.tar.gz 9739
5
MD5 f2c551037b9fcb9bd5b324f3f68a159a glibc-2.3.4-branch-update-20040808.patch.bz2 1252141
(-)files/2.3.3/ssp.c (-6 / +9 lines)
Added Link Here
1
diff -ur glibc-2.3.2.orig/debug/catchsegv.sh glibc-2.3.2/debug/catchsegv.sh
2
--- glibc-2.3.2.orig/debug/catchsegv.sh	2003-02-06 04:03:51.000000000 +0100
Added Link Here
1
--- glibc-2.3.2.orig/debug/catchsegv.sh	2004-10-05 01:25:30.683814576 -0400
Added Link Here
76
  {
76
  {
77
    int fd;
77
    int fd;
78
#ifdef HAVE_DEV_ERANDOM
78
#ifdef HAVE_DEV_ERANDOM
79
    if ((fd = open ("/dev/erandom", O_RDONLY)) == (-1))
79
    if ((fd = __open ("/dev/erandom", O_RDONLY)) == (-1))
80
#endif
80
#endif
81
      fd = open ("/dev/urandom", O_RDONLY);
81
      fd = __open ("/dev/urandom", O_RDONLY);
82
    if (fd != (-1))
82
    if (fd != (-1))
83
      {
83
      {
84
	size = read (fd, (char *) &__guard, sizeof (__guard));
84
	size = __read (fd, (char *) &__guard, sizeof (__guard));
85
	close (fd);
85
	__close (fd);
86
	if (size == sizeof (__guard))
86
	if (size == sizeof (__guard))
87
	  return;
87
	  return;
88
      }
88
      }
Added Link Here
142
    }
142
    }
143
143
144
  /* print error message */
144
  /* print error message */
145
  write (STDERR_FILENO, buf + 3, len - 3);
145
  __write (STDERR_FILENO, buf + 3, len - 3);
146
  write (STDERR_FILENO, "()\n", 3);
146
  __write (STDERR_FILENO, "()\n", 3);
147
#ifndef __dietlibc__
147
#ifndef __dietlibc__
148
  if ((log = socket (AF_UNIX, SOCK_DGRAM, 0)) != -1)
148
  if ((log = socket (AF_UNIX, SOCK_DGRAM, 0)) != -1)
149
    {
149
    {

Return to bug 66358