@@ -4,58 +4,148 @@ distributable:
4
4
5
5
versions :
6
6
# TODO HTML listing: https://ftp.gnu.org/gnu/glibc/
7
- - 2.24 # This is 2014; it should allow us to support just about anything running.
7
+ - 2.28
8
+
9
+ runtime :
10
+ env :
11
+ PATH : ${{prefix}}/sbin:$PATH
12
+ # FIXME: version.raw not recognized here
13
+ # CFLAGS: -Wl,--dynamic-linker={{prefix}}/lib/ld-{{version.raw}}.so
14
+ CFLAGS : -Wl,--dynamic-linker={{prefix}}/lib/ld-2.28.so
8
15
9
16
build :
10
17
dependencies :
11
18
gnu.org/make : ' >=3.79'
12
19
gnu.org/gawk : ' >=3'
13
20
gnu.org/gcc : ' *'
14
- gnu.org/binutils : ' *'
15
- gnu.org/texinfo : ' *'
16
21
gnu.org/gettext : ' *'
22
+ gnu.org/texinfo : ' *'
23
+ gnu.org/bison : ' *'
17
24
gnu.org/patch : ' *'
18
25
perl.org : ' *'
19
26
curl.se : ' *'
27
+ working-directory : build
20
28
script : |
21
29
if test "{{hw.platform}}" != "linux"; then
22
30
echo "glibc is only supported on Linux"
23
31
touch {{prefix}}/linux-only
24
32
exit 0
25
33
fi
26
34
27
- # ./configure doesn't recognize $CC versions >9.x
28
- patch -p1 <props/cc-version-10+.diff
29
-
30
- # https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=87a698a21646b7ee620923ef5ffa9735471a8ddd
31
35
for DIFF in $DIFFS; do
32
- curl | patch -p1
36
+ curl "$DIFF" | patch -p1 -d..
33
37
done
34
38
35
- mkdir build
36
- cd build
37
-
38
39
../configure $ARGS
39
- make --jobs {{ hw.concurrency }} all
40
+ make all -j {{hw.concurrency}}
40
41
make install
42
+
43
+ cd {{prefix}}/bin
44
+ for s in $SCRIPTS; do
45
+ sed -i.bak 's|{{prefix}}|"$(cd "$(dirname "$0")/.." \&\& pwd)"|' $s
46
+ rm $s.bak
47
+ done
41
48
test :
42
49
make test
43
50
env :
44
51
DIFFS :
45
52
- https://sourceware.org/git/?p=glibc.git;a=blobdiff_plain;f=configure;h=3b98ec312fc9c8cc605453654a6ca72106ca0185;hp=b959d2d9885e53e6adcd7037f8382720555abd40;hb=87a698a21646b7ee620923ef5ffa9735471a8ddd;hpb=24fdebe75f6df4c0edacb3f0cdc030913920aa4c
46
53
- https://sourceware.org/git/?p=glibc.git;a=blobdiff_plain;f=configure.ac;h=e20034f301fd7d04ab1c4499bfc1eacdb316570c;hp=49b900c1ed68fa4dd1dadca809ceb6e8b237a89c;hb=87a698a21646b7ee620923ef5ffa9735471a8ddd;hpb=24fdebe75f6df4c0edacb3f0cdc030913920aa4c
47
- CFLAGS :
48
- - -O2
49
- - -fPIC
50
- # - -U_FORTIFY_SOURCE
51
- # - -fno-stack-protector
52
- LDFLAGS :
54
+ SCRIPTS :
55
+ - catchsegv
56
+ - ldd
57
+ - mtrace
58
+ - sotruss
59
+ - tzselect
60
+ - xtrace
53
61
ARGS :
54
62
- --prefix={{ prefix }}
55
63
- --disable-debug
56
64
- --disable-dependency-tracking
57
65
- --disable-silent-rules
66
+ - --disable-werror
58
67
- --enable-obsolete-rpc
68
+ - --without-gd
59
69
- --without-selinux
70
+ - --enable-kernel=2.6.0
71
+ - --with-binutils={{deps.gnu.org/binutils.prefix}}/bin
72
+
73
+ test :
74
+ dependencies :
75
+ gnu.org/gcc : ' *'
76
+ script : |
77
+ test "{{hw.platform}}" = "darwin" && exit 0
78
+ case "{{hw.arch}}" in
79
+ x86-64) ARCH=x86_64;;
80
+ aarch64) ARCH=aarch64;;
81
+ *)
82
+ echo "Unsupported architecture {{hw.arch}}"
83
+ exit 1
84
+ ;;
85
+ esac
86
+ cp $FIXTURE test.c
87
+ gcc \
88
+ -Wl,--rpath="{{prefix}}/lib" \
89
+ -std=c11 \
90
+ -o test \
91
+ -v \
92
+ $CFLAGS \
93
+ test.c \
94
+ -pthread
95
+ file test
96
+ ./test
97
+ fixture : |
98
+ #define _GNU_SOURCE
99
+ #include <assert.h>
100
+ #include <gnu/libc-version.h>
101
+ #include <stdatomic.h>
102
+ #include <stdio.h>
103
+ #include <threads.h>
104
+
105
+ atomic_int acnt;
106
+ int cnt;
107
+
108
+ int f(void* thr_data) {
109
+ for(int n = 0; n < 1000; ++n) {
110
+ ++cnt;
111
+ ++acnt;
112
+ }
113
+ return 0;
114
+ }
115
+
116
+ int main(int argc, char **argv) {
117
+ /* Basic library version check. */
118
+ printf("gnu_get_libc_version() = %s\n", gnu_get_libc_version());
119
+
120
+ thrd_t thr[10];
121
+ for(int n = 0; n < 10; ++n)
122
+ thrd_create(&thr[n], f, NULL);
123
+ for(int n = 0; n < 10; ++n)
124
+ thrd_join(thr[n], NULL);
125
+ printf("The atomic counter is %u\n", acnt);
126
+ printf("The non-atomic counter is %u\n", cnt);
127
+ }
60
128
61
- test : false
129
+ provides :
130
+ - bin/catchsegv
131
+ - bin/gencat
132
+ - bin/getconf
133
+ - bin/getent
134
+ - bin/iconv
135
+ - bin/ldd
136
+ - bin/locale
137
+ - bin/localedef
138
+ - bin/makedb
139
+ - bin/mtrace
140
+ - bin/pcprofiledump
141
+ - bin/pldd
142
+ - bin/rpcgen
143
+ - bin/sotruss
144
+ - bin/sprof
145
+ - bin/tzselect
146
+ - bin/xtrace - sbin/iconvconfig
147
+ - sbin/ldconfig
148
+ - sbin/nscd
149
+ - sbin/sln
150
+ - sbin/zdump
151
+ - sbin/zic
0 commit comments