public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stian Halseth <stian@itx.no>
To: libc-alpha@sourceware.org
Cc: Stian Halseth <stian@itx.no>
Subject: [PATCH] sparc: Export sparc64 setcontext with weak_alias [BZ #34669]
Date: Wed, 23 Sep 2026 13:20:30 +0200	[thread overview]
Message-ID: <20260923112030.2138109-1-stian@itx.no> (raw)

setcontext.S marks setcontext weak with .weak and then defines it with
ENTRY, which emits .global.  GNU as lets .weak win, but LLVM's
integrated assembler rejects the change of binding (deliberately, since
LLVM 12), so the file does not assemble with clang:

  error: setcontext changed binding to STB_GLOBAL

Define the stub as __libc_setcontext and export it with weak_alias, as
getcontext, makecontext and swapcontext in the same directory already
do.  setcontext stays a weak GLIBC_2.2 function.

Tested on sparc64 with gcc: the dynamic symbol for setcontext is
unchanged, check-abi passes, and the stdlib ucontext tests pass.  With
clang the file now assembles without errors or warnings.

Signed-off-by: Stian Halseth <stian@itx.no>
---
 sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
index 810eeb225f..71cc541467 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
@@ -19,13 +19,13 @@
 #include "ucontext_i.h"
 
 /* int setcontext(ucontext_t *ctx); */
-.weak setcontext
-ENTRY(setcontext)
+ENTRY(__libc_setcontext)
 
 	ba,pt	%xcc, 1f
 	 mov	1, %o1
 
-END(setcontext)
+END(__libc_setcontext)
+weak_alias (__libc_setcontext, setcontext)
 
 /* int __setcontext(ucontext_t *ctx, int restoremask); */
 ENTRY(__setcontext)
-- 
2.55.0


             reply	other threads:[~2026-09-23 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 11:20 Stian Halseth [this message]
2026-09-23 18:59 ` Adhemerval Zanella Netto
2026-09-23 19:45   ` Stian Halseth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260923112030.2138109-1-stian@itx.no \
    --to=stian@itx.no \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).