forked from termux-pacman/glibc-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gpkg/glibc: corrections (termux-pacman#173)
ldd fix for x86_64 fix mprotect.c ignore system call 1008 and mbind
- Loading branch information
1 parent
da85eab
commit b1fdb95
Showing
14 changed files
with
221 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- src/elf/dl-load.c 2023-07-31 20:54:16.000000000 +0300 | ||
+++ src/elf/dl-load.c.patch 2023-12-25 17:28:25.688056890 +0300 | ||
@@ -1330,15 +1330,15 @@ | ||
errstring = N_("cannot change memory protections"); | ||
goto lose_errno; | ||
} | ||
- __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC; | ||
+ __stack_prot |= PROT_READ|PROT_WRITE; | ||
__mprotect ((void *) p, s, PROT_READ); | ||
} | ||
else | ||
- __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC; | ||
+ __stack_prot |= PROT_READ|PROT_WRITE; | ||
} | ||
else | ||
#endif | ||
- __stack_prot |= PROT_READ|PROT_WRITE|PROT_EXEC; | ||
+ __stack_prot |= PROT_READ|PROT_WRITE; | ||
|
||
#ifdef check_consistency | ||
check_consistency (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef _IGNORE_SYSCALL | ||
#define _IGNORE_SYSCALL | ||
|
||
#include <arch-syscall.h> | ||
|
||
struct IdSyscalls { | ||
int id; | ||
}; | ||
|
||
static struct IdSyscalls ListIgnoreSyscall[] = { | ||
{ __NR_mbind }, | ||
{ 1008 }, // for some reason used in julia | ||
}; | ||
|
||
#define count_ignore_syscall (sizeof(ListIgnoreSyscall) / sizeof(ListIgnoreSyscall[0])) | ||
|
||
#endif //_IGNORE_SYSCALL |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- glibc-2.38/misc/Makefile 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/misc/Makefile.patch 2023-12-26 00:08:33.550537534 +0300 | ||
@@ -192,6 +192,7 @@ | ||
swapon \ | ||
sync \ | ||
syncfs \ | ||
+ syscallS \ | ||
syscall \ | ||
syslog \ | ||
truncate \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- glibc-2.38/misc/Versions 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/misc/Versions.patch 2024-01-01 13:56:26.514498144 +0300 | ||
@@ -71,7 +71,7 @@ | ||
# s* | ||
sbrk; select; setdomainname; setfsent; sethostent; sethostid; sethostname; | ||
setlogmask; setmntent; setregid; setreuid; setttyent; setusershell; sstk; | ||
- stty; sync; syscall; syslog; | ||
+ stty; sync; syscallS; syscall; syslog; | ||
|
||
# t* | ||
tdelete; tfind; truncate; tsearch; ttyslot; twalk; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- glibc-2.38/sysdeps/unix/sysv/linux/aarch64/syscall.S 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/sysdeps/unix/sysv/linux/aarch64/syscall.S.patch 2023-12-25 22:43:44.138402265 +0300 | ||
@@ -26,7 +26,7 @@ | ||
For kernel entry we need to move the system call nr to x8 then | ||
load the remaining arguments to register. */ | ||
|
||
-ENTRY (syscall) | ||
+ENTRY (syscallS) | ||
uxtw x8, w0 | ||
mov x0, x1 | ||
mov x1, x2 | ||
@@ -41,4 +41,4 @@ | ||
RET | ||
1: | ||
b SYSCALL_ERROR | ||
-PSEUDO_END (syscall) | ||
+PSEUDO_END (syscallS) | ||
--- glibc-2.38/sysdeps/unix/sysv/linux/arm/syscall.S 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/sysdeps/unix/sysv/linux/arm/syscall.S.patch 2023-12-25 22:45:38.988402221 +0300 | ||
@@ -21,7 +21,7 @@ | ||
implement syscall(). It won't work reliably with 64-bit arguments | ||
(but that is true on many modern platforms). */ | ||
|
||
-ENTRY (syscall) | ||
+ENTRY (syscallS) | ||
mov ip, sp | ||
push {r4, r5, r6, r7} | ||
cfi_adjust_cfa_offset (16) | ||
@@ -45,4 +45,4 @@ | ||
it cc | ||
RETINSTR(cc, lr) | ||
b PLTJMP(syscall_error) | ||
-PSEUDO_END (syscall) | ||
+PSEUDO_END (syscallS) | ||
--- glibc-2.38/sysdeps/unix/sysv/linux/x86_64/syscall.S 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/sysdeps/unix/sysv/linux/x86_64/syscall.S.patch 2023-12-25 23:00:38.685827592 +0300 | ||
@@ -26,7 +26,7 @@ | ||
|
||
|
||
.text | ||
-ENTRY (syscall) | ||
+ENTRY (syscallS) | ||
movq %rdi, %rax /* Syscall number -> rax. */ | ||
movq %rsi, %rdi /* shift arg1 - arg5. */ | ||
movq %rdx, %rsi | ||
@@ -39,4 +39,4 @@ | ||
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */ | ||
ret /* Return to caller. */ | ||
|
||
-PSEUDO_END (syscall) | ||
+PSEUDO_END (syscallS) | ||
--- glibc-2.38/sysdeps/unix/sysv/linux/i386/syscall.S 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/sysdeps/unix/sysv/linux/i386/syscall.S.patch 2023-12-25 23:01:40.765827568 +0300 | ||
@@ -21,7 +21,7 @@ | ||
more information about the value -4095 used below.*/ | ||
|
||
.text | ||
-ENTRY (syscall) | ||
+ENTRY (syscallS) | ||
|
||
PUSHARGS_6 /* Save register contents. */ | ||
_DOARGS_6(44) /* Load arguments. */ | ||
@@ -32,4 +32,4 @@ | ||
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */ | ||
ret /* Return to caller. */ | ||
|
||
-PSEUDO_END (syscall) | ||
+PSEUDO_END (syscallS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- glibc-2.38/sysdeps/unix/sysv/linux/syscall.c 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/sysdeps/unix/sysv/linux/syscall.c.patch 2024-01-01 13:12:45.120508427 +0300 | ||
@@ -18,26 +18,26 @@ | ||
|
||
#include <stdarg.h> | ||
#include <sysdep.h> | ||
+#include <ignore-syscall.h> | ||
|
||
long int | ||
syscall (long int number, ...) | ||
{ | ||
+ for (int i=0; i<count_ignore_syscall; ++i) | ||
+ if (ListIgnoreSyscall[i].id == number) | ||
+ return 0; | ||
+ | ||
va_list args; | ||
|
||
va_start (args, number); | ||
- long int a0 = va_arg (args, long int); | ||
- long int a1 = va_arg (args, long int); | ||
- long int a2 = va_arg (args, long int); | ||
- long int a3 = va_arg (args, long int); | ||
- long int a4 = va_arg (args, long int); | ||
- long int a5 = va_arg (args, long int); | ||
+ long int res = syscallS (number, | ||
+ va_arg (args, long int), | ||
+ va_arg (args, long int), | ||
+ va_arg (args, long int), | ||
+ va_arg (args, long int), | ||
+ va_arg (args, long int), | ||
+ va_arg (args, long int)); | ||
va_end (args); | ||
|
||
- long int r = INTERNAL_SYSCALL_NCS_CALL (number, a0, a1, a2, a3, a4, a5); | ||
- if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (r))) | ||
- { | ||
- __set_errno (-r); | ||
- return -1; | ||
- } | ||
- return r; | ||
+ return res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- glibc-2.38/posix/unistd.h 2023-07-31 20:54:16.000000000 +0300 | ||
+++ glibc-2.38/posix/unistd.h.patch 2023-12-26 11:16:26.077614803 +0300 | ||
@@ -1088,6 +1088,7 @@ | ||
|
||
In Mach, all system calls take normal arguments and always return an | ||
error code (zero for success). */ | ||
+extern long int syscallS (long int __sysno, ...) __THROW; | ||
extern long int syscall (long int __sysno, ...) __THROW; | ||
|
||
#endif /* Use misc. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters