├── autobuild ├── patch ├── patches │ ├── patchelf │ │ ├── series │ │ └── 0001-add-remap-symvers.patch │ └── glibc │ │ ├── series │ │ ├── 0011-Add-___brk_addr-symbol.patch │ │ ├── 0009-remove-clone3-for-compatibility-with-qq.patch │ │ ├── 0012-siglist-errlist-add-compact-statements.patch │ │ ├── 0001-BACKPORT-UPSTREAM-stdlib-resolve-a-double-lock-init-.patch │ │ ├── 0006-add-stubs-for-signal-related-io-funcs.patch │ │ ├── 0010-prepend-trusted-dirs.patch │ │ ├── 0004-add-signal-functions.patch │ │ ├── 0007-add-syscall-fallback-for-stat-at.patch │ │ ├── 0003-add-sigset-ops.patch │ │ ├── 0002-add-old-world-abi-compatibility.patch │ │ ├── 0008-add-more-pthread-symbols.patch │ │ └── 0005-add-sigaction-ucontext-compat.patch ├── abiversions │ ├── libBrokenLocale.abilist │ ├── libanl.abilist │ ├── libutil.abilist │ ├── libcrypt.abilist │ ├── libdl.abilist │ ├── ld.abilist │ ├── librt.abilist │ ├── libthread_db.abilist │ ├── libresolv.abilist │ ├── libnsl.abilist │ ├── libpthread.abilist │ └── libm.abilist ├── overrides │ └── usr │ │ └── lib │ │ └── modules-load.d │ │ └── liblol.conf ├── defines ├── additional-files │ └── hooks │ │ └── postinst.in └── build ├── spec ├── README.zh.md ├── README.md └── LICENSE /autobuild/patch: -------------------------------------------------------------------------------- 1 | : "Do nothing" 2 | -------------------------------------------------------------------------------- /autobuild/patches/patchelf/series: -------------------------------------------------------------------------------- 1 | 0001-add-remap-symvers.patch 2 | -------------------------------------------------------------------------------- /autobuild/abiversions/libBrokenLocale.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 __ctype_get_mb_cur_max F 2 | -------------------------------------------------------------------------------- /autobuild/overrides/usr/lib/modules-load.d/liblol.conf: -------------------------------------------------------------------------------- 1 | # Load the la_ow_syscall kernel module for old-world compatibility. 2 | la_ow_syscall 3 | -------------------------------------------------------------------------------- /autobuild/abiversions/libanl.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 gai_cancel F 2 | GLIBC_2.27 gai_error F 3 | GLIBC_2.27 gai_suspend F 4 | GLIBC_2.27 getaddrinfo_a F 5 | -------------------------------------------------------------------------------- /autobuild/abiversions/libutil.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 forkpty F 2 | GLIBC_2.27 login F 3 | GLIBC_2.27 login_tty F 4 | GLIBC_2.27 logout F 5 | GLIBC_2.27 logwtmp F 6 | GLIBC_2.27 openpty F 7 | -------------------------------------------------------------------------------- /autobuild/abiversions/libcrypt.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 crypt F 2 | GLIBC_2.27 crypt_r F 3 | GLIBC_2.27 encrypt F 4 | GLIBC_2.27 encrypt_r F 5 | GLIBC_2.27 fcrypt F 6 | GLIBC_2.27 setkey F 7 | GLIBC_2.27 setkey_r F 8 | -------------------------------------------------------------------------------- /autobuild/defines: -------------------------------------------------------------------------------- 1 | PKGNAME=liblol 2 | PKGSEC=utils 3 | PKGDES="Compatibility layer for running applications designed for \"Old World\" LoongArch systems" 4 | 5 | NOLTO=1 6 | 7 | FAIL_ARCH="!(loongarch64|loongarch64_nosimd)" 8 | BUILDDEP="" 9 | -------------------------------------------------------------------------------- /autobuild/abiversions/libdl.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 dladdr F 2 | GLIBC_2.27 dladdr1 F 3 | GLIBC_2.27 dlclose F 4 | GLIBC_2.27 dlerror F 5 | GLIBC_2.27 dlinfo F 6 | GLIBC_2.27 dlmopen F 7 | GLIBC_2.27 dlopen F 8 | GLIBC_2.27 dlsym F 9 | GLIBC_2.27 dlvsym F 10 | -------------------------------------------------------------------------------- /autobuild/abiversions/ld.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 __libc_stack_end D 0x8 2 | GLIBC_2.27 __stack_chk_guard D 0x8 3 | GLIBC_2.27 __tls_get_addr F 4 | GLIBC_2.27 _dl_mcount F 5 | GLIBC_2.27 _r_debug D 0x28 6 | GLIBC_2.27 calloc F 7 | GLIBC_2.27 free F 8 | GLIBC_2.27 malloc F 9 | GLIBC_2.27 realloc F 10 | -------------------------------------------------------------------------------- /autobuild/additional-files/hooks/postinst.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -o pipefail 3 | 4 | if ! systemd-detect-virt --container >/dev/null ; then 5 | echo "Loading the la_ow_syscall (old-world syscall compatibility) kernel module ..." 6 | modprobe la_ow_syscall || \ 7 | echo " 8 | Warning: The la_ow_syscall kernel module does not appear to be available. 9 | Old-world applications may not run. 10 | " 11 | fi 12 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/series: -------------------------------------------------------------------------------- 1 | 0001-BACKPORT-UPSTREAM-stdlib-resolve-a-double-lock-init-.patch 2 | 0002-add-old-world-abi-compatibility.patch 3 | 0003-add-sigset-ops.patch 4 | 0004-add-signal-functions.patch 5 | 0005-add-sigaction-ucontext-compat.patch 6 | 0006-add-stubs-for-signal-related-io-funcs.patch 7 | 0007-add-syscall-fallback-for-stat-at.patch 8 | 0008-add-more-pthread-symbols.patch 9 | 0009-remove-clone3-for-compatibility-with-qq.patch 10 | 0010-prepend-trusted-dirs.patch 11 | 0011-Add-___brk_addr-symbol.patch 12 | 0012-siglist-errlist-add-compact-statements.patch 13 | -------------------------------------------------------------------------------- /spec: -------------------------------------------------------------------------------- 1 | VER=0.1.10 2 | __GLIBC_VER=2.42 3 | __LIBXCRYPT_VER=4.5.2 4 | 5 | SRCS="\ 6 | file::rename=glibc.tar.xz::https://ftp.gnu.org/gnu/glibc/glibc-${__GLIBC_VER}.tar.xz \ 7 | file::rename=patchelf.tar.gz::https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0.tar.gz \ 8 | file::rename=libxcrypt.tar.xz::https://github.com/besser82/libxcrypt/releases/download/v${__LIBXCRYPT_VER}/libxcrypt-${__LIBXCRYPT_VER}.tar.xz \ 9 | " 10 | CHKSUMS="sha256::d1775e32e4628e64ef930f435b67bb63af7599acb6be2b335b9f19f16509f17f \ 11 | sha256::64de10e4c6b8b8379db7e87f58030f336ea747c0515f381132e810dbf84a86e7 \ 12 | sha256::71513a31c01a428bccd5367a32fd95f115d6dac50fb5b60c779d5c7942aec071" 13 | -------------------------------------------------------------------------------- /README.zh.md: -------------------------------------------------------------------------------- 1 | libLoL 2 | ====== 3 | 4 | libLoL (LoongArch on LoongArch) 是一款用于提供旧世界 ABI 兼容性的运行时。旧世界 ABI 常用于为龙芯官方的 Loongnix 参考发行和统信 UOS 设计的商业软件,如: 5 | 6 | - 腾讯 QQ Linux 版 7 | - 金山 WPS for Linux 8 | - 龙芯浏览器(基于 Chromium) 9 | 10 | 由于这些应用程序尚未移植到新世界 ABI 上,本运行时旨在为新世界发行版用户提供运行上述应用程序的便利。欲知有关新旧世界应用不兼容来由的相关信息,请见龙芯开源社区《咱龙了吗?》站点的[《新世界与旧世界》](https://areweloongyet.com/docs/old-and-new-worlds/)一文。 11 | 12 | 组件 13 | ---- 14 | 15 | libLoL 由内核空间和用户空间两个组件组成: 16 | 17 | - 内核部分:通过 [la_ow_syscall](https://github.com/AOSC-Dev/la_ow_syscall) 模块,给 Linux 内核新增旧世界系统调用支持,进而使得新世界内核得以兼容旧世界运行时和应用程序 18 | - 用户空间部分:给 [Glibc 打补丁](https://github.com/AOSC-Dev/glibc-loongarch-oldworld)以提供旧世界应用程序所需符号的兼容性。其余运行时库由发行版软件包或 [Loongnix](https://www.loongson.cn/system/loongnix) 的二进制软件包提供。 19 | 20 | 报告问题 21 | -------- 22 | 23 | 请使用本仓库的[工单系统](https://github.com/AOSC-Dev/liblol/issues) 报告有关开发和使用方面的问题。您也可以通过我社的[聊天群组](https://aosc.io/zh-cn/contact/)报告问题。 24 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0011-Add-___brk_addr-symbol.patch: -------------------------------------------------------------------------------- 1 | From 72ab57d4638462dbd3cc2aada6694eaa30af7b6c Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Mon, 15 Jan 2024 04:16:47 +0800 4 | Subject: [PATCH 11/12] Add ___brk_addr symbol 5 | 6 | --- 7 | sysdeps/unix/sysv/linux/loongarch/brk.c | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/brk.c 10 | 11 | diff --git a/sysdeps/unix/sysv/linux/loongarch/brk.c b/sysdeps/unix/sysv/linux/loongarch/brk.c 12 | new file mode 100644 13 | index 0000000000..82c285f452 14 | --- /dev/null 15 | +++ b/sysdeps/unix/sysv/linux/loongarch/brk.c 16 | @@ -0,0 +1,9 @@ 17 | +#include 18 | + 19 | +#if LIB_COMPAT(libc, GLIBC_2_27, GLIBC_2_36) 20 | +#include 21 | +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL 22 | +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 23 | +#endif 24 | + 25 | +#include 26 | -- 27 | 2.52.0 28 | 29 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0009-remove-clone3-for-compatibility-with-qq.patch: -------------------------------------------------------------------------------- 1 | From ec8d7d9e099adc2bb22079da31e6d56797faa399 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sun, 14 Jan 2024 16:51:44 +0800 4 | Subject: [PATCH 09/12] remove clone3 for compatibility with qq 5 | 6 | --- 7 | sysdeps/unix/sysv/linux/loongarch/clone-internal.c | 8 ++++++++ 8 | 1 file changed, 8 insertions(+) 9 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/clone-internal.c 10 | 11 | diff --git a/sysdeps/unix/sysv/linux/loongarch/clone-internal.c b/sysdeps/unix/sysv/linux/loongarch/clone-internal.c 12 | new file mode 100644 13 | index 0000000000..e01ce980bc 14 | --- /dev/null 15 | +++ b/sysdeps/unix/sysv/linux/loongarch/clone-internal.c 16 | @@ -0,0 +1,8 @@ 17 | +#include 18 | + 19 | +#if LIB_COMPAT(libc, GLIBC_2_27, GLIBC_2_36) 20 | +#include 21 | +#undef HAVE_CLONE3_WRAPPER 22 | +#endif 23 | + 24 | +#include 25 | -- 26 | 2.52.0 27 | 28 | -------------------------------------------------------------------------------- /autobuild/abiversions/librt.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 __mq_open_2 F 2 | GLIBC_2.27 aio_cancel F 3 | GLIBC_2.27 aio_cancel64 F 4 | GLIBC_2.27 aio_error F 5 | GLIBC_2.27 aio_error64 F 6 | GLIBC_2.27 aio_fsync F 7 | GLIBC_2.27 aio_fsync64 F 8 | GLIBC_2.27 aio_init F 9 | GLIBC_2.27 aio_read F 10 | GLIBC_2.27 aio_read64 F 11 | GLIBC_2.27 aio_return F 12 | GLIBC_2.27 aio_return64 F 13 | GLIBC_2.27 aio_suspend F 14 | GLIBC_2.27 aio_suspend64 F 15 | GLIBC_2.27 aio_write F 16 | GLIBC_2.27 aio_write64 F 17 | GLIBC_2.27 lio_listio F 18 | GLIBC_2.27 lio_listio64 F 19 | GLIBC_2.27 mq_close F 20 | GLIBC_2.27 mq_getattr F 21 | GLIBC_2.27 mq_notify F 22 | GLIBC_2.27 mq_open F 23 | GLIBC_2.27 mq_receive F 24 | GLIBC_2.27 mq_send F 25 | GLIBC_2.27 mq_setattr F 26 | GLIBC_2.27 mq_timedreceive F 27 | GLIBC_2.27 mq_timedsend F 28 | GLIBC_2.27 mq_unlink F 29 | GLIBC_2.27 shm_open F 30 | GLIBC_2.27 shm_unlink F 31 | GLIBC_2.27 timer_create F 32 | GLIBC_2.27 timer_delete F 33 | GLIBC_2.27 timer_getoverrun F 34 | GLIBC_2.27 timer_gettime F 35 | GLIBC_2.27 timer_settime F 36 | -------------------------------------------------------------------------------- /autobuild/abiversions/libthread_db.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 td_init F 2 | GLIBC_2.27 td_log F 3 | GLIBC_2.27 td_symbol_list F 4 | GLIBC_2.27 td_ta_clear_event F 5 | GLIBC_2.27 td_ta_delete F 6 | GLIBC_2.27 td_ta_enable_stats F 7 | GLIBC_2.27 td_ta_event_addr F 8 | GLIBC_2.27 td_ta_event_getmsg F 9 | GLIBC_2.27 td_ta_get_nthreads F 10 | GLIBC_2.27 td_ta_get_ph F 11 | GLIBC_2.27 td_ta_get_stats F 12 | GLIBC_2.27 td_ta_map_id2thr F 13 | GLIBC_2.27 td_ta_map_lwp2thr F 14 | GLIBC_2.27 td_ta_new F 15 | GLIBC_2.27 td_ta_reset_stats F 16 | GLIBC_2.27 td_ta_set_event F 17 | GLIBC_2.27 td_ta_setconcurrency F 18 | GLIBC_2.27 td_ta_thr_iter F 19 | GLIBC_2.27 td_ta_tsd_iter F 20 | GLIBC_2.27 td_thr_clear_event F 21 | GLIBC_2.27 td_thr_dbresume F 22 | GLIBC_2.27 td_thr_dbsuspend F 23 | GLIBC_2.27 td_thr_event_enable F 24 | GLIBC_2.27 td_thr_event_getmsg F 25 | GLIBC_2.27 td_thr_get_info F 26 | GLIBC_2.27 td_thr_getfpregs F 27 | GLIBC_2.27 td_thr_getgregs F 28 | GLIBC_2.27 td_thr_getxregs F 29 | GLIBC_2.27 td_thr_getxregsize F 30 | GLIBC_2.27 td_thr_set_event F 31 | GLIBC_2.27 td_thr_setfpregs F 32 | GLIBC_2.27 td_thr_setgregs F 33 | GLIBC_2.27 td_thr_setprio F 34 | GLIBC_2.27 td_thr_setsigpending F 35 | GLIBC_2.27 td_thr_setxregs F 36 | GLIBC_2.27 td_thr_sigsetmask F 37 | GLIBC_2.27 td_thr_tls_get_addr F 38 | GLIBC_2.27 td_thr_tlsbase F 39 | GLIBC_2.27 td_thr_tsd F 40 | GLIBC_2.27 td_thr_validate F 41 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0012-siglist-errlist-add-compact-statements.patch: -------------------------------------------------------------------------------- 1 | From 8d63bb943b911a35c0f6f1f80283ccb43cc667f3 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sun, 10 Mar 2024 02:54:28 +0800 4 | Subject: [PATCH 12/12] siglist/errlist: add compact statements 5 | 6 | to make the length of symbols the same 7 | --- 8 | sysdeps/unix/sysv/linux/loongarch/errlist-compat-data.h | 8 ++++++++ 9 | sysdeps/unix/sysv/linux/loongarch/siglist-compat.h | 6 ++++++ 10 | 2 files changed, 14 insertions(+) 11 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/errlist-compat-data.h 12 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/siglist-compat.h 13 | 14 | diff --git a/sysdeps/unix/sysv/linux/loongarch/errlist-compat-data.h b/sysdeps/unix/sysv/linux/loongarch/errlist-compat-data.h 15 | new file mode 100644 16 | index 0000000000..5998ae2501 17 | --- /dev/null 18 | +++ b/sysdeps/unix/sysv/linux/loongarch/errlist-compat-data.h 19 | @@ -0,0 +1,8 @@ 20 | +#include 21 | + 22 | +// See sysdeps/unix/sysv/linux/loongarch/Versions of ow glibc 2.28 23 | +// They copied from mips, so we also copy the corresponding 24 | +// errlist-compat statements from mips 25 | +#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_32) 26 | +DEFINE_COMPAT_ERRLIST (1134, GLIBC_2_1) 27 | +#endif 28 | diff --git a/sysdeps/unix/sysv/linux/loongarch/siglist-compat.h b/sysdeps/unix/sysv/linux/loongarch/siglist-compat.h 29 | new file mode 100644 30 | index 0000000000..4b89f5fee8 31 | --- /dev/null 32 | +++ b/sysdeps/unix/sysv/linux/loongarch/siglist-compat.h 33 | @@ -0,0 +1,6 @@ 34 | +#include 35 | +#include 36 | + 37 | +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_32) 38 | +DEFINE_COMPAT_SIGLIST (__OW_NSIG, GLIBC_2_3_3) 39 | +#endif 40 | -- 41 | 2.52.0 42 | 43 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0001-BACKPORT-UPSTREAM-stdlib-resolve-a-double-lock-init-.patch: -------------------------------------------------------------------------------- 1 | From 5bdcac84f59f8f93e5bf177b281bb1179a5bbd74 Mon Sep 17 00:00:00 2001 2 | From: Davide Cavalca 3 | Date: Thu, 31 Jul 2025 17:32:58 +0200 4 | Subject: [PATCH 01/12] BACKPORT: UPSTREAM: stdlib: resolve a double lock init 5 | issue after fork [BZ #32994] 6 | 7 | The __abort_fork_reset_child (introduced in 8 | d40ac01cbbc66e6d9dbd8e3485605c63b2178251) call resets the lock after the 9 | fork. This causes a DRD regression in valgrind 10 | (https://bugs.kde.org/show_bug.cgi?id=503668), as it's effectively a 11 | double initialization, despite it being actually ok in this case. As 12 | suggested in https://sourceware.org/bugzilla/show_bug.cgi?id=32994#c2 13 | we replace it here with a memcpy of another initialized lock instead, 14 | which makes valgrind happy. 15 | 16 | Reviewed-by: Florian Weimer 17 | (cherry picked from commit d9a348d0927c7a1aec5caf3df3fcd36956b3eb23) 18 | 19 | [Mingcong Bai: Resolved a minor merge conflict in NEWS.] 20 | 21 | Signed-off-by: Mingcong Bai 22 | --- 23 | stdlib/abort.c | 6 +++++- 24 | 1 file changed, 5 insertions(+), 1 deletion(-) 25 | 26 | diff --git a/stdlib/abort.c b/stdlib/abort.c 27 | index caa9e6dc04..904244a2fb 100644 28 | --- a/stdlib/abort.c 29 | +++ b/stdlib/abort.c 30 | @@ -19,6 +19,7 @@ 31 | #include 32 | #include 33 | #include 34 | +#include 35 | #include 36 | 37 | /* Try to get a machine dependent instruction which will make the 38 | @@ -42,7 +43,10 @@ __libc_rwlock_define_initialized (static, lock); 39 | void 40 | __abort_fork_reset_child (void) 41 | { 42 | - __libc_rwlock_init (lock); 43 | + /* Reinitialize lock without calling pthread_rwlock_init, to 44 | + avoid a valgrind DRD false positive. */ 45 | + __libc_rwlock_define_initialized (, reset_lock); 46 | + memcpy (&lock, &reset_lock, sizeof (lock)); 47 | } 48 | 49 | void 50 | -- 51 | 2.52.0 52 | 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | libLoL 2 | ====== 3 | 4 | 简体中文自述文档请见[此处](README.zh.md) 5 | 6 | libLoL (LoongArch on LoongArch) is a compatibility runtime for applications 7 | designed for LoongArch's old-world ABI. By and large, these are applications 8 | built for Loongson's Loongnix reference Linux distribution and UnionTech's 9 | UOS, consisting mostly commercial applications designed for the mainland 10 | Chinese market, such as: 11 | 12 | - Tencent's QQ for Linux 13 | - Kingsoft's WPS for Linux 14 | - Loongson Browser (based on Chromium) 15 | 16 | As these applications have not yet been ported to the new-world ABI, this 17 | runtime is meant to provide help users of new-world Linux distributions use 18 | the aforementioned applications. 19 | 20 | For a brief introduction on old-world and new-world incompatibility, please 21 | refer to [this essay](https://areweloongyet.com/docs/old-and-new-worlds/) (in 22 | Chinese) from the Loongson Open Source Community's *Are We Loong Yet?* site. 23 | 24 | Components 25 | ---------- 26 | 27 | libLoL consists of two components, one in the kernel-space and the other in 28 | the user-space. 29 | 30 | - Kernel: The [la_ow_syscall](https://github.com/AOSC-Dev/la_ow_syscall) 31 | modules provides support for old-world system call support in the Linux 32 | Kernel, making it possible to run old-world applications on new-world 33 | (upstream) kernels. 34 | - User-space: A [patched Glibc](https://github.com/AOSC-Dev/glibc-loongarch-oldworld) 35 | provides symbol support for old-world applications - see the Autobuild 36 | building procedure in this repository. Additional runtime may be provided 37 | by the distribution or in binary form from [Loongnix](https://www.loongson.cn/system/loongnix). 38 | 39 | Reporting Issues 40 | ---------------- 41 | 42 | Please use the [Issues](https://github.com/AOSC-Dev/liblol/issues) function 43 | for reporting any developer or user issues (feel free to use English or 44 | Chinese). 45 | 46 | You are also welcome to report issues at AOSC's various 47 | [chat groups](https://aosc.io/contact/). 48 | -------------------------------------------------------------------------------- /autobuild/abiversions/libresolv.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 __b64_ntop F 2 | GLIBC_2.27 __b64_pton F 3 | GLIBC_2.27 __dn_comp F 4 | GLIBC_2.27 __dn_count_labels F 5 | GLIBC_2.27 __dn_expand F 6 | GLIBC_2.27 __dn_skipname F 7 | GLIBC_2.27 __fp_nquery F 8 | GLIBC_2.27 __fp_query F 9 | GLIBC_2.27 __fp_resstat F 10 | GLIBC_2.27 __hostalias F 11 | GLIBC_2.27 __loc_aton F 12 | GLIBC_2.27 __loc_ntoa F 13 | GLIBC_2.27 __p_cdname F 14 | GLIBC_2.27 __p_cdnname F 15 | GLIBC_2.27 __p_class F 16 | GLIBC_2.27 __p_class_syms D 0xa8 17 | GLIBC_2.27 __p_fqname F 18 | GLIBC_2.27 __p_fqnname F 19 | GLIBC_2.27 __p_option F 20 | GLIBC_2.27 __p_query F 21 | GLIBC_2.27 __p_rcode F 22 | GLIBC_2.27 __p_time F 23 | GLIBC_2.27 __p_type F 24 | GLIBC_2.27 __p_type_syms D 0x450 25 | GLIBC_2.27 __putlong F 26 | GLIBC_2.27 __putshort F 27 | GLIBC_2.27 __res_close F 28 | GLIBC_2.27 __res_dnok F 29 | GLIBC_2.27 __res_hnok F 30 | GLIBC_2.27 __res_hostalias F 31 | GLIBC_2.27 __res_isourserver F 32 | GLIBC_2.27 __res_mailok F 33 | GLIBC_2.27 __res_mkquery F 34 | GLIBC_2.27 __res_nameinquery F 35 | GLIBC_2.27 __res_nmkquery F 36 | GLIBC_2.27 __res_nquery F 37 | GLIBC_2.27 __res_nquerydomain F 38 | GLIBC_2.27 __res_nsearch F 39 | GLIBC_2.27 __res_nsend F 40 | GLIBC_2.27 __res_ownok F 41 | GLIBC_2.27 __res_queriesmatch F 42 | GLIBC_2.27 __res_query F 43 | GLIBC_2.27 __res_querydomain F 44 | GLIBC_2.27 __res_search F 45 | GLIBC_2.27 __res_send F 46 | GLIBC_2.27 __sym_ntop F 47 | GLIBC_2.27 __sym_ntos F 48 | GLIBC_2.27 __sym_ston F 49 | GLIBC_2.27 _getlong F 50 | GLIBC_2.27 _getshort F 51 | GLIBC_2.27 inet_net_ntop F 52 | GLIBC_2.27 inet_net_pton F 53 | GLIBC_2.27 inet_neta F 54 | GLIBC_2.27 ns_datetosecs F 55 | GLIBC_2.27 ns_format_ttl F 56 | GLIBC_2.27 ns_get16 F 57 | GLIBC_2.27 ns_get32 F 58 | GLIBC_2.27 ns_initparse F 59 | GLIBC_2.27 ns_makecanon F 60 | GLIBC_2.27 ns_msg_getflag F 61 | GLIBC_2.27 ns_name_compress F 62 | GLIBC_2.27 ns_name_ntol F 63 | GLIBC_2.27 ns_name_ntop F 64 | GLIBC_2.27 ns_name_pack F 65 | GLIBC_2.27 ns_name_pton F 66 | GLIBC_2.27 ns_name_rollback F 67 | GLIBC_2.27 ns_name_skip F 68 | GLIBC_2.27 ns_name_uncompress F 69 | GLIBC_2.27 ns_name_unpack F 70 | GLIBC_2.27 ns_parse_ttl F 71 | GLIBC_2.27 ns_parserr F 72 | GLIBC_2.27 ns_put16 F 73 | GLIBC_2.27 ns_put32 F 74 | GLIBC_2.27 ns_samedomain F 75 | GLIBC_2.27 ns_samename F 76 | GLIBC_2.27 ns_skiprr F 77 | GLIBC_2.27 ns_sprintrr F 78 | GLIBC_2.27 ns_sprintrrf F 79 | GLIBC_2.27 ns_subdomain F 80 | -------------------------------------------------------------------------------- /autobuild/abiversions/libnsl.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 __free_fdresult F 2 | GLIBC_2.27 __nis_default_access F 3 | GLIBC_2.27 __nis_default_group F 4 | GLIBC_2.27 __nis_default_owner F 5 | GLIBC_2.27 __nis_default_ttl F 6 | GLIBC_2.27 __nis_finddirectory F 7 | GLIBC_2.27 __nisbind_connect F 8 | GLIBC_2.27 __nisbind_create F 9 | GLIBC_2.27 __nisbind_destroy F 10 | GLIBC_2.27 __nisbind_next F 11 | GLIBC_2.27 __yp_check F 12 | GLIBC_2.27 nis_add F 13 | GLIBC_2.27 nis_add_entry F 14 | GLIBC_2.27 nis_addmember F 15 | GLIBC_2.27 nis_checkpoint F 16 | GLIBC_2.27 nis_clone_directory F 17 | GLIBC_2.27 nis_clone_object F 18 | GLIBC_2.27 nis_clone_result F 19 | GLIBC_2.27 nis_creategroup F 20 | GLIBC_2.27 nis_destroy_object F 21 | GLIBC_2.27 nis_destroygroup F 22 | GLIBC_2.27 nis_dir_cmp F 23 | GLIBC_2.27 nis_domain_of F 24 | GLIBC_2.27 nis_domain_of_r F 25 | GLIBC_2.27 nis_first_entry F 26 | GLIBC_2.27 nis_free_directory F 27 | GLIBC_2.27 nis_free_object F 28 | GLIBC_2.27 nis_free_request F 29 | GLIBC_2.27 nis_freenames F 30 | GLIBC_2.27 nis_freeresult F 31 | GLIBC_2.27 nis_freeservlist F 32 | GLIBC_2.27 nis_freetags F 33 | GLIBC_2.27 nis_getnames F 34 | GLIBC_2.27 nis_getservlist F 35 | GLIBC_2.27 nis_ismember F 36 | GLIBC_2.27 nis_leaf_of F 37 | GLIBC_2.27 nis_leaf_of_r F 38 | GLIBC_2.27 nis_lerror F 39 | GLIBC_2.27 nis_list F 40 | GLIBC_2.27 nis_local_directory F 41 | GLIBC_2.27 nis_local_group F 42 | GLIBC_2.27 nis_local_host F 43 | GLIBC_2.27 nis_local_principal F 44 | GLIBC_2.27 nis_lookup F 45 | GLIBC_2.27 nis_mkdir F 46 | GLIBC_2.27 nis_modify F 47 | GLIBC_2.27 nis_modify_entry F 48 | GLIBC_2.27 nis_name_of F 49 | GLIBC_2.27 nis_name_of_r F 50 | GLIBC_2.27 nis_next_entry F 51 | GLIBC_2.27 nis_perror F 52 | GLIBC_2.27 nis_ping F 53 | GLIBC_2.27 nis_print_directory F 54 | GLIBC_2.27 nis_print_entry F 55 | GLIBC_2.27 nis_print_group F 56 | GLIBC_2.27 nis_print_group_entry F 57 | GLIBC_2.27 nis_print_link F 58 | GLIBC_2.27 nis_print_object F 59 | GLIBC_2.27 nis_print_result F 60 | GLIBC_2.27 nis_print_rights F 61 | GLIBC_2.27 nis_print_table F 62 | GLIBC_2.27 nis_read_obj F 63 | GLIBC_2.27 nis_remove F 64 | GLIBC_2.27 nis_remove_entry F 65 | GLIBC_2.27 nis_removemember F 66 | GLIBC_2.27 nis_rmdir F 67 | GLIBC_2.27 nis_servstate F 68 | GLIBC_2.27 nis_sperrno F 69 | GLIBC_2.27 nis_sperror F 70 | GLIBC_2.27 nis_sperror_r F 71 | GLIBC_2.27 nis_stats F 72 | GLIBC_2.27 nis_verifygroup F 73 | GLIBC_2.27 nis_write_obj F 74 | GLIBC_2.27 readColdStartFile F 75 | GLIBC_2.27 writeColdStartFile F 76 | GLIBC_2.27 xdr_cback_data F 77 | GLIBC_2.27 xdr_domainname F 78 | GLIBC_2.27 xdr_keydat F 79 | GLIBC_2.27 xdr_mapname F 80 | GLIBC_2.27 xdr_obj_p F 81 | GLIBC_2.27 xdr_peername F 82 | GLIBC_2.27 xdr_valdat F 83 | GLIBC_2.27 xdr_yp_buf F 84 | GLIBC_2.27 xdr_ypall F 85 | GLIBC_2.27 xdr_ypbind_binding F 86 | GLIBC_2.27 xdr_ypbind_resp F 87 | GLIBC_2.27 xdr_ypbind_resptype F 88 | GLIBC_2.27 xdr_ypbind_setdom F 89 | GLIBC_2.27 xdr_ypdelete_args F 90 | GLIBC_2.27 xdr_ypmap_parms F 91 | GLIBC_2.27 xdr_ypmaplist F 92 | GLIBC_2.27 xdr_yppush_status F 93 | GLIBC_2.27 xdr_yppushresp_xfr F 94 | GLIBC_2.27 xdr_ypreq_key F 95 | GLIBC_2.27 xdr_ypreq_nokey F 96 | GLIBC_2.27 xdr_ypreq_xfr F 97 | GLIBC_2.27 xdr_ypresp_all F 98 | GLIBC_2.27 xdr_ypresp_key_val F 99 | GLIBC_2.27 xdr_ypresp_maplist F 100 | GLIBC_2.27 xdr_ypresp_master F 101 | GLIBC_2.27 xdr_ypresp_order F 102 | GLIBC_2.27 xdr_ypresp_val F 103 | GLIBC_2.27 xdr_ypresp_xfr F 104 | GLIBC_2.27 xdr_ypstat F 105 | GLIBC_2.27 xdr_ypupdate_args F 106 | GLIBC_2.27 xdr_ypxfrstat F 107 | GLIBC_2.27 yp_all F 108 | GLIBC_2.27 yp_bind F 109 | GLIBC_2.27 yp_first F 110 | GLIBC_2.27 yp_get_default_domain F 111 | GLIBC_2.27 yp_maplist F 112 | GLIBC_2.27 yp_master F 113 | GLIBC_2.27 yp_match F 114 | GLIBC_2.27 yp_next F 115 | GLIBC_2.27 yp_order F 116 | GLIBC_2.27 yp_unbind F 117 | GLIBC_2.27 yp_update F 118 | GLIBC_2.27 ypbinderr_string F 119 | GLIBC_2.27 yperr_string F 120 | GLIBC_2.27 ypprot_err F 121 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0006-add-stubs-for-signal-related-io-funcs.patch: -------------------------------------------------------------------------------- 1 | From b8198dc6fe22e925fc3eb0a68676d7e23c5d6f04 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sat, 13 Jan 2024 07:38:04 +0800 4 | Subject: [PATCH 06/12] add stubs for signal related io funcs 5 | 6 | --- 7 | sysdeps/unix/sysv/linux/loongarch/epoll_pwait.c | 1 + 8 | sysdeps/unix/sysv/linux/loongarch/epoll_pwait2.c | 1 + 9 | sysdeps/unix/sysv/linux/loongarch/ppoll.c | 1 + 10 | sysdeps/unix/sysv/linux/loongarch/ppoll_chk.c | 1 + 11 | sysdeps/unix/sysv/linux/loongarch/pselect.c | 1 + 12 | sysdeps/unix/sysv/linux/loongarch/signalfd.c | 1 + 13 | sysdeps/unix/sysv/linux/loongarch/spawnattr_getdefault.c | 1 + 14 | sysdeps/unix/sysv/linux/loongarch/spawnattr_getsigmask.c | 1 + 15 | 8 files changed, 8 insertions(+) 16 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/epoll_pwait.c 17 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/epoll_pwait2.c 18 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ppoll.c 19 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ppoll_chk.c 20 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/pselect.c 21 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/signalfd.c 22 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/spawnattr_getdefault.c 23 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/spawnattr_getsigmask.c 24 | 25 | diff --git a/sysdeps/unix/sysv/linux/loongarch/epoll_pwait.c b/sysdeps/unix/sysv/linux/loongarch/epoll_pwait.c 26 | new file mode 100644 27 | index 0000000000..5810355b7e 28 | --- /dev/null 29 | +++ b/sysdeps/unix/sysv/linux/loongarch/epoll_pwait.c 30 | @@ -0,0 +1 @@ 31 | +#include 32 | diff --git a/sysdeps/unix/sysv/linux/loongarch/epoll_pwait2.c b/sysdeps/unix/sysv/linux/loongarch/epoll_pwait2.c 33 | new file mode 100644 34 | index 0000000000..1c7586a4b5 35 | --- /dev/null 36 | +++ b/sysdeps/unix/sysv/linux/loongarch/epoll_pwait2.c 37 | @@ -0,0 +1 @@ 38 | +#include 39 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ppoll.c b/sysdeps/unix/sysv/linux/loongarch/ppoll.c 40 | new file mode 100644 41 | index 0000000000..65b7258b23 42 | --- /dev/null 43 | +++ b/sysdeps/unix/sysv/linux/loongarch/ppoll.c 44 | @@ -0,0 +1 @@ 45 | +#include 46 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ppoll_chk.c b/sysdeps/unix/sysv/linux/loongarch/ppoll_chk.c 47 | new file mode 100644 48 | index 0000000000..638bd42c31 49 | --- /dev/null 50 | +++ b/sysdeps/unix/sysv/linux/loongarch/ppoll_chk.c 51 | @@ -0,0 +1 @@ 52 | +#include 53 | diff --git a/sysdeps/unix/sysv/linux/loongarch/pselect.c b/sysdeps/unix/sysv/linux/loongarch/pselect.c 54 | new file mode 100644 55 | index 0000000000..224a88aa90 56 | --- /dev/null 57 | +++ b/sysdeps/unix/sysv/linux/loongarch/pselect.c 58 | @@ -0,0 +1 @@ 59 | +#include 60 | diff --git a/sysdeps/unix/sysv/linux/loongarch/signalfd.c b/sysdeps/unix/sysv/linux/loongarch/signalfd.c 61 | new file mode 100644 62 | index 0000000000..dc0ab6db79 63 | --- /dev/null 64 | +++ b/sysdeps/unix/sysv/linux/loongarch/signalfd.c 65 | @@ -0,0 +1 @@ 66 | +#include 67 | diff --git a/sysdeps/unix/sysv/linux/loongarch/spawnattr_getdefault.c b/sysdeps/unix/sysv/linux/loongarch/spawnattr_getdefault.c 68 | new file mode 100644 69 | index 0000000000..0d6e3feb02 70 | --- /dev/null 71 | +++ b/sysdeps/unix/sysv/linux/loongarch/spawnattr_getdefault.c 72 | @@ -0,0 +1 @@ 73 | +#include 74 | diff --git a/sysdeps/unix/sysv/linux/loongarch/spawnattr_getsigmask.c b/sysdeps/unix/sysv/linux/loongarch/spawnattr_getsigmask.c 75 | new file mode 100644 76 | index 0000000000..192980c66c 77 | --- /dev/null 78 | +++ b/sysdeps/unix/sysv/linux/loongarch/spawnattr_getsigmask.c 79 | @@ -0,0 +1 @@ 80 | +#include 81 | -- 82 | 2.52.0 83 | 84 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0010-prepend-trusted-dirs.patch: -------------------------------------------------------------------------------- 1 | From 3ffdb2ede4e757c237ba94815ade75bd3e22ebf4 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sun, 14 Jan 2024 13:28:41 +0800 4 | Subject: [PATCH 10/12] prepend trusted-dirs 5 | 6 | and search prepended trusted-dirs before other pathes 7 | --- 8 | elf/Makefile | 3 ++- 9 | elf/dl-load.c | 26 ++++++++++++++++++++++++-- 10 | 2 files changed, 26 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/elf/Makefile b/elf/Makefile 13 | index 48aa0b57e5..90c7062251 100644 14 | --- a/elf/Makefile 15 | +++ b/elf/Makefile 16 | @@ -1563,9 +1563,10 @@ endif 17 | $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @: 18 | $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig 19 | $(make-target-directory) 20 | - echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \ 21 | + echo "$(subst :, ,$(user-defined-trusted-dirs-pre) $(default-rpath) $(user-defined-trusted-dirs))" \ 22 | | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; 23 | echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T} 24 | + echo '#define SYSTEM_DIRS_PRE_COUNT $(words $(subst :, ,$(user-defined-trusted-dirs-pre)))' >> ${@:st=T} 25 | $(move-if-change) ${@:st=T} ${@:st=h} 26 | touch $@ 27 | CPPFLAGS-dl-load.c += -I$(objpfx). -I$(csu-objpfx). 28 | diff --git a/elf/dl-load.c b/elf/dl-load.c 29 | index 00b9da9ec7..05db6ab86a 100644 30 | --- a/elf/dl-load.c 31 | +++ b/elf/dl-load.c 32 | @@ -113,6 +113,9 @@ static const size_t system_dirs_len[] = 33 | SYSTEM_DIRS_LEN 34 | }; 35 | #define nsystem_dirs_len array_length (system_dirs_len) 36 | +#define normal_system_dirs_len (nsystem_dirs_len - SYSTEM_DIRS_PRE_COUNT) 37 | + 38 | +static_assert (SYSTEM_DIRS_PRE_COUNT < nsystem_dirs_len, "should have at least one system dir"); 39 | 40 | static bool 41 | is_trusted_path_normalize (const char *path, size_t len) 42 | @@ -697,7 +700,7 @@ _dl_init_paths (const char *llp, const char *source, 43 | 44 | /* First set up the rest of the default search directory entries. */ 45 | aelem = __rtld_search_dirs.dirs = (struct r_search_path_elem **) 46 | - malloc ((nsystem_dirs_len + 1) * sizeof (struct r_search_path_elem *)); 47 | + malloc ((nsystem_dirs_len + 2) * sizeof (struct r_search_path_elem *)); 48 | if (__rtld_search_dirs.dirs == NULL) 49 | { 50 | errstring = N_("cannot create search path array"); 51 | @@ -722,11 +725,17 @@ _dl_init_paths (const char *llp, const char *source, 52 | pelem = GL(dl_all_dirs) = __rtld_search_dirs.dirs[0]; 53 | strp = system_dirs; 54 | idx = 0; 55 | + aelem = &__rtld_search_dirs.dirs[normal_system_dirs_len + 1]; 56 | 57 | do 58 | { 59 | size_t cnt; 60 | 61 | + if (aelem == &__rtld_search_dirs.dirs[nsystem_dirs_len + 1]){ 62 | + *aelem = NULL; 63 | + aelem = &__rtld_search_dirs.dirs[0]; 64 | + } 65 | + 66 | *aelem++ = pelem; 67 | 68 | pelem->what = "system search path"; 69 | @@ -1972,9 +1981,22 @@ _dl_map_new_object (struct link_map *loader, const char *name, 70 | 71 | fd = -1; 72 | 73 | + if (SYSTEM_DIRS_PRE_COUNT > 0 74 | + && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL 75 | + || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB))) 76 | + && __rtld_search_dirs.dirs != (void *) -1) 77 | + { 78 | + struct r_search_path_struct pre_sp = { 79 | + .dirs = &__rtld_search_dirs.dirs[normal_system_dirs_len + 1], 80 | + .malloced = 0, 81 | + }; 82 | + fd = open_path (name, namelen, mode, &pre_sp, 83 | + &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); 84 | + } 85 | + 86 | /* When the object has the RUNPATH information we don't use any 87 | RPATHs. */ 88 | - if (loader == NULL || loader->l_info[DT_RUNPATH] == NULL) 89 | + if (fd == -1 && (loader == NULL || loader->l_info[DT_RUNPATH] == NULL)) 90 | { 91 | /* This is the executable's map (if there is one). Make sure that 92 | we do not look at it twice. */ 93 | -- 94 | 2.52.0 95 | 96 | -------------------------------------------------------------------------------- /autobuild/abiversions/libpthread.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.0 _IO_flockfile F 2 | GLIBC_2.0 _IO_ftrylockfile F 3 | GLIBC_2.0 _IO_funlockfile F 4 | GLIBC_2.0 __close F 5 | GLIBC_2.0 __connect F 6 | GLIBC_2.0 __errno_location F 7 | GLIBC_2.0 __fcntl F 8 | GLIBC_2.0 __fork F 9 | GLIBC_2.0 __h_errno_location F 10 | GLIBC_2.0 __lseek F 11 | GLIBC_2.0 __open F 12 | GLIBC_2.0 __pthread_getspecific F 13 | GLIBC_2.0 __pthread_key_create F 14 | GLIBC_2.0 __pthread_mutex_destroy F 15 | GLIBC_2.0 __pthread_mutex_init F 16 | GLIBC_2.0 __pthread_mutex_lock F 17 | GLIBC_2.0 __pthread_mutex_trylock F 18 | GLIBC_2.0 __pthread_mutex_unlock F 19 | GLIBC_2.0 __pthread_mutexattr_destroy F 20 | GLIBC_2.0 __pthread_mutexattr_init F 21 | GLIBC_2.0 __pthread_mutexattr_settype F 22 | GLIBC_2.0 __pthread_once F 23 | GLIBC_2.0 __pthread_setspecific F 24 | GLIBC_2.0 __read F 25 | GLIBC_2.0 __send F 26 | GLIBC_2.0 __sigaction F 27 | GLIBC_2.0 __wait F 28 | GLIBC_2.0 __write F 29 | GLIBC_2.0 _pthread_cleanup_pop F 30 | GLIBC_2.0 _pthread_cleanup_pop_restore F 31 | GLIBC_2.0 _pthread_cleanup_push F 32 | GLIBC_2.0 _pthread_cleanup_push_defer F 33 | GLIBC_2.0 accept F 34 | GLIBC_2.0 close F 35 | GLIBC_2.0 connect F 36 | GLIBC_2.0 fcntl F 37 | GLIBC_2.0 flockfile F 38 | GLIBC_2.0 fork F 39 | GLIBC_2.0 fsync F 40 | GLIBC_2.0 ftrylockfile F 41 | GLIBC_2.0 funlockfile F 42 | GLIBC_2.0 longjmp F 43 | GLIBC_2.0 lseek F 44 | GLIBC_2.0 msync F 45 | GLIBC_2.0 nanosleep F 46 | GLIBC_2.0 open F 47 | GLIBC_2.0 pause F 48 | GLIBC_2.0 pthread_atfork F 49 | GLIBC_2.0 pthread_attr_destroy F 50 | GLIBC_2.0 pthread_attr_getdetachstate F 51 | GLIBC_2.0 pthread_attr_getinheritsched F 52 | GLIBC_2.0 pthread_attr_getschedparam F 53 | GLIBC_2.0 pthread_attr_getschedpolicy F 54 | GLIBC_2.0 pthread_attr_getscope F 55 | GLIBC_2.0 pthread_attr_init F 56 | GLIBC_2.0 pthread_attr_setdetachstate F 57 | GLIBC_2.0 pthread_attr_setinheritsched F 58 | GLIBC_2.0 pthread_attr_setschedparam F 59 | GLIBC_2.0 pthread_attr_setschedpolicy F 60 | GLIBC_2.0 pthread_attr_setscope F 61 | GLIBC_2.0 pthread_cancel F 62 | GLIBC_2.0 pthread_cond_broadcast F 63 | GLIBC_2.0 pthread_cond_destroy F 64 | GLIBC_2.0 pthread_cond_init F 65 | GLIBC_2.0 pthread_cond_signal F 66 | GLIBC_2.0 pthread_cond_timedwait F 67 | GLIBC_2.0 pthread_cond_wait F 68 | GLIBC_2.0 pthread_condattr_destroy F 69 | GLIBC_2.0 pthread_condattr_init F 70 | GLIBC_2.0 pthread_create F 71 | GLIBC_2.0 pthread_detach F 72 | GLIBC_2.0 pthread_equal F 73 | GLIBC_2.0 pthread_exit F 74 | GLIBC_2.0 pthread_getschedparam F 75 | GLIBC_2.0 pthread_getspecific F 76 | GLIBC_2.0 pthread_join F 77 | GLIBC_2.0 pthread_key_create F 78 | GLIBC_2.0 pthread_key_delete F 79 | GLIBC_2.0 pthread_kill F 80 | GLIBC_2.0 pthread_kill_other_threads_np F 81 | GLIBC_2.0 pthread_mutex_destroy F 82 | GLIBC_2.0 pthread_mutex_init F 83 | GLIBC_2.0 pthread_mutex_lock F 84 | GLIBC_2.0 pthread_mutex_trylock F 85 | GLIBC_2.0 pthread_mutex_unlock F 86 | GLIBC_2.0 pthread_mutexattr_destroy F 87 | GLIBC_2.0 pthread_mutexattr_getkind_np F 88 | GLIBC_2.0 pthread_mutexattr_init F 89 | GLIBC_2.0 pthread_mutexattr_setkind_np F 90 | GLIBC_2.0 pthread_once F 91 | GLIBC_2.0 pthread_self F 92 | GLIBC_2.0 pthread_setcancelstate F 93 | GLIBC_2.0 pthread_setcanceltype F 94 | GLIBC_2.0 pthread_setschedparam F 95 | GLIBC_2.0 pthread_setspecific F 96 | GLIBC_2.0 pthread_sigmask F 97 | GLIBC_2.0 pthread_testcancel F 98 | GLIBC_2.0 raise F 99 | GLIBC_2.0 read F 100 | GLIBC_2.0 recv F 101 | GLIBC_2.0 recvfrom F 102 | GLIBC_2.0 recvmsg F 103 | GLIBC_2.0 sem_destroy F 104 | GLIBC_2.0 sem_getvalue F 105 | GLIBC_2.0 sem_init F 106 | GLIBC_2.0 sem_post F 107 | GLIBC_2.0 sem_trywait F 108 | GLIBC_2.0 sem_wait F 109 | GLIBC_2.0 send F 110 | GLIBC_2.0 sendmsg F 111 | GLIBC_2.0 sendto F 112 | GLIBC_2.0 sigaction F 113 | GLIBC_2.0 siglongjmp F 114 | GLIBC_2.0 sigwait F 115 | GLIBC_2.0 system F 116 | GLIBC_2.0 tcdrain F 117 | GLIBC_2.0 wait F 118 | GLIBC_2.0 waitpid F 119 | GLIBC_2.0 write F 120 | GLIBC_2.11 pthread_sigqueue F 121 | GLIBC_2.12 pthread_getname_np F 122 | GLIBC_2.12 pthread_mutex_consistent F 123 | GLIBC_2.12 pthread_mutexattr_getrobust F 124 | GLIBC_2.12 pthread_mutexattr_setrobust F 125 | GLIBC_2.12 pthread_setname_np F 126 | GLIBC_2.18 pthread_getattr_default_np F 127 | GLIBC_2.18 pthread_setattr_default_np F 128 | GLIBC_2.2 __libc_allocate_rtsig F 129 | GLIBC_2.2 __libc_current_sigrtmax F 130 | GLIBC_2.2 __libc_current_sigrtmin F 131 | GLIBC_2.2 __open64 F 132 | GLIBC_2.2 __pread64 F 133 | GLIBC_2.2 __pthread_rwlock_destroy F 134 | GLIBC_2.2 __pthread_rwlock_init F 135 | GLIBC_2.2 __pthread_rwlock_rdlock F 136 | GLIBC_2.2 __pthread_rwlock_tryrdlock F 137 | GLIBC_2.2 __pthread_rwlock_trywrlock F 138 | GLIBC_2.2 __pthread_rwlock_unlock F 139 | GLIBC_2.2 __pthread_rwlock_wrlock F 140 | GLIBC_2.2 __pwrite64 F 141 | GLIBC_2.2 __res_state F 142 | GLIBC_2.2 lseek64 F 143 | GLIBC_2.2 open64 F 144 | GLIBC_2.2 pread F 145 | GLIBC_2.2 pread64 F 146 | GLIBC_2.2 pthread_attr_getguardsize F 147 | GLIBC_2.2 pthread_attr_getstack F 148 | GLIBC_2.2 pthread_attr_getstackaddr F 149 | GLIBC_2.2 pthread_attr_getstacksize F 150 | GLIBC_2.2 pthread_attr_init F 151 | GLIBC_2.2 pthread_attr_setguardsize F 152 | GLIBC_2.2 pthread_attr_setstack F 153 | GLIBC_2.2 pthread_attr_setstackaddr F 154 | GLIBC_2.2 pthread_attr_setstacksize F 155 | GLIBC_2.2 pthread_barrier_destroy F 156 | GLIBC_2.2 pthread_barrier_init F 157 | GLIBC_2.2 pthread_barrier_wait F 158 | GLIBC_2.2 pthread_barrierattr_destroy F 159 | GLIBC_2.2 pthread_barrierattr_init F 160 | GLIBC_2.2 pthread_barrierattr_setpshared F 161 | GLIBC_2.2 pthread_condattr_getpshared F 162 | GLIBC_2.2 pthread_condattr_setpshared F 163 | GLIBC_2.2 pthread_create F 164 | GLIBC_2.2 pthread_getconcurrency F 165 | GLIBC_2.2 pthread_getcpuclockid F 166 | GLIBC_2.2 pthread_mutex_timedlock F 167 | GLIBC_2.2 pthread_mutexattr_getpshared F 168 | GLIBC_2.2 pthread_mutexattr_gettype F 169 | GLIBC_2.2 pthread_mutexattr_setpshared F 170 | GLIBC_2.2 pthread_mutexattr_settype F 171 | GLIBC_2.2 pthread_rwlock_destroy F 172 | GLIBC_2.2 pthread_rwlock_init F 173 | GLIBC_2.2 pthread_rwlock_rdlock F 174 | GLIBC_2.2 pthread_rwlock_timedrdlock F 175 | GLIBC_2.2 pthread_rwlock_timedwrlock F 176 | GLIBC_2.2 pthread_rwlock_tryrdlock F 177 | GLIBC_2.2 pthread_rwlock_trywrlock F 178 | GLIBC_2.2 pthread_rwlock_unlock F 179 | GLIBC_2.2 pthread_rwlock_wrlock F 180 | GLIBC_2.2 pthread_rwlockattr_destroy F 181 | GLIBC_2.2 pthread_rwlockattr_getkind_np F 182 | GLIBC_2.2 pthread_rwlockattr_getpshared F 183 | GLIBC_2.2 pthread_rwlockattr_init F 184 | GLIBC_2.2 pthread_rwlockattr_setkind_np F 185 | GLIBC_2.2 pthread_rwlockattr_setpshared F 186 | GLIBC_2.2 pthread_setconcurrency F 187 | GLIBC_2.2 pthread_spin_destroy F 188 | GLIBC_2.2 pthread_spin_init F 189 | GLIBC_2.2 pthread_spin_lock F 190 | GLIBC_2.2 pthread_spin_trylock F 191 | GLIBC_2.2 pthread_spin_unlock F 192 | GLIBC_2.2 pthread_yield F 193 | GLIBC_2.2 pwrite F 194 | GLIBC_2.2 pwrite64 F 195 | GLIBC_2.2 sem_close F 196 | GLIBC_2.2 sem_destroy F 197 | GLIBC_2.2 sem_getvalue F 198 | GLIBC_2.2 sem_init F 199 | GLIBC_2.2 sem_open F 200 | GLIBC_2.2 sem_post F 201 | GLIBC_2.2 sem_timedwait F 202 | GLIBC_2.2 sem_trywait F 203 | GLIBC_2.2 sem_unlink F 204 | GLIBC_2.2 sem_wait F 205 | GLIBC_2.2.3 pthread_getattr_np F 206 | GLIBC_2.2.6 __nanosleep F 207 | GLIBC_2.28 call_once F 208 | GLIBC_2.28 cnd_broadcast F 209 | GLIBC_2.28 cnd_destroy F 210 | GLIBC_2.28 cnd_init F 211 | GLIBC_2.28 cnd_signal F 212 | GLIBC_2.28 cnd_timedwait F 213 | GLIBC_2.28 cnd_wait F 214 | GLIBC_2.28 mtx_destroy F 215 | GLIBC_2.28 mtx_init F 216 | GLIBC_2.28 mtx_lock F 217 | GLIBC_2.28 mtx_timedlock F 218 | GLIBC_2.28 mtx_trylock F 219 | GLIBC_2.28 mtx_unlock F 220 | GLIBC_2.28 thrd_create F 221 | GLIBC_2.28 thrd_detach F 222 | GLIBC_2.28 thrd_exit F 223 | GLIBC_2.28 thrd_join F 224 | GLIBC_2.28 tss_create F 225 | GLIBC_2.28 tss_delete F 226 | GLIBC_2.28 tss_get F 227 | GLIBC_2.28 tss_set F 228 | GLIBC_2.3.2 pthread_cond_broadcast F 229 | GLIBC_2.3.2 pthread_cond_destroy F 230 | GLIBC_2.3.2 pthread_cond_init F 231 | GLIBC_2.3.2 pthread_cond_signal F 232 | GLIBC_2.3.2 pthread_cond_timedwait F 233 | GLIBC_2.3.2 pthread_cond_wait F 234 | GLIBC_2.3.3 __pthread_cleanup_routine F 235 | GLIBC_2.3.3 __pthread_register_cancel F 236 | GLIBC_2.3.3 __pthread_register_cancel_defer F 237 | GLIBC_2.3.3 __pthread_unregister_cancel F 238 | GLIBC_2.3.3 __pthread_unregister_cancel_restore F 239 | GLIBC_2.3.3 __pthread_unwind_next F 240 | GLIBC_2.3.3 pthread_attr_getaffinity_np F 241 | GLIBC_2.3.3 pthread_attr_setaffinity_np F 242 | GLIBC_2.3.3 pthread_attr_setstack F 243 | GLIBC_2.3.3 pthread_attr_setstacksize F 244 | GLIBC_2.3.3 pthread_barrierattr_getpshared F 245 | GLIBC_2.3.3 pthread_condattr_getclock F 246 | GLIBC_2.3.3 pthread_condattr_setclock F 247 | GLIBC_2.3.3 pthread_getaffinity_np F 248 | GLIBC_2.3.3 pthread_setaffinity_np F 249 | GLIBC_2.3.3 pthread_timedjoin_np F 250 | GLIBC_2.3.3 pthread_tryjoin_np F 251 | GLIBC_2.3.4 pthread_attr_getaffinity_np F 252 | GLIBC_2.3.4 pthread_attr_setaffinity_np F 253 | GLIBC_2.3.4 pthread_getaffinity_np F 254 | GLIBC_2.3.4 pthread_setaffinity_np F 255 | GLIBC_2.3.4 pthread_setschedprio F 256 | GLIBC_2.4 pthread_mutex_consistent_np F 257 | GLIBC_2.4 pthread_mutex_getprioceiling F 258 | GLIBC_2.4 pthread_mutex_setprioceiling F 259 | GLIBC_2.4 pthread_mutexattr_getprioceiling F 260 | GLIBC_2.4 pthread_mutexattr_getprotocol F 261 | GLIBC_2.4 pthread_mutexattr_getrobust_np F 262 | GLIBC_2.4 pthread_mutexattr_setprioceiling F 263 | GLIBC_2.4 pthread_mutexattr_setprotocol F 264 | GLIBC_2.4 pthread_mutexattr_setrobust_np F 265 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0004-add-signal-functions.patch: -------------------------------------------------------------------------------- 1 | From 8c137f8fdef79f87a81b7a95405219e2a04657b4 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sat, 13 Jan 2024 06:35:35 +0800 4 | Subject: [PATCH 04/12] add signal functions 5 | 6 | --- 7 | sysdeps/loongarch/nptl/pthread_sigmask.c | 73 +++++++++++++++++++ 8 | .../unix/sysv/linux/loongarch/bits/ow_nsig.h | 1 + 9 | .../sysv/linux/loongarch/bits/signum-arch.h | 3 +- 10 | sysdeps/unix/sysv/linux/loongarch/ow_sigop.h | 8 ++ 11 | .../unix/sysv/linux/loongarch/sigpending.c | 22 ++++++ 12 | .../unix/sysv/linux/loongarch/sigprocmask.c | 20 +++++ 13 | .../unix/sysv/linux/loongarch/sigsuspend.c | 1 + 14 | .../unix/sysv/linux/loongarch/sigtimedwait.c | 1 + 15 | sysdeps/unix/sysv/linux/loongarch/sigwait.c | 10 +++ 16 | .../unix/sysv/linux/loongarch/sigwaitinfo.c | 1 + 17 | .../linux/loongarch/spawnattr_setdefault.c | 1 + 18 | .../linux/loongarch/spawnattr_setsigmask.c | 1 + 19 | 12 files changed, 141 insertions(+), 1 deletion(-) 20 | create mode 100644 sysdeps/loongarch/nptl/pthread_sigmask.c 21 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/bits/ow_nsig.h 22 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigpending.c 23 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigprocmask.c 24 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigsuspend.c 25 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigtimedwait.c 26 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigwait.c 27 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigwaitinfo.c 28 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/spawnattr_setdefault.c 29 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/spawnattr_setsigmask.c 30 | 31 | diff --git a/sysdeps/loongarch/nptl/pthread_sigmask.c b/sysdeps/loongarch/nptl/pthread_sigmask.c 32 | new file mode 100644 33 | index 0000000000..d69470002a 34 | --- /dev/null 35 | +++ b/sysdeps/loongarch/nptl/pthread_sigmask.c 36 | @@ -0,0 +1,73 @@ 37 | +/* Copyright (C) 2002-2023 Free Software Foundation, Inc. 38 | + This file is part of the GNU C Library. 39 | + 40 | + The GNU C Library is free software; you can redistribute it and/or 41 | + modify it under the terms of the GNU Lesser General Public 42 | + License as published by the Free Software Foundation; either 43 | + version 2.1 of the License, or (at your option) any later version. 44 | + 45 | + The GNU C Library is distributed in the hope that it will be useful, 46 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 47 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 48 | + Lesser General Public License for more details. 49 | + 50 | + You should have received a copy of the GNU Lesser General Public 51 | + License along with the GNU C Library; if not, see 52 | + . */ 53 | + 54 | +#include 55 | +#include 56 | +#include 57 | +#include 58 | + 59 | +int 60 | +__pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) 61 | +{ 62 | + sigset_t local_newmask; 63 | + 64 | + /* The only thing we have to make sure here is that SIGCANCEL and 65 | + SIGSETXID is not blocked. */ 66 | + if (newmask != NULL 67 | + && (__glibc_unlikely (__sigismember (newmask, SIGCANCEL)) 68 | + || __glibc_unlikely (__sigismember (newmask, SIGSETXID)))) 69 | + { 70 | + local_newmask = *newmask; 71 | + clear_internal_signals (&local_newmask); 72 | + newmask = &local_newmask; 73 | + } 74 | + 75 | + /* We know that realtime signals are available if NPTL is used. */ 76 | + int result = INTERNAL_SYSCALL_CALL (rt_sigprocmask, how, newmask, 77 | + oldmask, __NSIG_BYTES); 78 | + 79 | + return (INTERNAL_SYSCALL_ERROR_P (result) 80 | + ? INTERNAL_SYSCALL_ERRNO (result) 81 | + : 0); 82 | +} 83 | +libc_hidden_def (__pthread_sigmask) 84 | + 85 | +versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_36); 86 | + 87 | +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_36) 88 | + 89 | +#include 90 | + 91 | +int 92 | +__ow___pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) 93 | +{ 94 | + int rc = __pthread_sigmask (how, newmask, oldmask); 95 | + if (rc >= 0 && oldmask != NULL){ 96 | + __ow_clear_unused_bits(oldmask); 97 | + } 98 | + return rc; 99 | +} 100 | +#if SHLIB_COMPAT (libc, GLIBC_2_32, GLIBC_2_36) 101 | +compat_symbol (libc, __ow___pthread_sigmask, pthread_sigmask, GLIBC_2_32); 102 | +#endif 103 | + 104 | +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32) 105 | +strong_alias (__ow___pthread_sigmask, __ow___pthread_sigmask_2); 106 | +compat_symbol (libc, __ow___pthread_sigmask_2, pthread_sigmask, GLIBC_2_0); 107 | +#endif 108 | + 109 | +#endif 110 | diff --git a/sysdeps/unix/sysv/linux/loongarch/bits/ow_nsig.h b/sysdeps/unix/sysv/linux/loongarch/bits/ow_nsig.h 111 | new file mode 100644 112 | index 0000000000..12f039ddd5 113 | --- /dev/null 114 | +++ b/sysdeps/unix/sysv/linux/loongarch/bits/ow_nsig.h 115 | @@ -0,0 +1 @@ 116 | +#define __OW_NSIG 128 117 | diff --git a/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h 118 | index 522f084657..9abda0a70b 100644 119 | --- a/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h 120 | +++ b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h 121 | @@ -1,6 +1,7 @@ 122 | #include 123 | 124 | #ifdef LA_OW_COMPACT 125 | +#include 126 | #undef __SIGRTMAX 127 | -#define __SIGRTMAX 128 128 | +#define __SIGRTMAX __OW_NSIG 129 | #endif 130 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h 131 | index f06836b852..847c71cf80 100644 132 | --- a/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h 133 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h 134 | @@ -1,4 +1,5 @@ 135 | #include 136 | +#include 137 | 138 | extern int __ow_sigaddset(sigset_t *, int); 139 | extern int __ow_sigdelset(sigset_t *, int); 140 | @@ -6,3 +7,10 @@ extern int __ow_sigemptyset(sigset_t *); 141 | extern int __ow_sigfillset(sigset_t *); 142 | extern int __ow_sigandset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right); 143 | extern int __ow_sigorset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right); 144 | + 145 | +#include 146 | + 147 | +static inline void __ow_clear_unused_bits(sigset_t *set) 148 | +{ 149 | + memset ((void *)set + (NSIG / 8), 0, (__OW_NSIG - NSIG) / 8); 150 | +} 151 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigpending.c b/sysdeps/unix/sysv/linux/loongarch/sigpending.c 152 | new file mode 100644 153 | index 0000000000..238c27ade3 154 | --- /dev/null 155 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigpending.c 156 | @@ -0,0 +1,22 @@ 157 | +#include 158 | + 159 | +#include 160 | + 161 | +#define sigpending __sigpending 162 | +#include 163 | +#undef sigpending 164 | + 165 | +versioned_symbol (libc, __sigpending, sigpending, GLIBC_2_36); 166 | + 167 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 168 | +#include "ow_sigop.h" 169 | +int __ow_sigpending (sigset_t *set) 170 | +{ 171 | + int rc = __sigpending (set); 172 | + if (rc >= 0){ 173 | + __ow_clear_unused_bits(set); 174 | + } 175 | + return rc; 176 | +} 177 | +compat_symbol (libc, __ow_sigpending, sigpending, GLIBC_2_0); 178 | +#endif 179 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigprocmask.c b/sysdeps/unix/sysv/linux/loongarch/sigprocmask.c 180 | new file mode 100644 181 | index 0000000000..17aa8572a9 182 | --- /dev/null 183 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigprocmask.c 184 | @@ -0,0 +1,20 @@ 185 | +#include 186 | + 187 | +#undef weak_alias 188 | +#define weak_alias(name, aliasname) 189 | +#include 190 | + 191 | +versioned_symbol (libc, __sigprocmask, sigprocmask, GLIBC_2_36); 192 | + 193 | +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_36) 194 | +#include "ow_sigop.h" 195 | +int __ow_sigprocmask (int how, const sigset_t *set, sigset_t *oldset) 196 | +{ 197 | + int rc = __sigprocmask (how, set, oldset); 198 | + if (rc >= 0 && oldset != NULL){ 199 | + __ow_clear_unused_bits(oldset); 200 | + } 201 | + return rc; 202 | +} 203 | +compat_symbol (libc, __ow_sigprocmask, sigprocmask, GLIBC_2_0); 204 | +#endif 205 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigsuspend.c b/sysdeps/unix/sysv/linux/loongarch/sigsuspend.c 206 | new file mode 100644 207 | index 0000000000..9351c54b96 208 | --- /dev/null 209 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigsuspend.c 210 | @@ -0,0 +1 @@ 211 | +#include 212 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigtimedwait.c b/sysdeps/unix/sysv/linux/loongarch/sigtimedwait.c 213 | new file mode 100644 214 | index 0000000000..65636bb644 215 | --- /dev/null 216 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigtimedwait.c 217 | @@ -0,0 +1 @@ 218 | +#include 219 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigwait.c b/sysdeps/unix/sysv/linux/loongarch/sigwait.c 220 | new file mode 100644 221 | index 0000000000..e11d42f204 222 | --- /dev/null 223 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigwait.c 224 | @@ -0,0 +1,10 @@ 225 | +#include 226 | + 227 | +#undef weak_alias 228 | +#define weak_alias(name, aliasname) 229 | +#include 230 | + 231 | +versioned_symbol (libc, __sigwait, sigwait, GLIBC_2_0); 232 | +#if OTHER_SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_34) 233 | +compat_symbol (libpthread, __sigwait, sigwait, GLIBC_2_0); 234 | +#endif 235 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigwaitinfo.c b/sysdeps/unix/sysv/linux/loongarch/sigwaitinfo.c 236 | new file mode 100644 237 | index 0000000000..36edb29394 238 | --- /dev/null 239 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigwaitinfo.c 240 | @@ -0,0 +1 @@ 241 | +#include 242 | diff --git a/sysdeps/unix/sysv/linux/loongarch/spawnattr_setdefault.c b/sysdeps/unix/sysv/linux/loongarch/spawnattr_setdefault.c 243 | new file mode 100644 244 | index 0000000000..f75f1f16f0 245 | --- /dev/null 246 | +++ b/sysdeps/unix/sysv/linux/loongarch/spawnattr_setdefault.c 247 | @@ -0,0 +1 @@ 248 | +#include 249 | diff --git a/sysdeps/unix/sysv/linux/loongarch/spawnattr_setsigmask.c b/sysdeps/unix/sysv/linux/loongarch/spawnattr_setsigmask.c 250 | new file mode 100644 251 | index 0000000000..a95cf5daff 252 | --- /dev/null 253 | +++ b/sysdeps/unix/sysv/linux/loongarch/spawnattr_setsigmask.c 254 | @@ -0,0 +1 @@ 255 | +#include 256 | -- 257 | 2.52.0 258 | 259 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0007-add-syscall-fallback-for-stat-at.patch: -------------------------------------------------------------------------------- 1 | From 8a52fe017a736b9688a2fd8456dd807c6f6aba83 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sun, 14 Jan 2024 15:51:49 +0800 4 | Subject: [PATCH 07/12] add syscall fallback for *stat(at)? 5 | 6 | --- 7 | sysdeps/unix/sysv/linux/loongarch/fstat64.c | 5 ++ 8 | sysdeps/unix/sysv/linux/loongarch/fstatat64.c | 13 ++++ 9 | sysdeps/unix/sysv/linux/loongarch/fxstat64.c | 67 +++++++++++++++++ 10 | .../unix/sysv/linux/loongarch/fxstatat64.c | 61 ++++++++++++++++ 11 | sysdeps/unix/sysv/linux/loongarch/lxstat64.c | 72 +++++++++++++++++++ 12 | .../unix/sysv/linux/loongarch/ow_syscall_nr.h | 2 + 13 | sysdeps/unix/sysv/linux/loongarch/xstat64.c | 71 ++++++++++++++++++ 14 | 7 files changed, 291 insertions(+) 15 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/fstat64.c 16 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/fstatat64.c 17 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/fxstat64.c 18 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/fxstatat64.c 19 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/lxstat64.c 20 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_syscall_nr.h 21 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/xstat64.c 22 | 23 | diff --git a/sysdeps/unix/sysv/linux/loongarch/fstat64.c b/sysdeps/unix/sysv/linux/loongarch/fstat64.c 24 | new file mode 100644 25 | index 0000000000..46bbf62460 26 | --- /dev/null 27 | +++ b/sysdeps/unix/sysv/linux/loongarch/fstat64.c 28 | @@ -0,0 +1,5 @@ 29 | +#include 30 | + 31 | +// In glibc 2.39, fstat64 changed its implementation to use fstat() in 551101e 32 | +// However, on loongarch64, it still calls __fstatat64_time64, unchanged. 33 | +// So the magic will happen there, no magic is needed here. 34 | diff --git a/sysdeps/unix/sysv/linux/loongarch/fstatat64.c b/sysdeps/unix/sysv/linux/loongarch/fstatat64.c 35 | new file mode 100644 36 | index 0000000000..a437eeaa6d 37 | --- /dev/null 38 | +++ b/sysdeps/unix/sysv/linux/loongarch/fstatat64.c 39 | @@ -0,0 +1,13 @@ 40 | +#include 41 | + 42 | +#if LIB_COMPAT(libc, GLIBC_2_27, GLIBC_2_36) 43 | +# include 44 | +# ifdef __ASSUME_STATX 45 | +# undef __ASSUME_STATX 46 | +# endif 47 | +// Hack: force use statx for fstatat64 even __NR_newfstatat is available 48 | +# define STAT_HAS_TIME32 49 | +# include "ow_syscall_nr.h" 50 | +#endif 51 | + 52 | +#include 53 | diff --git a/sysdeps/unix/sysv/linux/loongarch/fxstat64.c b/sysdeps/unix/sysv/linux/loongarch/fxstat64.c 54 | new file mode 100644 55 | index 0000000000..f7174ea844 56 | --- /dev/null 57 | +++ b/sysdeps/unix/sysv/linux/loongarch/fxstat64.c 58 | @@ -0,0 +1,67 @@ 59 | +/* fxstat64 using Linux fstat64/statx system call. 60 | + Copyright (C) 1997-2023 Free Software Foundation, Inc. 61 | + This file is part of the GNU C Library. 62 | + 63 | + The GNU C Library is free software; you can redistribute it and/or 64 | + modify it under the terms of the GNU Lesser General Public 65 | + License as published by the Free Software Foundation; either 66 | + version 2.1 of the License, or (at your option) any later version. 67 | + 68 | + The GNU C Library is distributed in the hope that it will be useful, 69 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 70 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 71 | + Lesser General Public License for more details. 72 | + 73 | + You should have received a copy of the GNU Lesser General Public 74 | + License along with the GNU C Library; if not, see 75 | + . */ 76 | + 77 | +#define __fxstat __redirect___fxstat 78 | +#include 79 | +#undef __fxstat 80 | +#include 81 | +#include 82 | +#include 83 | +#include 84 | +#include 85 | +#include 86 | +#include "ow_syscall_nr.h" 87 | + 88 | +#if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) 89 | + 90 | +/* Get information about the file FD in BUF. */ 91 | + 92 | +int 93 | +___fxstat64 (int vers, int fd, struct stat64 *buf) 94 | +{ 95 | + /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ 96 | + struct statx tmp; 97 | + int r = INLINE_SYSCALL_CALL (statx, fd, "", AT_EMPTY_PATH, 98 | + STATX_BASIC_STATS, &tmp); 99 | + if (r == 0) { 100 | + __cp_stat64_statx (buf, &tmp); 101 | + return r; 102 | + } else if (errno != ENOSYS) { 103 | + return r; 104 | + } 105 | +#if defined __NR_fstat 106 | + if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX) 107 | + return INLINE_SYSCALL_CALL (fstat, fd, buf); 108 | + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); 109 | +#endif 110 | + return r; 111 | +} 112 | + 113 | +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) 114 | +versioned_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2); 115 | +strong_alias (___fxstat64, __old__fxstat64) 116 | +compat_symbol (libc, __old__fxstat64, __fxstat64, GLIBC_2_1); 117 | +#else 118 | +strong_alias (___fxstat64, __fxstat64) 119 | +#endif 120 | + 121 | +#if XSTAT_IS_XSTAT64 122 | +strong_alias (___fxstat64, __fxstat) 123 | +#endif 124 | + 125 | +#endif /* LIB_COMPAT */ 126 | diff --git a/sysdeps/unix/sysv/linux/loongarch/fxstatat64.c b/sysdeps/unix/sysv/linux/loongarch/fxstatat64.c 127 | new file mode 100644 128 | index 0000000000..720f12a084 129 | --- /dev/null 130 | +++ b/sysdeps/unix/sysv/linux/loongarch/fxstatat64.c 131 | @@ -0,0 +1,61 @@ 132 | +/* fxstatat64 used on fstatat64, Linux implementation. 133 | + Copyright (C) 2005-2023 Free Software Foundation, Inc. 134 | + This file is part of the GNU C Library. 135 | + 136 | + The GNU C Library is free software; you can redistribute it and/or 137 | + modify it under the terms of the GNU Lesser General Public 138 | + License as published by the Free Software Foundation; either 139 | + version 2.1 of the License, or (at your option) any later version. 140 | + 141 | + The GNU C Library is distributed in the hope that it will be useful, 142 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 143 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 144 | + Lesser General Public License for more details. 145 | + 146 | + You should have received a copy of the GNU Lesser General Public 147 | + License along with the GNU C Library; if not, see 148 | + . */ 149 | + 150 | +#define __fxstatat __redirect___fxstatat 151 | +#include 152 | +#undef __fxstatat 153 | +#include 154 | +#include 155 | +#include 156 | +#include 157 | +#include 158 | +#include 159 | +#include "ow_syscall_nr.h" 160 | + 161 | +#if LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33) 162 | + 163 | +/* Get information about the file FD in BUF. */ 164 | + 165 | +int 166 | +__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag) 167 | +{ 168 | + /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ 169 | + if (vers == _STAT_VER_KERNEL) 170 | + { 171 | + struct statx tmp; 172 | + int r = INLINE_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | flag, 173 | + STATX_BASIC_STATS, &tmp); 174 | + if (r == 0) { 175 | + __cp_stat64_statx (st, &tmp); 176 | + return r; 177 | + }else if (errno != ENOSYS){ 178 | + return r; 179 | + } 180 | +#if defined __NR_newfstatat 181 | + return INLINE_SYSCALL_CALL (newfstatat, fd, file, st, flag); 182 | +#endif 183 | + return r; 184 | + } 185 | + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); 186 | +} 187 | + 188 | +#if XSTAT_IS_XSTAT64 189 | +strong_alias (__fxstatat64, __fxstatat) 190 | +#endif 191 | + 192 | +#endif /* LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33) */ 193 | diff --git a/sysdeps/unix/sysv/linux/loongarch/lxstat64.c b/sysdeps/unix/sysv/linux/loongarch/lxstat64.c 194 | new file mode 100644 195 | index 0000000000..51bd906bf1 196 | --- /dev/null 197 | +++ b/sysdeps/unix/sysv/linux/loongarch/lxstat64.c 198 | @@ -0,0 +1,72 @@ 199 | +/* lxstat64 using Linux lstat64 system call. 200 | + Copyright (C) 1991-2023 Free Software Foundation, Inc. 201 | + This file is part of the GNU C Library. 202 | + 203 | + The GNU C Library is free software; you can redistribute it and/or 204 | + modify it under the terms of the GNU Lesser General Public 205 | + License as published by the Free Software Foundation; either 206 | + version 2.1 of the License, or (at your option) any later version. 207 | + 208 | + The GNU C Library is distributed in the hope that it will be useful, 209 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 210 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 211 | + Lesser General Public License for more details. 212 | + 213 | + You should have received a copy of the GNU Lesser General Public 214 | + License along with the GNU C Library; if not, see 215 | + . */ 216 | + 217 | +#define __lxstat __redirect___lxstat 218 | +#include 219 | +#undef __lxstat 220 | +#include 221 | +#include 222 | +#include 223 | +#include 224 | +#include 225 | +#include 226 | +#include "ow_syscall_nr.h" 227 | + 228 | +#if LIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33) 229 | + 230 | +/* Get information about the file NAME in BUF. */ 231 | + 232 | +int 233 | +___lxstat64 (int vers, const char *name, struct stat64 *buf) 234 | +{ 235 | + /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ 236 | + if (vers == _STAT_VER_KERNEL) 237 | + { 238 | + struct statx tmp; 239 | + int r = INLINE_SYSCALL_CALL (statx, AT_FDCWD, name, 240 | + AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW, 241 | + STATX_BASIC_STATS, &tmp); 242 | + if (r == 0) { 243 | + __cp_stat64_statx (buf, &tmp); 244 | + return r; 245 | + }else if(errno != ENOSYS){ 246 | + return r; 247 | + } 248 | +#if defined __NR_newfstatat 249 | + return INLINE_SYSCALL_CALL (newfstatat, AT_FDCWD, name, buf, 250 | + AT_SYMLINK_NOFOLLOW); 251 | +#endif 252 | + return r; 253 | + } 254 | + 255 | + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); 256 | +} 257 | + 258 | +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) 259 | +versioned_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2); 260 | +strong_alias (___lxstat64, __old__lxstat64) 261 | +compat_symbol (libc, __old__lxstat64, __lxstat64, GLIBC_2_1); 262 | +#else 263 | +strong_alias (___lxstat64, __lxstat64); 264 | +#endif 265 | + 266 | +#if XSTAT_IS_XSTAT64 267 | +strong_alias (___lxstat64,__lxstat) 268 | +#endif 269 | + 270 | +#endif /* LIB_COMPAT */ 271 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_syscall_nr.h b/sysdeps/unix/sysv/linux/loongarch/ow_syscall_nr.h 272 | new file mode 100644 273 | index 0000000000..61886aebab 274 | --- /dev/null 275 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_syscall_nr.h 276 | @@ -0,0 +1,2 @@ 277 | +#define __NR_newfstatat 79 278 | +#define __NR_fstat 80 279 | diff --git a/sysdeps/unix/sysv/linux/loongarch/xstat64.c b/sysdeps/unix/sysv/linux/loongarch/xstat64.c 280 | new file mode 100644 281 | index 0000000000..c30f52e9f6 282 | --- /dev/null 283 | +++ b/sysdeps/unix/sysv/linux/loongarch/xstat64.c 284 | @@ -0,0 +1,71 @@ 285 | +/* xstat64 using Linux stat64 system call. 286 | + Copyright (C) 1991-2023 Free Software Foundation, Inc. 287 | + This file is part of the GNU C Library. 288 | + 289 | + The GNU C Library is free software; you can redistribute it and/or 290 | + modify it under the terms of the GNU Lesser General Public 291 | + License as published by the Free Software Foundation; either 292 | + version 2.1 of the License, or (at your option) any later version. 293 | + 294 | + The GNU C Library is distributed in the hope that it will be useful, 295 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 296 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 297 | + Lesser General Public License for more details. 298 | + 299 | + You should have received a copy of the GNU Lesser General Public 300 | + License along with the GNU C Library; if not, see 301 | + . */ 302 | + 303 | +#define __xstat __redirect___xstat 304 | +#include 305 | +#undef __xstat 306 | +#include 307 | +#include 308 | +#include 309 | +#include 310 | +#include 311 | +#include 312 | +#include "ow_syscall_nr.h" 313 | + 314 | +#if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) 315 | + 316 | +/* Get information about the file NAME in BUF. */ 317 | + 318 | +int 319 | +___xstat64 (int vers, const char *name, struct stat64 *buf) 320 | +{ 321 | + /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ 322 | + if (vers == _STAT_VER_KERNEL) 323 | + { 324 | + struct statx tmp; 325 | + int r = INLINE_SYSCALL_CALL (statx, AT_FDCWD, name, AT_NO_AUTOMOUNT, 326 | + STATX_BASIC_STATS, &tmp); 327 | + if (r == 0) { 328 | + __cp_stat64_statx (buf, &tmp); 329 | + return r; 330 | + }else if(errno != ENOSYS){ 331 | + return r; 332 | + } 333 | +#if defined __NR_newfstatat 334 | + return INLINE_SYSCALL_CALL (newfstatat, AT_FDCWD, name, buf, 0); 335 | +#endif 336 | + return r; 337 | + } 338 | + 339 | + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); 340 | +} 341 | + 342 | +#if XSTAT_IS_XSTAT64 343 | +strong_alias (___xstat64, __xstat) 344 | +#endif 345 | + 346 | +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) 347 | +versioned_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2); 348 | +strong_alias (___xstat64, __old__xstat64) 349 | +compat_symbol (libc, __old__xstat64, __xstat64, GLIBC_2_1); 350 | +#else 351 | +strong_alias (___xstat64, __xstat64) 352 | +#endif 353 | + 354 | + 355 | +#endif /* LIB_COMPAT */ 356 | -- 357 | 2.52.0 358 | 359 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0003-add-sigset-ops.patch: -------------------------------------------------------------------------------- 1 | From a686be3451f63b2f808573e4efa00f22fef28778 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sat, 13 Jan 2024 05:07:19 +0800 4 | Subject: [PATCH 03/12] add sigset ops 5 | 6 | --- 7 | sysdeps/unix/sysv/linux/loongarch/Makefile | 13 +++++++++++++ 8 | .../unix/sysv/linux/loongarch/bits/signum-arch.h | 6 ++++++ 9 | sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c | 11 +++++++++++ 10 | sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c | 11 +++++++++++ 11 | sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c | 11 +++++++++++ 12 | sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c | 11 +++++++++++ 13 | sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c | 11 +++++++++++ 14 | sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c | 11 +++++++++++ 15 | sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c | 11 +++++++++++ 16 | sysdeps/unix/sysv/linux/loongarch/ow_sigop.h | 8 ++++++++ 17 | sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c | 11 +++++++++++ 18 | sysdeps/unix/sysv/linux/loongarch/sigaddset.c | 11 +++++++++++ 19 | sysdeps/unix/sysv/linux/loongarch/sigandset.c | 7 +++++++ 20 | sysdeps/unix/sysv/linux/loongarch/sigdelset.c | 11 +++++++++++ 21 | sysdeps/unix/sysv/linux/loongarch/sigempty.c | 11 +++++++++++ 22 | sysdeps/unix/sysv/linux/loongarch/sigfillset.c | 11 +++++++++++ 23 | sysdeps/unix/sysv/linux/loongarch/sigisempty.c | 7 +++++++ 24 | sysdeps/unix/sysv/linux/loongarch/sigismem.c | 7 +++++++ 25 | sysdeps/unix/sysv/linux/loongarch/sigorset.c | 7 +++++++ 26 | 19 files changed, 187 insertions(+) 27 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h 28 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c 29 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c 30 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c 31 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c 32 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c 33 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c 34 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c 35 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigop.h 36 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c 37 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigaddset.c 38 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigandset.c 39 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigdelset.c 40 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigempty.c 41 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigfillset.c 42 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigisempty.c 43 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigismem.c 44 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigorset.c 45 | 46 | diff --git a/sysdeps/unix/sysv/linux/loongarch/Makefile b/sysdeps/unix/sysv/linux/loongarch/Makefile 47 | index c84a1762ed..70cac2d36c 100644 48 | --- a/sysdeps/unix/sysv/linux/loongarch/Makefile 49 | +++ b/sysdeps/unix/sysv/linux/loongarch/Makefile 50 | @@ -2,6 +2,19 @@ ifeq ($(subdir),stdlib) 51 | gen-as-const-headers += ucontext_i.sym 52 | endif 53 | 54 | +ifeq ($(subdir),signal) 55 | +sysdep_routines += \ 56 | + ow_sigisempty \ 57 | + ow_sigismem \ 58 | + ow_sigaddset \ 59 | + ow_sigfillset \ 60 | + ow_sigempty \ 61 | + ow_sigdelset \ 62 | + ow_sigandset \ 63 | + ow_sigorset \ 64 | + # sysdep_routines 65 | +endif 66 | + 67 | abi-variants := lp64s lp64d 68 | 69 | ifeq (,$(filter $(default-abi),$(abi-variants))) 70 | diff --git a/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h 71 | new file mode 100644 72 | index 0000000000..522f084657 73 | --- /dev/null 74 | +++ b/sysdeps/unix/sysv/linux/loongarch/bits/signum-arch.h 75 | @@ -0,0 +1,6 @@ 76 | +#include 77 | + 78 | +#ifdef LA_OW_COMPACT 79 | +#undef __SIGRTMAX 80 | +#define __SIGRTMAX 128 81 | +#endif 82 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c 83 | new file mode 100644 84 | index 0000000000..0bc18cdaa1 85 | --- /dev/null 86 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigaddset.c 87 | @@ -0,0 +1,11 @@ 88 | +#define LA_OW_COMPACT 89 | + 90 | +#include 91 | + 92 | +#define sigaddset __ow_sigaddset 93 | +#include 94 | + 95 | +#undef sigaddset 96 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 97 | +compat_symbol(libc, __ow_sigaddset, sigaddset, GLIBC_2_0); 98 | +#endif 99 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c 100 | new file mode 100644 101 | index 0000000000..b28cfc23f1 102 | --- /dev/null 103 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigandset.c 104 | @@ -0,0 +1,11 @@ 105 | +#define LA_OW_COMPACT 106 | + 107 | +#include 108 | + 109 | +#define sigandset __ow_sigandset 110 | +#include 111 | + 112 | +#undef sigandset 113 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 114 | +compat_symbol(libc, __ow_sigandset, sigandset, GLIBC_2_0); 115 | +#endif 116 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c 117 | new file mode 100644 118 | index 0000000000..d29dc88570 119 | --- /dev/null 120 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigdelset.c 121 | @@ -0,0 +1,11 @@ 122 | +#define LA_OW_COMPACT 123 | + 124 | +#include 125 | + 126 | +#define sigdelset __ow_sigdelset 127 | +#include 128 | + 129 | +#undef sigdelset 130 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 131 | +compat_symbol(libc, __ow_sigdelset, sigdelset, GLIBC_2_0); 132 | +#endif 133 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c 134 | new file mode 100644 135 | index 0000000000..67d3176edf 136 | --- /dev/null 137 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigempty.c 138 | @@ -0,0 +1,11 @@ 139 | +#define LA_OW_COMPACT 140 | + 141 | +#include 142 | + 143 | +#define sigemptyset __ow_sigemptyset 144 | +#include 145 | + 146 | +#undef sigemptyset 147 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 148 | +compat_symbol(libc, __ow_sigemptyset, sigemptyset, GLIBC_2_0); 149 | +#endif 150 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c 151 | new file mode 100644 152 | index 0000000000..3d41cbf55c 153 | --- /dev/null 154 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigfillset.c 155 | @@ -0,0 +1,11 @@ 156 | +#define LA_OW_COMPACT 157 | + 158 | +#include 159 | + 160 | +#define sigfillset __ow_sigfillset 161 | +#include 162 | + 163 | +#undef sigfillset 164 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 165 | +compat_symbol(libc, __ow_sigfillset, sigfillset, GLIBC_2_0); 166 | +#endif 167 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c 168 | new file mode 100644 169 | index 0000000000..b30cb1a286 170 | --- /dev/null 171 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigisempty.c 172 | @@ -0,0 +1,11 @@ 173 | +#define LA_OW_COMPACT 174 | + 175 | +#include 176 | + 177 | +#define sigisemptyset __ow_sigisemptyset 178 | +#include 179 | + 180 | +#undef sigisemptyset 181 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 182 | +compat_symbol(libc, __ow_sigisemptyset, sigisemptyset, GLIBC_2_0); 183 | +#endif 184 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c 185 | new file mode 100644 186 | index 0000000000..21432e423f 187 | --- /dev/null 188 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigismem.c 189 | @@ -0,0 +1,11 @@ 190 | +#define LA_OW_COMPACT 191 | + 192 | +#include 193 | + 194 | +#define sigismember __ow_sigismember 195 | +#include 196 | + 197 | +#undef sigismember 198 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 199 | +compat_symbol(libc, __ow_sigismember, sigismember, GLIBC_2_0); 200 | +#endif 201 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h 202 | new file mode 100644 203 | index 0000000000..f06836b852 204 | --- /dev/null 205 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigop.h 206 | @@ -0,0 +1,8 @@ 207 | +#include 208 | + 209 | +extern int __ow_sigaddset(sigset_t *, int); 210 | +extern int __ow_sigdelset(sigset_t *, int); 211 | +extern int __ow_sigemptyset(sigset_t *); 212 | +extern int __ow_sigfillset(sigset_t *); 213 | +extern int __ow_sigandset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right); 214 | +extern int __ow_sigorset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right); 215 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c b/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c 216 | new file mode 100644 217 | index 0000000000..8e73662b68 218 | --- /dev/null 219 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_sigorset.c 220 | @@ -0,0 +1,11 @@ 221 | +#define LA_OW_COMPACT 222 | + 223 | +#include 224 | + 225 | +#define sigorset __ow_sigorset 226 | +#include 227 | + 228 | +#undef sigorset 229 | +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_36) 230 | +compat_symbol(libc, __ow_sigorset, sigorset, GLIBC_2_0); 231 | +#endif 232 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigaddset.c b/sysdeps/unix/sysv/linux/loongarch/sigaddset.c 233 | new file mode 100644 234 | index 0000000000..d86362d17c 235 | --- /dev/null 236 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigaddset.c 237 | @@ -0,0 +1,11 @@ 238 | +#include 239 | +#include 240 | + 241 | +#define sigaddset __nw_sigaddset 242 | +#undef libc_hidden_def 243 | +#define libc_hidden_def(name) 244 | +#include 245 | + 246 | +#undef sigaddset 247 | +versioned_symbol(libc, __nw_sigaddset, sigaddset, GLIBC_2_36); 248 | +libc_hidden_ver(__nw_sigaddset, sigaddset) 249 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigandset.c b/sysdeps/unix/sysv/linux/loongarch/sigandset.c 250 | new file mode 100644 251 | index 0000000000..e3345db85f 252 | --- /dev/null 253 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigandset.c 254 | @@ -0,0 +1,7 @@ 255 | +#include 256 | + 257 | +#define sigandset __nw_sigandset 258 | +#include 259 | + 260 | +#undef sigandset 261 | +versioned_symbol(libc, __nw_sigandset, sigandset, GLIBC_2_36); 262 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigdelset.c b/sysdeps/unix/sysv/linux/loongarch/sigdelset.c 263 | new file mode 100644 264 | index 0000000000..13e9c950d7 265 | --- /dev/null 266 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigdelset.c 267 | @@ -0,0 +1,11 @@ 268 | +#include 269 | +#include 270 | + 271 | +#define sigdelset __nw_sigdelset 272 | +#undef libc_hidden_def 273 | +#define libc_hidden_def(name) 274 | +#include 275 | + 276 | +#undef sigdelset 277 | +versioned_symbol(libc, __nw_sigdelset, sigdelset, GLIBC_2_36); 278 | +libc_hidden_ver(__nw_sigdelset, sigdelset) 279 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigempty.c b/sysdeps/unix/sysv/linux/loongarch/sigempty.c 280 | new file mode 100644 281 | index 0000000000..476756e6e0 282 | --- /dev/null 283 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigempty.c 284 | @@ -0,0 +1,11 @@ 285 | +#include 286 | +#include 287 | + 288 | +#define sigemptyset __nw_sigemptyset 289 | +#undef libc_hidden_def 290 | +#define libc_hidden_def(name) 291 | +#include 292 | + 293 | +#undef sigemptyset 294 | +versioned_symbol(libc, __nw_sigemptyset, sigemptyset, GLIBC_2_36); 295 | +libc_hidden_ver(__nw_sigemptyset, sigemptyset) 296 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigfillset.c b/sysdeps/unix/sysv/linux/loongarch/sigfillset.c 297 | new file mode 100644 298 | index 0000000000..2f55b8664c 299 | --- /dev/null 300 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigfillset.c 301 | @@ -0,0 +1,11 @@ 302 | +#include 303 | +#include 304 | + 305 | +#define sigfillset __nw_sigfillset 306 | +#undef libc_hidden_def 307 | +#define libc_hidden_def(name) 308 | +#include 309 | + 310 | +#undef sigfillset 311 | +versioned_symbol(libc, __nw_sigfillset, sigfillset, GLIBC_2_36); 312 | +libc_hidden_ver(__nw_sigfillset, sigfillset) 313 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigisempty.c b/sysdeps/unix/sysv/linux/loongarch/sigisempty.c 314 | new file mode 100644 315 | index 0000000000..b6ea8b8454 316 | --- /dev/null 317 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigisempty.c 318 | @@ -0,0 +1,7 @@ 319 | +#include 320 | + 321 | +#define sigisemptyset __nw_sigisemptyset 322 | +#include 323 | + 324 | +#undef sigisemptyset 325 | +versioned_symbol(libc, __nw_sigisemptyset, sigisemptyset, GLIBC_2_36); 326 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigismem.c b/sysdeps/unix/sysv/linux/loongarch/sigismem.c 327 | new file mode 100644 328 | index 0000000000..ae7d9b624d 329 | --- /dev/null 330 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigismem.c 331 | @@ -0,0 +1,7 @@ 332 | +#include 333 | + 334 | +#define sigismember __nw_sigismember 335 | +#include 336 | + 337 | +#undef sigismember 338 | +versioned_symbol(libc, __nw_sigismember, sigismember, GLIBC_2_36); 339 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigorset.c b/sysdeps/unix/sysv/linux/loongarch/sigorset.c 340 | new file mode 100644 341 | index 0000000000..a49e3f4ee8 342 | --- /dev/null 343 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigorset.c 344 | @@ -0,0 +1,7 @@ 345 | +#include 346 | + 347 | +#define sigorset __nw_sigorset 348 | +#include 349 | + 350 | +#undef sigorset 351 | +versioned_symbol(libc, __nw_sigorset, sigorset, GLIBC_2_36); 352 | -- 353 | 2.52.0 354 | 355 | -------------------------------------------------------------------------------- /autobuild/build: -------------------------------------------------------------------------------- 1 | abinfo "Setting up build environment ..." 2 | OWTARGET="loongarch64-aosc-linux-gnuow" 3 | LOLPREFIX="/opt/lol" 4 | 5 | abinfo "Appending -O2 to CPPFLAGS to fix build ..." 6 | export CPPFLAGS="${CPPFLAGS} -O2" 7 | 8 | apply_source_patch_series() { 9 | local patch_path=$1 10 | local src_path=$2 11 | local package=$3 12 | local patch 13 | 14 | abinfo "Applying $package patches ..." 15 | while IFS= read -r patch; do 16 | abinfo " Applying $patch ..." 17 | patch -p 1 --ignore-whitespace -d "$src_path" \ 18 | < "$patch_path/$patch" 19 | done <"$patch_path/series" 20 | } 21 | 22 | glibc_source() { 23 | abinfo "Extracting Glibc sources ..." 24 | 25 | abinfo "Setting up Glibc source tree ..." 26 | abinfo "Unpacking Glibc source tar ..." 27 | mkdir -pv "$BLDDIR/src/glibc" 28 | tar \ 29 | -C "$BLDDIR/src/glibc" \ 30 | -xvJ \ 31 | --strip-components=1 \ 32 | -f "$SRCDIR/glibc.tar.xz" 33 | apply_source_patch_series \ 34 | "$SRCDIR/autobuild/patches/glibc" \ 35 | "$BLDDIR/src/glibc" \ 36 | "Glibc" 37 | } 38 | 39 | libxcrypt_source() { 40 | abinfo "Extracting Libxcrypt sources ..." 41 | 42 | abinfo "Setting up Libxcrypt source tree ..." 43 | abinfo "Unpacking Libxcrypt source tar ..." 44 | mkdir -pv "$BLDDIR/src/libxcrypt" 45 | tar \ 46 | -C "$BLDDIR/src/libxcrypt" \ 47 | -xvJ \ 48 | --strip-components=1 \ 49 | -f "$SRCDIR/libxcrypt.tar.xz" 50 | } 51 | 52 | cflags_common="-O2 -g -ffile-prefix-map=$BLDDIR=." 53 | ldflags_common="-Wl,-O1,--sort-common,--as-needed -Wl,-build-id=sha1" 54 | libc_map="GLIBC_2.36=GLIBC_2.27,GLIBC_2.28" 55 | 56 | gen_abi_list() { 57 | local lib=$1 58 | LC_ALL=C objdump --dynamic-syms "$lib" | \ 59 | LC_ALL=C awk -f "$BLDDIR/src/glibc/scripts/abilist.awk" 60 | } 61 | 62 | glibc_build() { 63 | mkdir -pv "$BLDDIR/build/glibc" 64 | 65 | pushd "$BLDDIR/build/glibc" 66 | 67 | local debver=$PKGVER 68 | if [ "$PKGREL" != 0 ]; then 69 | debver+="-$PKGREL" 70 | fi 71 | 72 | cat > configparms < "$BLDDIR/build/abiversions/actual/$lib.abilist" 195 | done 196 | 197 | chmod -v +x \ 198 | "$PKGDIR$LOLPREFIX/support/lib/$OWTARGET/ld.so.1" \ 199 | "$PKGDIR$LOLPREFIX/support/lib/$OWTARGET/libc.so.6" 200 | 201 | mkdir -pv "$PKGDIR/usr/lib" #/lib64 is /usr/lib on AOSC 202 | ln -sfvr "$PKGDIR$LOLPREFIX/support/lib/$OWTARGET/ld.so.1" \ 203 | "$PKGDIR/usr/lib/ld.so.1" 204 | popd 205 | } 206 | 207 | libxcrypt_build_core() { 208 | abinfo "Configuring Libxcrypt ..." 209 | env -i "TERM=$TERM" "PATH=$PATH" \ 210 | "$BLDDIR/src/libxcrypt/configure" \ 211 | --prefix="/usr" \ 212 | --host="$OWTARGET" \ 213 | --disable-werror \ 214 | --enable-shared \ 215 | --disable-xcrypt-compat-files \ 216 | --enable-obsolete-api=glibc \ 217 | CFLAGS="$cflags_common" \ 218 | LDFLAGS="$ldflags_common" 219 | 220 | abinfo "Building Libxcrypt ..." 221 | rm -f crypt-symbol-vers.h crypt-symbol-vers.h.stamp 222 | env -i "MAKEFLAGS=$MAKEFLAGS" "TERM=$TERM" "PATH=$PATH" \ 223 | make "libcrypt.la" "$@" 224 | 225 | if [ ! -f .libs/libcrypt.so.1 ]; then 226 | abdie "libcrypt.so.1 not generated" 227 | fi 228 | } 229 | 230 | 231 | libxcrypt_build() { 232 | mkdir -pv "$BLDDIR/build/libxcrypt" 233 | pushd "$BLDDIR/build/libxcrypt" 234 | 235 | 236 | autoreconf -fvs --install "$BLDDIR/src/libxcrypt" 237 | 238 | libxcrypt_build_core "SYMVER_FLOOR=GLIBC_2.27" 239 | 240 | abinfo "Patching Libxcrypt ..." 241 | 242 | "$BLDDIR/build/patchelf/src/patchelf" \ 243 | --page-size "$(( 64 * 1024 ))" \ 244 | --remap-symvers "$libc_map" \ 245 | ".libs/libcrypt.so.1" 246 | 247 | "$BLDDIR/build/patchelf/src/patchelf" \ 248 | --page-size "$(( 64 * 1024 ))" \ 249 | --replace-needed "ld-linux-loongarch-lp64d.so.1" "ld.so.1" \ 250 | ".libs/libcrypt.so.1" 251 | 252 | abinfo "Installing Libxcrypt ..." 253 | install -Dvm644 ".libs/libcrypt.so.1" \ 254 | -t "$PKGDIR$LOLPREFIX/support/lib/$OWTARGET/" 255 | 256 | abinfo "Generating abi info ..." 257 | mkdir -pv "$BLDDIR/build/abiversions/actual" 258 | 259 | gen_abi_list ".libs/libcrypt.so.1" \ 260 | > "$BLDDIR/build/abiversions/actual/libcrypt.abilist" 261 | popd 262 | 263 | abinfo "Rebuilding Libxcrypt with proper ABI ..." 264 | mkdir -pv "$BLDDIR/build/libxcrypt-normal" 265 | pushd "$BLDDIR/build/libxcrypt-normal" 266 | 267 | libxcrypt_build_core 268 | 269 | abinfo "Generating expected abi info ..." 270 | gen_abi_list ".libs/libcrypt.so.1" \ 271 | > "$BLDDIR/build/libxcrypt-normal/libcrypt.abilist" 272 | popd 273 | 274 | } 275 | 276 | patchelf_build() { 277 | abinfo "Unpacking patchelf ..." 278 | mkdir -pv "$BLDDIR/src/patchelf" 279 | tar \ 280 | -C "$BLDDIR/src/patchelf" \ 281 | -xvz \ 282 | --strip-components=1 \ 283 | -f "$SRCDIR/patchelf.tar.gz" 284 | 285 | apply_source_patch_series \ 286 | "$SRCDIR/autobuild/patches/patchelf" \ 287 | "$BLDDIR/src/patchelf" \ 288 | "patchelf" 289 | 290 | abinfo "Building patchelf ..." 291 | mkdir -pv "$BLDDIR/build/patchelf" 292 | pushd "$BLDDIR/build/patchelf" 293 | "$BLDDIR/src/patchelf/configure" 294 | make 295 | popd 296 | } 297 | 298 | install_hooks() { 299 | for i in postinst; do 300 | sed 's#@prefix@#'"$LOLPREFIX"'#g; s#@target@#'"$OWTARGET"'#g' \ 301 | "$SRCDIR/autobuild/additional-files/hooks/$i.in" \ 302 | > "$SRCDIR/autobuild/$i" 303 | chmod +x "$SRCDIR/autobuild/$i" 304 | done 305 | } 306 | 307 | check_abiversion() { 308 | abinfo "Generating expected ABI version ..." 309 | mkdir -pv "$BLDDIR/build/abiversions/ow" 310 | mkdir -pv "$BLDDIR/build/abiversions/exp" 311 | local merged_libs=(libanl libdl libpthread librt libutil) 312 | for i in "${merged_libs[@]}"; do 313 | cut -d" " -f 1 "$SRCDIR/autobuild/abiversions/$i.abilist" | uniq | sed 's/$/ __'$i'_version_placeholder F/' >"$BLDDIR/build/abiversions/ow/$i.abilist" 314 | cat "$SRCDIR/autobuild/abiversions/$i.abilist" >> "$BLDDIR/build/abiversions/ow/libc.abilist" 315 | done 316 | cat "$SRCDIR/autobuild/abiversions/libc.abilist" >> "$BLDDIR/build/abiversions/ow/libc.abilist" 317 | for i in "$SRCDIR/autobuild/abiversions/"*".abilist"; do 318 | local name=$(basename "$i") 319 | local filename="$BLDDIR/build/abiversions/ow/$name" 320 | if [ ! -f "$filename" ]; then 321 | cp "$i" "$filename" 322 | fi 323 | done 324 | for i in \ 325 | "$BLDDIR/src/glibc/sysdeps/unix/sysv/linux/loongarch/lp64/"*".abilist" \ 326 | "$BLDDIR/build/libxcrypt-normal/libcrypt.abilist" \ 327 | ; do 328 | local name=$(basename "$i") 329 | local filename="$BLDDIR/build/abiversions/ow/$name" 330 | if [ ! -f "$filename" ]; then 331 | filename="/dev/null" 332 | fi 333 | cat "$i" "$filename" | sort | uniq >"$BLDDIR/build/abiversions/exp/$name" 334 | done 335 | for i in "$BLDDIR/build/abiversions/ow/"*".abilist"; do 336 | local name=$(basename "$i") 337 | local filename="$BLDDIR/build/abiversions/exp/$name" 338 | if [ ! -f "$filename" ]; then 339 | cp "$i" "$filename" 340 | fi 341 | done 342 | abinfo "Comparing ABI versions ..." 343 | local abi_error="" 344 | local abi_warn="" 345 | for i in "$BLDDIR/build/abiversions/exp/"*".abilist"; do 346 | local name=$(basename "$i") 347 | local lib=$(echo "$name" | cut -d. -f1) 348 | if [ ! -f "$BLDDIR/build/abiversions/actual/$name" ]; then 349 | abi_error+="Missing expected library: $lib"$'\n' 350 | continue 351 | fi 352 | local missing=$(comm -23 "$i" <(cat "$BLDDIR/build/abiversions/actual/$name" "$BLDDIR/build/abiversions/actual/libc.abilist" | sort | uniq)) 353 | local extra=$(comm -13 "$i" "$BLDDIR/build/abiversions/actual/$name") 354 | if [ "" != "$missing" ]; then 355 | abi_error+="Missing symbols in $lib:"$'\n' 356 | abi_error+="$missing"$'\n' 357 | fi 358 | if [ "" != "$extra" ]; then 359 | abi_warn+="Extra symbols in $lib:"$'\n' 360 | abi_warn+="$extra"$'\n' 361 | fi 362 | done 363 | if [ -n "$abi_error" ]; then 364 | abdie "ABI check failed"$'\n'"$abi_error" 365 | else 366 | abinfo "ABI check passed" 367 | if [ -n "$abi_warn" ]; then 368 | abinfo "Warnings:"$'\n'"$abi_warn" 369 | fi 370 | fi 371 | } 372 | 373 | abinfo "Building patchelf..." 374 | patchelf_build 375 | 376 | abinfo "Building Glibc ..." 377 | glibc_source 378 | glibc_build 379 | 380 | abinfo "Building Libxcrypt ..." 381 | libxcrypt_source 382 | libxcrypt_build 383 | 384 | check_abiversion 385 | 386 | abinfo "Making symlinks for system provided libs ..." 387 | system_libs_prio=("/usr/lib/libstdc++.so.6") 388 | for i in "${system_libs_prio[@]}"; do 389 | ln -sfv "$i" "$PKGDIR$LOLPREFIX/support/lib/$OWTARGET/" 390 | done 391 | 392 | abinfo "Installing package hooks ..." 393 | install_hooks 394 | 395 | abinfo "Adding glibc dependency ..." 396 | cur_glibc_version=$(dpkg-query -W --showformat='${Version}' glibc) 397 | if [ -z "$cur_glibc_version" ]; then 398 | abdie "Cannot find glibc version" 399 | fi 400 | abinfo "Current glibc version: $cur_glibc_version" 401 | cur_glibc_epoch="" 402 | if [[ "$cur_glibc_version" == *":"* ]]; then 403 | cur_glibc_epoch="$(echo "$cur_glibc_version" | cut -d: -f1)" 404 | abinfo "Current glibc epoch: $cur_glibc_epoch" 405 | cur_glibc_epoch+=":" 406 | fi 407 | PKGDEP+=" glibc>=${cur_glibc_epoch}2.36 glibc<<${cur_glibc_epoch}${__GLIBC_VER}.1~" 408 | 409 | abinfo "Adding libxcrypt dependency ..." 410 | cur_libxcrypt_version=$(dpkg-query -W --showformat='${Version}' libxcrypt) 411 | if [ -z "$cur_libxcrypt_version" ]; then 412 | abdie "Cannot find libxcrypt version" 413 | fi 414 | abinfo "Current libxcrypt version: $cur_libxcrypt_version" 415 | cur_libxcrypt_epoch="" 416 | if [[ "$cur_libxcrypt_version" == *":"* ]]; then 417 | cur_libxcrypt_epoch="$(echo "$cur_libxcrypt_version" | cut -d: -f1)" 418 | abinfo "Current libxcrypt epoch: $cur_libxcrypt_epoch" 419 | cur_libxcrypt_epoch+=":" 420 | fi 421 | PKGBREAK+=" libxcrypt>=${cur_libxcrypt_epoch}${__LIBXCRYPT_VER}.1~" 422 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0002-add-old-world-abi-compatibility.patch: -------------------------------------------------------------------------------- 1 | From 71a9c15c708f8c8bc58a9359c6e2d9704ebfd116 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sat, 13 Jan 2024 03:23:48 +0800 4 | Subject: [PATCH 02/12] add old world abi compatibility 5 | 6 | --- 7 | login/Makefile | 8 +- 8 | nptl/Versions | 261 ++++++++++++++++++ 9 | scripts/firstversions.awk | 9 +- 10 | scripts/versions.awk | 2 +- 11 | sunrpc/Makefile | 4 +- 12 | sysdeps/nptl/Makeconfig | 1 + 13 | sysdeps/unix/sysv/linux/loongarch/Versions | 36 +++ 14 | .../unix/sysv/linux/loongarch/shlib-versions | 11 +- 15 | sysdeps/unix/sysv/linux/loongarch/statx_cp.c | 4 + 16 | 9 files changed, 319 insertions(+), 17 deletions(-) 17 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/Versions 18 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/statx_cp.c 19 | 20 | diff --git a/login/Makefile b/login/Makefile 21 | index d6a9a6975e..46cbc2763e 100644 22 | --- a/login/Makefile 23 | +++ b/login/Makefile 24 | @@ -95,7 +95,7 @@ CFLAGS-tst-utmp-unsigned-64.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 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 | @@ -103,9 +103,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 | 46 | diff --git a/nptl/Versions b/nptl/Versions 47 | index ef55376dd9..09c22f7290 100644 48 | --- a/nptl/Versions 49 | +++ b/nptl/Versions 50 | @@ -536,3 +536,264 @@ ld { 51 | __nptl_set_robust_list_avail; 52 | } 53 | } 54 | + 55 | +libpthread_in_libc { 56 | + GLIBC_2.0 { 57 | + pthread_create; pthread_join; 58 | + pthread_exit; pthread_detach; 59 | + 60 | + pthread_mutex_init; pthread_mutex_destroy; 61 | + pthread_mutex_lock; pthread_mutex_trylock; pthread_mutex_unlock; 62 | + 63 | + pthread_mutexattr_init; pthread_mutexattr_destroy; 64 | + 65 | + pthread_cond_wait; pthread_cond_timedwait; 66 | + pthread_cond_signal; pthread_cond_broadcast; 67 | + 68 | + pthread_cancel; pthread_testcancel; 69 | + pthread_setcancelstate; pthread_setcanceltype; 70 | + 71 | + pthread_sigmask; pthread_kill; 72 | + 73 | + pthread_key_create; pthread_key_delete; 74 | + pthread_getspecific; pthread_setspecific; 75 | + 76 | + pthread_once; 77 | + 78 | + pthread_atfork; 79 | + 80 | + flockfile; funlockfile; ftrylockfile; 81 | + 82 | + # Non-standard POSIX1.x functions. 83 | + pthread_mutexattr_getkind_np; pthread_mutexattr_setkind_np; 84 | + 85 | + # Protected names for functions used in other shared objects. 86 | + __pthread_mutex_init; __pthread_mutex_destroy; 87 | + __pthread_mutex_lock; __pthread_mutex_trylock; __pthread_mutex_unlock; 88 | + __pthread_mutexattr_init; __pthread_mutexattr_destroy; 89 | + __pthread_mutexattr_settype; 90 | + __pthread_key_create; __pthread_getspecific; __pthread_setspecific; 91 | + __pthread_once; __pthread_atfork; 92 | + _IO_flockfile; _IO_ftrylockfile; _IO_funlockfile; 93 | + 94 | + # Semaphores. 95 | + sem_destroy; sem_getvalue; sem_init; sem_post; sem_trywait; sem_wait; 96 | + 97 | + # Special fork handling. 98 | + fork; __fork; 99 | + 100 | + # Cancellation points. 101 | + close; __close; fcntl; __fcntl; read; __read; write; __write; accept; 102 | + connect; __connect; recv; recvfrom; recvmsg; send; __send; sendmsg; sendto; 103 | + fsync; lseek; __lseek; msync; open; __open; pause; tcdrain; 104 | + system; 105 | + nanosleep; wait; __wait; waitpid; 106 | + 107 | + # Hidden entry point (through macros). 108 | + _pthread_cleanup_push; _pthread_cleanup_pop; 109 | + _pthread_cleanup_push_defer; _pthread_cleanup_pop_restore; 110 | + 111 | + pthread_kill_other_threads_np; 112 | + 113 | + # The error functions. 114 | + __errno_location; __h_errno_location; 115 | + 116 | + # Functions which previously have been overwritten. 117 | + sigwait; sigaction; __sigaction; _exit; _Exit; longjmp; siglongjmp; 118 | + raise; 119 | + 120 | + #Additional 121 | + pthread_attr_destroy; pthread_attr_getdetachstate; 122 | + pthread_attr_getinheritsched; pthread_attr_getschedparam; 123 | + pthread_attr_getschedpolicy; pthread_attr_getscope; pthread_attr_init; 124 | + pthread_attr_setdetachstate; pthread_attr_setinheritsched; 125 | + pthread_attr_setschedparam; pthread_attr_setschedpolicy; 126 | + pthread_attr_setscope; pthread_cond_destroy; pthread_cond_init; 127 | + pthread_condattr_destroy; 128 | + pthread_condattr_init; pthread_equal; pthread_getschedparam; pthread_self; 129 | + pthread_setschedparam; 130 | + } 131 | + 132 | + GLIBC_2.1 { 133 | + pthread_create; 134 | + 135 | + pthread_attr_getguardsize; pthread_attr_setguardsize; 136 | + pthread_attr_getstackaddr; pthread_attr_setstackaddr; 137 | + pthread_attr_getstacksize; pthread_attr_setstacksize; 138 | + 139 | + pthread_mutexattr_gettype; pthread_mutexattr_settype; 140 | + 141 | + pthread_rwlock_init; pthread_rwlock_destroy; 142 | + pthread_rwlock_rdlock; pthread_rwlock_wrlock; pthread_rwlock_unlock; 143 | + pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock; 144 | + 145 | + pthread_rwlockattr_init; pthread_rwlockattr_destroy; 146 | + pthread_rwlockattr_getpshared; pthread_rwlockattr_setpshared; 147 | + pthread_rwlockattr_getkind_np; pthread_rwlockattr_setkind_np; 148 | + 149 | + pthread_getconcurrency; pthread_setconcurrency; 150 | + 151 | + # Semaphores. 152 | + sem_destroy; sem_getvalue; sem_init; sem_post; sem_trywait; sem_wait; 153 | + 154 | + __libc_current_sigrtmin; __libc_current_sigrtmax; 155 | + __libc_allocate_rtsig; 156 | + } 157 | + 158 | + GLIBC_2.1.1 { 159 | + sem_close; sem_open; sem_unlink; 160 | + } 161 | + 162 | + GLIBC_2.1.2 { 163 | + __libpthread_version_placeholder; 164 | + } 165 | + 166 | + GLIBC_2.2 { 167 | + pthread_mutexattr_getpshared; pthread_mutexattr_setpshared; 168 | + 169 | + pthread_condattr_getpshared; pthread_condattr_setpshared; 170 | + 171 | + # New functions from IEEE Std. 1003.1-2001. 172 | + pthread_mutex_timedlock; 173 | + 174 | + pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock; 175 | + 176 | + pthread_attr_getstack; pthread_attr_setstack; 177 | + 178 | + pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; 179 | + pthread_spin_trylock; pthread_spin_unlock; 180 | + 181 | + pthread_barrier_init; pthread_barrier_destroy; pthread_barrier_wait; 182 | + pthread_barrierattr_destroy; pthread_barrierattr_init; 183 | + pthread_barrierattr_setpshared; 184 | + 185 | + sem_timedwait; 186 | + 187 | + pthread_yield; 188 | + 189 | + pthread_getcpuclockid; 190 | + 191 | + # Cancellation points. 192 | + lseek64; open64; __open64; pread; pread64; __pread64; pwrite; pwrite64; 193 | + __pwrite64; 194 | + 195 | + # Names used internally. 196 | + __pthread_rwlock_init; __pthread_rwlock_destroy; 197 | + __pthread_rwlock_rdlock; __pthread_rwlock_tryrdlock; 198 | + __pthread_rwlock_wrlock; __pthread_rwlock_trywrlock; 199 | + __pthread_rwlock_unlock; 200 | + 201 | + __res_state; 202 | + 203 | + # Additional 204 | + pthread_attr_init; 205 | + } 206 | + 207 | + GLIBC_2.2.3 { 208 | + __libpthread_version_placeholder; 209 | + 210 | + # Additional 211 | + pthread_getattr_np; 212 | + } 213 | + 214 | + GLIBC_2.2.6 { 215 | + __libpthread_version_placeholder; 216 | + 217 | + # Additional 218 | + __nanosleep; 219 | + } 220 | + 221 | + GLIBC_2.3.2 { 222 | + # Changed pthread_cond_t. 223 | + pthread_cond_init; 224 | + pthread_cond_wait; pthread_cond_timedwait; 225 | + pthread_cond_signal; pthread_cond_broadcast; 226 | + 227 | + # Additional 228 | + pthread_cond_destroy; 229 | + } 230 | + 231 | + GLIBC_2.3.3 { 232 | + # 1003.1-2001 function accidentally left out in 2.2. 233 | + pthread_barrierattr_getpshared; 234 | + 235 | + # Unix CS option. 236 | + pthread_condattr_getclock; pthread_condattr_setclock; 237 | + 238 | + # Proposed API extensions. 239 | + pthread_tryjoin_np; pthread_timedjoin_np; 240 | + 241 | + # New cancellation cleanup handling. 242 | + __pthread_register_cancel; __pthread_unregister_cancel; 243 | + __pthread_register_cancel_defer; __pthread_unregister_cancel_restore; 244 | + __pthread_unwind_next; 245 | + __pthread_cleanup_routine; 246 | + 247 | + # affinity interfaces without size parameter 248 | + pthread_setaffinity_np; 249 | + pthread_attr_getaffinity_np; 250 | + 251 | + # Additional 252 | + pthread_attr_setaffinity_np; pthread_attr_setstack; 253 | + pthread_attr_setstacksize; pthread_getaffinity_np; 254 | + } 255 | + 256 | + GLIBC_2.3.4 { 257 | + # New affinity interfaces. 258 | + pthread_getaffinity_np; pthread_setaffinity_np; 259 | + pthread_attr_getaffinity_np; 260 | + 261 | + pthread_setschedprio; 262 | + 263 | + # Additional 264 | + pthread_attr_setaffinity_np; 265 | + } 266 | + 267 | + GLIBC_2.4 { 268 | + pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust_np; 269 | + pthread_mutex_consistent_np; 270 | + pthread_mutexattr_getprotocol; pthread_mutexattr_setprotocol; 271 | + pthread_mutexattr_getprioceiling; pthread_mutexattr_setprioceiling; 272 | + pthread_mutex_getprioceiling; pthread_mutex_setprioceiling; 273 | + }; 274 | + 275 | + GLIBC_2.11 { 276 | + pthread_sigqueue; 277 | + }; 278 | + 279 | + GLIBC_2.12 { 280 | + pthread_mutex_consistent; pthread_mutexattr_getrobust; 281 | + pthread_mutexattr_setrobust; 282 | + 283 | + pthread_setname_np; pthread_getname_np; 284 | + }; 285 | + 286 | + GLIBC_2.18 { 287 | + pthread_getattr_default_np; 288 | + pthread_setattr_default_np; 289 | + } 290 | + 291 | + GLIBC_2.20 { 292 | + } 293 | + 294 | + GLIBC_2.22 { 295 | + } 296 | + 297 | + # C11 thread symbols. 298 | + GLIBC_2.28 { 299 | + thrd_create; thrd_detach; thrd_exit; thrd_join; 300 | + mtx_init; mtx_lock; mtx_timedlock; mtx_trylock; mtx_unlock; mtx_destroy; 301 | + call_once; cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; 302 | + cnd_timedwait; cnd_wait; tss_create; tss_delete; tss_get; tss_set; 303 | + } 304 | + 305 | + GLIBC_2.30 { 306 | + sem_clockwait; pthread_cond_clockwait; 307 | + pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock; 308 | + pthread_mutex_clocklock; 309 | + } 310 | + 311 | + GLIBC_2.31 { 312 | + pthread_clockjoin_np; 313 | + } 314 | +} 315 | diff --git a/scripts/firstversions.awk b/scripts/firstversions.awk 316 | index ccde4b59b4..16008b0858 100644 317 | --- a/scripts/firstversions.awk 318 | +++ b/scripts/firstversions.awk 319 | @@ -27,9 +27,16 @@ function vers_compare (v1, v2) 320 | } 321 | 322 | NF > 2 && $2 == ":" { 323 | - for (i = 0; i <= NF - 3; ++i) 324 | + for (i = 0; i <= NF - 3; ++i){ 325 | firstversion[$1, i] = $(3 + i); 326 | + if ( $1 == "libpthread" ) { 327 | + firstversion["libpthread_in_libc", i] = $(3 + i); 328 | + } 329 | + } 330 | idx[$1] = 0; 331 | + if ( $1 == "libpthread" ) { 332 | + idx["libpthread_in_libc"] = 0; 333 | + } 334 | next; 335 | } 336 | 337 | diff --git a/scripts/versions.awk b/scripts/versions.awk 338 | index 3365218445..57ff62c524 100644 339 | --- a/scripts/versions.awk 340 | +++ b/scripts/versions.awk 341 | @@ -89,7 +89,7 @@ function ord(c) { 342 | sortver=actver 343 | # Ensure GLIBC_ versions come always first 344 | sub(/^GLIBC_/," GLIBC_",sortver) 345 | - printf("%s %s %s\n", actlib, sortver, $0) | sort; 346 | + printf("%s %s %s\n", actlib == "libpthread_in_libc" ? "libc" : actlib, sortver, $0) | sort; 347 | } 348 | 349 | # Some targets do not set the ABI baseline for libdl. As a result, 350 | diff --git a/sunrpc/Makefile b/sunrpc/Makefile 351 | index ca5311c41d..d0133505ad 100644 352 | --- a/sunrpc/Makefile 353 | +++ b/sunrpc/Makefile 354 | @@ -22,7 +22,7 @@ subdir := sunrpc 355 | 356 | include ../Makeconfig 357 | 358 | -ifdef have-GLIBC_2.31 359 | +#ifdef have-GLIBC_2.31 360 | 361 | # The code in this subdirectory is taken from Sun's RPCSRC-4.0 362 | # distribution with some additional changes from the TI-RPC package 363 | @@ -62,7 +62,7 @@ routines := auth_none authuxprot clnt_raw clnt_simp \ 364 | rpc_gethostbyname 365 | # We only add the RPC for compatibility to libc.so. 366 | shared-only-routines = $(routines) 367 | -endif 368 | +#endif 369 | 370 | tests = tst-xdrmem tst-xdrmem2 tst-udp-error tst-udp-timeout \ 371 | tst-udp-nonblocking tst-bug22542 tst-bug28768 372 | diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig 373 | index b5f546bac1..4847f08584 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 = 384 | diff --git a/sysdeps/unix/sysv/linux/loongarch/Versions b/sysdeps/unix/sysv/linux/loongarch/Versions 385 | new file mode 100644 386 | index 0000000000..6b3dd0d12e 387 | --- /dev/null 388 | +++ b/sysdeps/unix/sysv/linux/loongarch/Versions 389 | @@ -0,0 +1,36 @@ 390 | +libc { 391 | + GLIBC_2.36 { 392 | + __ppoll_chk; 393 | + signalfd; 394 | + epoll_pwait2; 395 | + epoll_pwait; 396 | + pselect; 397 | + ppoll; 398 | + posix_spawnattr_getsigmask; 399 | + posix_spawnattr_getsigdefault; 400 | + posix_spawnattr_setsigmask; 401 | + posix_spawnattr_setsigdefault; 402 | + sigwaitinfo; 403 | + sigorset; 404 | + sigandset; 405 | + sigisemptyset; 406 | + sigismember; 407 | + sigaddset; 408 | + sigfillset; 409 | + sigemptyset; 410 | + sigdelset; 411 | + sigwait; 412 | + sigtimedwait; 413 | + __sigsuspend; 414 | + sigsuspend; 415 | + sigpending; 416 | + pthread_sigmask; 417 | + sigprocmask; 418 | + sigaction; 419 | + __sigaction; 420 | + swapcontext; 421 | + setcontext; 422 | + makecontext; 423 | + getcontext; 424 | + } 425 | +} 426 | diff --git a/sysdeps/unix/sysv/linux/loongarch/shlib-versions b/sysdeps/unix/sysv/linux/loongarch/shlib-versions 427 | index 5f40e7f5ec..4f126b5494 100644 428 | --- a/sysdeps/unix/sysv/linux/loongarch/shlib-versions 429 | +++ b/sysdeps/unix/sysv/linux/loongarch/shlib-versions 430 | @@ -1,9 +1,2 @@ 431 | -DEFAULT GLIBC_2.36 432 | - 433 | -%if LOONGARCH_ABI_GRLEN == 64 && LOONGARCH_ABI_FRLEN == 64 434 | -ld=ld-linux-loongarch-lp64d.so.1 435 | -%elif LOONGARCH_ABI_GRLEN == 64 && LOONGARCH_ABI_FRLEN == 0 436 | -ld=ld-linux-loongarch-lp64s.so.1 437 | -%else 438 | -%error cannot determine ABI 439 | -%endif 440 | +DEFAULT GLIBC_2.27 GLIBC_2.28 GLIBC_2.36 441 | +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 442 | diff --git a/sysdeps/unix/sysv/linux/loongarch/statx_cp.c b/sysdeps/unix/sysv/linux/loongarch/statx_cp.c 443 | new file mode 100644 444 | index 0000000000..3b57a461d1 445 | --- /dev/null 446 | +++ b/sysdeps/unix/sysv/linux/loongarch/statx_cp.c 447 | @@ -0,0 +1,4 @@ 448 | +// We neet statx_cp for oldworld compaitibility. 449 | +// So include it back and override the oerride in wordsize-64 450 | + 451 | +#include 452 | -- 453 | 2.52.0 454 | 455 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0008-add-more-pthread-symbols.patch: -------------------------------------------------------------------------------- 1 | From 37625283fdf659ccb64a98d669b70783f097a34e Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sun, 14 Jan 2024 08:41:15 +0800 4 | Subject: [PATCH 08/12] add more pthread symbols 5 | 6 | --- 7 | nptl/old_pthread_cond_destroy.c | 4 ++-- 8 | nptl/old_pthread_cond_init.c | 4 ++-- 9 | nptl/pthread_attr_init.c | 6 +++--- 10 | nptl/pthread_attr_setaffinity.c | 10 +++++----- 11 | nptl/pthread_attr_setstack.c | 4 ++-- 12 | nptl/pthread_attr_setstacksize.c | 2 +- 13 | nptl/pthread_cond_broadcast.c | 2 +- 14 | nptl/pthread_cond_destroy.c | 2 +- 15 | nptl/pthread_cond_init.c | 2 +- 16 | nptl/pthread_cond_wait.c | 4 ++-- 17 | nptl/pthread_detach.c | 2 +- 18 | nptl/pthread_getaffinity.c | 10 +++++----- 19 | nptl/pthread_getattr_np.c | 6 +++--- 20 | nptl/pthread_join.c | 4 ++-- 21 | nptl/pthread_kill.c | 4 ++-- 22 | nptl/pthread_mutex_destroy.c | 2 +- 23 | nptl/pthread_mutexattr_destroy.c | 6 +++--- 24 | nptl/pthread_setattr_default_np.c | 4 ++-- 25 | nptl/pthread_sigmask.c | 6 +++--- 26 | nptl/pthread_testcancel.c | 4 ++-- 27 | nptl/pthread_tryjoin.c | 4 ++-- 28 | sysdeps/loongarch/nptl/pthread_sigmask.c | 10 +++++----- 29 | sysdeps/unix/sysv/linux/loongarch/Makefile | 4 ++++ 30 | 23 files changed, 55 insertions(+), 51 deletions(-) 31 | 32 | diff --git a/nptl/old_pthread_cond_destroy.c b/nptl/old_pthread_cond_destroy.c 33 | index 7e2ef61efe..dee1207398 100644 34 | --- a/nptl/old_pthread_cond_destroy.c 35 | +++ b/nptl/old_pthread_cond_destroy.c 36 | @@ -20,7 +20,7 @@ 37 | #include 38 | 39 | 40 | -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) 41 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_2) 42 | int 43 | __pthread_cond_destroy_2_0 (pthread_cond_2_0_t *cond) 44 | { 45 | @@ -29,6 +29,6 @@ __pthread_cond_destroy_2_0 (pthread_cond_2_0_t *cond) 46 | 47 | return 0; 48 | } 49 | -compat_symbol (libc, __pthread_cond_destroy_2_0, pthread_cond_destroy, 50 | +compat_symbol (libpthread, __pthread_cond_destroy_2_0, pthread_cond_destroy, 51 | GLIBC_2_0); 52 | #endif 53 | diff --git a/nptl/old_pthread_cond_init.c b/nptl/old_pthread_cond_init.c 54 | index e75d56fde4..2be90b1913 100644 55 | --- a/nptl/old_pthread_cond_init.c 56 | +++ b/nptl/old_pthread_cond_init.c 57 | @@ -20,7 +20,7 @@ 58 | #include 59 | 60 | 61 | -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) 62 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_2) 63 | int 64 | __pthread_cond_init_2_0 (pthread_cond_2_0_t *cond, 65 | const pthread_condattr_t *cond_attr) 66 | @@ -39,6 +39,6 @@ __pthread_cond_init_2_0 (pthread_cond_2_0_t *cond, 67 | 68 | return 0; 69 | } 70 | -compat_symbol (libc, __pthread_cond_init_2_0, pthread_cond_init, 71 | +compat_symbol (libpthread, __pthread_cond_init_2_0, pthread_cond_init, 72 | GLIBC_2_0); 73 | #endif 74 | diff --git a/nptl/pthread_attr_init.c b/nptl/pthread_attr_init.c 75 | index 9af4e873c3..39b64eb734 100644 76 | --- a/nptl/pthread_attr_init.c 77 | +++ b/nptl/pthread_attr_init.c 78 | @@ -48,10 +48,10 @@ __pthread_attr_init (pthread_attr_t *attr) 79 | return 0; 80 | } 81 | libc_hidden_def (__pthread_attr_init) 82 | -versioned_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_1); 83 | +versioned_symbol (libpthread, __pthread_attr_init, pthread_attr_init, GLIBC_2_1); 84 | 85 | 86 | -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1) 87 | +#if OTHER_SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) 88 | int 89 | __pthread_attr_init_2_0 (pthread_attr_t *attr) 90 | { 91 | @@ -80,5 +80,5 @@ __pthread_attr_init_2_0 (pthread_attr_t *attr) 92 | old attribute structure. */ 93 | return 0; 94 | } 95 | -compat_symbol (libc, __pthread_attr_init_2_0, pthread_attr_init, GLIBC_2_0); 96 | +compat_symbol (libpthread, __pthread_attr_init_2_0, pthread_attr_init, GLIBC_2_0); 97 | #endif 98 | diff --git a/nptl/pthread_attr_setaffinity.c b/nptl/pthread_attr_setaffinity.c 99 | index 0867037266..8aba389d9d 100644 100 | --- a/nptl/pthread_attr_setaffinity.c 101 | +++ b/nptl/pthread_attr_setaffinity.c 102 | @@ -62,24 +62,24 @@ __pthread_attr_setaffinity_np (pthread_attr_t *attr, size_t cpusetsize, 103 | return 0; 104 | } 105 | libc_hidden_def (__pthread_attr_setaffinity_np) 106 | -versioned_symbol (libc, __pthread_attr_setaffinity_np, 107 | +versioned_symbol (libpthread, __pthread_attr_setaffinity_np, 108 | pthread_attr_setaffinity_np, GLIBC_2_32); 109 | 110 | 111 | -#if SHLIB_COMPAT (libc, GLIBC_2_3_4, GLIBC_2_32) 112 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_4, GLIBC_2_32) 113 | /* Compat symbol with the old libc version. */ 114 | strong_alias (__pthread_attr_setaffinity_np, __pthread_attr_setaffinity_alias) 115 | -compat_symbol (libc, __pthread_attr_setaffinity_alias, 116 | +compat_symbol (libpthread, __pthread_attr_setaffinity_alias, 117 | pthread_attr_setaffinity_np, GLIBC_2_3_4); 118 | #endif 119 | 120 | -#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4) 121 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) 122 | int 123 | __pthread_attr_setaffinity_old (pthread_attr_t *attr, cpu_set_t *cpuset) 124 | { 125 | /* The old interface by default assumed a 1024 processor bitmap. */ 126 | return __pthread_attr_setaffinity_np (attr, 128, cpuset); 127 | } 128 | -compat_symbol (libc, __pthread_attr_setaffinity_old, 129 | +compat_symbol (libpthread, __pthread_attr_setaffinity_old, 130 | pthread_attr_setaffinity_np, GLIBC_2_3_3); 131 | #endif 132 | diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c 133 | index 6efbbfee80..d569f2df90 100644 134 | --- a/nptl/pthread_attr_setstack.c 135 | +++ b/nptl/pthread_attr_setstack.c 136 | @@ -53,10 +53,10 @@ __pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, 137 | 138 | return 0; 139 | } 140 | -versioned_symbol (libc, __pthread_attr_setstack, pthread_attr_setstack, 141 | +versioned_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, 142 | GLIBC_2_34); 143 | 144 | -#if PTHREAD_STACK_MIN == 16384 145 | +#if PTHREAD_STACK_MIN == 16384 && !defined(COMP_CHANGED_PTHREAD_STACK_MIN) 146 | # if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34) 147 | compat_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, 148 | GLIBC_2_2); 149 | diff --git a/nptl/pthread_attr_setstacksize.c b/nptl/pthread_attr_setstacksize.c 150 | index e7812d269c..6e2dec44c6 100644 151 | --- a/nptl/pthread_attr_setstacksize.c 152 | +++ b/nptl/pthread_attr_setstacksize.c 153 | @@ -45,7 +45,7 @@ versioned_symbol (libc, __pthread_attr_setstacksize, 154 | pthread_attr_setstacksize, GLIBC_2_34); 155 | 156 | 157 | -#if PTHREAD_STACK_MIN == 16384 158 | +#if PTHREAD_STACK_MIN == 16384 && !defined(COMP_CHANGED_PTHREAD_STACK_MIN) 159 | # if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_34) 160 | compat_symbol (libpthread, __pthread_attr_setstacksize, 161 | pthread_attr_setstacksize, GLIBC_2_1); 162 | diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c 163 | index 12e2687c58..55fac56b1c 100644 164 | --- a/nptl/pthread_cond_broadcast.c 165 | +++ b/nptl/pthread_cond_broadcast.c 166 | @@ -86,7 +86,7 @@ ___pthread_cond_broadcast (pthread_cond_t *cond) 167 | 168 | return 0; 169 | } 170 | -versioned_symbol (libc, ___pthread_cond_broadcast, 171 | +versioned_symbol (libpthread, ___pthread_cond_broadcast, 172 | pthread_cond_broadcast, GLIBC_2_3_2); 173 | libc_hidden_ver (___pthread_cond_broadcast, __pthread_cond_broadcast) 174 | #ifndef SHARED 175 | diff --git a/nptl/pthread_cond_destroy.c b/nptl/pthread_cond_destroy.c 176 | index c504a96031..f5b13cb1a4 100644 177 | --- a/nptl/pthread_cond_destroy.c 178 | +++ b/nptl/pthread_cond_destroy.c 179 | @@ -58,5 +58,5 @@ __pthread_cond_destroy (pthread_cond_t *cond) 180 | return 0; 181 | } 182 | libc_hidden_def (__pthread_cond_destroy) 183 | -versioned_symbol (libc, __pthread_cond_destroy, 184 | +versioned_symbol (libpthread, __pthread_cond_destroy, 185 | pthread_cond_destroy, GLIBC_2_3_2); 186 | diff --git a/nptl/pthread_cond_init.c b/nptl/pthread_cond_init.c 187 | index d3285b10e5..a4bc15115c 100644 188 | --- a/nptl/pthread_cond_init.c 189 | +++ b/nptl/pthread_cond_init.c 190 | @@ -49,5 +49,5 @@ __pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr) 191 | return 0; 192 | } 193 | libc_hidden_def (__pthread_cond_init) 194 | -versioned_symbol (libc, __pthread_cond_init, 195 | +versioned_symbol (libpthread, __pthread_cond_init, 196 | pthread_cond_init, GLIBC_2_3_2); 197 | diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c 198 | index c6461bd116..7bf37275ca 100644 199 | --- a/nptl/pthread_cond_wait.c 200 | +++ b/nptl/pthread_cond_wait.c 201 | @@ -453,7 +453,7 @@ ___pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) 202 | return __pthread_cond_wait_common (cond, mutex, 0, NULL); 203 | } 204 | 205 | -versioned_symbol (libc, ___pthread_cond_wait, pthread_cond_wait, 206 | +versioned_symbol (libpthread, ___pthread_cond_wait, pthread_cond_wait, 207 | GLIBC_2_3_2); 208 | libc_hidden_ver (___pthread_cond_wait, __pthread_cond_wait) 209 | #ifndef SHARED 210 | @@ -493,7 +493,7 @@ ___pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, 211 | return __pthread_cond_timedwait64 (cond, mutex, &ts64); 212 | } 213 | #endif /* __TIMESIZE == 64 */ 214 | -versioned_symbol (libc, ___pthread_cond_timedwait, 215 | +versioned_symbol (libpthread, ___pthread_cond_timedwait, 216 | pthread_cond_timedwait, GLIBC_2_3_2); 217 | libc_hidden_ver (___pthread_cond_timedwait, __pthread_cond_timedwait) 218 | #ifndef SHARED 219 | diff --git a/nptl/pthread_detach.c b/nptl/pthread_detach.c 220 | index 3bbc037bdc..df4248fb8c 100644 221 | --- a/nptl/pthread_detach.c 222 | +++ b/nptl/pthread_detach.c 223 | @@ -59,5 +59,5 @@ strong_alias (___pthread_detach, __pthread_detach) 224 | #endif 225 | 226 | #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) 227 | -compat_symbol (libc, ___pthread_detach, pthread_detach, GLIBC_2_0); 228 | +compat_symbol (libpthread, ___pthread_detach, pthread_detach, GLIBC_2_0); 229 | #endif 230 | diff --git a/nptl/pthread_getaffinity.c b/nptl/pthread_getaffinity.c 231 | index 0828185fbd..0daf039ed4 100644 232 | --- a/nptl/pthread_getaffinity.c 233 | +++ b/nptl/pthread_getaffinity.c 234 | @@ -41,22 +41,22 @@ __pthread_getaffinity_np (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset) 235 | return 0; 236 | } 237 | libc_hidden_def (__pthread_getaffinity_np) 238 | -versioned_symbol (libc, __pthread_getaffinity_np, pthread_getaffinity_np, 239 | +versioned_symbol (libpthread, __pthread_getaffinity_np, pthread_getaffinity_np, 240 | GLIBC_2_32); 241 | 242 | -#if SHLIB_COMPAT (libc, GLIBC_2_3_4, GLIBC_2_32) 243 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_4, GLIBC_2_32) 244 | strong_alias (__pthread_getaffinity_np, __pthread_getaffinity_alias) 245 | -compat_symbol (libc, __pthread_getaffinity_alias, pthread_getaffinity_np, 246 | +compat_symbol (libpthread, __pthread_getaffinity_alias, pthread_getaffinity_np, 247 | GLIBC_2_3_4); 248 | #endif 249 | 250 | -#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4) 251 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) 252 | int 253 | __pthread_getaffinity_old (pthread_t th, cpu_set_t *cpuset) 254 | { 255 | /* The old interface by default assumed a 1024 processor bitmap. */ 256 | return __pthread_getaffinity_np (th, 128, cpuset); 257 | } 258 | -compat_symbol (libc, __pthread_getaffinity_old, pthread_getaffinity_np, 259 | +compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np, 260 | GLIBC_2_3_3); 261 | #endif 262 | diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c 263 | index 43dd16d59c..e74798dbb3 100644 264 | --- a/nptl/pthread_getattr_np.c 265 | +++ b/nptl/pthread_getattr_np.c 266 | @@ -205,10 +205,10 @@ __pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr) 267 | 268 | return ret; 269 | } 270 | -versioned_symbol (libc, __pthread_getattr_np, pthread_getattr_np, GLIBC_2_32); 271 | +versioned_symbol (libpthread, __pthread_getattr_np, pthread_getattr_np, GLIBC_2_32); 272 | 273 | -#if SHLIB_COMPAT (libc, GLIBC_2_2_3, GLIBC_2_32) 274 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2_3, GLIBC_2_32) 275 | strong_alias (__pthread_getattr_np, __pthread_getattr_np_alias) 276 | -compat_symbol (libc, __pthread_getattr_np_alias, 277 | +compat_symbol (libpthread, __pthread_getattr_np_alias, 278 | pthread_getattr_np, GLIBC_2_2_3); 279 | #endif 280 | diff --git a/nptl/pthread_join.c b/nptl/pthread_join.c 281 | index cf8e56c8cf..c07cf6196b 100644 282 | --- a/nptl/pthread_join.c 283 | +++ b/nptl/pthread_join.c 284 | @@ -24,12 +24,12 @@ ___pthread_join (pthread_t threadid, void **thread_return) 285 | return __pthread_clockjoin_ex (threadid, thread_return, 0 /* Ignored */, 286 | NULL, true); 287 | } 288 | -versioned_symbol (libc, ___pthread_join, pthread_join, GLIBC_2_34); 289 | +versioned_symbol (libpthread, ___pthread_join, pthread_join, GLIBC_2_34); 290 | libc_hidden_ver (___pthread_join, __pthread_join) 291 | #ifndef SHARED 292 | strong_alias (___pthread_join, __pthread_join) 293 | #endif 294 | 295 | #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) 296 | -compat_symbol (libc, ___pthread_join, pthread_join, GLIBC_2_0); 297 | +compat_symbol (libpthread, ___pthread_join, pthread_join, GLIBC_2_0); 298 | #endif 299 | diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c 300 | index 3938e3f8cd..9a97efcbbe 100644 301 | --- a/nptl/pthread_kill.c 302 | +++ b/nptl/pthread_kill.c 303 | @@ -104,7 +104,7 @@ __pthread_kill (pthread_t threadid, int signo) 304 | avoid the symbol version if it ends up being used on ld.so. */ 305 | #if !IS_IN(rtld) 306 | libc_hidden_def (__pthread_kill) 307 | -versioned_symbol (libc, __pthread_kill, pthread_kill, GLIBC_2_34); 308 | +versioned_symbol (libpthread, __pthread_kill, pthread_kill, GLIBC_2_34); 309 | 310 | # if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) 311 | /* Variant which returns ESRCH in the no-TID case, for backwards 312 | @@ -118,6 +118,6 @@ __pthread_kill_esrch (pthread_t threadid, int signo) 313 | 314 | return __pthread_kill_implementation (threadid, signo, ESRCH); 315 | } 316 | -compat_symbol (libc, __pthread_kill_esrch, pthread_kill, GLIBC_2_0); 317 | +compat_symbol (libpthread, __pthread_kill_esrch, pthread_kill, GLIBC_2_0); 318 | # endif 319 | #endif 320 | diff --git a/nptl/pthread_mutex_destroy.c b/nptl/pthread_mutex_destroy.c 321 | index 94f50accf0..a19e2e5e3f 100644 322 | --- a/nptl/pthread_mutex_destroy.c 323 | +++ b/nptl/pthread_mutex_destroy.c 324 | @@ -40,7 +40,7 @@ ___pthread_mutex_destroy (pthread_mutex_t *mutex) 325 | 326 | return 0; 327 | } 328 | -versioned_symbol (libc, ___pthread_mutex_destroy, pthread_mutex_destroy, 329 | +versioned_symbol (libpthread, ___pthread_mutex_destroy, pthread_mutex_destroy, 330 | GLIBC_2_0); 331 | libc_hidden_ver (___pthread_mutex_destroy, __pthread_mutex_destroy) 332 | #ifndef SHARED 333 | diff --git a/nptl/pthread_mutexattr_destroy.c b/nptl/pthread_mutexattr_destroy.c 334 | index 90b51ec6e0..b4f1b3040a 100644 335 | --- a/nptl/pthread_mutexattr_destroy.c 336 | +++ b/nptl/pthread_mutexattr_destroy.c 337 | @@ -23,11 +23,11 @@ ___pthread_mutexattr_destroy (pthread_mutexattr_t *attr) 338 | { 339 | return 0; 340 | } 341 | -versioned_symbol (libc, ___pthread_mutexattr_destroy, 342 | +versioned_symbol (libpthread, ___pthread_mutexattr_destroy, 343 | pthread_mutexattr_destroy, GLIBC_2_34); 344 | #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) 345 | -compat_symbol (libc, ___pthread_mutexattr_destroy, 346 | +compat_symbol (libpthread, ___pthread_mutexattr_destroy, 347 | pthread_mutexattr_destroy, GLIBC_2_0); 348 | -compat_symbol (libc, ___pthread_mutexattr_destroy, 349 | +compat_symbol (libpthread, ___pthread_mutexattr_destroy, 350 | __pthread_mutexattr_destroy, GLIBC_2_0); 351 | #endif 352 | diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c 353 | index 75df86893a..fe2a8a93fd 100644 354 | --- a/nptl/pthread_setattr_default_np.c 355 | +++ b/nptl/pthread_setattr_default_np.c 356 | @@ -81,10 +81,10 @@ __pthread_setattr_default_np (const pthread_attr_t *in) 357 | lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE); 358 | return ret; 359 | } 360 | -versioned_symbol (libc, __pthread_setattr_default_np, 361 | +versioned_symbol (libpthread, __pthread_setattr_default_np, 362 | pthread_setattr_default_np, GLIBC_2_34); 363 | #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_18, GLIBC_2_34) 364 | -compat_symbol (libc, __pthread_setattr_default_np, 365 | +compat_symbol (libpthread, __pthread_setattr_default_np, 366 | pthread_setattr_default_np, GLIBC_2_18); 367 | #endif 368 | 369 | diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c 370 | index 752fd17977..6302443a79 100644 371 | --- a/nptl/pthread_sigmask.c 372 | +++ b/nptl/pthread_sigmask.c 373 | @@ -46,8 +46,8 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) 374 | } 375 | libc_hidden_def (__pthread_sigmask) 376 | 377 | -versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32); 378 | -#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32) 379 | +versioned_symbol (libpthread, __pthread_sigmask, pthread_sigmask, GLIBC_2_32); 380 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_32) 381 | strong_alias (__pthread_sigmask, __pthread_sigmask_2); 382 | -compat_symbol (libc, __pthread_sigmask_2, pthread_sigmask, GLIBC_2_0); 383 | +compat_symbol (libpthread, __pthread_sigmask_2, pthread_sigmask, GLIBC_2_0); 384 | #endif 385 | diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c 386 | index a4e71992ea..e5a35e4e8d 100644 387 | --- a/nptl/pthread_testcancel.c 388 | +++ b/nptl/pthread_testcancel.c 389 | @@ -27,12 +27,12 @@ ___pthread_testcancel (void) 390 | if (cancel_enabled_and_canceled (cancelhandling)) 391 | __do_cancel (PTHREAD_CANCELED); 392 | } 393 | -versioned_symbol (libc, ___pthread_testcancel, pthread_testcancel, GLIBC_2_34); 394 | +versioned_symbol (libpthread, ___pthread_testcancel, pthread_testcancel, GLIBC_2_34); 395 | libc_hidden_ver (___pthread_testcancel, __pthread_testcancel) 396 | #ifndef SHARED 397 | strong_alias (___pthread_testcancel, __pthread_testcancel) 398 | #endif 399 | 400 | #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) 401 | -compat_symbol (libc, ___pthread_testcancel, pthread_testcancel, GLIBC_2_0); 402 | +compat_symbol (libpthread, ___pthread_testcancel, pthread_testcancel, GLIBC_2_0); 403 | #endif 404 | diff --git a/nptl/pthread_tryjoin.c b/nptl/pthread_tryjoin.c 405 | index 54b528fd19..dcbda41cc4 100644 406 | --- a/nptl/pthread_tryjoin.c 407 | +++ b/nptl/pthread_tryjoin.c 408 | @@ -31,8 +31,8 @@ __pthread_tryjoin_np (pthread_t threadid, void **thread_return) 409 | return __pthread_clockjoin_ex (threadid, thread_return, 0 /* Ignored */, 410 | NULL, false); 411 | } 412 | -versioned_symbol (libc, __pthread_tryjoin_np, pthread_tryjoin_np, GLIBC_2_34); 413 | +versioned_symbol (libpthread, __pthread_tryjoin_np, pthread_tryjoin_np, GLIBC_2_34); 414 | 415 | #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_34) 416 | -compat_symbol (libc, __pthread_tryjoin_np, pthread_tryjoin_np, GLIBC_2_3_3); 417 | +compat_symbol (libpthread, __pthread_tryjoin_np, pthread_tryjoin_np, GLIBC_2_3_3); 418 | #endif 419 | diff --git a/sysdeps/loongarch/nptl/pthread_sigmask.c b/sysdeps/loongarch/nptl/pthread_sigmask.c 420 | index d69470002a..707787a67a 100644 421 | --- a/sysdeps/loongarch/nptl/pthread_sigmask.c 422 | +++ b/sysdeps/loongarch/nptl/pthread_sigmask.c 423 | @@ -48,7 +48,7 @@ libc_hidden_def (__pthread_sigmask) 424 | 425 | versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_36); 426 | 427 | -#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_36) 428 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_36) 429 | 430 | #include 431 | 432 | @@ -61,13 +61,13 @@ __ow___pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) 433 | } 434 | return rc; 435 | } 436 | -#if SHLIB_COMPAT (libc, GLIBC_2_32, GLIBC_2_36) 437 | -compat_symbol (libc, __ow___pthread_sigmask, pthread_sigmask, GLIBC_2_32); 438 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_36) 439 | +compat_symbol (libpthread, __ow___pthread_sigmask, pthread_sigmask, GLIBC_2_32); 440 | #endif 441 | 442 | -#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32) 443 | +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_32) 444 | strong_alias (__ow___pthread_sigmask, __ow___pthread_sigmask_2); 445 | -compat_symbol (libc, __ow___pthread_sigmask_2, pthread_sigmask, GLIBC_2_0); 446 | +compat_symbol (libpthread, __ow___pthread_sigmask_2, pthread_sigmask, GLIBC_2_0); 447 | #endif 448 | 449 | #endif 450 | diff --git a/sysdeps/unix/sysv/linux/loongarch/Makefile b/sysdeps/unix/sysv/linux/loongarch/Makefile 451 | index 1d447ea4b8..4d1d5d0e6d 100644 452 | --- a/sysdeps/unix/sysv/linux/loongarch/Makefile 453 | +++ b/sysdeps/unix/sysv/linux/loongarch/Makefile 454 | @@ -21,6 +21,10 @@ sysdep_routines += \ 455 | # sysdep_routines 456 | endif 457 | 458 | +ifeq ($(subdir),nptl) 459 | +sysdep-CFLAGS += -DCOMP_CHANGED_PTHREAD_STACK_MIN 460 | +endif 461 | + 462 | abi-variants := lp64s lp64d 463 | 464 | ifeq (,$(filter $(default-abi),$(abi-variants))) 465 | -- 466 | 2.52.0 467 | 468 | -------------------------------------------------------------------------------- /autobuild/patches/patchelf/0001-add-remap-symvers.patch: -------------------------------------------------------------------------------- 1 | From 191f6766cf0f320a785986f91a022a9c263c69cd Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Fri, 12 Jan 2024 16:56:07 +0800 4 | Subject: [PATCH] add remap-symvers 5 | 6 | --- 7 | src/elf.h | 2 + 8 | src/patchelf.cc | 351 +++++++++++++++++++++++++++++++++++++++++++++++- 9 | src/patchelf.h | 6 +- 10 | 3 files changed, 354 insertions(+), 5 deletions(-) 11 | 12 | diff --git a/src/elf.h b/src/elf.h 13 | index 920e689..669fd2d 100644 14 | --- a/src/elf.h 15 | +++ b/src/elf.h 16 | @@ -55,6 +55,8 @@ typedef uint16_t Elf64_Section; 17 | typedef Elf32_Half Elf32_Versym; 18 | typedef Elf64_Half Elf64_Versym; 19 | 20 | +#define VERSYM_HIDDEN 0x8000 21 | +#define VERSYM_VERSION 0x7fff 22 | 23 | /* The ELF file header. This appears at the start of every ELF file. */ 24 | 25 | diff --git a/src/patchelf.cc b/src/patchelf.cc 26 | index 82b4b46..f0dbdb2 100644 27 | --- a/src/patchelf.cc 28 | +++ b/src/patchelf.cc 29 | @@ -1234,8 +1234,14 @@ void ElfFile::rewriteHeaders(Elf_Addr phdrAddress) 30 | } 31 | else if (d_tag == DT_VERNEED) 32 | dyn->d_un.d_ptr = findSectionHeader(".gnu.version_r").sh_addr; 33 | + else if (d_tag == DT_VERNEEDNUM) 34 | + dyn->d_un.d_val = findSectionHeader(".gnu.version_r").sh_info; 35 | else if (d_tag == DT_VERSYM) 36 | dyn->d_un.d_ptr = findSectionHeader(".gnu.version").sh_addr; 37 | + else if (d_tag == DT_VERDEF) 38 | + dyn->d_un.d_ptr = findSectionHeader(".gnu.version_d").sh_addr; 39 | + else if (d_tag == DT_VERDEFNUM) 40 | + dyn->d_un.d_val = findSectionHeader(".gnu.version_d").sh_info; 41 | else if (d_tag == DT_MIPS_RLD_MAP_REL) { 42 | /* the MIPS_RLD_MAP_REL tag stores the offset to the debug 43 | pointer, relative to the address of the tag */ 44 | @@ -2016,7 +2022,7 @@ auto ElfFile::parseGnuHashTable(span sectionData) -> Gn 45 | } 46 | 47 | template 48 | -void ElfFile::rebuildGnuHashTable(span strTab, span dynsyms) 49 | +void ElfFile::rebuildGnuHashTable(span strTab, span dynsyms, span versyms) 50 | { 51 | auto sectionData = tryGetSectionSpan(".gnu.hash"); 52 | if (!sectionData) 53 | @@ -2028,12 +2034,20 @@ void ElfFile::rebuildGnuHashTable(span strTab, span(newSection.data(), newSection.size()); 61 | + ght = parseGnuHashTable(sectionData); 62 | + } 63 | + 64 | // The hash table includes only a subset of dynsyms 65 | auto firstSymIdx = rdi(ght.m_hdr.symndx); 66 | dynsyms = span(&dynsyms[firstSymIdx], dynsyms.end()); 67 | 68 | // Only use the range of symbol versions that will be changed 69 | - auto versyms = tryGetSectionSpan(".gnu.version"); 70 | + if (!versyms) 71 | + versyms = tryGetSectionSpan(".gnu.version"); 72 | if (versyms) 73 | versyms = span(&versyms[firstSymIdx], versyms.end()); 74 | 75 | @@ -2148,7 +2162,7 @@ auto ElfFile::parseHashTable(span sectionData) -> HashT 76 | } 77 | 78 | template 79 | -void ElfFile::rebuildHashTable(span strTab, span dynsyms) 80 | +void ElfFile::rebuildHashTable(span strTab, span dynsyms, int moreSyms) 81 | { 82 | auto sectionData = tryGetSectionSpan(".hash"); 83 | if (!sectionData) 84 | @@ -2156,6 +2170,15 @@ void ElfFile::rebuildHashTable(span strTab, span 0) 89 | + { 90 | + auto & newSection = replaceSection(".hash", sectionData.size() + moreSyms * sizeof(uint32_t)); 91 | + sectionData = span(newSection.data(), newSection.size()); 92 | + auto hdr = (typename HashTable::Header*)sectionData.begin(); 93 | + wri(hdr->nchain, rdi(hdr->nchain) + moreSyms); 94 | + ht = parseHashTable(sectionData); 95 | + } 96 | + 97 | std::fill(ht.m_buckets.begin(), ht.m_buckets.end(), 0); 98 | std::fill(ht.m_chain.begin(), ht.m_chain.end(), 0); 99 | 100 | @@ -2320,6 +2343,281 @@ void ElfFile::modifyExecstack(ExecstackMode op) 101 | printf("execstack: %c\n", result); 102 | } 103 | 104 | +template 105 | +void ElfFile::remapSymvers(const std::string & mapTo, const std::vector & mapFrom, bool alsoPatchVerNeed) 106 | +{ 107 | + auto shdrDynStr = findSectionHeader(".dynstr"); 108 | + auto shdrDynsym = findSectionHeader(".dynsym"); 109 | + auto shdrVersym = findSectionHeader(".gnu.version"); 110 | + 111 | + auto strTab = (char *)fileContents->data() + rdi(shdrDynStr.sh_offset); 112 | + auto strTabSize = rdi(shdrDynStr.sh_size); 113 | + auto dynsyms = (Elf_Sym *)(fileContents->data() + rdi(shdrDynsym.sh_offset)); 114 | + auto versyms = (Elf_Versym *)(fileContents->data() + rdi(shdrVersym.sh_offset)); 115 | + const size_t count = rdi(shdrDynsym.sh_size) / sizeof(Elf_Sym); 116 | + 117 | + if (count != rdi(shdrVersym.sh_size) / sizeof(Elf_Versym)) 118 | + error("versym size mismatch"); 119 | + 120 | + auto &shdrVerdef = findSectionHeader(".gnu.version_d"); 121 | + auto verdef = (char *)(fileContents->data() + rdi(shdrVerdef.sh_offset)); 122 | + 123 | + std::map verdefMap; 124 | + 125 | + debug("Parsing .gnu.version_d\n"); 126 | + 127 | + int verdef_entries = rdi(shdrVerdef.sh_info); 128 | + debug(".gnu.version_d: %d entries\n", verdef_entries); 129 | + 130 | + auto verdef_end = verdef + rdi(shdrVerdef.sh_size); 131 | + off_t curoff = 0; 132 | + 133 | + int map_to_ndx = -1; 134 | + int max_ndx = 0; 135 | + off_t last_verdef_off = 0; 136 | + off_t mapToStrOff = 0; 137 | + bool mapToAdded = false; 138 | + 139 | + for(int i = 0; i < verdef_entries; i++){ 140 | + Elf_Verdef *vd = (Elf_Verdef *) (verdef + curoff); 141 | + if ((char *)vd + sizeof(Elf_Verdef) > verdef_end) 142 | + error(fmt("verdef entry overflow: idx=", i)); 143 | + auto ndx = rdi(vd->vd_ndx); 144 | + if ((char *)vd + rdi(vd->vd_aux) >= verdef_end) 145 | + error(fmt("verdef entry aux out of bounds: idx=", i)); 146 | + auto aux = (Elf_Verdaux *) ((char *)vd + rdi(vd->vd_aux)); 147 | + if ((char *)aux + sizeof(Elf_Verdaux) > verdef_end) 148 | + error(fmt("verdef entry aux overflow: idx=", i)); 149 | + std::string_view name = &strTab[rdi(aux->vda_name)]; 150 | + debug("verdef entry %d: %s, ndx=%d\n", i, name.data(), ndx); 151 | + if (ndx > max_ndx) 152 | + max_ndx = ndx; 153 | + if (name == mapTo) { 154 | + map_to_ndx = ndx; 155 | + mapToStrOff = rdi(aux->vda_name); 156 | + } 157 | + if(ndx != 0 && ndx != 1){ 158 | + verdefMap[ndx] = name; 159 | + } 160 | + 161 | + if(rdi(vd->vd_next) == 0){ 162 | + if(i == verdef_entries - 1){ 163 | + last_verdef_off = curoff; 164 | + break; 165 | + } 166 | + else 167 | + error(fmt("verdef entry should have next entry: idx=", i)); 168 | + } 169 | + if((char *)vd + rdi(vd->vd_next) >= verdef_end) 170 | + error(fmt("verdef entry next out of bounds: idx=", i)); 171 | + curoff += rdi(vd->vd_next); 172 | + } 173 | + if (map_to_ndx == -1){ 174 | + debug("no version index for %s, adding\n", mapTo.c_str()); 175 | + auto & newDynStr = replaceSection(".dynstr", rdi(shdrDynStr.sh_size) + mapTo.size() + 1); 176 | + mapToStrOff = rdi(shdrDynStr.sh_size); 177 | + setSubstr(newDynStr, mapToStrOff, mapTo + '\0'); 178 | + strTab = newDynStr.data(); 179 | + strTabSize = newDynStr.size(); 180 | + } 181 | + debug("parsing verneed entries\n", mapTo.c_str()); 182 | + auto verneedhdr = tryFindSectionHeader(".gnu.version_r"); 183 | + std::map verneedMap; 184 | + if(verneedhdr){ 185 | + auto &shdrVerNeed = verneedhdr->get(); 186 | + auto verneed = (char *)(fileContents->data() + rdi(shdrVerNeed.sh_offset)); 187 | + 188 | + debug("found .gnu.version_r, parsing\n"); 189 | + int verneed_entries = rdi(shdrVerNeed.sh_info); 190 | + debug(".gnu.version_r: %d entries\n", verdef_entries); 191 | + 192 | + auto verneed_end = verneed + rdi(shdrVerNeed.sh_size); 193 | + off_t curoff = 0; 194 | + for(int i = 0; i < verneed_entries; i++){ 195 | + Elf_Verneed *vn = (Elf_Verneed *) (verneed + curoff); 196 | + if ((char *)vn + sizeof(Elf_Verneed) > verneed_end) 197 | + error(fmt("verneed entry overflow: idx=", i)); 198 | + auto aux_cnt = rdi(vn->vn_cnt); 199 | + debug("file: %s, %d versions\n", &strTab[rdi(vn->vn_file)], aux_cnt); 200 | + off_t aux_off = rdi(vn->vn_aux); 201 | + if ((char *)vn + aux_off >= verneed_end) 202 | + error(fmt("verneed entry aux out of bounds: idx=", i)); 203 | + for(int j = 0; j < aux_cnt; j++){ 204 | + auto aux = (Elf_Vernaux *) ((char *)vn + aux_off); 205 | + if ((char *)aux + sizeof(Elf_Vernaux) > verneed_end) 206 | + error(fmt("verneed entry aux overflow: idx=", i, "aux idx=", j)); 207 | + auto ndx = rdi(aux->vna_other) & VERSYM_VERSION; 208 | + debug(" %s, ndx=%d\n", &strTab[rdi(aux->vna_name)], ndx); 209 | + if(alsoPatchVerNeed){ 210 | + for (auto it : mapFrom){ 211 | + if (it == &strTab[rdi(aux->vna_name)]){ 212 | + debug(" found %s, changing to %s\n", it.c_str(), mapTo.c_str()); 213 | + wri(aux->vna_name, mapToStrOff); 214 | + wri(aux->vna_hash, sysvHash(mapTo)); 215 | + break; 216 | + } 217 | + } 218 | + } 219 | + if(map_to_ndx == -1 && ndx >= max_ndx + 1){ 220 | + verneedMap[ndx] = ndx + 1; 221 | + ndx = ndx + 1; 222 | + wri(aux->vna_other, (rdi(aux->vna_other) & ~VERSYM_VERSION) | (ndx & VERSYM_VERSION)); 223 | + debug(" changing ndx to %d\n", ndx); 224 | + } 225 | + if (rdi(aux->vna_next) == 0){ 226 | + if (j == aux_cnt - 1) 227 | + break; 228 | + else 229 | + error(fmt("verneed entry should have next entry: idx=", i, "aux idx=", j)); 230 | + } 231 | + if ((char *)aux + rdi(aux->vna_next) >= verneed_end) 232 | + error(fmt("verneed entry next out of bounds: idx=", i, "aux idx=", j)); 233 | + aux_off += rdi(aux->vna_next); 234 | + } 235 | + if (rdi(vn->vn_next) == 0){ 236 | + if (i == verneed_entries - 1) 237 | + break; 238 | + else 239 | + error(fmt("verneed entry should have next entry: idx=", i)); 240 | + } 241 | + if ((char *)vn + rdi(vn->vn_next) >= verneed_end) 242 | + error(fmt("verneed entry next out of bounds: idx=", i)); 243 | + curoff += rdi(vn->vn_next); 244 | + } 245 | + }else{ 246 | + debug("no .gnu.version_r found\n"); 247 | + } 248 | + if (map_to_ndx == -1){ 249 | + map_to_ndx = max_ndx + 1; 250 | + debug("decided to use %d for %s\n", map_to_ndx, mapTo.c_str()); 251 | + if(map_to_ndx > VERSYM_VERSION){ 252 | + error(fmt("version index %d is too large", map_to_ndx)); 253 | + } 254 | + verdefMap[map_to_ndx] = mapTo; 255 | + auto & newVerdef = replaceSection(".gnu.version_d", rdi(shdrVerdef.sh_size) + sizeof(Elf_Verdef) + sizeof(Elf_Verdaux)); 256 | + char * newVerdefData = newVerdef.data(); 257 | + Elf_Verdef *lastVd = (Elf_Verdef *)(newVerdefData + last_verdef_off); 258 | + Elf_Verdef *newVd = (Elf_Verdef *)(newVerdefData + rdi(shdrVerdef.sh_size)); 259 | + wri(lastVd->vd_next, (char *)newVd - (char *)lastVd); 260 | + wri(newVd->vd_version, 1); 261 | + wri(newVd->vd_flags, 0); 262 | + wri(newVd->vd_ndx, map_to_ndx); 263 | + wri(newVd->vd_cnt, 1); 264 | + wri(newVd->vd_hash, sysvHash(mapTo)); 265 | + wri(newVd->vd_aux, sizeof(Elf_Verdef)); 266 | + wri(newVd->vd_next, 0); 267 | + Elf_Verdaux *newVda = (Elf_Verdaux *)((char *)newVd + sizeof(Elf_Verdef)); 268 | + wri(newVda->vda_next, 0); 269 | + wri(((Elf_Shdr *)(&shdrVerdef))->sh_info, rdi(shdrVerdef.sh_info) + 1); 270 | + verdef_entries += 1; 271 | + 272 | + wri(newVda->vda_name, mapToStrOff); 273 | + mapToAdded = true; 274 | + }else{ 275 | + debug("verdef entry for %s found at ndx=%d\n", mapTo.c_str(), map_to_ndx); 276 | + } 277 | + std::map> symVersionMap; 278 | + 279 | + debug("Parsing .dynsym\n"); 280 | + for(size_t i = 0; i < count; i++){ 281 | + auto dynsym = &dynsyms[i]; 282 | + std::string name = strTab + rdi(dynsym->st_name); 283 | + auto verndx = rdi(versyms[i]); 284 | + auto verdef_ndx = verndx & VERSYM_VERSION; 285 | + 286 | + if(verneedMap.find(verdef_ndx) != verneedMap.end()){ 287 | + debug("verneed entry remapping for %s found at ndx=%d\n", name.c_str(), verdef_ndx); 288 | + verdef_ndx = verneedMap[verdef_ndx]; 289 | + wri(versyms[i], (verndx & ~VERSYM_VERSION) | (verdef_ndx & VERSYM_VERSION)); 290 | + } 291 | + 292 | + if(name.empty()) 293 | + continue; 294 | + debug("dynsym entry %d: %s ", i, name.c_str()); 295 | + auto shndx = rdi(dynsym->st_shndx); 296 | + if(shndx == SHN_UNDEF){ 297 | + debug("(undefined)\n"); 298 | + continue; 299 | + }else if(shndx == SHN_ABS){ 300 | + debug("(absolute)\n"); 301 | + continue; 302 | + }else if(shndx == SHN_COMMON){ 303 | + debug("(common)\n"); 304 | + continue; 305 | + } 306 | + if(verndx == 0){ 307 | + debug("(local)\n"); 308 | + continue; 309 | + }else if(verndx == 1){ 310 | + debug("(global)\n"); 311 | + continue; 312 | + } 313 | + if(verdefMap.find(verdef_ndx) == verdefMap.end()){ 314 | + debug("(verdef %d not found)\n", verdef_ndx); 315 | + continue; 316 | + } 317 | + debug("(ver: %s)\n", verdefMap[verdef_ndx].c_str()); 318 | + symVersionMap[verdefMap[verdef_ndx]][name] = i; 319 | + } 320 | + 321 | + debug("Generating new dsyms list\n"); 322 | + std::map newDsyms; 323 | + for(const auto &fromVer : mapFrom){ 324 | + if(symVersionMap.find(fromVer) == symVersionMap.end()){ 325 | + debug("No symbols with version %s found\n", fromVer.c_str()); 326 | + continue; 327 | + } 328 | + for(auto sym : symVersionMap[fromVer]){ 329 | + debug("Adding %s@%s to new dsyms list\n", sym.first.c_str(), fromVer.c_str()); 330 | + newDsyms[sym.first] = sym.second; 331 | + } 332 | + } 333 | + for(const auto &syms : symVersionMap[mapTo]){ 334 | + debug("removing %s@%s from new dsyms list\n", syms.first.c_str(), mapTo.c_str()); 335 | + newDsyms.erase(syms.first); 336 | + } 337 | + auto newDynsymSize = (newDsyms.size() + (mapToAdded ? 1 : 0)) * sizeof(Elf_Sym) + rdi(shdrDynsym.sh_size); 338 | + auto newVersymSize = (newDsyms.size() + (mapToAdded ? 1 : 0)) * sizeof(Elf_Versym) + rdi(shdrVersym.sh_size); 339 | + 340 | + auto& newDynsym = replaceSection(".dynsym", newDynsymSize); 341 | + auto& newVersym = replaceSection(".gnu.version", newVersymSize); 342 | + 343 | + auto newDynsymSpan = span((Elf_Sym *)newDynsym.data(), newDynsymSize / sizeof(Elf_Sym)); 344 | + auto newVersymSpan = span((Elf_Versym *)newVersym.data(), newVersymSize / sizeof(Elf_Versym)); 345 | + 346 | + { 347 | + int i = count; 348 | + for(auto it = newDsyms.cbegin(); it != newDsyms.cend(); ++it){ 349 | + auto sym = it->second; 350 | + debug("Adding %s@%s to dynsym list\n", it->first.c_str(), mapTo.c_str()); 351 | + newDynsymSpan[i] = dynsyms[sym]; 352 | + bool is_hidden = rdi(newVersymSpan[sym]) & VERSYM_HIDDEN; 353 | + wri(newVersymSpan[i], map_to_ndx | (is_hidden ? VERSYM_HIDDEN : 0)); 354 | + wri(newVersymSpan[sym], rdi(newVersymSpan[sym]) | VERSYM_HIDDEN); 355 | + i += 1; 356 | + } 357 | + if(mapToAdded){ 358 | + debug("Adding %s@%s to dynsym list\n", mapTo.c_str(), mapTo.c_str()); 359 | + wri(newDynsymSpan[i].st_name, mapToStrOff); 360 | + wri(newDynsymSpan[i].st_info, STB_GLOBAL << 4 | STT_OBJECT); 361 | + wri(newDynsymSpan[i].st_other, STV_DEFAULT); 362 | + wri(newDynsymSpan[i].st_shndx, SHN_ABS); 363 | + wri(newDynsymSpan[i].st_value, 0); 364 | + wri(newDynsymSpan[i].st_size, 0); 365 | + wri(newVersymSpan[i], map_to_ndx); 366 | + } 367 | + } 368 | + 369 | + debug("Rebuilding hash tables\n"); 370 | + 371 | + rebuildGnuHashTable(span(strTab, strTabSize), newDynsymSpan, newVersymSpan); 372 | + rebuildHashTable(span(strTab, strTabSize), newDynsymSpan, newDsyms.size() + (mapToAdded ? 1 : 0)); 373 | + 374 | + this->rewriteSections(); 375 | + 376 | + changed = true; 377 | +} 378 | + 379 | template 380 | template 381 | void ElfFile::forAllStringReferences(const Elf_Shdr& strTabHdr, StrIdxCallback&& fn) 382 | @@ -2384,6 +2682,10 @@ static bool noDefaultLib = false; 383 | static bool printExecstack = false; 384 | static bool clearExecstack = false; 385 | static bool setExecstack = false; 386 | +static bool remapSymvers = false; 387 | +static bool remapVerneed = false; 388 | +static std::string symverMapTo; 389 | +static std::vector symverMapFrom; 390 | 391 | template 392 | static void patchElf2(ElfFile && elfFile, const FileContents & fileContents, const std::string & fileName) 393 | @@ -2441,6 +2743,9 @@ static void patchElf2(ElfFile && elfFile, const FileContents & fileContents, con 394 | if (renameDynamicSymbols) 395 | elfFile.renameDynamicSymbols(symbolsToRename); 396 | 397 | + if (remapSymvers) 398 | + elfFile.remapSymvers(symverMapTo, symverMapFrom, remapVerneed); 399 | + 400 | if (elfFile.isChanged()){ 401 | writeFile(fileName, elfFile.fileContents); 402 | } else if (alwaysWrite) { 403 | @@ -2505,6 +2810,8 @@ static void showHelp(const std::string & progName) 404 | [--clear-execstack]\n\ 405 | [--set-execstack]\n\ 406 | [--rename-dynamic-symbols NAME_MAP_FILE]\tRenames dynamic symbols. The map file should contain two symbols (old_name new_name) per line\n\ 407 | + [--remap-symvers TO=FROM1,FROM2...]\n\ 408 | + [--also-remap-verneed]\n\ 409 | [--output FILE]\n\ 410 | [--debug]\n\ 411 | [--version]\n\ 412 | @@ -2661,6 +2968,44 @@ static int mainWrapped(int argc, char * * argv) 413 | symbolsToRename[*symbolsToRenameKeys.insert(from).first] = to; 414 | } 415 | } 416 | + else if (arg == "--remap-symvers") { 417 | + remapSymvers = true; 418 | + if (++i == argc) error("missing argument"); 419 | + 420 | + const char* mapping = argv[i]; 421 | + for(int i = 0; mapping[i]; ++i) 422 | + { 423 | + if (mapping[i] == '=') 424 | + { 425 | + char *mapto = strndup(mapping, i); 426 | + symverMapTo = mapto; 427 | + free(mapto); 428 | + mapping += i + 1; 429 | + break; 430 | + } 431 | + } 432 | + if (symverMapTo.empty()) 433 | + error(fmt("Invalid symver mapping, must contains =: ", mapping)); 434 | + for(int i = 0; mapping[i]; ++i) 435 | + { 436 | + if (mapping[i] == ',') 437 | + { 438 | + char *mapfrom = strndup(mapping, i); 439 | + if(strlen(mapfrom) != 0) 440 | + symverMapFrom.push_back(mapfrom); 441 | + free(mapfrom); 442 | + mapping += i + 1; 443 | + i = -1; 444 | + } 445 | + } 446 | + if (strlen(mapping) != 0) 447 | + symverMapFrom.push_back(mapping); 448 | + if (symverMapFrom.empty()) 449 | + error(fmt("Invalid symver mapping, must contains at least one from: ", mapping)); 450 | + } 451 | + else if (arg == "--also-remap-verneed") { 452 | + remapVerneed = true; 453 | + } 454 | else if (arg == "--help" || arg == "-h" ) { 455 | showHelp(argv[0]); 456 | return 0; 457 | diff --git a/src/patchelf.h b/src/patchelf.h 458 | index 4e229d6..3d2eb23 100644 459 | --- a/src/patchelf.h 460 | +++ b/src/patchelf.h 461 | @@ -175,6 +175,8 @@ public: 462 | 463 | void modifyExecstack(ExecstackMode op); 464 | 465 | + void remapSymvers(const std::string & mapTo, const std::vector & mapFrom, bool alsoRemapVerneed); 466 | + 467 | private: 468 | struct GnuHashTable { 469 | using BloomWord = Elf_Addr; 470 | @@ -194,8 +196,8 @@ private: 471 | }; 472 | HashTable parseHashTable(span gh); 473 | 474 | - void rebuildGnuHashTable(span strTab, span dynsyms); 475 | - void rebuildHashTable(span strTab, span dynsyms); 476 | + void rebuildGnuHashTable(span strTab, span dynsyms, span versyms = {nullptr, nullptr}); 477 | + void rebuildHashTable(span strTab, span dynsyms, int moreSyms = 0); 478 | 479 | using Elf_Rel_Info = decltype(Elf_Rel::r_info); 480 | 481 | -- 482 | 2.43.0 483 | 484 | -------------------------------------------------------------------------------- /autobuild/abiversions/libm.abilist: -------------------------------------------------------------------------------- 1 | GLIBC_2.27 __acos_finite F 2 | GLIBC_2.27 __acosf_finite F 3 | GLIBC_2.27 __acosh_finite F 4 | GLIBC_2.27 __acoshf_finite F 5 | GLIBC_2.27 __acoshl_finite F 6 | GLIBC_2.27 __acosl_finite F 7 | GLIBC_2.27 __asin_finite F 8 | GLIBC_2.27 __asinf_finite F 9 | GLIBC_2.27 __asinl_finite F 10 | GLIBC_2.27 __atan2_finite F 11 | GLIBC_2.27 __atan2f_finite F 12 | GLIBC_2.27 __atan2l_finite F 13 | GLIBC_2.27 __atanh_finite F 14 | GLIBC_2.27 __atanhf_finite F 15 | GLIBC_2.27 __atanhl_finite F 16 | GLIBC_2.27 __clog10 F 17 | GLIBC_2.27 __clog10f F 18 | GLIBC_2.27 __clog10l F 19 | GLIBC_2.27 __cosh_finite F 20 | GLIBC_2.27 __coshf_finite F 21 | GLIBC_2.27 __coshl_finite F 22 | GLIBC_2.27 __exp10_finite F 23 | GLIBC_2.27 __exp10f_finite F 24 | GLIBC_2.27 __exp10l_finite F 25 | GLIBC_2.27 __exp2_finite F 26 | GLIBC_2.27 __exp2f_finite F 27 | GLIBC_2.27 __exp2l_finite F 28 | GLIBC_2.27 __exp_finite F 29 | GLIBC_2.27 __expf_finite F 30 | GLIBC_2.27 __expl_finite F 31 | GLIBC_2.27 __finite F 32 | GLIBC_2.27 __finitef F 33 | GLIBC_2.27 __finitel F 34 | GLIBC_2.27 __fmod_finite F 35 | GLIBC_2.27 __fmodf_finite F 36 | GLIBC_2.27 __fmodl_finite F 37 | GLIBC_2.27 __fpclassify F 38 | GLIBC_2.27 __fpclassifyf F 39 | GLIBC_2.27 __fpclassifyl F 40 | GLIBC_2.27 __gamma_r_finite F 41 | GLIBC_2.27 __gammaf_r_finite F 42 | GLIBC_2.27 __gammal_r_finite F 43 | GLIBC_2.27 __hypot_finite F 44 | GLIBC_2.27 __hypotf_finite F 45 | GLIBC_2.27 __hypotl_finite F 46 | GLIBC_2.27 __iseqsig F 47 | GLIBC_2.27 __iseqsigf F 48 | GLIBC_2.27 __iseqsigl F 49 | GLIBC_2.27 __issignaling F 50 | GLIBC_2.27 __issignalingf F 51 | GLIBC_2.27 __issignalingl F 52 | GLIBC_2.27 __j0_finite F 53 | GLIBC_2.27 __j0f_finite F 54 | GLIBC_2.27 __j0l_finite F 55 | GLIBC_2.27 __j1_finite F 56 | GLIBC_2.27 __j1f_finite F 57 | GLIBC_2.27 __j1l_finite F 58 | GLIBC_2.27 __jn_finite F 59 | GLIBC_2.27 __jnf_finite F 60 | GLIBC_2.27 __jnl_finite F 61 | GLIBC_2.27 __lgamma_r_finite F 62 | GLIBC_2.27 __lgammaf_r_finite F 63 | GLIBC_2.27 __lgammal_r_finite F 64 | GLIBC_2.27 __log10_finite F 65 | GLIBC_2.27 __log10f_finite F 66 | GLIBC_2.27 __log10l_finite F 67 | GLIBC_2.27 __log2_finite F 68 | GLIBC_2.27 __log2f_finite F 69 | GLIBC_2.27 __log2l_finite F 70 | GLIBC_2.27 __log_finite F 71 | GLIBC_2.27 __logf_finite F 72 | GLIBC_2.27 __logl_finite F 73 | GLIBC_2.27 __pow_finite F 74 | GLIBC_2.27 __powf_finite F 75 | GLIBC_2.27 __powl_finite F 76 | GLIBC_2.27 __remainder_finite F 77 | GLIBC_2.27 __remainderf_finite F 78 | GLIBC_2.27 __remainderl_finite F 79 | GLIBC_2.27 __scalb_finite F 80 | GLIBC_2.27 __scalbf_finite F 81 | GLIBC_2.27 __scalbl_finite F 82 | GLIBC_2.27 __signbit F 83 | GLIBC_2.27 __signbitf F 84 | GLIBC_2.27 __signbitl F 85 | GLIBC_2.27 __signgam D 0x4 86 | GLIBC_2.27 __sinh_finite F 87 | GLIBC_2.27 __sinhf_finite F 88 | GLIBC_2.27 __sinhl_finite F 89 | GLIBC_2.27 __sqrt_finite F 90 | GLIBC_2.27 __sqrtf_finite F 91 | GLIBC_2.27 __sqrtl_finite F 92 | GLIBC_2.27 __y0_finite F 93 | GLIBC_2.27 __y0f_finite F 94 | GLIBC_2.27 __y0l_finite F 95 | GLIBC_2.27 __y1_finite F 96 | GLIBC_2.27 __y1f_finite F 97 | GLIBC_2.27 __y1l_finite F 98 | GLIBC_2.27 __yn_finite F 99 | GLIBC_2.27 __ynf_finite F 100 | GLIBC_2.27 __ynl_finite F 101 | GLIBC_2.27 acos F 102 | GLIBC_2.27 acosf F 103 | GLIBC_2.27 acosf128 F 104 | GLIBC_2.27 acosf32 F 105 | GLIBC_2.27 acosf32x F 106 | GLIBC_2.27 acosf64 F 107 | GLIBC_2.27 acosf64x F 108 | GLIBC_2.27 acosh F 109 | GLIBC_2.27 acoshf F 110 | GLIBC_2.27 acoshf128 F 111 | GLIBC_2.27 acoshf32 F 112 | GLIBC_2.27 acoshf32x F 113 | GLIBC_2.27 acoshf64 F 114 | GLIBC_2.27 acoshf64x F 115 | GLIBC_2.27 acoshl F 116 | GLIBC_2.27 acosl F 117 | GLIBC_2.27 asin F 118 | GLIBC_2.27 asinf F 119 | GLIBC_2.27 asinf128 F 120 | GLIBC_2.27 asinf32 F 121 | GLIBC_2.27 asinf32x F 122 | GLIBC_2.27 asinf64 F 123 | GLIBC_2.27 asinf64x F 124 | GLIBC_2.27 asinh F 125 | GLIBC_2.27 asinhf F 126 | GLIBC_2.27 asinhf128 F 127 | GLIBC_2.27 asinhf32 F 128 | GLIBC_2.27 asinhf32x F 129 | GLIBC_2.27 asinhf64 F 130 | GLIBC_2.27 asinhf64x F 131 | GLIBC_2.27 asinhl F 132 | GLIBC_2.27 asinl F 133 | GLIBC_2.27 atan F 134 | GLIBC_2.27 atan2 F 135 | GLIBC_2.27 atan2f F 136 | GLIBC_2.27 atan2f128 F 137 | GLIBC_2.27 atan2f32 F 138 | GLIBC_2.27 atan2f32x F 139 | GLIBC_2.27 atan2f64 F 140 | GLIBC_2.27 atan2f64x F 141 | GLIBC_2.27 atan2l F 142 | GLIBC_2.27 atanf F 143 | GLIBC_2.27 atanf128 F 144 | GLIBC_2.27 atanf32 F 145 | GLIBC_2.27 atanf32x F 146 | GLIBC_2.27 atanf64 F 147 | GLIBC_2.27 atanf64x F 148 | GLIBC_2.27 atanh F 149 | GLIBC_2.27 atanhf F 150 | GLIBC_2.27 atanhf128 F 151 | GLIBC_2.27 atanhf32 F 152 | GLIBC_2.27 atanhf32x F 153 | GLIBC_2.27 atanhf64 F 154 | GLIBC_2.27 atanhf64x F 155 | GLIBC_2.27 atanhl F 156 | GLIBC_2.27 atanl F 157 | GLIBC_2.27 cabs F 158 | GLIBC_2.27 cabsf F 159 | GLIBC_2.27 cabsf128 F 160 | GLIBC_2.27 cabsf32 F 161 | GLIBC_2.27 cabsf32x F 162 | GLIBC_2.27 cabsf64 F 163 | GLIBC_2.27 cabsf64x F 164 | GLIBC_2.27 cabsl F 165 | GLIBC_2.27 cacos F 166 | GLIBC_2.27 cacosf F 167 | GLIBC_2.27 cacosf128 F 168 | GLIBC_2.27 cacosf32 F 169 | GLIBC_2.27 cacosf32x F 170 | GLIBC_2.27 cacosf64 F 171 | GLIBC_2.27 cacosf64x F 172 | GLIBC_2.27 cacosh F 173 | GLIBC_2.27 cacoshf F 174 | GLIBC_2.27 cacoshf128 F 175 | GLIBC_2.27 cacoshf32 F 176 | GLIBC_2.27 cacoshf32x F 177 | GLIBC_2.27 cacoshf64 F 178 | GLIBC_2.27 cacoshf64x F 179 | GLIBC_2.27 cacoshl F 180 | GLIBC_2.27 cacosl F 181 | GLIBC_2.27 canonicalize F 182 | GLIBC_2.27 canonicalizef F 183 | GLIBC_2.27 canonicalizef128 F 184 | GLIBC_2.27 canonicalizef32 F 185 | GLIBC_2.27 canonicalizef32x F 186 | GLIBC_2.27 canonicalizef64 F 187 | GLIBC_2.27 canonicalizef64x F 188 | GLIBC_2.27 canonicalizel F 189 | GLIBC_2.27 carg F 190 | GLIBC_2.27 cargf F 191 | GLIBC_2.27 cargf128 F 192 | GLIBC_2.27 cargf32 F 193 | GLIBC_2.27 cargf32x F 194 | GLIBC_2.27 cargf64 F 195 | GLIBC_2.27 cargf64x F 196 | GLIBC_2.27 cargl F 197 | GLIBC_2.27 casin F 198 | GLIBC_2.27 casinf F 199 | GLIBC_2.27 casinf128 F 200 | GLIBC_2.27 casinf32 F 201 | GLIBC_2.27 casinf32x F 202 | GLIBC_2.27 casinf64 F 203 | GLIBC_2.27 casinf64x F 204 | GLIBC_2.27 casinh F 205 | GLIBC_2.27 casinhf F 206 | GLIBC_2.27 casinhf128 F 207 | GLIBC_2.27 casinhf32 F 208 | GLIBC_2.27 casinhf32x F 209 | GLIBC_2.27 casinhf64 F 210 | GLIBC_2.27 casinhf64x F 211 | GLIBC_2.27 casinhl F 212 | GLIBC_2.27 casinl F 213 | GLIBC_2.27 catan F 214 | GLIBC_2.27 catanf F 215 | GLIBC_2.27 catanf128 F 216 | GLIBC_2.27 catanf32 F 217 | GLIBC_2.27 catanf32x F 218 | GLIBC_2.27 catanf64 F 219 | GLIBC_2.27 catanf64x F 220 | GLIBC_2.27 catanh F 221 | GLIBC_2.27 catanhf F 222 | GLIBC_2.27 catanhf128 F 223 | GLIBC_2.27 catanhf32 F 224 | GLIBC_2.27 catanhf32x F 225 | GLIBC_2.27 catanhf64 F 226 | GLIBC_2.27 catanhf64x F 227 | GLIBC_2.27 catanhl F 228 | GLIBC_2.27 catanl F 229 | GLIBC_2.27 cbrt F 230 | GLIBC_2.27 cbrtf F 231 | GLIBC_2.27 cbrtf128 F 232 | GLIBC_2.27 cbrtf32 F 233 | GLIBC_2.27 cbrtf32x F 234 | GLIBC_2.27 cbrtf64 F 235 | GLIBC_2.27 cbrtf64x F 236 | GLIBC_2.27 cbrtl F 237 | GLIBC_2.27 ccos F 238 | GLIBC_2.27 ccosf F 239 | GLIBC_2.27 ccosf128 F 240 | GLIBC_2.27 ccosf32 F 241 | GLIBC_2.27 ccosf32x F 242 | GLIBC_2.27 ccosf64 F 243 | GLIBC_2.27 ccosf64x F 244 | GLIBC_2.27 ccosh F 245 | GLIBC_2.27 ccoshf F 246 | GLIBC_2.27 ccoshf128 F 247 | GLIBC_2.27 ccoshf32 F 248 | GLIBC_2.27 ccoshf32x F 249 | GLIBC_2.27 ccoshf64 F 250 | GLIBC_2.27 ccoshf64x F 251 | GLIBC_2.27 ccoshl F 252 | GLIBC_2.27 ccosl F 253 | GLIBC_2.27 ceil F 254 | GLIBC_2.27 ceilf F 255 | GLIBC_2.27 ceilf128 F 256 | GLIBC_2.27 ceilf32 F 257 | GLIBC_2.27 ceilf32x F 258 | GLIBC_2.27 ceilf64 F 259 | GLIBC_2.27 ceilf64x F 260 | GLIBC_2.27 ceill F 261 | GLIBC_2.27 cexp F 262 | GLIBC_2.27 cexpf F 263 | GLIBC_2.27 cexpf128 F 264 | GLIBC_2.27 cexpf32 F 265 | GLIBC_2.27 cexpf32x F 266 | GLIBC_2.27 cexpf64 F 267 | GLIBC_2.27 cexpf64x F 268 | GLIBC_2.27 cexpl F 269 | GLIBC_2.27 cimag F 270 | GLIBC_2.27 cimagf F 271 | GLIBC_2.27 cimagf128 F 272 | GLIBC_2.27 cimagf32 F 273 | GLIBC_2.27 cimagf32x F 274 | GLIBC_2.27 cimagf64 F 275 | GLIBC_2.27 cimagf64x F 276 | GLIBC_2.27 cimagl F 277 | GLIBC_2.27 clog F 278 | GLIBC_2.27 clog10 F 279 | GLIBC_2.27 clog10f F 280 | GLIBC_2.27 clog10f128 F 281 | GLIBC_2.27 clog10f32 F 282 | GLIBC_2.27 clog10f32x F 283 | GLIBC_2.27 clog10f64 F 284 | GLIBC_2.27 clog10f64x F 285 | GLIBC_2.27 clog10l F 286 | GLIBC_2.27 clogf F 287 | GLIBC_2.27 clogf128 F 288 | GLIBC_2.27 clogf32 F 289 | GLIBC_2.27 clogf32x F 290 | GLIBC_2.27 clogf64 F 291 | GLIBC_2.27 clogf64x F 292 | GLIBC_2.27 clogl F 293 | GLIBC_2.27 conj F 294 | GLIBC_2.27 conjf F 295 | GLIBC_2.27 conjf128 F 296 | GLIBC_2.27 conjf32 F 297 | GLIBC_2.27 conjf32x F 298 | GLIBC_2.27 conjf64 F 299 | GLIBC_2.27 conjf64x F 300 | GLIBC_2.27 conjl F 301 | GLIBC_2.27 copysign F 302 | GLIBC_2.27 copysignf F 303 | GLIBC_2.27 copysignf128 F 304 | GLIBC_2.27 copysignf32 F 305 | GLIBC_2.27 copysignf32x F 306 | GLIBC_2.27 copysignf64 F 307 | GLIBC_2.27 copysignf64x F 308 | GLIBC_2.27 copysignl F 309 | GLIBC_2.27 cos F 310 | GLIBC_2.27 cosf F 311 | GLIBC_2.27 cosf128 F 312 | GLIBC_2.27 cosf32 F 313 | GLIBC_2.27 cosf32x F 314 | GLIBC_2.27 cosf64 F 315 | GLIBC_2.27 cosf64x F 316 | GLIBC_2.27 cosh F 317 | GLIBC_2.27 coshf F 318 | GLIBC_2.27 coshf128 F 319 | GLIBC_2.27 coshf32 F 320 | GLIBC_2.27 coshf32x F 321 | GLIBC_2.27 coshf64 F 322 | GLIBC_2.27 coshf64x F 323 | GLIBC_2.27 coshl F 324 | GLIBC_2.27 cosl F 325 | GLIBC_2.27 cpow F 326 | GLIBC_2.27 cpowf F 327 | GLIBC_2.27 cpowf128 F 328 | GLIBC_2.27 cpowf32 F 329 | GLIBC_2.27 cpowf32x F 330 | GLIBC_2.27 cpowf64 F 331 | GLIBC_2.27 cpowf64x F 332 | GLIBC_2.27 cpowl F 333 | GLIBC_2.27 cproj F 334 | GLIBC_2.27 cprojf F 335 | GLIBC_2.27 cprojf128 F 336 | GLIBC_2.27 cprojf32 F 337 | GLIBC_2.27 cprojf32x F 338 | GLIBC_2.27 cprojf64 F 339 | GLIBC_2.27 cprojf64x F 340 | GLIBC_2.27 cprojl F 341 | GLIBC_2.27 creal F 342 | GLIBC_2.27 crealf F 343 | GLIBC_2.27 crealf128 F 344 | GLIBC_2.27 crealf32 F 345 | GLIBC_2.27 crealf32x F 346 | GLIBC_2.27 crealf64 F 347 | GLIBC_2.27 crealf64x F 348 | GLIBC_2.27 creall F 349 | GLIBC_2.27 csin F 350 | GLIBC_2.27 csinf F 351 | GLIBC_2.27 csinf128 F 352 | GLIBC_2.27 csinf32 F 353 | GLIBC_2.27 csinf32x F 354 | GLIBC_2.27 csinf64 F 355 | GLIBC_2.27 csinf64x F 356 | GLIBC_2.27 csinh F 357 | GLIBC_2.27 csinhf F 358 | GLIBC_2.27 csinhf128 F 359 | GLIBC_2.27 csinhf32 F 360 | GLIBC_2.27 csinhf32x F 361 | GLIBC_2.27 csinhf64 F 362 | GLIBC_2.27 csinhf64x F 363 | GLIBC_2.27 csinhl F 364 | GLIBC_2.27 csinl F 365 | GLIBC_2.27 csqrt F 366 | GLIBC_2.27 csqrtf F 367 | GLIBC_2.27 csqrtf128 F 368 | GLIBC_2.27 csqrtf32 F 369 | GLIBC_2.27 csqrtf32x F 370 | GLIBC_2.27 csqrtf64 F 371 | GLIBC_2.27 csqrtf64x F 372 | GLIBC_2.27 csqrtl F 373 | GLIBC_2.27 ctan F 374 | GLIBC_2.27 ctanf F 375 | GLIBC_2.27 ctanf128 F 376 | GLIBC_2.27 ctanf32 F 377 | GLIBC_2.27 ctanf32x F 378 | GLIBC_2.27 ctanf64 F 379 | GLIBC_2.27 ctanf64x F 380 | GLIBC_2.27 ctanh F 381 | GLIBC_2.27 ctanhf F 382 | GLIBC_2.27 ctanhf128 F 383 | GLIBC_2.27 ctanhf32 F 384 | GLIBC_2.27 ctanhf32x F 385 | GLIBC_2.27 ctanhf64 F 386 | GLIBC_2.27 ctanhf64x F 387 | GLIBC_2.27 ctanhl F 388 | GLIBC_2.27 ctanl F 389 | GLIBC_2.27 drem F 390 | GLIBC_2.27 dremf F 391 | GLIBC_2.27 dreml F 392 | GLIBC_2.27 erf F 393 | GLIBC_2.27 erfc F 394 | GLIBC_2.27 erfcf F 395 | GLIBC_2.27 erfcf128 F 396 | GLIBC_2.27 erfcf32 F 397 | GLIBC_2.27 erfcf32x F 398 | GLIBC_2.27 erfcf64 F 399 | GLIBC_2.27 erfcf64x F 400 | GLIBC_2.27 erfcl F 401 | GLIBC_2.27 erff F 402 | GLIBC_2.27 erff128 F 403 | GLIBC_2.27 erff32 F 404 | GLIBC_2.27 erff32x F 405 | GLIBC_2.27 erff64 F 406 | GLIBC_2.27 erff64x F 407 | GLIBC_2.27 erfl F 408 | GLIBC_2.27 exp F 409 | GLIBC_2.27 exp10 F 410 | GLIBC_2.27 exp10f F 411 | GLIBC_2.27 exp10f128 F 412 | GLIBC_2.27 exp10f32 F 413 | GLIBC_2.27 exp10f32x F 414 | GLIBC_2.27 exp10f64 F 415 | GLIBC_2.27 exp10f64x F 416 | GLIBC_2.27 exp10l F 417 | GLIBC_2.27 exp2 F 418 | GLIBC_2.27 exp2f F 419 | GLIBC_2.27 exp2f128 F 420 | GLIBC_2.27 exp2f32 F 421 | GLIBC_2.27 exp2f32x F 422 | GLIBC_2.27 exp2f64 F 423 | GLIBC_2.27 exp2f64x F 424 | GLIBC_2.27 exp2l F 425 | GLIBC_2.27 expf F 426 | GLIBC_2.27 expf128 F 427 | GLIBC_2.27 expf32 F 428 | GLIBC_2.27 expf32x F 429 | GLIBC_2.27 expf64 F 430 | GLIBC_2.27 expf64x F 431 | GLIBC_2.27 expl F 432 | GLIBC_2.27 expm1 F 433 | GLIBC_2.27 expm1f F 434 | GLIBC_2.27 expm1f128 F 435 | GLIBC_2.27 expm1f32 F 436 | GLIBC_2.27 expm1f32x F 437 | GLIBC_2.27 expm1f64 F 438 | GLIBC_2.27 expm1f64x F 439 | GLIBC_2.27 expm1l F 440 | GLIBC_2.27 fabs F 441 | GLIBC_2.27 fabsf F 442 | GLIBC_2.27 fabsf128 F 443 | GLIBC_2.27 fabsf32 F 444 | GLIBC_2.27 fabsf32x F 445 | GLIBC_2.27 fabsf64 F 446 | GLIBC_2.27 fabsf64x F 447 | GLIBC_2.27 fabsl F 448 | GLIBC_2.27 fdim F 449 | GLIBC_2.27 fdimf F 450 | GLIBC_2.27 fdimf128 F 451 | GLIBC_2.27 fdimf32 F 452 | GLIBC_2.27 fdimf32x F 453 | GLIBC_2.27 fdimf64 F 454 | GLIBC_2.27 fdimf64x F 455 | GLIBC_2.27 fdiml F 456 | GLIBC_2.27 feclearexcept F 457 | GLIBC_2.27 fedisableexcept F 458 | GLIBC_2.27 feenableexcept F 459 | GLIBC_2.27 fegetenv F 460 | GLIBC_2.27 fegetexcept F 461 | GLIBC_2.27 fegetexceptflag F 462 | GLIBC_2.27 fegetmode F 463 | GLIBC_2.27 fegetround F 464 | GLIBC_2.27 feholdexcept F 465 | GLIBC_2.27 feraiseexcept F 466 | GLIBC_2.27 fesetenv F 467 | GLIBC_2.27 fesetexcept F 468 | GLIBC_2.27 fesetexceptflag F 469 | GLIBC_2.27 fesetmode F 470 | GLIBC_2.27 fesetround F 471 | GLIBC_2.27 fetestexcept F 472 | GLIBC_2.27 fetestexceptflag F 473 | GLIBC_2.27 feupdateenv F 474 | GLIBC_2.27 finite F 475 | GLIBC_2.27 finitef F 476 | GLIBC_2.27 finitel F 477 | GLIBC_2.27 floor F 478 | GLIBC_2.27 floorf F 479 | GLIBC_2.27 floorf128 F 480 | GLIBC_2.27 floorf32 F 481 | GLIBC_2.27 floorf32x F 482 | GLIBC_2.27 floorf64 F 483 | GLIBC_2.27 floorf64x F 484 | GLIBC_2.27 floorl F 485 | GLIBC_2.27 fma F 486 | GLIBC_2.27 fmaf F 487 | GLIBC_2.27 fmaf128 F 488 | GLIBC_2.27 fmaf32 F 489 | GLIBC_2.27 fmaf32x F 490 | GLIBC_2.27 fmaf64 F 491 | GLIBC_2.27 fmaf64x F 492 | GLIBC_2.27 fmal F 493 | GLIBC_2.27 fmax F 494 | GLIBC_2.27 fmaxf F 495 | GLIBC_2.27 fmaxf128 F 496 | GLIBC_2.27 fmaxf32 F 497 | GLIBC_2.27 fmaxf32x F 498 | GLIBC_2.27 fmaxf64 F 499 | GLIBC_2.27 fmaxf64x F 500 | GLIBC_2.27 fmaxl F 501 | GLIBC_2.27 fmaxmag F 502 | GLIBC_2.27 fmaxmagf F 503 | GLIBC_2.27 fmaxmagf128 F 504 | GLIBC_2.27 fmaxmagf32 F 505 | GLIBC_2.27 fmaxmagf32x F 506 | GLIBC_2.27 fmaxmagf64 F 507 | GLIBC_2.27 fmaxmagf64x F 508 | GLIBC_2.27 fmaxmagl F 509 | GLIBC_2.27 fmin F 510 | GLIBC_2.27 fminf F 511 | GLIBC_2.27 fminf128 F 512 | GLIBC_2.27 fminf32 F 513 | GLIBC_2.27 fminf32x F 514 | GLIBC_2.27 fminf64 F 515 | GLIBC_2.27 fminf64x F 516 | GLIBC_2.27 fminl F 517 | GLIBC_2.27 fminmag F 518 | GLIBC_2.27 fminmagf F 519 | GLIBC_2.27 fminmagf128 F 520 | GLIBC_2.27 fminmagf32 F 521 | GLIBC_2.27 fminmagf32x F 522 | GLIBC_2.27 fminmagf64 F 523 | GLIBC_2.27 fminmagf64x F 524 | GLIBC_2.27 fminmagl F 525 | GLIBC_2.27 fmod F 526 | GLIBC_2.27 fmodf F 527 | GLIBC_2.27 fmodf128 F 528 | GLIBC_2.27 fmodf32 F 529 | GLIBC_2.27 fmodf32x F 530 | GLIBC_2.27 fmodf64 F 531 | GLIBC_2.27 fmodf64x F 532 | GLIBC_2.27 fmodl F 533 | GLIBC_2.27 frexp F 534 | GLIBC_2.27 frexpf F 535 | GLIBC_2.27 frexpf128 F 536 | GLIBC_2.27 frexpf32 F 537 | GLIBC_2.27 frexpf32x F 538 | GLIBC_2.27 frexpf64 F 539 | GLIBC_2.27 frexpf64x F 540 | GLIBC_2.27 frexpl F 541 | GLIBC_2.27 fromfp F 542 | GLIBC_2.27 fromfpf F 543 | GLIBC_2.27 fromfpf128 F 544 | GLIBC_2.27 fromfpf32 F 545 | GLIBC_2.27 fromfpf32x F 546 | GLIBC_2.27 fromfpf64 F 547 | GLIBC_2.27 fromfpf64x F 548 | GLIBC_2.27 fromfpl F 549 | GLIBC_2.27 fromfpx F 550 | GLIBC_2.27 fromfpxf F 551 | GLIBC_2.27 fromfpxf128 F 552 | GLIBC_2.27 fromfpxf32 F 553 | GLIBC_2.27 fromfpxf32x F 554 | GLIBC_2.27 fromfpxf64 F 555 | GLIBC_2.27 fromfpxf64x F 556 | GLIBC_2.27 fromfpxl F 557 | GLIBC_2.27 gamma F 558 | GLIBC_2.27 gammaf F 559 | GLIBC_2.27 gammal F 560 | GLIBC_2.27 getpayload F 561 | GLIBC_2.27 getpayloadf F 562 | GLIBC_2.27 getpayloadf128 F 563 | GLIBC_2.27 getpayloadf32 F 564 | GLIBC_2.27 getpayloadf32x F 565 | GLIBC_2.27 getpayloadf64 F 566 | GLIBC_2.27 getpayloadf64x F 567 | GLIBC_2.27 getpayloadl F 568 | GLIBC_2.27 hypot F 569 | GLIBC_2.27 hypotf F 570 | GLIBC_2.27 hypotf128 F 571 | GLIBC_2.27 hypotf32 F 572 | GLIBC_2.27 hypotf32x F 573 | GLIBC_2.27 hypotf64 F 574 | GLIBC_2.27 hypotf64x F 575 | GLIBC_2.27 hypotl F 576 | GLIBC_2.27 ilogb F 577 | GLIBC_2.27 ilogbf F 578 | GLIBC_2.27 ilogbf128 F 579 | GLIBC_2.27 ilogbf32 F 580 | GLIBC_2.27 ilogbf32x F 581 | GLIBC_2.27 ilogbf64 F 582 | GLIBC_2.27 ilogbf64x F 583 | GLIBC_2.27 ilogbl F 584 | GLIBC_2.27 j0 F 585 | GLIBC_2.27 j0f F 586 | GLIBC_2.27 j0f128 F 587 | GLIBC_2.27 j0f32 F 588 | GLIBC_2.27 j0f32x F 589 | GLIBC_2.27 j0f64 F 590 | GLIBC_2.27 j0f64x F 591 | GLIBC_2.27 j0l F 592 | GLIBC_2.27 j1 F 593 | GLIBC_2.27 j1f F 594 | GLIBC_2.27 j1f128 F 595 | GLIBC_2.27 j1f32 F 596 | GLIBC_2.27 j1f32x F 597 | GLIBC_2.27 j1f64 F 598 | GLIBC_2.27 j1f64x F 599 | GLIBC_2.27 j1l F 600 | GLIBC_2.27 jn F 601 | GLIBC_2.27 jnf F 602 | GLIBC_2.27 jnf128 F 603 | GLIBC_2.27 jnf32 F 604 | GLIBC_2.27 jnf32x F 605 | GLIBC_2.27 jnf64 F 606 | GLIBC_2.27 jnf64x F 607 | GLIBC_2.27 jnl F 608 | GLIBC_2.27 ldexp F 609 | GLIBC_2.27 ldexpf F 610 | GLIBC_2.27 ldexpf128 F 611 | GLIBC_2.27 ldexpf32 F 612 | GLIBC_2.27 ldexpf32x F 613 | GLIBC_2.27 ldexpf64 F 614 | GLIBC_2.27 ldexpf64x F 615 | GLIBC_2.27 ldexpl F 616 | GLIBC_2.27 lgamma F 617 | GLIBC_2.27 lgamma_r F 618 | GLIBC_2.27 lgammaf F 619 | GLIBC_2.27 lgammaf128 F 620 | GLIBC_2.27 lgammaf128_r F 621 | GLIBC_2.27 lgammaf32 F 622 | GLIBC_2.27 lgammaf32_r F 623 | GLIBC_2.27 lgammaf32x F 624 | GLIBC_2.27 lgammaf32x_r F 625 | GLIBC_2.27 lgammaf64 F 626 | GLIBC_2.27 lgammaf64_r F 627 | GLIBC_2.27 lgammaf64x F 628 | GLIBC_2.27 lgammaf64x_r F 629 | GLIBC_2.27 lgammaf_r F 630 | GLIBC_2.27 lgammal F 631 | GLIBC_2.27 lgammal_r F 632 | GLIBC_2.27 llogb F 633 | GLIBC_2.27 llogbf F 634 | GLIBC_2.27 llogbf128 F 635 | GLIBC_2.27 llogbf32 F 636 | GLIBC_2.27 llogbf32x F 637 | GLIBC_2.27 llogbf64 F 638 | GLIBC_2.27 llogbf64x F 639 | GLIBC_2.27 llogbl F 640 | GLIBC_2.27 llrint F 641 | GLIBC_2.27 llrintf F 642 | GLIBC_2.27 llrintf128 F 643 | GLIBC_2.27 llrintf32 F 644 | GLIBC_2.27 llrintf32x F 645 | GLIBC_2.27 llrintf64 F 646 | GLIBC_2.27 llrintf64x F 647 | GLIBC_2.27 llrintl F 648 | GLIBC_2.27 llround F 649 | GLIBC_2.27 llroundf F 650 | GLIBC_2.27 llroundf128 F 651 | GLIBC_2.27 llroundf32 F 652 | GLIBC_2.27 llroundf32x F 653 | GLIBC_2.27 llroundf64 F 654 | GLIBC_2.27 llroundf64x F 655 | GLIBC_2.27 llroundl F 656 | GLIBC_2.27 log F 657 | GLIBC_2.27 log10 F 658 | GLIBC_2.27 log10f F 659 | GLIBC_2.27 log10f128 F 660 | GLIBC_2.27 log10f32 F 661 | GLIBC_2.27 log10f32x F 662 | GLIBC_2.27 log10f64 F 663 | GLIBC_2.27 log10f64x F 664 | GLIBC_2.27 log10l F 665 | GLIBC_2.27 log1p F 666 | GLIBC_2.27 log1pf F 667 | GLIBC_2.27 log1pf128 F 668 | GLIBC_2.27 log1pf32 F 669 | GLIBC_2.27 log1pf32x F 670 | GLIBC_2.27 log1pf64 F 671 | GLIBC_2.27 log1pf64x F 672 | GLIBC_2.27 log1pl F 673 | GLIBC_2.27 log2 F 674 | GLIBC_2.27 log2f F 675 | GLIBC_2.27 log2f128 F 676 | GLIBC_2.27 log2f32 F 677 | GLIBC_2.27 log2f32x F 678 | GLIBC_2.27 log2f64 F 679 | GLIBC_2.27 log2f64x F 680 | GLIBC_2.27 log2l F 681 | GLIBC_2.27 logb F 682 | GLIBC_2.27 logbf F 683 | GLIBC_2.27 logbf128 F 684 | GLIBC_2.27 logbf32 F 685 | GLIBC_2.27 logbf32x F 686 | GLIBC_2.27 logbf64 F 687 | GLIBC_2.27 logbf64x F 688 | GLIBC_2.27 logbl F 689 | GLIBC_2.27 logf F 690 | GLIBC_2.27 logf128 F 691 | GLIBC_2.27 logf32 F 692 | GLIBC_2.27 logf32x F 693 | GLIBC_2.27 logf64 F 694 | GLIBC_2.27 logf64x F 695 | GLIBC_2.27 logl F 696 | GLIBC_2.27 lrint F 697 | GLIBC_2.27 lrintf F 698 | GLIBC_2.27 lrintf128 F 699 | GLIBC_2.27 lrintf32 F 700 | GLIBC_2.27 lrintf32x F 701 | GLIBC_2.27 lrintf64 F 702 | GLIBC_2.27 lrintf64x F 703 | GLIBC_2.27 lrintl F 704 | GLIBC_2.27 lround F 705 | GLIBC_2.27 lroundf F 706 | GLIBC_2.27 lroundf128 F 707 | GLIBC_2.27 lroundf32 F 708 | GLIBC_2.27 lroundf32x F 709 | GLIBC_2.27 lroundf64 F 710 | GLIBC_2.27 lroundf64x F 711 | GLIBC_2.27 lroundl F 712 | GLIBC_2.27 modf F 713 | GLIBC_2.27 modff F 714 | GLIBC_2.27 modff128 F 715 | GLIBC_2.27 modff32 F 716 | GLIBC_2.27 modff32x F 717 | GLIBC_2.27 modff64 F 718 | GLIBC_2.27 modff64x F 719 | GLIBC_2.27 modfl F 720 | GLIBC_2.27 nan F 721 | GLIBC_2.27 nanf F 722 | GLIBC_2.27 nanf128 F 723 | GLIBC_2.27 nanf32 F 724 | GLIBC_2.27 nanf32x F 725 | GLIBC_2.27 nanf64 F 726 | GLIBC_2.27 nanf64x F 727 | GLIBC_2.27 nanl F 728 | GLIBC_2.27 nearbyint F 729 | GLIBC_2.27 nearbyintf F 730 | GLIBC_2.27 nearbyintf128 F 731 | GLIBC_2.27 nearbyintf32 F 732 | GLIBC_2.27 nearbyintf32x F 733 | GLIBC_2.27 nearbyintf64 F 734 | GLIBC_2.27 nearbyintf64x F 735 | GLIBC_2.27 nearbyintl F 736 | GLIBC_2.27 nextafter F 737 | GLIBC_2.27 nextafterf F 738 | GLIBC_2.27 nextafterf128 F 739 | GLIBC_2.27 nextafterf32 F 740 | GLIBC_2.27 nextafterf32x F 741 | GLIBC_2.27 nextafterf64 F 742 | GLIBC_2.27 nextafterf64x F 743 | GLIBC_2.27 nextafterl F 744 | GLIBC_2.27 nextdown F 745 | GLIBC_2.27 nextdownf F 746 | GLIBC_2.27 nextdownf128 F 747 | GLIBC_2.27 nextdownf32 F 748 | GLIBC_2.27 nextdownf32x F 749 | GLIBC_2.27 nextdownf64 F 750 | GLIBC_2.27 nextdownf64x F 751 | GLIBC_2.27 nextdownl F 752 | GLIBC_2.27 nexttoward F 753 | GLIBC_2.27 nexttowardf F 754 | GLIBC_2.27 nexttowardl F 755 | GLIBC_2.27 nextup F 756 | GLIBC_2.27 nextupf F 757 | GLIBC_2.27 nextupf128 F 758 | GLIBC_2.27 nextupf32 F 759 | GLIBC_2.27 nextupf32x F 760 | GLIBC_2.27 nextupf64 F 761 | GLIBC_2.27 nextupf64x F 762 | GLIBC_2.27 nextupl F 763 | GLIBC_2.27 pow F 764 | GLIBC_2.27 powf F 765 | GLIBC_2.27 powf128 F 766 | GLIBC_2.27 powf32 F 767 | GLIBC_2.27 powf32x F 768 | GLIBC_2.27 powf64 F 769 | GLIBC_2.27 powf64x F 770 | GLIBC_2.27 powl F 771 | GLIBC_2.27 remainder F 772 | GLIBC_2.27 remainderf F 773 | GLIBC_2.27 remainderf128 F 774 | GLIBC_2.27 remainderf32 F 775 | GLIBC_2.27 remainderf32x F 776 | GLIBC_2.27 remainderf64 F 777 | GLIBC_2.27 remainderf64x F 778 | GLIBC_2.27 remainderl F 779 | GLIBC_2.27 remquo F 780 | GLIBC_2.27 remquof F 781 | GLIBC_2.27 remquof128 F 782 | GLIBC_2.27 remquof32 F 783 | GLIBC_2.27 remquof32x F 784 | GLIBC_2.27 remquof64 F 785 | GLIBC_2.27 remquof64x F 786 | GLIBC_2.27 remquol F 787 | GLIBC_2.27 rint F 788 | GLIBC_2.27 rintf F 789 | GLIBC_2.27 rintf128 F 790 | GLIBC_2.27 rintf32 F 791 | GLIBC_2.27 rintf32x F 792 | GLIBC_2.27 rintf64 F 793 | GLIBC_2.27 rintf64x F 794 | GLIBC_2.27 rintl F 795 | GLIBC_2.27 round F 796 | GLIBC_2.27 roundeven F 797 | GLIBC_2.27 roundevenf F 798 | GLIBC_2.27 roundevenf128 F 799 | GLIBC_2.27 roundevenf32 F 800 | GLIBC_2.27 roundevenf32x F 801 | GLIBC_2.27 roundevenf64 F 802 | GLIBC_2.27 roundevenf64x F 803 | GLIBC_2.27 roundevenl F 804 | GLIBC_2.27 roundf F 805 | GLIBC_2.27 roundf128 F 806 | GLIBC_2.27 roundf32 F 807 | GLIBC_2.27 roundf32x F 808 | GLIBC_2.27 roundf64 F 809 | GLIBC_2.27 roundf64x F 810 | GLIBC_2.27 roundl F 811 | GLIBC_2.27 scalb F 812 | GLIBC_2.27 scalbf F 813 | GLIBC_2.27 scalbl F 814 | GLIBC_2.27 scalbln F 815 | GLIBC_2.27 scalblnf F 816 | GLIBC_2.27 scalblnf128 F 817 | GLIBC_2.27 scalblnf32 F 818 | GLIBC_2.27 scalblnf32x F 819 | GLIBC_2.27 scalblnf64 F 820 | GLIBC_2.27 scalblnf64x F 821 | GLIBC_2.27 scalblnl F 822 | GLIBC_2.27 scalbn F 823 | GLIBC_2.27 scalbnf F 824 | GLIBC_2.27 scalbnf128 F 825 | GLIBC_2.27 scalbnf32 F 826 | GLIBC_2.27 scalbnf32x F 827 | GLIBC_2.27 scalbnf64 F 828 | GLIBC_2.27 scalbnf64x F 829 | GLIBC_2.27 scalbnl F 830 | GLIBC_2.27 setpayload F 831 | GLIBC_2.27 setpayloadf F 832 | GLIBC_2.27 setpayloadf128 F 833 | GLIBC_2.27 setpayloadf32 F 834 | GLIBC_2.27 setpayloadf32x F 835 | GLIBC_2.27 setpayloadf64 F 836 | GLIBC_2.27 setpayloadf64x F 837 | GLIBC_2.27 setpayloadl F 838 | GLIBC_2.27 setpayloadsig F 839 | GLIBC_2.27 setpayloadsigf F 840 | GLIBC_2.27 setpayloadsigf128 F 841 | GLIBC_2.27 setpayloadsigf32 F 842 | GLIBC_2.27 setpayloadsigf32x F 843 | GLIBC_2.27 setpayloadsigf64 F 844 | GLIBC_2.27 setpayloadsigf64x F 845 | GLIBC_2.27 setpayloadsigl F 846 | GLIBC_2.27 signgam D 0x4 847 | GLIBC_2.27 significand F 848 | GLIBC_2.27 significandf F 849 | GLIBC_2.27 significandl F 850 | GLIBC_2.27 sin F 851 | GLIBC_2.27 sincos F 852 | GLIBC_2.27 sincosf F 853 | GLIBC_2.27 sincosf128 F 854 | GLIBC_2.27 sincosf32 F 855 | GLIBC_2.27 sincosf32x F 856 | GLIBC_2.27 sincosf64 F 857 | GLIBC_2.27 sincosf64x F 858 | GLIBC_2.27 sincosl F 859 | GLIBC_2.27 sinf F 860 | GLIBC_2.27 sinf128 F 861 | GLIBC_2.27 sinf32 F 862 | GLIBC_2.27 sinf32x F 863 | GLIBC_2.27 sinf64 F 864 | GLIBC_2.27 sinf64x F 865 | GLIBC_2.27 sinh F 866 | GLIBC_2.27 sinhf F 867 | GLIBC_2.27 sinhf128 F 868 | GLIBC_2.27 sinhf32 F 869 | GLIBC_2.27 sinhf32x F 870 | GLIBC_2.27 sinhf64 F 871 | GLIBC_2.27 sinhf64x F 872 | GLIBC_2.27 sinhl F 873 | GLIBC_2.27 sinl F 874 | GLIBC_2.27 sqrt F 875 | GLIBC_2.27 sqrtf F 876 | GLIBC_2.27 sqrtf128 F 877 | GLIBC_2.27 sqrtf32 F 878 | GLIBC_2.27 sqrtf32x F 879 | GLIBC_2.27 sqrtf64 F 880 | GLIBC_2.27 sqrtf64x F 881 | GLIBC_2.27 sqrtl F 882 | GLIBC_2.27 tan F 883 | GLIBC_2.27 tanf F 884 | GLIBC_2.27 tanf128 F 885 | GLIBC_2.27 tanf32 F 886 | GLIBC_2.27 tanf32x F 887 | GLIBC_2.27 tanf64 F 888 | GLIBC_2.27 tanf64x F 889 | GLIBC_2.27 tanh F 890 | GLIBC_2.27 tanhf F 891 | GLIBC_2.27 tanhf128 F 892 | GLIBC_2.27 tanhf32 F 893 | GLIBC_2.27 tanhf32x F 894 | GLIBC_2.27 tanhf64 F 895 | GLIBC_2.27 tanhf64x F 896 | GLIBC_2.27 tanhl F 897 | GLIBC_2.27 tanl F 898 | GLIBC_2.27 tgamma F 899 | GLIBC_2.27 tgammaf F 900 | GLIBC_2.27 tgammaf128 F 901 | GLIBC_2.27 tgammaf32 F 902 | GLIBC_2.27 tgammaf32x F 903 | GLIBC_2.27 tgammaf64 F 904 | GLIBC_2.27 tgammaf64x F 905 | GLIBC_2.27 tgammal F 906 | GLIBC_2.27 totalorder F 907 | GLIBC_2.27 totalorderf F 908 | GLIBC_2.27 totalorderf128 F 909 | GLIBC_2.27 totalorderf32 F 910 | GLIBC_2.27 totalorderf32x F 911 | GLIBC_2.27 totalorderf64 F 912 | GLIBC_2.27 totalorderf64x F 913 | GLIBC_2.27 totalorderl F 914 | GLIBC_2.27 totalordermag F 915 | GLIBC_2.27 totalordermagf F 916 | GLIBC_2.27 totalordermagf128 F 917 | GLIBC_2.27 totalordermagf32 F 918 | GLIBC_2.27 totalordermagf32x F 919 | GLIBC_2.27 totalordermagf64 F 920 | GLIBC_2.27 totalordermagf64x F 921 | GLIBC_2.27 totalordermagl F 922 | GLIBC_2.27 trunc F 923 | GLIBC_2.27 truncf F 924 | GLIBC_2.27 truncf128 F 925 | GLIBC_2.27 truncf32 F 926 | GLIBC_2.27 truncf32x F 927 | GLIBC_2.27 truncf64 F 928 | GLIBC_2.27 truncf64x F 929 | GLIBC_2.27 truncl F 930 | GLIBC_2.27 ufromfp F 931 | GLIBC_2.27 ufromfpf F 932 | GLIBC_2.27 ufromfpf128 F 933 | GLIBC_2.27 ufromfpf32 F 934 | GLIBC_2.27 ufromfpf32x F 935 | GLIBC_2.27 ufromfpf64 F 936 | GLIBC_2.27 ufromfpf64x F 937 | GLIBC_2.27 ufromfpl F 938 | GLIBC_2.27 ufromfpx F 939 | GLIBC_2.27 ufromfpxf F 940 | GLIBC_2.27 ufromfpxf128 F 941 | GLIBC_2.27 ufromfpxf32 F 942 | GLIBC_2.27 ufromfpxf32x F 943 | GLIBC_2.27 ufromfpxf64 F 944 | GLIBC_2.27 ufromfpxf64x F 945 | GLIBC_2.27 ufromfpxl F 946 | GLIBC_2.27 y0 F 947 | GLIBC_2.27 y0f F 948 | GLIBC_2.27 y0f128 F 949 | GLIBC_2.27 y0f32 F 950 | GLIBC_2.27 y0f32x F 951 | GLIBC_2.27 y0f64 F 952 | GLIBC_2.27 y0f64x F 953 | GLIBC_2.27 y0l F 954 | GLIBC_2.27 y1 F 955 | GLIBC_2.27 y1f F 956 | GLIBC_2.27 y1f128 F 957 | GLIBC_2.27 y1f32 F 958 | GLIBC_2.27 y1f32x F 959 | GLIBC_2.27 y1f64 F 960 | GLIBC_2.27 y1f64x F 961 | GLIBC_2.27 y1l F 962 | GLIBC_2.27 yn F 963 | GLIBC_2.27 ynf F 964 | GLIBC_2.27 ynf128 F 965 | GLIBC_2.27 ynf32 F 966 | GLIBC_2.27 ynf32x F 967 | GLIBC_2.27 ynf64 F 968 | GLIBC_2.27 ynf64x F 969 | GLIBC_2.27 ynl F 970 | GLIBC_2.28 daddl F 971 | GLIBC_2.28 ddivl F 972 | GLIBC_2.28 dmull F 973 | GLIBC_2.28 dsubl F 974 | GLIBC_2.28 f32addf128 F 975 | GLIBC_2.28 f32addf32x F 976 | GLIBC_2.28 f32addf64 F 977 | GLIBC_2.28 f32addf64x F 978 | GLIBC_2.28 f32divf128 F 979 | GLIBC_2.28 f32divf32x F 980 | GLIBC_2.28 f32divf64 F 981 | GLIBC_2.28 f32divf64x F 982 | GLIBC_2.28 f32mulf128 F 983 | GLIBC_2.28 f32mulf32x F 984 | GLIBC_2.28 f32mulf64 F 985 | GLIBC_2.28 f32mulf64x F 986 | GLIBC_2.28 f32subf128 F 987 | GLIBC_2.28 f32subf32x F 988 | GLIBC_2.28 f32subf64 F 989 | GLIBC_2.28 f32subf64x F 990 | GLIBC_2.28 f32xaddf128 F 991 | GLIBC_2.28 f32xaddf64 F 992 | GLIBC_2.28 f32xaddf64x F 993 | GLIBC_2.28 f32xdivf128 F 994 | GLIBC_2.28 f32xdivf64 F 995 | GLIBC_2.28 f32xdivf64x F 996 | GLIBC_2.28 f32xmulf128 F 997 | GLIBC_2.28 f32xmulf64 F 998 | GLIBC_2.28 f32xmulf64x F 999 | GLIBC_2.28 f32xsubf128 F 1000 | GLIBC_2.28 f32xsubf64 F 1001 | GLIBC_2.28 f32xsubf64x F 1002 | GLIBC_2.28 f64addf128 F 1003 | GLIBC_2.28 f64addf64x F 1004 | GLIBC_2.28 f64divf128 F 1005 | GLIBC_2.28 f64divf64x F 1006 | GLIBC_2.28 f64mulf128 F 1007 | GLIBC_2.28 f64mulf64x F 1008 | GLIBC_2.28 f64subf128 F 1009 | GLIBC_2.28 f64subf64x F 1010 | GLIBC_2.28 f64xaddf128 F 1011 | GLIBC_2.28 f64xdivf128 F 1012 | GLIBC_2.28 f64xmulf128 F 1013 | GLIBC_2.28 f64xsubf128 F 1014 | GLIBC_2.28 fadd F 1015 | GLIBC_2.28 faddl F 1016 | GLIBC_2.28 fdiv F 1017 | GLIBC_2.28 fdivl F 1018 | GLIBC_2.28 fmul F 1019 | GLIBC_2.28 fmull F 1020 | GLIBC_2.28 fsub F 1021 | GLIBC_2.28 fsubl F 1022 | -------------------------------------------------------------------------------- /autobuild/patches/glibc/0005-add-sigaction-ucontext-compat.patch: -------------------------------------------------------------------------------- 1 | From 3616b6b4e4c2b0cf9b0d22560ddc679927ed4f80 Mon Sep 17 00:00:00 2001 2 | From: Miao Wang 3 | Date: Sun, 14 Jan 2024 05:15:07 +0800 4 | Subject: [PATCH 05/12] add sigaction & ucontext compat 5 | 6 | --- 7 | sysdeps/unix/sysv/linux/loongarch/Makefile | 8 +- 8 | .../unix/sysv/linux/loongarch/getcontext.S | 3 +- 9 | .../unix/sysv/linux/loongarch/makecontext.c | 3 +- 10 | .../unix/sysv/linux/loongarch/ow_getcontext.S | 13 + 11 | .../sysv/linux/loongarch/ow_makecontext.c | 17 + 12 | .../unix/sysv/linux/loongarch/ow_setcontext.S | 14 + 13 | .../sysv/linux/loongarch/ow_swapcontext.S | 13 + 14 | .../sysv/linux/loongarch/ow_ucontext-macros.h | 35 ++ 15 | .../unix/sysv/linux/loongarch/ow_ucontext.h | 105 +++++ 16 | .../sysv/linux/loongarch/ow_ucontext_i.sym | 32 ++ 17 | .../unix/sysv/linux/loongarch/setcontext.S | 4 +- 18 | sysdeps/unix/sysv/linux/loongarch/sigaction.c | 384 ++++++++++++++++++ 19 | .../unix/sysv/linux/loongarch/swapcontext.S | 3 +- 20 | 13 files changed, 629 insertions(+), 5 deletions(-) 21 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_getcontext.S 22 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_makecontext.c 23 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_setcontext.S 24 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_swapcontext.S 25 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_ucontext-macros.h 26 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_ucontext.h 27 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/ow_ucontext_i.sym 28 | create mode 100644 sysdeps/unix/sysv/linux/loongarch/sigaction.c 29 | 30 | diff --git a/sysdeps/unix/sysv/linux/loongarch/Makefile b/sysdeps/unix/sysv/linux/loongarch/Makefile 31 | index 70cac2d36c..1d447ea4b8 100644 32 | --- a/sysdeps/unix/sysv/linux/loongarch/Makefile 33 | +++ b/sysdeps/unix/sysv/linux/loongarch/Makefile 34 | @@ -1,5 +1,11 @@ 35 | ifeq ($(subdir),stdlib) 36 | -gen-as-const-headers += ucontext_i.sym 37 | +gen-as-const-headers += ucontext_i.sym ow_ucontext_i.sym 38 | +sysdep_routines += \ 39 | + ow_swapcontext \ 40 | + ow_makecontext \ 41 | + ow_getcontext \ 42 | + ow_setcontext \ 43 | + # sysdep_routines 44 | endif 45 | 46 | ifeq ($(subdir),signal) 47 | diff --git a/sysdeps/unix/sysv/linux/loongarch/getcontext.S b/sysdeps/unix/sysv/linux/loongarch/getcontext.S 48 | index 4e78c7c717..282779177d 100644 49 | --- a/sysdeps/unix/sysv/linux/loongarch/getcontext.S 50 | +++ b/sysdeps/unix/sysv/linux/loongarch/getcontext.S 51 | @@ -16,6 +16,7 @@ 52 | License along with the GNU C Library. If not, see 53 | . */ 54 | 55 | +#include 56 | #include "ucontext-macros.h" 57 | 58 | /* int getcontext (ucontext_t *ucp) */ 59 | @@ -56,4 +57,4 @@ LEAF (__getcontext) 60 | 61 | PSEUDO_END (__getcontext) 62 | 63 | -weak_alias (__getcontext, getcontext) 64 | +versioned_symbol (libc, __getcontext, getcontext, GLIBC_2_36); 65 | diff --git a/sysdeps/unix/sysv/linux/loongarch/makecontext.c b/sysdeps/unix/sysv/linux/loongarch/makecontext.c 66 | index 82a868f9a5..78c12178fb 100644 67 | --- a/sysdeps/unix/sysv/linux/loongarch/makecontext.c 68 | +++ b/sysdeps/unix/sysv/linux/loongarch/makecontext.c 69 | @@ -17,6 +17,7 @@ 70 | License along with the GNU C Library. If not, see 71 | . */ 72 | 73 | +#include 74 | #include 75 | #include 76 | #include 77 | @@ -78,4 +79,4 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, long int a0, 78 | } 79 | } 80 | 81 | -weak_alias (__makecontext, makecontext) 82 | +versioned_symbol (libc, __makecontext, makecontext, GLIBC_2_36); 83 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_getcontext.S b/sysdeps/unix/sysv/linux/loongarch/ow_getcontext.S 84 | new file mode 100644 85 | index 0000000000..24ae4244aa 86 | --- /dev/null 87 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_getcontext.S 88 | @@ -0,0 +1,13 @@ 89 | +#include 90 | +#include "ow_ucontext-macros.h" 91 | + 92 | +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_36) 93 | +#undef versioned_symbol 94 | +#define versioned_symbol(a, b, c, d) 95 | +#define __getcontext __ow___getcontext 96 | +#include "getcontext.S" 97 | + 98 | +#undef __getcontext 99 | +compat_symbol (libc, __ow___getcontext, getcontext, GLIBC_2_1); 100 | + 101 | +#endif 102 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_makecontext.c b/sysdeps/unix/sysv/linux/loongarch/ow_makecontext.c 103 | new file mode 100644 104 | index 0000000000..d2effdc952 105 | --- /dev/null 106 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_makecontext.c 107 | @@ -0,0 +1,17 @@ 108 | +#include 109 | + 110 | +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_36) 111 | +#include 112 | +#include "ow_ucontext.h" 113 | + 114 | +#undef versioned_symbol 115 | +#define versioned_symbol(a, b, c, d) 116 | +#define ucontext_t __ow_ucontext_t 117 | +#define __makecontext __ow___makecontext 118 | +#define __start_context __ow___start_context 119 | +#include "makecontext.c" 120 | + 121 | +#undef __makecontext 122 | +compat_symbol (libc, __ow___makecontext, makecontext, GLIBC_2_1); 123 | + 124 | +#endif 125 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_setcontext.S b/sysdeps/unix/sysv/linux/loongarch/ow_setcontext.S 126 | new file mode 100644 127 | index 0000000000..906e28fb78 128 | --- /dev/null 129 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_setcontext.S 130 | @@ -0,0 +1,14 @@ 131 | +#include 132 | +#include "ow_ucontext-macros.h" 133 | + 134 | +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_36) 135 | +#undef versioned_symbol 136 | +#define versioned_symbol(a, b, c, d) 137 | +#define __setcontext __ow___setcontext 138 | +#define __start_context __ow___start_context 139 | +#include "setcontext.S" 140 | + 141 | +#undef __setcontext 142 | +compat_symbol (libc, __ow___setcontext, setcontext, GLIBC_2_0); 143 | + 144 | +#endif 145 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_swapcontext.S b/sysdeps/unix/sysv/linux/loongarch/ow_swapcontext.S 146 | new file mode 100644 147 | index 0000000000..c0a0b6a487 148 | --- /dev/null 149 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_swapcontext.S 150 | @@ -0,0 +1,13 @@ 151 | +#include 152 | +#include "ow_ucontext-macros.h" 153 | + 154 | +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_36) 155 | +#undef versioned_symbol 156 | +#define versioned_symbol(a, b, c, d) 157 | +#define __swapcontext __ow___swapcontext 158 | +#include "swapcontext.S" 159 | + 160 | +#undef __swapcontext 161 | +compat_symbol (libc, __ow___swapcontext, swapcontext, GLIBC_2_1); 162 | + 163 | +#endif 164 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_ucontext-macros.h b/sysdeps/unix/sysv/linux/loongarch/ow_ucontext-macros.h 165 | new file mode 100644 166 | index 0000000000..984c906964 167 | --- /dev/null 168 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_ucontext-macros.h 169 | @@ -0,0 +1,35 @@ 170 | +/* Macros for ucontext routines. 171 | + Copyright (C) 2022-2023 Free Software Foundation, Inc. 172 | + This file is part of the GNU C Library. 173 | + 174 | + The GNU C Library is free software; you can redistribute it and/or 175 | + modify it under the terms of the GNU Lesser General Public 176 | + License as published by the Free Software Foundation; either 177 | + version 2.1 of the License, or (at your option) any later version. 178 | + 179 | + The GNU C Library is distributed in the hope that it will be useful, 180 | + but WITHOUT ANY WARRANTY; without even the implied warranty of 181 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 182 | + Lesser General Public License for more details. 183 | + 184 | + You should have received a copy of the GNU Lesser General Public 185 | + License along with the GNU C Library. If not, see 186 | + . */ 187 | + 188 | +#ifndef _LINUX_LOONGARCH_OW_UCONTEXT_MACROS_H 189 | +#define _LINUX_LOONGARCH_OW_UCONTEXT_MACROS_H 190 | + 191 | +// We also define this to prevent new world headers from being included. 192 | +#define _LINUX_LOONGARCH_UCONTEXT_MACROS_H 193 | + 194 | +#include 195 | +#include 196 | +#include "ow_ucontext_i.h" 197 | + 198 | +#define SAVE_INT_REG(name, num, base) \ 199 | + REG_S name, base, ((num) *SZREG + MCONTEXT_GREGS) 200 | + 201 | +#define RESTORE_INT_REG(name, num, base) \ 202 | + REG_L name, base, ((num) *SZREG + MCONTEXT_GREGS) 203 | + 204 | +#endif /* _LINUX_LOONGARCH_OW_UCONTEXT_MACROS_H */ 205 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_ucontext.h b/sysdeps/unix/sysv/linux/loongarch/ow_ucontext.h 206 | new file mode 100644 207 | index 0000000000..33cd554f11 208 | --- /dev/null 209 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_ucontext.h 210 | @@ -0,0 +1,105 @@ 211 | +#ifndef _OW_UCONTEXT_H 212 | +#define _OW_UCONTEXT_H 1 213 | +#include 214 | +#include 215 | +#include 216 | +#include 217 | +#include "ow_sigop.h" 218 | + 219 | +union __ow_loongarch_mc_fp_state { 220 | + unsigned int __val32[256 / 32]; 221 | + unsigned long long __val64[256 / 64]; 222 | +}; 223 | + 224 | +typedef struct __ow_mcontext_t { 225 | + unsigned long long __pc; 226 | + unsigned long long __gregs[32]; 227 | + unsigned int __flags; 228 | + 229 | + unsigned int __fcsr; 230 | + unsigned int __vcsr; 231 | + unsigned long long __fcc; 232 | + union __ow_loongarch_mc_fp_state __fpregs[32] __attribute__((__aligned__ (32))); 233 | + 234 | + unsigned int __reserved; 235 | +} __ow_mcontext_t; 236 | + 237 | +/* Userlevel context. */ 238 | +typedef struct __ow_ucontext_t 239 | + { 240 | + unsigned long int __uc_flags; 241 | + struct __ow_ucontext_t *uc_link; 242 | + stack_t uc_stack; 243 | + __ow_mcontext_t uc_mcontext; 244 | + sigset_t uc_sigmask; 245 | + } __ow_ucontext_t; 246 | + 247 | +struct __nw_sctx_info 248 | + { 249 | + unsigned int magic; 250 | + unsigned int size; 251 | + unsigned long long padding; /* padding to 16 bytes */ 252 | + }; 253 | + 254 | +/* FPU context */ 255 | +#define FPU_CTX_MAGIC 0x46505501 256 | +#define FPU_CTX_ALIGN 8 257 | +struct __nw_fpu_context 258 | + { 259 | + unsigned long long regs[32]; 260 | + unsigned long long fcc; 261 | + unsigned int fcsr; 262 | + }; 263 | +/* LSX context */ 264 | +#define LSX_CTX_MAGIC 0x53580001 265 | +#define LSX_CTX_ALIGN 16 266 | +struct __nw_lsx_context 267 | + { 268 | + unsigned long long regs[32][2]; 269 | + unsigned long long fcc; 270 | + unsigned long long fcsr; 271 | + }; 272 | +/* LASX context */ 273 | +#define LASX_CTX_MAGIC 0x41535801 274 | +#define LASX_CTX_ALIGN 32 275 | +struct __nw_lasx_context 276 | + { 277 | + unsigned long long regs[32][4]; 278 | + unsigned long long fcc; 279 | + unsigned long long fcsr; 280 | + }; 281 | + 282 | +static inline void __copy_nw_ow (__ow_ucontext_t *ow_ctx, const ucontext_t *nw_ctx){ 283 | + ow_ctx->__uc_flags = nw_ctx->__uc_flags; 284 | + ow_ctx->uc_link = NULL; 285 | + ow_ctx->uc_stack = nw_ctx->uc_stack; 286 | + ow_ctx->uc_sigmask = nw_ctx->uc_sigmask; 287 | + __ow_clear_unused_bits (&ow_ctx->uc_sigmask); 288 | + 289 | + ow_ctx->uc_mcontext.__pc = nw_ctx->uc_mcontext.__pc; 290 | + static_assert (sizeof (ow_ctx->uc_mcontext.__gregs) == 291 | + sizeof (nw_ctx->uc_mcontext.__gregs), 292 | + "gregs size mismatch"); 293 | + memcpy (&ow_ctx->uc_mcontext.__gregs, &nw_ctx->uc_mcontext.__gregs, 294 | + sizeof (ow_ctx->uc_mcontext.__gregs)); 295 | + ow_ctx->uc_mcontext.__flags = nw_ctx->uc_mcontext.__flags; 296 | + ow_ctx->uc_mcontext.__fcsr = 0; 297 | + ow_ctx->uc_mcontext.__vcsr = 0; 298 | + ow_ctx->uc_mcontext.__fcc = 0; 299 | + memset (&ow_ctx->uc_mcontext.__fpregs, 0, 300 | + sizeof (ow_ctx->uc_mcontext.__fpregs)); 301 | + ow_ctx->uc_mcontext.__reserved = 0; 302 | +} 303 | + 304 | +static inline void __copy_ow_nw (ucontext_t *nw_ctx, const __ow_ucontext_t *ow_ctx){ 305 | + nw_ctx->uc_mcontext.__flags = ow_ctx->uc_mcontext.__flags; 306 | + memcpy (&nw_ctx->uc_mcontext.__gregs, &ow_ctx->uc_mcontext.__gregs, 307 | + sizeof (nw_ctx->uc_mcontext.__gregs)); 308 | + nw_ctx->uc_mcontext.__pc = ow_ctx->uc_mcontext.__pc; 309 | + nw_ctx->uc_sigmask = ow_ctx->uc_sigmask; 310 | + __ow_clear_unused_bits (&nw_ctx->uc_sigmask); 311 | + nw_ctx->uc_stack = ow_ctx->uc_stack; 312 | + nw_ctx->__uc_flags = ow_ctx->__uc_flags; 313 | +} 314 | + 315 | +#endif 316 | diff --git a/sysdeps/unix/sysv/linux/loongarch/ow_ucontext_i.sym b/sysdeps/unix/sysv/linux/loongarch/ow_ucontext_i.sym 317 | new file mode 100644 318 | index 0000000000..5af4dd4d54 319 | --- /dev/null 320 | +++ b/sysdeps/unix/sysv/linux/loongarch/ow_ucontext_i.sym 321 | @@ -0,0 +1,32 @@ 322 | +#include 323 | +#include 324 | +#include 325 | +#include 326 | +#include "ow_ucontext.h" 327 | + 328 | +-- Constants used by the rt_sigprocmask call. 329 | + 330 | +SIG_BLOCK 331 | +SIG_SETMASK 332 | + 333 | +_NSIG8 (_NSIG / 8) 334 | + 335 | +-- Offsets of the fields in the ucontext_t structure. 336 | +#define ucontext(member) offsetof (__ow_ucontext_t, member) 337 | +#define stack(member) ucontext (uc_stack.member) 338 | +#define mcontext(member) ucontext (uc_mcontext.member) 339 | + 340 | +UCONTEXT_FLAGS ucontext (__uc_flags) 341 | +UCONTEXT_LINK ucontext (uc_link) 342 | +UCONTEXT_STACK ucontext (uc_stack) 343 | +UCONTEXT_MCONTEXT ucontext (uc_mcontext) 344 | +UCONTEXT_SIGMASK ucontext (uc_sigmask) 345 | + 346 | +STACK_SP stack (ss_sp) 347 | +STACK_SIZE stack (ss_size) 348 | +STACK_FLAGS stack (ss_flags) 349 | + 350 | +MCONTEXT_PC mcontext (__pc) 351 | +MCONTEXT_GREGS mcontext (__gregs) 352 | + 353 | +UCONTEXT_SIZE sizeof (__ow_ucontext_t) 354 | diff --git a/sysdeps/unix/sysv/linux/loongarch/setcontext.S b/sysdeps/unix/sysv/linux/loongarch/setcontext.S 355 | index ef4830ad71..c662773819 100644 356 | --- a/sysdeps/unix/sysv/linux/loongarch/setcontext.S 357 | +++ b/sysdeps/unix/sysv/linux/loongarch/setcontext.S 358 | @@ -15,6 +15,8 @@ 359 | You should have received a copy of the GNU Lesser General Public 360 | License along with the GNU C Library. If not, see 361 | . */ 362 | + 363 | +#include 364 | #include "sys/regdef.h" 365 | #include "ucontext-macros.h" 366 | 367 | @@ -80,7 +82,7 @@ LEAF (__setcontext) 368 | b __syscall_error 369 | 370 | PSEUDO_END (__setcontext) 371 | -weak_alias (__setcontext, setcontext) 372 | +versioned_symbol (libc, __setcontext, setcontext, GLIBC_2_36); 373 | 374 | LEAF (__start_context) 375 | 376 | diff --git a/sysdeps/unix/sysv/linux/loongarch/sigaction.c b/sysdeps/unix/sysv/linux/loongarch/sigaction.c 377 | new file mode 100644 378 | index 0000000000..6e370c338b 379 | --- /dev/null 380 | +++ b/sysdeps/unix/sysv/linux/loongarch/sigaction.c 381 | @@ -0,0 +1,384 @@ 382 | +#include 383 | +#include 384 | +#include 385 | + 386 | +#undef weak_alias 387 | +#define weak_alias(name, aliasname) 388 | +#undef libc_hidden_def 389 | +#define libc_hidden_def(name) 390 | +#define __sigaction __nw_sigaction 391 | + 392 | +#include 393 | + 394 | +#undef __sigaction 395 | + 396 | +versioned_symbol (libc, __nw_sigaction, sigaction, GLIBC_2_36); 397 | +versioned_symbol (libc, __nw_sigaction, __sigaction, GLIBC_2_36); 398 | +libc_hidden_ver (__nw_sigaction, __sigaction); 399 | + 400 | +#if IS_IN(libc) && (SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_36) || OTHER_SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_34)) 401 | +#include 402 | +#include 403 | +#if !IS_IN(rtld) 404 | +#include 405 | +#endif 406 | +#include "ow_ucontext.h" 407 | + 408 | +typedef void (*__linx_sighandler_t) (int, siginfo_t *, void *); 409 | + 410 | +static void 411 | +custom_handler (int sig, siginfo_t *info, void *ucontext, 412 | + __linx_sighandler_t real_handler) 413 | +{ 414 | + struct __ow_ucontext_t ow_ctx; 415 | + 416 | + struct ucontext_t *nw_ctx = ucontext; 417 | + 418 | + __copy_nw_ow(&ow_ctx, nw_ctx); 419 | + int have_fpu = 0, have_lsx = 0, have_lasx = 0; 420 | + void *fp_ctx_p = NULL; 421 | + struct __nw_sctx_info *extinfo = (void *)&nw_ctx->uc_mcontext.__extcontext; 422 | + while (extinfo->magic) 423 | + { 424 | + switch (extinfo->magic) 425 | + { 426 | + case FPU_CTX_MAGIC: 427 | + { 428 | + struct __nw_fpu_context *fp_ctx = (void *)(extinfo + 1); 429 | + have_fpu = 1; 430 | + fp_ctx_p = fp_ctx; 431 | + ow_ctx.uc_mcontext.__fcsr = fp_ctx->fcsr; 432 | + ow_ctx.uc_mcontext.__fcc = fp_ctx->fcc; 433 | + for (int i = 0; i < 32; i++) 434 | + { 435 | + ow_ctx.uc_mcontext.__fpregs[i].__val64[0] = fp_ctx->regs[i]; 436 | + } 437 | + break; 438 | + } 439 | + case LSX_CTX_MAGIC: 440 | + { 441 | + struct __nw_lsx_context *fp_ctx = (void *)(extinfo + 1); 442 | + have_lsx = 1; 443 | + fp_ctx_p = fp_ctx; 444 | + ow_ctx.uc_mcontext.__fcsr = fp_ctx->fcsr; 445 | + ow_ctx.uc_mcontext.__fcc = fp_ctx->fcc; 446 | + for (int i = 0; i < 32; i++) 447 | + { 448 | + ow_ctx.uc_mcontext.__fpregs[i].__val64[0] = fp_ctx->regs[i][0]; 449 | + ow_ctx.uc_mcontext.__fpregs[i].__val64[1] = fp_ctx->regs[i][1]; 450 | + } 451 | + break; 452 | + } 453 | + case LASX_CTX_MAGIC: 454 | + { 455 | + struct __nw_lasx_context *fp_ctx = (void *)(extinfo + 1); 456 | + have_lasx = 1; 457 | + fp_ctx_p = fp_ctx; 458 | + ow_ctx.uc_mcontext.__fcsr = fp_ctx->fcsr; 459 | + ow_ctx.uc_mcontext.__fcc = fp_ctx->fcc; 460 | + for (int i = 0; i < 32; i++) 461 | + { 462 | + ow_ctx.uc_mcontext.__fpregs[i].__val64[0] = fp_ctx->regs[i][0]; 463 | + ow_ctx.uc_mcontext.__fpregs[i].__val64[1] = fp_ctx->regs[i][1]; 464 | + ow_ctx.uc_mcontext.__fpregs[i].__val64[2] = fp_ctx->regs[i][2]; 465 | + ow_ctx.uc_mcontext.__fpregs[i].__val64[3] = fp_ctx->regs[i][3]; 466 | + } 467 | + break; 468 | + } 469 | + } 470 | + if (have_fpu || have_lsx || have_lasx) 471 | + { 472 | + break; 473 | + } 474 | + extinfo = (struct __nw_sctx_info *)((void *)extinfo + extinfo->size); 475 | + } 476 | + 477 | + real_handler (sig, info, &ow_ctx); 478 | + 479 | + if (have_lasx) 480 | + { 481 | + struct __nw_lasx_context *fp_ctx = fp_ctx_p; 482 | + for (int i = 0; i < 32; i++) 483 | + { 484 | + fp_ctx->regs[i][0] = ow_ctx.uc_mcontext.__fpregs[i].__val64[0]; 485 | + fp_ctx->regs[i][1] = ow_ctx.uc_mcontext.__fpregs[i].__val64[1]; 486 | + fp_ctx->regs[i][2] = ow_ctx.uc_mcontext.__fpregs[i].__val64[2]; 487 | + fp_ctx->regs[i][3] = ow_ctx.uc_mcontext.__fpregs[i].__val64[3]; 488 | + } 489 | + fp_ctx->fcc = ow_ctx.uc_mcontext.__fcc; 490 | + fp_ctx->fcsr = ow_ctx.uc_mcontext.__fcsr; 491 | + } 492 | + else if (have_lsx) 493 | + { 494 | + struct __nw_lsx_context *fp_ctx = fp_ctx_p; 495 | + for (int i = 0; i < 32; i++) 496 | + { 497 | + fp_ctx->regs[i][0] = ow_ctx.uc_mcontext.__fpregs[i].__val64[0]; 498 | + fp_ctx->regs[i][1] = ow_ctx.uc_mcontext.__fpregs[i].__val64[1]; 499 | + } 500 | + fp_ctx->fcc = ow_ctx.uc_mcontext.__fcc; 501 | + fp_ctx->fcsr = ow_ctx.uc_mcontext.__fcsr; 502 | + } 503 | + else if (have_fpu) 504 | + { 505 | + struct __nw_fpu_context *fp_ctx = fp_ctx_p; 506 | + for (int i = 0; i < 32; i++) 507 | + { 508 | + fp_ctx->regs[i] = ow_ctx.uc_mcontext.__fpregs[i].__val64[0]; 509 | + } 510 | + fp_ctx->fcc = ow_ctx.uc_mcontext.__fcc; 511 | + fp_ctx->fcsr = ow_ctx.uc_mcontext.__fcsr; 512 | + } 513 | + __copy_ow_nw (nw_ctx, &ow_ctx); 514 | +} 515 | + 516 | +static inline int 517 | +is_fake_handler (__linx_sighandler_t handler) 518 | +{ 519 | + return handler == (__linx_sighandler_t)SIG_ERR 520 | + || handler == (__linx_sighandler_t)SIG_DFL 521 | + || handler == (__linx_sighandler_t)SIG_IGN 522 | +#ifdef SIG_HOLD 523 | + || handler == (__linx_sighandler_t)SIG_HOLD 524 | +#endif 525 | + ; 526 | +} 527 | + 528 | + 529 | +#define LA_INS_PCADDI 0x18000000u 530 | +#define LA_INS_LD_D 0x28C00000u 531 | +#define LA_INS_JIRL 0x4C000000u 532 | +#define LA_REG_ZERO 0 533 | +#define LA_REG_T0 12 534 | +#define LA_REG_RA 1 535 | +#define LA_REG_A0 4 536 | +#define LA_REG_A1 5 537 | +#define LA_REG_A2 6 538 | +#define LA_REG_A3 7 539 | +#define LA_REG_A4 8 540 | +#define LA_REG_A5 9 541 | + 542 | +#define SIGHANDLER_PROG_NR_INS 4 543 | +struct __attribute__ ((__packed__, aligned (8))) sighandler_prog 544 | +{ 545 | + unsigned int magic[2]; 546 | + unsigned int prog[SIGHANDLER_PROG_NR_INS]; 547 | + 548 | + struct sighandler_prog_data 549 | + { 550 | + unsigned long our_handler_addr; 551 | + unsigned long orig_handler_addr; 552 | + } data; 553 | +} static const prog_tmpl = { 554 | + .magic = {U"开刀"}, 555 | + .prog = { 556 | + /* pcaddi $t0, SIGHANDLER_PROG_NR_INS */ 557 | + LA_INS_PCADDI | LA_REG_T0 | (SIGHANDLER_PROG_NR_INS << 5), 558 | + /* ld.d $a3, $t0, orig_handler_addr */ 559 | + LA_INS_LD_D | LA_REG_A3 | (LA_REG_T0 << 5) | (offsetof (struct sighandler_prog_data, orig_handler_addr) << 10), 560 | + /* ld.d $t0, $t0, our_handler_addr */ 561 | + LA_INS_LD_D | LA_REG_T0 | (LA_REG_T0 << 5) | (offsetof (struct sighandler_prog_data, our_handler_addr) << 10), 562 | + /* jirl $zero, $t0, 0 */ 563 | + LA_INS_JIRL | LA_REG_ZERO | (LA_REG_T0 << 5) | (0 << 10), 564 | + }, 565 | + .data = { 566 | + .our_handler_addr = (unsigned long)custom_handler, 567 | + } 568 | +}; 569 | + 570 | + 571 | +#define PROG_POOL_SIZE 2 572 | +#define LA_PAGE_SIZE (16 * 1024) 573 | + 574 | +static_assert (sizeof (struct sighandler_prog) <= LA_PAGE_SIZE, 575 | + "sighandler_prog too large"); 576 | +static_assert (SIGHANDLER_PROG_NR_INS < (1u << 19), "prog too long"); 577 | +static_assert (offsetof (struct sighandler_prog, data.our_handler_addr) 578 | + == offsetof (struct sighandler_prog, prog) 579 | + + sizeof (unsigned int) * SIGHANDLER_PROG_NR_INS, 580 | + "data offset wrong"); 581 | +static_assert (offsetof (struct sighandler_prog, data.our_handler_addr) 582 | + % sizeof (unsigned long) 583 | + == 0, 584 | + "data offset not aligned"); 585 | +static_assert (offsetof (struct sighandler_prog_data, orig_handler_addr) 586 | + < (1u << 11), 587 | + "data too long"); 588 | +static_assert (offsetof (struct sighandler_prog_data, our_handler_addr) 589 | + < (1u << 11), 590 | + "data too long"); 591 | + 592 | + 593 | +struct sighandler_prog_pool 594 | +{ 595 | + struct sighandler_prog *prog[PROG_POOL_SIZE]; 596 | + size_t pos; 597 | +#if !IS_IN(rtld) 598 | + __libc_lock_define (, lock); 599 | +#endif 600 | +}; 601 | + 602 | +static void 603 | +destroy_handler (struct sighandler_prog *prog) 604 | +{ 605 | + __munmap (prog, LA_PAGE_SIZE); 606 | +} 607 | + 608 | + 609 | +static struct sighandler_prog * 610 | +alloc_handler (__linx_sighandler_t handler) 611 | +{ 612 | + struct sighandler_prog *prog 613 | + = __mmap (NULL, LA_PAGE_SIZE, PROT_READ | PROT_WRITE, 614 | + MAP_ANON | MAP_PRIVATE, -1, 0); 615 | + if (__glibc_unlikely (prog == MAP_FAILED)) 616 | + { 617 | + return NULL; 618 | + } 619 | + memcpy (prog, &prog_tmpl, sizeof (struct sighandler_prog)); 620 | + prog->data.orig_handler_addr = (unsigned long)handler; 621 | + 622 | + int rc = __mprotect (prog, LA_PAGE_SIZE, PROT_READ | PROT_EXEC); 623 | + if (rc < 0) 624 | + { 625 | + destroy_handler (prog); 626 | + prog = NULL; 627 | + } 628 | + return prog; 629 | +} 630 | + 631 | + 632 | +static void 633 | +store_handler (struct sighandler_prog_pool *pool, struct sighandler_prog *prog) 634 | +{ 635 | + struct sighandler_prog *orig_prog; 636 | + orig_prog = pool->prog[pool->pos]; 637 | + pool->prog[pool->pos] = prog; 638 | + pool->pos = (pool->pos + 1) % PROG_POOL_SIZE; 639 | + if (orig_prog) 640 | + { 641 | + destroy_handler (orig_prog); 642 | + } 643 | +} 644 | + 645 | +int __ow___sigaction (int sig, const struct sigaction *act, struct sigaction *oact) 646 | +{ 647 | + static struct sighandler_prog_pool prog_pool[NSIG] 648 | + = { [0 ... NSIG - 1] = { 649 | + .prog = { NULL }, 650 | + .pos = 0, 651 | +#if !IS_IN(rtld) 652 | + .lock = _LIBC_LOCK_INITIALIZER, 653 | +#endif 654 | + } }; 655 | + 656 | + sigset_t saveset, allset; 657 | + struct sighandler_prog *old_prog = NULL; 658 | + struct sighandler_prog *new_prog = NULL; 659 | + int result = 0, result2 = 0; 660 | + struct sigaction iact, ioact; 661 | + 662 | + if (sig <= 0 || sig >= __OW_NSIG || is_internal_signal (sig)) 663 | + { 664 | + __set_errno (EINVAL); 665 | + return -1; 666 | + } 667 | + 668 | + if (sig >= NSIG) 669 | + { 670 | + if (oact) 671 | + { 672 | + memset (oact, 0, sizeof (struct sigaction)); 673 | + oact->sa_handler = SIG_IGN; 674 | + } 675 | + return 0; 676 | + } 677 | + 678 | + if (act) 679 | + { 680 | + if (!is_fake_handler (act->sa_sigaction)) 681 | + { 682 | + new_prog = alloc_handler (act->sa_sigaction); 683 | + if (!new_prog) 684 | + { 685 | + return -1; 686 | + } 687 | + iact.sa_sigaction = (__linx_sighandler_t)new_prog; 688 | + } 689 | + else 690 | + { 691 | + iact.sa_sigaction = act->sa_sigaction; 692 | + } 693 | + memcpy (&iact.sa_mask, &act->sa_mask, sizeof (sigset_t)); 694 | + iact.sa_flags = act->sa_flags; 695 | + } 696 | + if (new_prog) 697 | + { 698 | + __sigfillset (&allset); 699 | + result = INLINE_SYSCALL_CALL (rt_sigprocmask, SIG_BLOCK, &allset, 700 | + &saveset, NSIG / 8); 701 | + if (result < 0) 702 | + { 703 | + destroy_handler (new_prog); 704 | + return result; 705 | + } 706 | + 707 | +#if !IS_IN(rtld) 708 | + __libc_lock_lock (prog_pool[sig].lock); 709 | +#endif 710 | + } 711 | + result = __libc_sigaction (sig, act ? &iact : NULL, oact ? &ioact : NULL); 712 | + if (result < 0) 713 | + { 714 | + if (new_prog) 715 | + { 716 | + destroy_handler (new_prog); 717 | + } 718 | + goto out_unlock; 719 | + } 720 | + if (oact) 721 | + { 722 | + oact->sa_sigaction = ioact.sa_sigaction; 723 | + if (!is_fake_handler (ioact.sa_sigaction)) 724 | + { 725 | + old_prog = (struct sighandler_prog *)ioact.sa_sigaction; 726 | + if (memcmp (old_prog->magic, prog_tmpl.magic, 727 | + sizeof (prog_tmpl.magic)) 728 | + == 0) 729 | + { 730 | + oact->sa_sigaction 731 | + = (__linx_sighandler_t)old_prog->data.orig_handler_addr; 732 | + } 733 | + } 734 | + memcpy (&oact->sa_mask, &ioact.sa_mask, NSIG / 8); 735 | + __ow_clear_unused_bits (&oact->sa_mask); 736 | + oact->sa_flags = ioact.sa_flags; 737 | + } 738 | + if (new_prog) 739 | + store_handler (&prog_pool[sig], new_prog); 740 | + 741 | +out_unlock: 742 | + if (new_prog) 743 | + { 744 | +#if !IS_IN(rtld) 745 | + __libc_lock_unlock (prog_pool[sig].lock); 746 | +#endif 747 | + 748 | + result2 = INLINE_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, &saveset, 749 | + NULL, NSIG / 8); 750 | + if (result2 < 0) 751 | + result = result2; 752 | + } 753 | + return result; 754 | +} 755 | + 756 | +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_36) 757 | +compat_symbol (libc, __ow___sigaction, sigaction, GLIBC_2_0); 758 | +compat_symbol (libc, __ow___sigaction, __sigaction, GLIBC_2_0); 759 | +#endif 760 | + 761 | +#if OTHER_SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_34) 762 | +compat_symbol (libpthread, __ow___sigaction, sigaction, GLIBC_2_0); 763 | +compat_symbol (libpthread, __ow___sigaction, __sigaction, GLIBC_2_0); 764 | +#endif 765 | +#endif 766 | diff --git a/sysdeps/unix/sysv/linux/loongarch/swapcontext.S b/sysdeps/unix/sysv/linux/loongarch/swapcontext.S 767 | index 4b8a90bc2e..8767a2e56f 100644 768 | --- a/sysdeps/unix/sysv/linux/loongarch/swapcontext.S 769 | +++ b/sysdeps/unix/sysv/linux/loongarch/swapcontext.S 770 | @@ -16,6 +16,7 @@ 771 | License along with the GNU C Library. If not, see 772 | . */ 773 | 774 | +#include 775 | #include "ucontext-macros.h" 776 | 777 | /* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */ 778 | @@ -92,4 +93,4 @@ LEAF (__swapcontext) 779 | 780 | PSEUDO_END (__swapcontext) 781 | 782 | -weak_alias (__swapcontext, swapcontext) 783 | +versioned_symbol (libc, __swapcontext, swapcontext, GLIBC_2_36); 784 | -- 785 | 2.52.0 786 | 787 | --------------------------------------------------------------------------------