NetBSD Problem Report #58753

From www@netbsd.org  Mon Oct 14 00:06:10 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 088B01A923B
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 14 Oct 2024 00:06:10 +0000 (UTC)
Message-Id: <20241014000608.AFFBB1A923D@mollari.NetBSD.org>
Date: Mon, 14 Oct 2024 00:06:08 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: alpha longjmp references compat symbol sigreturn
X-Send-Pr-Version: www-1.0

>Number:         58753
>Category:       port-alpha
>Synopsis:       alpha longjmp references compat symbol sigreturn
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-alpha-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 14 00:10:01 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, ...
>Organization:
The NetBSigreturneD Foundalpha
>Environment:
>Description:
      build  libc/libc.so.12.220.1.link
/home/riastradh/netbsd/10/obj.alpha/tooldir/bin/../lib/gcc/alpha--netbsd/10.5.0/../../../../alpha--netbsd/bin/ld: libc_pic.a(compat_setjmp.pico): in function `longjmp':
(.text+0x10c): warning: warning: reference to compatibility sigreturn()

Presumably this happens because of:

    115 LEAF(longjmp, 2)
    116 	LDGP(pv)
    117 	bne	a1, 1f				/* val != 0, just go */
    118 	ldiq	a1, 1				/* val = 1 otherwise */
    119 1:	stq	a1, (( 0 + 4) * 8)(a0)		/* save return value */
    120 	CALL(sigreturn)				/* use sigreturn to return */

https://nxr.netbsd.org/xref/src/lib/libc/compat/arch/alpha/gen/compat_setjmp.S?r=1.3#115

Is this correct?  Other longjmp implementations don't seem to use sigreturn -- arm, i386, and sh3 use sigsetmask (but maybe should use a libc-internal symbol so programs can't accidentally override it?); powerpc uses compat_13_sigprocmask13; m68k, mips, and sparc/sparc64 use an explicit trap to invoke syscall compat_13_sigreturn13.

Maybe this isn't a problem, but it would be nice to find a way to avoid the warning if so.
>How-To-Repeat:
build libc on alpha
>Fix:
Yes, please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.