NetBSD Problem Report #58376

From www@netbsd.org  Fri Jun 28 17:31:51 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 13D221A923A
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 28 Jun 2024 17:31:51 +0000 (UTC)
Message-Id: <20240628173149.D36BD1A923C@mollari.NetBSD.org>
Date: Fri, 28 Jun 2024 17:31:49 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: Missing DPADD for library version scripts
X-Send-Pr-Version: www-1.0

>Number:         58376
>Category:       lib
>Synopsis:       Missing DPADD for library version scripts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 28 17:35:00 +0000 2024
>Last-Modified:  Fri Jun 28 22:00:04 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
The -Wl,--version-script=NetBSD.map Foundation
>Environment:
>Description:
Many (if not most, or even perhaps all) libraries that use version scripts do so by something like

LDFLAGS+=-Wl,--version-script=${.CURDIR}/foo.map

but do nothing to ensure that changes to foo.map trigger relinking, so the libraries can have stale symbol version exports.
>How-To-Repeat:
1. build libcrypto, heimdal, libnetpgpverify, gallium, ...
2. change the version script
3. rebuild
4. observe the changes to the version script do not trigger relinking and are not reflected in the library
>Fix:
Two options:

1. Sprinkle DPADD+= .../foo.map everywhere.
2. Invent a variable in bsd.lib.mk, say VERSIONSCRIPT, which (a) adds the appropriate -Wl,--version-script flag to LDFLAGS, and (b) updates DPADD accordingly.

>Audit-Trail:
From: Jason Thorpe <thorpej@me.com>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: lib/58376: Missing DPADD for library version scripts
Date: Fri, 28 Jun 2024 10:51:58 -0700

 > On Jun 28, 2024, at 10:35=E2=80=AFAM, campbell+netbsd@mumble.net =
 wrote:
 >=20
 > 2. Invent a variable in bsd.lib.mk, say VERSIONSCRIPT, which (a) adds =
 the appropriate -Wl,--version-script flag to LDFLAGS, and (b) updates =
 DPADD accordingly.

 This option is the better one, IMO.

 -- thorpej

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58376 CVS commit: src/share/mk
Date: Fri, 28 Jun 2024 20:45:26 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Jun 28 20:45:26 UTC 2024

 Modified Files:
 	src/share/mk: bsd.README bsd.lib.mk

 Log Message:
 bsd.lib.mk: New variable VERSION_MAP.

 This updates LDFLAGS with the right -Wl,--version-script=... argument
 as well as DPADD so that changing the version script causes the
 library to be rebuilt.

 Name chosen to match FreeBSD.

 PR lib/58376


 To generate a diff of this commit:
 cvs rdiff -u -r1.447 -r1.448 src/share/mk/bsd.README
 cvs rdiff -u -r1.405 -r1.406 src/share/mk/bsd.lib.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58376 CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto
Date: Fri, 28 Jun 2024 21:15:55 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Jun 28 21:15:55 UTC 2024

 Modified Files:
 	src/crypto/external/bsd/openssl/lib/libcrypto: Makefile

 Log Message:
 libcrypto: Use VERSION_MAP, not explicit -Wl,--version-script.

 Fixes dependencies as in PR lib/58376.


 To generate a diff of this commit:
 cvs rdiff -u -r1.33 -r1.34 \
     src/crypto/external/bsd/openssl/lib/libcrypto/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58376 CVS commit: src/share/mk
Date: Fri, 28 Jun 2024 21:58:24 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Jun 28 21:58:24 UTC 2024

 Modified Files:
 	src/share/mk: bsd.README bsd.lib.mk

 Log Message:
 bsd.lib.mk: Resolve VERSION_MAP like a target prerequisite.

 Not sure what I did before to make ${${VERSION_MAP}:P} fail to work;
 can't reproduce it any more!

 PR lib/58376


 To generate a diff of this commit:
 cvs rdiff -u -r1.448 -r1.449 src/share/mk/bsd.README
 cvs rdiff -u -r1.406 -r1.407 src/share/mk/bsd.lib.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58376 CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto
Date: Fri, 28 Jun 2024 21:59:18 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Fri Jun 28 21:59:18 UTC 2024

 Modified Files:
 	src/crypto/external/bsd/openssl/lib/libcrypto: Makefile

 Log Message:
 libcrypto: No need for ${.CURDIR}/ qualification in VERSION_MAP.

 PR lib/58376


 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.35 \
     src/crypto/external/bsd/openssl/lib/libcrypto/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

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.