Skip to content

Commit

Permalink
liblol: glibc: add compat libs
Browse files Browse the repository at this point in the history
  • Loading branch information
shankerwangmiao committed Jan 27, 2024
1 parent 99ddd93 commit 1c9c458
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 109 deletions.
3 changes: 3 additions & 0 deletions autobuild/build
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ EOF
"locale/libBrokenLocale.so.1" \
"rt/librt.so.1" \
"crypt/libcrypt.so.1" \
"resolv/libanl.so.1" \
"login/libutil.so.1" \
"nis/libnsl.so.1" \
)
local dir
local lib
Expand Down
60 changes: 50 additions & 10 deletions autobuild/patches/glibc/0001-add-old-world-abi-compatibility.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
From e6d58b5366ca272021d357dbda1c530f3dd25eab Mon Sep 17 00:00:00 2001
From d55a93c9639ea23d9b62a1d01cadedefeefb67ae Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sat, 13 Jan 2024 03:23:48 +0800
Subject: [PATCH 01/10] add old world abi compatibility

---
login/Makefile | 8 +-
nptl/Versions | 261 ++++++++++++++++++
scripts/firstversions.awk | 9 +-
scripts/versions.awk | 2 +-
sunrpc/Makefile | 4 +-
sysdeps/nptl/Makeconfig | 1 +
sysdeps/unix/sysv/linux/loongarch/Versions | 36 +++
.../unix/sysv/linux/loongarch/shlib-versions | 11 +-
sysdeps/unix/sysv/linux/loongarch/statx_cp.c | 4 +
7 files changed, 314 insertions(+), 13 deletions(-)
9 files changed, 319 insertions(+), 17 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/loongarch/Versions
create mode 100644 sysdeps/unix/sysv/linux/loongarch/statx_cp.c

diff --git a/login/Makefile b/login/Makefile
index 74216cbc..5f5f2427 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -49,7 +49,7 @@ tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
# Empty compatibility library for old binaries.
extra-libs := libutil
extra-libs-others := $(extra-libs)
-ifeq ($(have-GLIBC_2.33),yes)
+#ifeq ($(have-GLIBC_2.33),yes)
libutil-routines := libutil-compat
libutil-shared-only-routines := libutil-compat

@@ -57,9 +57,9 @@ libutil-shared-only-routines := libutil-compat
# link is not installed.
install-lib-ldscripts = libutil.so
$(inst_libdir)/libutil.so:
-else # not $(have-GLIBC_2.33)
-libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
-endif # $(have-GLIBC_2.33)
+#else # not $(have-GLIBC_2.33)
+#libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
+#endif # $(have-GLIBC_2.33)

include ../Rules

diff --git a/nptl/Versions b/nptl/Versions
index 3221de89d1..a0df5497ac 100644
index 3221de89..a0df5497 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -533,3 +533,264 @@ ld {
Expand Down Expand Up @@ -285,7 +313,7 @@ index 3221de89d1..a0df5497ac 100644
+ }
+}
diff --git a/scripts/firstversions.awk b/scripts/firstversions.awk
index ccde4b59b4..16008b0858 100644
index ccde4b59..16008b08 100644
--- a/scripts/firstversions.awk
+++ b/scripts/firstversions.awk
@@ -27,9 +27,16 @@ function vers_compare (v1, v2)
Expand All @@ -307,7 +335,7 @@ index ccde4b59b4..16008b0858 100644
}

diff --git a/scripts/versions.awk b/scripts/versions.awk
index eeb7a10654..6b30e74561 100644
index eeb7a106..6b30e745 100644
--- a/scripts/versions.awk
+++ b/scripts/versions.awk
@@ -89,7 +89,7 @@ function ord(c) {
Expand All @@ -320,7 +348,7 @@ index eeb7a10654..6b30e74561 100644

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

tests = tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \
tst-udp-nonblocking tst-bug22542 tst-bug28768
diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig
index 77aedd1e..963ad5d5 100644
--- a/sysdeps/nptl/Makeconfig
+++ b/sysdeps/nptl/Makeconfig
@@ -20,6 +20,7 @@

have-thread-library = yes
have-anl-library = $(have-GLIBC_2.34)
+have-anl-library = yes

# The thread library is integrated.
shared-thread-library =
diff --git a/sysdeps/unix/sysv/linux/loongarch/Versions b/sysdeps/unix/sysv/linux/loongarch/Versions
new file mode 100644
index 0000000000..6b3dd0d12e
index 00000000..6b3dd0d1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/Versions
@@ -0,0 +1,36 @@
Expand Down Expand Up @@ -384,7 +424,7 @@ index 0000000000..6b3dd0d12e
+ }
+}
diff --git a/sysdeps/unix/sysv/linux/loongarch/shlib-versions b/sysdeps/unix/sysv/linux/loongarch/shlib-versions
index 5f40e7f5ec..4f126b5494 100644
index 5f40e7f5..4f126b54 100644
--- a/sysdeps/unix/sysv/linux/loongarch/shlib-versions
+++ b/sysdeps/unix/sysv/linux/loongarch/shlib-versions
@@ -1,9 +1,2 @@
Expand All @@ -401,7 +441,7 @@ index 5f40e7f5ec..4f126b5494 100644
+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
diff --git a/sysdeps/unix/sysv/linux/loongarch/statx_cp.c b/sysdeps/unix/sysv/linux/loongarch/statx_cp.c
new file mode 100644
index 0000000000..3b57a461d1
index 00000000..3b57a461
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/statx_cp.c
@@ -0,0 +1,4 @@
Expand All @@ -410,5 +450,5 @@ index 0000000000..3b57a461d1
+
+#include <sysdeps/unix/sysv/linux/statx_cp.c>
--
2.39.0
2.43.0

42 changes: 21 additions & 21 deletions autobuild/patches/glibc/0002-add-sigset-ops.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 28b88a89b987cccc6a39cf13cc8d0d11d10207c9 Mon Sep 17 00:00:00 2001
From dc917c1307c621f28528e8e797c6eb35f6bc48ac Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sat, 13 Jan 2024 05:07:19 +0800
Subject: [PATCH 02/10] add sigset ops
Expand Down Expand Up @@ -44,7 +44,7 @@ Subject: [PATCH 02/10] add sigset ops
create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigorset.c

diff --git a/sysdeps/unix/sysv/linux/loongarch/Makefile b/sysdeps/unix/sysv/linux/loongarch/Makefile
index c84a1762ed..70cac2d36c 100644
index c84a1762..70cac2d3 100644
--- a/sysdeps/unix/sysv/linux/loongarch/Makefile
+++ b/sysdeps/unix/sysv/linux/loongarch/Makefile
@@ -2,6 +2,19 @@ ifeq ($(subdir),stdlib)
Expand All @@ -69,7 +69,7 @@ index c84a1762ed..70cac2d36c 100644
ifeq (,$(filter $(default-abi),$(abi-variants)))
diff --git a/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h
new file mode 100644
index 0000000000..522f084657
index 00000000..522f0846
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h
@@ -0,0 +1,6 @@
Expand All @@ -81,7 +81,7 @@ index 0000000000..522f084657
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c
new file mode 100644
index 0000000000..0bc18cdaa1
index 00000000..0bc18cda
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c
@@ -0,0 +1,11 @@
Expand All @@ -98,7 +98,7 @@ index 0000000000..0bc18cdaa1
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c
new file mode 100644
index 0000000000..b28cfc23f1
index 00000000..b28cfc23
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c
@@ -0,0 +1,11 @@
Expand All @@ -115,7 +115,7 @@ index 0000000000..b28cfc23f1
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c
new file mode 100644
index 0000000000..d29dc88570
index 00000000..d29dc885
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c
@@ -0,0 +1,11 @@
Expand All @@ -132,7 +132,7 @@ index 0000000000..d29dc88570
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c
new file mode 100644
index 0000000000..67d3176edf
index 00000000..67d3176e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c
@@ -0,0 +1,11 @@
Expand All @@ -149,7 +149,7 @@ index 0000000000..67d3176edf
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c
new file mode 100644
index 0000000000..3d41cbf55c
index 00000000..3d41cbf5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c
@@ -0,0 +1,11 @@
Expand All @@ -166,7 +166,7 @@ index 0000000000..3d41cbf55c
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c
new file mode 100644
index 0000000000..b30cb1a286
index 00000000..b30cb1a2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c
@@ -0,0 +1,11 @@
Expand All @@ -183,7 +183,7 @@ index 0000000000..b30cb1a286
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c
new file mode 100644
index 0000000000..21432e423f
index 00000000..21432e42
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c
@@ -0,0 +1,11 @@
Expand All @@ -200,7 +200,7 @@ index 0000000000..21432e423f
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h
new file mode 100644
index 0000000000..f06836b852
index 00000000..f06836b8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h
@@ -0,0 +1,8 @@
Expand All @@ -214,7 +214,7 @@ index 0000000000..f06836b852
+extern int __ow_sigorset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right);
diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c
new file mode 100644
index 0000000000..8e73662b68
index 00000000..8e73662b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c
@@ -0,0 +1,11 @@
Expand All @@ -231,7 +231,7 @@ index 0000000000..8e73662b68
+#endif
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigaddset.c b/sysdeps/unix/sysv/linux/loongarch/sigaddset.c
new file mode 100644
index 0000000000..d86362d17c
index 00000000..d86362d1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigaddset.c
@@ -0,0 +1,11 @@
Expand All @@ -248,7 +248,7 @@ index 0000000000..d86362d17c
+libc_hidden_ver(__nw_sigaddset, sigaddset)
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigandset.c b/sysdeps/unix/sysv/linux/loongarch/sigandset.c
new file mode 100644
index 0000000000..e3345db85f
index 00000000..e3345db8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigandset.c
@@ -0,0 +1,7 @@
Expand All @@ -261,7 +261,7 @@ index 0000000000..e3345db85f
+versioned_symbol(libc, __nw_sigandset, sigandset, GLIBC_2_36);
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigdelset.c b/sysdeps/unix/sysv/linux/loongarch/sigdelset.c
new file mode 100644
index 0000000000..13e9c950d7
index 00000000..13e9c950
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigdelset.c
@@ -0,0 +1,11 @@
Expand All @@ -278,7 +278,7 @@ index 0000000000..13e9c950d7
+libc_hidden_ver(__nw_sigdelset, sigdelset)
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigempty.c b/sysdeps/unix/sysv/linux/loongarch/sigempty.c
new file mode 100644
index 0000000000..476756e6e0
index 00000000..476756e6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigempty.c
@@ -0,0 +1,11 @@
Expand All @@ -295,7 +295,7 @@ index 0000000000..476756e6e0
+libc_hidden_ver(__nw_sigemptyset, sigemptyset)
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigfillset.c b/sysdeps/unix/sysv/linux/loongarch/sigfillset.c
new file mode 100644
index 0000000000..2f55b8664c
index 00000000..2f55b866
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigfillset.c
@@ -0,0 +1,11 @@
Expand All @@ -312,7 +312,7 @@ index 0000000000..2f55b8664c
+libc_hidden_ver(__nw_sigfillset, sigfillset)
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigisempty.c b/sysdeps/unix/sysv/linux/loongarch/sigisempty.c
new file mode 100644
index 0000000000..b6ea8b8454
index 00000000..b6ea8b84
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigisempty.c
@@ -0,0 +1,7 @@
Expand All @@ -325,7 +325,7 @@ index 0000000000..b6ea8b8454
+versioned_symbol(libc, __nw_sigisemptyset, sigisemptyset, GLIBC_2_36);
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigismem.c b/sysdeps/unix/sysv/linux/loongarch/sigismem.c
new file mode 100644
index 0000000000..ae7d9b624d
index 00000000..ae7d9b62
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigismem.c
@@ -0,0 +1,7 @@
Expand All @@ -338,7 +338,7 @@ index 0000000000..ae7d9b624d
+versioned_symbol(libc, __nw_sigismember, sigismember, GLIBC_2_36);
diff --git a/sysdeps/unix/sysv/linux/loongarch/sigorset.c b/sysdeps/unix/sysv/linux/loongarch/sigorset.c
new file mode 100644
index 0000000000..a49e3f4ee8
index 00000000..a49e3f4e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/sigorset.c
@@ -0,0 +1,7 @@
Expand All @@ -350,5 +350,5 @@ index 0000000000..a49e3f4ee8
+#undef sigorset
+versioned_symbol(libc, __nw_sigorset, sigorset, GLIBC_2_36);
--
2.39.0
2.43.0

Loading

0 comments on commit 1c9c458

Please sign in to comment.