Skip to content

Commit 5c7ea72

Browse files
shankerwangmiaoMingcongBai
authored andcommitted
liblol: glibc: add compat libs
1 parent 6995b7f commit 5c7ea72

13 files changed

Lines changed: 152 additions & 109 deletions

autobuild/build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ EOF
8888
"locale/libBrokenLocale.so.1" \
8989
"rt/librt.so.1" \
9090
"crypt/libcrypt.so.1" \
91+
"resolv/libanl.so.1" \
92+
"login/libutil.so.1" \
93+
"nis/libnsl.so.1" \
9194
)
9295
local dir
9396
local lib

autobuild/patches/glibc/0001-add-old-world-abi-compatibility.patch

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,50 @@
1-
From e6d58b5366ca272021d357dbda1c530f3dd25eab Mon Sep 17 00:00:00 2001
1+
From d55a93c9639ea23d9b62a1d01cadedefeefb67ae Mon Sep 17 00:00:00 2001
22
From: Miao Wang <shankerwangmiao@gmail.com>
33
Date: Sat, 13 Jan 2024 03:23:48 +0800
44
Subject: [PATCH 01/10] add old world abi compatibility
55

66
---
7+
login/Makefile | 8 +-
78
nptl/Versions | 261 ++++++++++++++++++
89
scripts/firstversions.awk | 9 +-
910
scripts/versions.awk | 2 +-
1011
sunrpc/Makefile | 4 +-
12+
sysdeps/nptl/Makeconfig | 1 +
1113
sysdeps/unix/sysv/linux/loongarch/Versions | 36 +++
1214
.../unix/sysv/linux/loongarch/shlib-versions | 11 +-
1315
sysdeps/unix/sysv/linux/loongarch/statx_cp.c | 4 +
14-
7 files changed, 314 insertions(+), 13 deletions(-)
16+
9 files changed, 319 insertions(+), 17 deletions(-)
1517
create mode 100644 sysdeps/unix/sysv/linux/loongarch/Versions
1618
create mode 100644 sysdeps/unix/sysv/linux/loongarch/statx_cp.c
1719

20+
diff --git a/login/Makefile b/login/Makefile
21+
index 74216cbc..5f5f2427 100644
22+
--- a/login/Makefile
23+
+++ b/login/Makefile
24+
@@ -49,7 +49,7 @@ tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
25+
# Empty compatibility library for old binaries.
26+
extra-libs := libutil
27+
extra-libs-others := $(extra-libs)
28+
-ifeq ($(have-GLIBC_2.33),yes)
29+
+#ifeq ($(have-GLIBC_2.33),yes)
30+
libutil-routines := libutil-compat
31+
libutil-shared-only-routines := libutil-compat
32+
33+
@@ -57,9 +57,9 @@ libutil-shared-only-routines := libutil-compat
34+
# link is not installed.
35+
install-lib-ldscripts = libutil.so
36+
$(inst_libdir)/libutil.so:
37+
-else # not $(have-GLIBC_2.33)
38+
-libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
39+
-endif # $(have-GLIBC_2.33)
40+
+#else # not $(have-GLIBC_2.33)
41+
+#libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
42+
+#endif # $(have-GLIBC_2.33)
43+
44+
include ../Rules
45+
1846
diff --git a/nptl/Versions b/nptl/Versions
19-
index 3221de89d1..a0df5497ac 100644
47+
index 3221de89..a0df5497 100644
2048
--- a/nptl/Versions
2149
+++ b/nptl/Versions
2250
@@ -533,3 +533,264 @@ ld {
@@ -285,7 +313,7 @@ index 3221de89d1..a0df5497ac 100644
285313
+ }
286314
+}
287315
diff --git a/scripts/firstversions.awk b/scripts/firstversions.awk
288-
index ccde4b59b4..16008b0858 100644
316+
index ccde4b59..16008b08 100644
289317
--- a/scripts/firstversions.awk
290318
+++ b/scripts/firstversions.awk
291319
@@ -27,9 +27,16 @@ function vers_compare (v1, v2)
@@ -307,7 +335,7 @@ index ccde4b59b4..16008b0858 100644
307335
}
308336

309337
diff --git a/scripts/versions.awk b/scripts/versions.awk
310-
index eeb7a10654..6b30e74561 100644
338+
index eeb7a106..6b30e745 100644
311339
--- a/scripts/versions.awk
312340
+++ b/scripts/versions.awk
313341
@@ -89,7 +89,7 @@ function ord(c) {
@@ -320,7 +348,7 @@ index eeb7a10654..6b30e74561 100644
320348

321349
# Some targets do not set the ABI baseline for libdl. As a result,
322350
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
323-
index ec2ea04ca9..015be5be3f 100644
351+
index ec2ea04c..015be5be 100644
324352
--- a/sunrpc/Makefile
325353
+++ b/sunrpc/Makefile
326354
@@ -22,7 +22,7 @@ subdir := sunrpc
@@ -341,9 +369,21 @@ index ec2ea04ca9..015be5be3f 100644
341369

342370
tests = tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \
343371
tst-udp-nonblocking tst-bug22542 tst-bug28768
372+
diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig
373+
index 77aedd1e..963ad5d5 100644
374+
--- a/sysdeps/nptl/Makeconfig
375+
+++ b/sysdeps/nptl/Makeconfig
376+
@@ -20,6 +20,7 @@
377+
378+
have-thread-library = yes
379+
have-anl-library = $(have-GLIBC_2.34)
380+
+have-anl-library = yes
381+
382+
# The thread library is integrated.
383+
shared-thread-library =
344384
diff --git a/sysdeps/unix/sysv/linux/loongarch/Versions b/sysdeps/unix/sysv/linux/loongarch/Versions
345385
new file mode 100644
346-
index 0000000000..6b3dd0d12e
386+
index 00000000..6b3dd0d1
347387
--- /dev/null
348388
+++ b/sysdeps/unix/sysv/linux/loongarch/Versions
349389
@@ -0,0 +1,36 @@
@@ -384,7 +424,7 @@ index 0000000000..6b3dd0d12e
384424
+ }
385425
+}
386426
diff --git a/sysdeps/unix/sysv/linux/loongarch/shlib-versions b/sysdeps/unix/sysv/linux/loongarch/shlib-versions
387-
index 5f40e7f5ec..4f126b5494 100644
427+
index 5f40e7f5..4f126b54 100644
388428
--- a/sysdeps/unix/sysv/linux/loongarch/shlib-versions
389429
+++ b/sysdeps/unix/sysv/linux/loongarch/shlib-versions
390430
@@ -1,9 +1,2 @@
@@ -401,7 +441,7 @@ index 5f40e7f5ec..4f126b5494 100644
401441
+libpthread=0 GLIBC_2.0 GLIBC_2.2 GLIBC_2.2.1 GLIBC_2.2.2 GLIBC_2.2.3 GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.19 GLIBC_2.20 GLIBC_2.21 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_2.25 GLIBC_2.26 GLIBC_2.27 GLIBC_2.28 GLIBC_2.36
402442
diff --git a/sysdeps/unix/sysv/linux/loongarch/statx_cp.c b/sysdeps/unix/sysv/linux/loongarch/statx_cp.c
403443
new file mode 100644
404-
index 0000000000..3b57a461d1
444+
index 00000000..3b57a461
405445
--- /dev/null
406446
+++ b/sysdeps/unix/sysv/linux/loongarch/statx_cp.c
407447
@@ -0,0 +1,4 @@
@@ -410,5 +450,5 @@ index 0000000000..3b57a461d1
410450
+
411451
+#include <sysdeps/unix/sysv/linux/statx_cp.c>
412452
--
413-
2.39.0
453+
2.43.0
414454

autobuild/patches/glibc/0002-add-sigset-ops.patch

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 28b88a89b987cccc6a39cf13cc8d0d11d10207c9 Mon Sep 17 00:00:00 2001
1+
From dc917c1307c621f28528e8e797c6eb35f6bc48ac Mon Sep 17 00:00:00 2001
22
From: Miao Wang <shankerwangmiao@gmail.com>
33
Date: Sat, 13 Jan 2024 05:07:19 +0800
44
Subject: [PATCH 02/10] add sigset ops
@@ -44,7 +44,7 @@ Subject: [PATCH 02/10] add sigset ops
4444
create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigorset.c
4545

4646
diff --git a/sysdeps/unix/sysv/linux/loongarch/Makefile b/sysdeps/unix/sysv/linux/loongarch/Makefile
47-
index c84a1762ed..70cac2d36c 100644
47+
index c84a1762..70cac2d3 100644
4848
--- a/sysdeps/unix/sysv/linux/loongarch/Makefile
4949
+++ b/sysdeps/unix/sysv/linux/loongarch/Makefile
5050
@@ -2,6 +2,19 @@ ifeq ($(subdir),stdlib)
@@ -69,7 +69,7 @@ index c84a1762ed..70cac2d36c 100644
6969
ifeq (,$(filter $(default-abi),$(abi-variants)))
7070
diff --git a/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h
7171
new file mode 100644
72-
index 0000000000..522f084657
72+
index 00000000..522f0846
7373
--- /dev/null
7474
+++ b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h
7575
@@ -0,0 +1,6 @@
@@ -81,7 +81,7 @@ index 0000000000..522f084657
8181
+#endif
8282
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c
8383
new file mode 100644
84-
index 0000000000..0bc18cdaa1
84+
index 00000000..0bc18cda
8585
--- /dev/null
8686
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c
8787
@@ -0,0 +1,11 @@
@@ -98,7 +98,7 @@ index 0000000000..0bc18cdaa1
9898
+#endif
9999
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c
100100
new file mode 100644
101-
index 0000000000..b28cfc23f1
101+
index 00000000..b28cfc23
102102
--- /dev/null
103103
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c
104104
@@ -0,0 +1,11 @@
@@ -115,7 +115,7 @@ index 0000000000..b28cfc23f1
115115
+#endif
116116
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c
117117
new file mode 100644
118-
index 0000000000..d29dc88570
118+
index 00000000..d29dc885
119119
--- /dev/null
120120
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c
121121
@@ -0,0 +1,11 @@
@@ -132,7 +132,7 @@ index 0000000000..d29dc88570
132132
+#endif
133133
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c
134134
new file mode 100644
135-
index 0000000000..67d3176edf
135+
index 00000000..67d3176e
136136
--- /dev/null
137137
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c
138138
@@ -0,0 +1,11 @@
@@ -149,7 +149,7 @@ index 0000000000..67d3176edf
149149
+#endif
150150
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c
151151
new file mode 100644
152-
index 0000000000..3d41cbf55c
152+
index 00000000..3d41cbf5
153153
--- /dev/null
154154
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c
155155
@@ -0,0 +1,11 @@
@@ -166,7 +166,7 @@ index 0000000000..3d41cbf55c
166166
+#endif
167167
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c
168168
new file mode 100644
169-
index 0000000000..b30cb1a286
169+
index 00000000..b30cb1a2
170170
--- /dev/null
171171
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c
172172
@@ -0,0 +1,11 @@
@@ -183,7 +183,7 @@ index 0000000000..b30cb1a286
183183
+#endif
184184
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c
185185
new file mode 100644
186-
index 0000000000..21432e423f
186+
index 00000000..21432e42
187187
--- /dev/null
188188
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c
189189
@@ -0,0 +1,11 @@
@@ -200,7 +200,7 @@ index 0000000000..21432e423f
200200
+#endif
201201
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h
202202
new file mode 100644
203-
index 0000000000..f06836b852
203+
index 00000000..f06836b8
204204
--- /dev/null
205205
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h
206206
@@ -0,0 +1,8 @@
@@ -214,7 +214,7 @@ index 0000000000..f06836b852
214214
+extern int __ow_sigorset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right);
215215
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c
216216
new file mode 100644
217-
index 0000000000..8e73662b68
217+
index 00000000..8e73662b
218218
--- /dev/null
219219
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c
220220
@@ -0,0 +1,11 @@
@@ -231,7 +231,7 @@ index 0000000000..8e73662b68
231231
+#endif
232232
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigaddset.c b/sysdeps/unix/sysv/linux/loongarch/sigaddset.c
233233
new file mode 100644
234-
index 0000000000..d86362d17c
234+
index 00000000..d86362d1
235235
--- /dev/null
236236
+++ b/sysdeps/unix/sysv/linux/loongarch/sigaddset.c
237237
@@ -0,0 +1,11 @@
@@ -248,7 +248,7 @@ index 0000000000..d86362d17c
248248
+libc_hidden_ver(__nw_sigaddset, sigaddset)
249249
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigandset.c b/sysdeps/unix/sysv/linux/loongarch/sigandset.c
250250
new file mode 100644
251-
index 0000000000..e3345db85f
251+
index 00000000..e3345db8
252252
--- /dev/null
253253
+++ b/sysdeps/unix/sysv/linux/loongarch/sigandset.c
254254
@@ -0,0 +1,7 @@
@@ -261,7 +261,7 @@ index 0000000000..e3345db85f
261261
+versioned_symbol(libc, __nw_sigandset, sigandset, GLIBC_2_36);
262262
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigdelset.c b/sysdeps/unix/sysv/linux/loongarch/sigdelset.c
263263
new file mode 100644
264-
index 0000000000..13e9c950d7
264+
index 00000000..13e9c950
265265
--- /dev/null
266266
+++ b/sysdeps/unix/sysv/linux/loongarch/sigdelset.c
267267
@@ -0,0 +1,11 @@
@@ -278,7 +278,7 @@ index 0000000000..13e9c950d7
278278
+libc_hidden_ver(__nw_sigdelset, sigdelset)
279279
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigempty.c b/sysdeps/unix/sysv/linux/loongarch/sigempty.c
280280
new file mode 100644
281-
index 0000000000..476756e6e0
281+
index 00000000..476756e6
282282
--- /dev/null
283283
+++ b/sysdeps/unix/sysv/linux/loongarch/sigempty.c
284284
@@ -0,0 +1,11 @@
@@ -295,7 +295,7 @@ index 0000000000..476756e6e0
295295
+libc_hidden_ver(__nw_sigemptyset, sigemptyset)
296296
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigfillset.c b/sysdeps/unix/sysv/linux/loongarch/sigfillset.c
297297
new file mode 100644
298-
index 0000000000..2f55b8664c
298+
index 00000000..2f55b866
299299
--- /dev/null
300300
+++ b/sysdeps/unix/sysv/linux/loongarch/sigfillset.c
301301
@@ -0,0 +1,11 @@
@@ -312,7 +312,7 @@ index 0000000000..2f55b8664c
312312
+libc_hidden_ver(__nw_sigfillset, sigfillset)
313313
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigisempty.c b/sysdeps/unix/sysv/linux/loongarch/sigisempty.c
314314
new file mode 100644
315-
index 0000000000..b6ea8b8454
315+
index 00000000..b6ea8b84
316316
--- /dev/null
317317
+++ b/sysdeps/unix/sysv/linux/loongarch/sigisempty.c
318318
@@ -0,0 +1,7 @@
@@ -325,7 +325,7 @@ index 0000000000..b6ea8b8454
325325
+versioned_symbol(libc, __nw_sigisemptyset, sigisemptyset, GLIBC_2_36);
326326
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigismem.c b/sysdeps/unix/sysv/linux/loongarch/sigismem.c
327327
new file mode 100644
328-
index 0000000000..ae7d9b624d
328+
index 00000000..ae7d9b62
329329
--- /dev/null
330330
+++ b/sysdeps/unix/sysv/linux/loongarch/sigismem.c
331331
@@ -0,0 +1,7 @@
@@ -338,7 +338,7 @@ index 0000000000..ae7d9b624d
338338
+versioned_symbol(libc, __nw_sigismember, sigismember, GLIBC_2_36);
339339
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigorset.c b/sysdeps/unix/sysv/linux/loongarch/sigorset.c
340340
new file mode 100644
341-
index 0000000000..a49e3f4ee8
341+
index 00000000..a49e3f4e
342342
--- /dev/null
343343
+++ b/sysdeps/unix/sysv/linux/loongarch/sigorset.c
344344
@@ -0,0 +1,7 @@
@@ -350,5 +350,5 @@ index 0000000000..a49e3f4ee8
350350
+#undef sigorset
351351
+versioned_symbol(libc, __nw_sigorset, sigorset, GLIBC_2_36);
352352
--
353-
2.39.0
353+
2.43.0
354354

0 commit comments

Comments
 (0)