authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-09-05 05:50:26+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-09-06 10:39:30-07:00
logb230e4f598bd18b47f3f1c981869c597a06c7452
treeb94b60e29d6ec275bc7a3fccd1c589dff6946372
parent204107c499f78a3deca1b446e3e093384214b821

glibc: Patch to work around missing features in LLVM's s390x assembler.

Revert this with LLVM 20.

5 files changed, 16 insertions(+), 8 deletions(-)

lib/libc/glibc/sysdeps/s390/s390-32/start-2.33.S+2-1
...@@ -61,7 +61,8 @@...@@ -61,7 +61,8 @@
61_start:61_start:
62 cfi_startproc62 cfi_startproc
63 /* Mark r14 as undefined in order to stop unwinding here! */63 /* Mark r14 as undefined in order to stop unwinding here! */
64 cfi_undefined (r14)64 /* zig patch: r14 -> %r14. revert with llvm 20. */
65 cfi_undefined (%r14)
6566
66 /* Check if the kernel provides highgprs facility if needed by67 /* Check if the kernel provides highgprs facility if needed by
67 the binary. */68 the binary. */
lib/libc/glibc/sysdeps/s390/s390-32/start.S+2-1
...@@ -60,7 +60,8 @@...@@ -60,7 +60,8 @@
60_start:60_start:
61 cfi_startproc61 cfi_startproc
62 /* Mark r14 as undefined in order to stop unwinding here! */62 /* Mark r14 as undefined in order to stop unwinding here! */
63 cfi_undefined (r14)63 /* zig patch: r14 -> %r14. revert with llvm 20. */
64 cfi_undefined (%r14)
6465
65 /* Check if the kernel provides highgprs facility if needed by66 /* Check if the kernel provides highgprs facility if needed by
66 the binary. */67 the binary. */
lib/libc/glibc/sysdeps/s390/s390-64/crti.S+2-1
...@@ -67,7 +67,8 @@ _init:...@@ -67,7 +67,8 @@ _init:
67 stg %r1,0(%r15)67 stg %r1,0(%r15)
68 larl %r12,_GLOBAL_OFFSET_TABLE_68 larl %r12,_GLOBAL_OFFSET_TABLE_
69#if PREINIT_FUNCTION_WEAK69#if PREINIT_FUNCTION_WEAK
70 larl %r1,PREINIT_FUNCTION@GOTENT70 /* zig patch: GOTENT -> GOT. revert with llvm 20. */
71 larl %r1,PREINIT_FUNCTION@GOT
71 lg %r1,0(%r1)72 lg %r1,0(%r1)
72 ltgr %r1,%r173 ltgr %r1,%r1
73 je 1f74 je 1f
lib/libc/glibc/sysdeps/s390/s390-64/start-2.33.S+4-2
...@@ -61,7 +61,8 @@...@@ -61,7 +61,8 @@
61_start:61_start:
62 cfi_startproc62 cfi_startproc
63 /* Mark r14 as undefined in order to stop unwinding here! */63 /* Mark r14 as undefined in order to stop unwinding here! */
64 cfi_undefined (r14)64 /* zig patch: r14 -> %r14. revert with llvm 20. */
65 cfi_undefined (%r14)
65 /* Load argc and argv from stack. */66 /* Load argc and argv from stack. */
66 la %r4,8(%r15) # get argv67 la %r4,8(%r15) # get argv
67 lg %r3,0(%r15) # get argc68 lg %r3,0(%r15) # get argc
...@@ -85,7 +86,8 @@ _start:...@@ -85,7 +86,8 @@ _start:
8586
86 /* Ok, now branch to the libc main routine. */87 /* Ok, now branch to the libc main routine. */
87#ifdef PIC88#ifdef PIC
88 larl %r2,main@GOTENT # load pointer to main89 /* zig patch: GOTENT -> GOT. revert with llvm 20. */
90 larl %r2,main@GOT # load pointer to main
89 lg %r2,0(%r2)91 lg %r2,0(%r2)
90 brasl %r14,__libc_start_main@plt92 brasl %r14,__libc_start_main@plt
91#else93#else
lib/libc/glibc/sysdeps/s390/s390-64/start.S+6-3
...@@ -60,7 +60,8 @@...@@ -60,7 +60,8 @@
60_start:60_start:
61 cfi_startproc61 cfi_startproc
62 /* Mark r14 as undefined in order to stop unwinding here! */62 /* Mark r14 as undefined in order to stop unwinding here! */
63 cfi_undefined (r14)63 /* zig patch: r14 -> %r14. revert with llvm 20. */
64 cfi_undefined (%r14)
64 /* Load argc and argv from stack. */65 /* Load argc and argv from stack. */
65 la %r4,8(%r15) # get argv66 la %r4,8(%r15) # get argv
66 lg %r3,0(%r15) # get argc67 lg %r3,0(%r15) # get argc
...@@ -87,7 +88,8 @@ _start:...@@ -87,7 +88,8 @@ _start:
87# ifdef SHARED88# ifdef SHARED
88 /* Used for dynamic linked position independent executable.89 /* Used for dynamic linked position independent executable.
89 => Scrt1.o */90 => Scrt1.o */
90 larl %r2,main@GOTENT # load pointer to main91 /* zig patch: GOTENT -> GOT. revert with llvm 20. */
92 larl %r2,main@GOT # load pointer to main
91 lg %r2,0(%r2)93 lg %r2,0(%r2)
92# else94# else
93 /* Used for dynamic linked position dependent executable.95 /* Used for dynamic linked position dependent executable.
...@@ -119,7 +121,8 @@ _start:...@@ -119,7 +121,8 @@ _start:
119 use of GOT relocations before __libc_start_main is called. */121 use of GOT relocations before __libc_start_main is called. */
120__wrap_main:122__wrap_main:
121 cfi_startproc123 cfi_startproc
122 larl %r1,main@GOTENT # load pointer to main124 /* zig patch: GOTENT -> GOT. revert with llvm 20. */
125 larl %r1,main@GOT # load pointer to main
123 lg %r1,0(%r1)126 lg %r1,0(%r1)
124 br %r1127 br %r1
125 cfi_endproc128 cfi_endproc