diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-07-24 15:57:51 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-08-07 10:08:24 -0500 |
commit | 0be42b21591a6087939a33ab408beab2fd918c59 (patch) | |
tree | 370a506f6752b20e2e79e72059ae4be4fdf0566c /system/gcc/sanitation.patch | |
parent | 4e4936e9f343d2eaaa2aacb1153493264362d5a6 (diff) | |
download | packages-0be42b21591a6087939a33ab408beab2fd918c59.tar.gz packages-0be42b21591a6087939a33ab408beab2fd918c59.tar.bz2 packages-0be42b21591a6087939a33ab408beab2fd918c59.tar.xz packages-0be42b21591a6087939a33ab408beab2fd918c59.zip |
system/gcc: Fixes for 32-bit Arm platforms
* The san library needs some adjustments to handle the fact we need
frame pointers (r7 is used for the syscall number, and the FP).
* Fix GCC Go __go_mmap external linking since they changed the signature
upstream for the C side. This closes #1201.
Diffstat (limited to 'system/gcc/sanitation.patch')
-rw-r--r-- | system/gcc/sanitation.patch | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/system/gcc/sanitation.patch b/system/gcc/sanitation.patch index 861f5d08e..984b60498 100644 --- a/system/gcc/sanitation.patch +++ b/system/gcc/sanitation.patch @@ -1,5 +1,5 @@ ---- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp.old 2024-05-21 07:47:42.000000000 +0000 -+++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp 2024-06-20 23:28:49.290053800 +0000 +--- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp.old 2024-05-21 02:47:42.000000000 -0500 ++++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp 2024-07-24 15:56:06.119891718 -0500 @@ -82,6 +82,10 @@ # include <sys/sysmacros.h> #endif @@ -71,7 +71,24 @@ // Doesn't set sa_restorer if the caller did not set it, so use with caution //(see below). int internal_sigaction_norestorer(int signum, const void *act, void *oldact) { -@@ -2173,11 +2170,20 @@ +@@ -1677,6 +1674,8 @@ + return res; + } + #elif defined(__arm__) ++#pragma GCC push_options ++#pragma GCC optimize("omit-frame-pointer") + uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, + int *parent_tidptr, void *newtls, int *child_tidptr) { + unsigned int res; +@@ -1742,6 +1741,7 @@ + : "memory"); + return res; + } ++#pragma GCC pop_options + #endif + #endif // SANITIZER_LINUX + +@@ -2173,11 +2173,20 @@ *bp = ucontext->uc_mcontext.mc_frame[31]; # else ucontext_t *ucontext = (ucontext_t*)context; @@ -145,3 +162,23 @@ // GLIBC 2.20+ sys/user does not include asm/ptrace.h # include <asm/ptrace.h> #endif +--- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_arm.inc.old 2024-05-21 02:47:42.000000000 -0500 ++++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_arm.inc 2024-07-24 15:56:06.129890658 -0500 +@@ -12,6 +12,9 @@ + + #define SYSCALL(name) __NR_ ## name + ++#pragma GCC push_options ++#pragma GCC optimize("omit-frame-pointer") ++ + static uptr __internal_syscall(u32 nr) { + register u32 r8 asm("r7") = nr; + register u32 r0 asm("r0"); +@@ -115,6 +118,7 @@ + #define __internal_syscall6(n, a1, a2, a3, a4, a5, a6) \ + (__internal_syscall)(n, (u32)(a1), (long)(a2), (long)(a3), (long)(a4), \ + (u32)(a5), (long)(a6)) ++#pragma GCC pop_options + + #define __SYSCALL_NARGS_X(a1, a2, a3, a4, a5, a6, a7, a8, n, ...) n + #define __SYSCALL_NARGS(...) \ |