Skip to content

Commit 7976e91

Browse files
committed
wip
1 parent 98962f1 commit 7976e91

2 files changed

Lines changed: 2 additions & 28 deletions

File tree

projects/gnu.org/glibc/package.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ test:
7777
# Putting ourselves in the LD_LIBRARY_PATH breaks literally everything else...
7878
- export LD_LIBRARY_PATH="$(echo LD_LIBRARY_PATH | tr ':' '\n' | grep -v {{prefix}} | tr '\n' ':')"
7979

80-
- gcc -o test1 test.c -pthread -fPIC -pie
80+
- gcc -o test1 test.c -fPIC -pie
8181
- ./test1
8282

83-
- find {{deps.gnu.org/gcc.prefix}} -name stdatomic.h
84-
8583
- |
8684
gcc \
8785
-nostdinc \
@@ -97,11 +95,9 @@ test:
9795
{{prefix}}/lib/crt1.o \
9896
{{prefix}}/lib/crtn.o \
9997
test.c \
100-
-pthread \
10198
-fPIC \
10299
-pie
103-
- objdump -p test2
104-
- ./test2
100+
- test "$(./test2)" = "gnu_get_libc_version() = {{version.marketing}}"
105101

106102
provides:
107103
- bin/catchsegv

projects/gnu.org/glibc/test.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,8 @@
11
#define _GNU_SOURCE
2-
#include <assert.h>
32
#include <gnu/libc-version.h>
4-
#include <stdatomic.h>
53
#include <stdio.h>
6-
#include <threads.h>
7-
8-
atomic_int acnt;
9-
int cnt;
10-
11-
int f(void* thr_data) {
12-
for(int n = 0; n < 1000; ++n) {
13-
++cnt;
14-
++acnt;
15-
}
16-
return 0;
17-
}
184

195
int main(int argc, char **argv) {
206
/* Basic library version check. */
217
printf("gnu_get_libc_version() = %s\n", gnu_get_libc_version());
22-
23-
thrd_t thr[10];
24-
for(int n = 0; n < 10; ++n)
25-
thrd_create(&thr[n], f, NULL);
26-
for(int n = 0; n < 10; ++n)
27-
thrd_join(thr[n], NULL);
28-
printf("The atomic counter is %u\n", acnt);
29-
printf("The non-atomic counter is %u\n", cnt);
308
}

0 commit comments

Comments
 (0)