Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/libc/glibc/sysdeps/s390/s390-32/start-2.33.S
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
_start:
cfi_startproc
/* Mark r14 as undefined in order to stop unwinding here! */
cfi_undefined (r14)
/* zig patch: r14 -> %r14. revert with llvm 20. */
cfi_undefined (%r14)

/* Check if the kernel provides highgprs facility if needed by
the binary. */
Expand Down
3 changes: 2 additions & 1 deletion lib/libc/glibc/sysdeps/s390/s390-32/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
_start:
cfi_startproc
/* Mark r14 as undefined in order to stop unwinding here! */
cfi_undefined (r14)
/* zig patch: r14 -> %r14. revert with llvm 20. */
cfi_undefined (%r14)

/* Check if the kernel provides highgprs facility if needed by
the binary. */
Expand Down
3 changes: 2 additions & 1 deletion lib/libc/glibc/sysdeps/s390/s390-64/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ _init:
stg %r1,0(%r15)
larl %r12,_GLOBAL_OFFSET_TABLE_
#if PREINIT_FUNCTION_WEAK
larl %r1,PREINIT_FUNCTION@GOTENT
/* zig patch: GOTENT -> GOT. revert with llvm 20. */
larl %r1,PREINIT_FUNCTION@GOT
lg %r1,0(%r1)
ltgr %r1,%r1
je 1f
Expand Down
6 changes: 4 additions & 2 deletions lib/libc/glibc/sysdeps/s390/s390-64/start-2.33.S
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
_start:
cfi_startproc
/* Mark r14 as undefined in order to stop unwinding here! */
cfi_undefined (r14)
/* zig patch: r14 -> %r14. revert with llvm 20. */
cfi_undefined (%r14)
/* Load argc and argv from stack. */
la %r4,8(%r15) # get argv
lg %r3,0(%r15) # get argc
Expand All @@ -85,7 +86,8 @@ _start:

/* Ok, now branch to the libc main routine. */
#ifdef PIC
larl %r2,main@GOTENT # load pointer to main
/* zig patch: GOTENT -> GOT. revert with llvm 20. */
larl %r2,main@GOT # load pointer to main
lg %r2,0(%r2)
brasl %r14,__libc_start_main@plt
#else
Expand Down
9 changes: 6 additions & 3 deletions lib/libc/glibc/sysdeps/s390/s390-64/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
_start:
cfi_startproc
/* Mark r14 as undefined in order to stop unwinding here! */
cfi_undefined (r14)
/* zig patch: r14 -> %r14. revert with llvm 20. */
cfi_undefined (%r14)
/* Load argc and argv from stack. */
la %r4,8(%r15) # get argv
lg %r3,0(%r15) # get argc
Expand All @@ -87,7 +88,8 @@ _start:
# ifdef SHARED
/* Used for dynamic linked position independent executable.
=> Scrt1.o */
larl %r2,main@GOTENT # load pointer to main
/* zig patch: GOTENT -> GOT. revert with llvm 20. */
larl %r2,main@GOT # load pointer to main
lg %r2,0(%r2)
# else
/* Used for dynamic linked position dependent executable.
Expand Down Expand Up @@ -119,7 +121,8 @@ _start:
use of GOT relocations before __libc_start_main is called. */
__wrap_main:
cfi_startproc
larl %r1,main@GOTENT # load pointer to main
/* zig patch: GOTENT -> GOT. revert with llvm 20. */
larl %r1,main@GOT # load pointer to main
lg %r1,0(%r1)
br %r1
cfi_endproc
Expand Down