From patchwork Wed Sep 23 11:20:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stian Halseth X-Patchwork-Id: 144491 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 22E944BB24EF for ; Wed, 23 Sep 2026 11:21:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22E944BB24EF Authentication-Results: sourceware.org; dkim=pass (1024-bit key, secure) header.d=itx.no header.i=@itx.no header.a=rsa-sha256 header.s=mx.itx.no header.b=odlkdA7P X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx.itxnorge.no (itx-kvm-14.itxnorge.no [91.189.121.228]) by sourceware.org (Postfix) with ESMTPS id EBDE44BA7980 for ; Wed, 23 Sep 2026 11:20:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBDE44BA7980 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=itx.no Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=itx.no ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EBDE44BA7980 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=91.189.121.228 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790162444; cv=none; b=BnLScTgC93C51UEwxiO5GlkyLK/TGMtGpL9UCBjLSN2X3xPnxzuPgzk/HWn4/vS75qME/lvivLj1kc40iDf2/lim/tFlI5Dox7VMlrFe2AkrlHD8jQe7P6It0Go6VdTu41NF2smGaqGQanm90na4hz30llTjDH4uWKkbqPEZO7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790162444; c=relaxed/simple; bh=b18qjG4wbdwENG/0vgZ8o6DXbaCuQNo/u58qs1I3sg4=; h=From:DKIM-Signature:To:Subject:Date:Message-ID:MIME-Version; b=Y+Wf7l3lkwMD4I3DZmmhcUc/0OOXBrkQHprWDe3/QWcGeQ2p6PbQuT6NX529lLROPW2awWJkvD1uln62s94JKkRnSaUFCu8zRAqXT1JfjIx+6ZxaaO4ZbK3iDnia8sTe3ygV7njBIyu8oco+3OJQLWwWMs+U5bVZBjZefvUzazk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, secure) header.d=itx.no header.i=@itx.no header.a=rsa-sha256 header.s=mx.itx.no header.b=odlkdA7P DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBDE44BA7980 From: Stian Halseth DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itx.no; s=mx.itx.no; t=1790162440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gkL9C8UUqmYwdeWVTB/op35QLElPrnfJS8N94y+FHgs=; b=odlkdA7PShX1Cl8Bk1xbfCPzrvZ/DXoG6wo9Jl5wCHuV3HEgYRsVvzx35wq6k1KPbsr4sw n/m3zRudXCwLH9vyNCSI0czQZTA3Ry/7JDACoaC0JdKckzVR1XS5thnaNLLLS+GduJllP4 iy9Nulx3DNiq5Fc/kQj9ZeqyiJSGTlo= To: libc-alpha@sourceware.org Cc: Stian Halseth Subject: [PATCH] sparc: Export sparc64 setcontext with weak_alias [BZ #34669] Date: Wed, 23 Sep 2026 13:20:30 +0200 Message-ID: <20260923112030.2138109-1-stian@itx.no> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org 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 Reviewed-by: Adhemerval Zanella --- 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)