Skip to content

Commit 338a821

Browse files
committed
this builds
1 parent cede0e3 commit 338a821

File tree

3 files changed

+110
-30
lines changed

3 files changed

+110
-30
lines changed

projects/gnu.org/gcc/package.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ build:
2121
gnu.org/make: '*'
2222
perl.org: '^5.6.1'
2323
gnu.org/patch: '*'
24+
curl.se: '*'
2425
working-directory: build
2526
script: |
2627
# Branch from the Darwin maintainer of GCC, with a few generic fixes and

projects/gnu.org/glibc/cc-version-10+.diff

Lines changed: 0 additions & 11 deletions
This file was deleted.

projects/gnu.org/glibc/package.yml

Lines changed: 109 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,148 @@ distributable:
44

55
versions:
66
#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
815

916
build:
1017
dependencies:
1118
gnu.org/make: '>=3.79'
1219
gnu.org/gawk: '>=3'
1320
gnu.org/gcc: '*'
14-
gnu.org/binutils: '*'
15-
gnu.org/texinfo: '*'
1621
gnu.org/gettext: '*'
22+
gnu.org/texinfo: '*'
23+
gnu.org/bison: '*'
1724
gnu.org/patch: '*'
1825
perl.org: '*'
1926
curl.se: '*'
27+
working-directory: build
2028
script: |
2129
if test "{{hw.platform}}" != "linux"; then
2230
echo "glibc is only supported on Linux"
2331
touch {{prefix}}/linux-only
2432
exit 0
2533
fi
2634
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
3135
for DIFF in $DIFFS; do
32-
curl | patch -p1
36+
curl "$DIFF" | patch -p1 -d..
3337
done
3438
35-
mkdir build
36-
cd build
37-
3839
../configure $ARGS
39-
make --jobs {{ hw.concurrency }} all
40+
make all -j {{hw.concurrency}}
4041
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
4148
test:
4249
make test
4350
env:
4451
DIFFS:
4552
- https://sourceware.org/git/?p=glibc.git;a=blobdiff_plain;f=configure;h=3b98ec312fc9c8cc605453654a6ca72106ca0185;hp=b959d2d9885e53e6adcd7037f8382720555abd40;hb=87a698a21646b7ee620923ef5ffa9735471a8ddd;hpb=24fdebe75f6df4c0edacb3f0cdc030913920aa4c
4653
- 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
5361
ARGS:
5462
- --prefix={{ prefix }}
5563
- --disable-debug
5664
- --disable-dependency-tracking
5765
- --disable-silent-rules
66+
- --disable-werror
5867
- --enable-obsolete-rpc
68+
- --without-gd
5969
- --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+
}
60128
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

Comments
 (0)