Skip to content

Commit

Permalink
liblol: glibc: also export ___brk_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
shankerwangmiao committed Jan 14, 2024
1 parent d73c258 commit a74fb12
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e6d58b5366ca272021d357dbda1c530f3dd25eab Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sat, 13 Jan 2024 03:23:48 +0800
Subject: [PATCH 1/9] add old world abi compatibility
Subject: [PATCH 01/10] add old world abi compatibility

---
nptl/Versions | 261 ++++++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion autobuild/patches/glibc/0002-add-sigset-ops.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 28b88a89b987cccc6a39cf13cc8d0d11d10207c9 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sat, 13 Jan 2024 05:07:19 +0800
Subject: [PATCH 2/9] add sigset ops
Subject: [PATCH 02/10] add sigset ops

---
sysdeps/unix/sysv/linux/loongarch/Makefile | 13 +++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion autobuild/patches/glibc/0003-add-signal-functions.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3d0e1f810d7b069688995499b00c191769de3ba8 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sat, 13 Jan 2024 06:35:35 +0800
Subject: [PATCH 3/9] add signal functions
Subject: [PATCH 03/10] add signal functions

---
sysdeps/loongarch/nptl/pthread_sigmask.c | 73 +++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From dc24dd030ab8c9a5200d11d1a66e4b038c2f0c03 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sun, 14 Jan 2024 05:15:07 +0800
Subject: [PATCH 4/9] add sigaction & ucontext compat
Subject: [PATCH 04/10] add sigaction & ucontext compat

---
sysdeps/unix/sysv/linux/loongarch/Makefile | 8 +-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3117d391980e8406789cef2cfe09b0c852991869 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sat, 13 Jan 2024 07:38:04 +0800
Subject: [PATCH 5/9] add stubs for signal related io funcs
Subject: [PATCH 05/10] add stubs for signal related io funcs

---
sysdeps/unix/sysv/linux/loongarch/epoll_pwait.c | 1 +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 00b87a67cd5fceafe6117fe7aaac0fb458b61150 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sun, 14 Jan 2024 15:51:49 +0800
Subject: [PATCH 6/9] add syscall fallback for *stat(at)?
Subject: [PATCH 06/10] add syscall fallback for *stat(at)?

---
sysdeps/unix/sysv/linux/loongarch/fxstat64.c | 67 ++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a021f7f41b009bb07fe6a0cbadcb99118cca937a Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sun, 14 Jan 2024 08:41:15 +0800
Subject: [PATCH 7/9] add more pthread symbols
Subject: [PATCH 07/10] add more pthread symbols

---
nptl/old_pthread_cond_destroy.c | 4 ++--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
From f514ec845f07b3d6e5e329a64783438a11f1291d Mon Sep 17 00:00:00 2001
From e766883c29709df46d9a67e2e2896756dee31cb5 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sun, 14 Jan 2024 16:51:44 +0800
Subject: [PATCH 8/9] remove clone3 for compatibility with qq
Subject: [PATCH 08/10] remove clone3 for compatibility with qq

---
sysdeps/unix/sysv/linux/loongarch/sysdep.h | 1 +
1 file changed, 1 insertion(+)
sysdeps/unix/sysv/linux/loongarch/clone-internal.c | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 sysdeps/unix/sysv/linux/loongarch/clone-internal.c

diff --git a/sysdeps/unix/sysv/linux/loongarch/sysdep.h b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
index e11cd865ce..5c532ecdff 100644
--- a/sysdeps/unix/sysv/linux/loongarch/sysdep.h
+++ b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
@@ -121,6 +121,7 @@
#define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"

#define HAVE_CLONE3_WRAPPER 1
diff --git a/sysdeps/unix/sysv/linux/loongarch/clone-internal.c b/sysdeps/unix/sysv/linux/loongarch/clone-internal.c
new file mode 100644
index 0000000000..e01ce980bc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/clone-internal.c
@@ -0,0 +1,8 @@
+#include <shlib-compat.h>
+
+#if LIB_COMPAT(libc, GLIBC_2_27, GLIBC_2_36)
+#include <sysdep.h>
+#undef HAVE_CLONE3_WRAPPER
#define INTERNAL_SYSCALL(name, nr, args...) \
internal_syscall##nr (SYS_ify (name), args)
+#endif
+
+#include <sysdeps/unix/sysv/linux/clone-internal.c>
--
2.39.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 448b6b9c8ee7cc340aafac9e60502147444fb939 Mon Sep 17 00:00:00 2001
From 8d5b7202db61545872a880abd0c9a3dc012b20b3 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Sun, 14 Jan 2024 13:28:41 +0800
Subject: [PATCH 9/9] able to prepend trusted-dirs
Subject: [PATCH 09/10] able to prepend trusted-dirs

---
elf/Makefile | 2 +-
Expand Down
28 changes: 28 additions & 0 deletions autobuild/patches/glibc/0010-Add-___brk_addr-symbol.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From c2ef1e7fe9b5c0cec43197e440cc5b4a05bbde24 Mon Sep 17 00:00:00 2001
From: Miao Wang <[email protected]>
Date: Mon, 15 Jan 2024 04:16:47 +0800
Subject: [PATCH 10/10] Add ___brk_addr symbol

---
sysdeps/unix/sysv/linux/loongarch/brk.c | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 sysdeps/unix/sysv/linux/loongarch/brk.c

diff --git a/sysdeps/unix/sysv/linux/loongarch/brk.c b/sysdeps/unix/sysv/linux/loongarch/brk.c
new file mode 100644
index 0000000000..82c285f452
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/loongarch/brk.c
@@ -0,0 +1,9 @@
+#include <shlib-compat.h>
+
+#if LIB_COMPAT(libc, GLIBC_2_27, GLIBC_2_36)
+#include <sysdep.h>
+#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
+#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
+#endif
+
+#include <sysdeps/unix/sysv/linux/brk.c>
--
2.39.0

1 change: 1 addition & 0 deletions autobuild/patches/glibc/series
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
0007-add-more-pthread-symbols.patch
0008-remove-clone3-for-compatibility-with-qq.patch
0009-able-to-prepend-trusted-dirs.patch
0010-Add-___brk_addr-symbol.patch

0 comments on commit a74fb12

Please sign in to comment.