NetBSD Problem Report #58157
From www@netbsd.org Tue Apr 16 04:16: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))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 06A7D1A9238
for <gnats-bugs@gnats.NetBSD.org>; Tue, 16 Apr 2024 04:16:51 +0000 (UTC)
Message-Id: <20240416041619.BF4271A923A@mollari.NetBSD.org>
Date: Tue, 16 Apr 2024 04:16:19 +0000 (UTC)
From: simmonds@polymorphism.ca
Reply-To: simmonds@polymorphism.ca
To: gnats-bugs@NetBSD.org
Subject: OpenSSL 3.3.0 has wrong libdir in pkg-config
X-Send-Pr-Version: www-1.0
>Number: 58157
>Category: pkg
>Synopsis: OpenSSL 3.3.0 has wrong libdir in pkg-config
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Apr 16 04:20:00 +0000 2024
>Closed-Date: Tue Apr 16 07:20:14 +0000 2024
>Last-Modified: Tue Apr 16 07:35:01 +0000 2024
>Originator: Colin Simmonds
>Release: Latest pkgsrc from git as of 20240415
>Organization:
>Environment:
Darwin meiling.local 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64 arm Darwin
>Description:
OpenSSL 3.3.0 has changed how it generates its .pc files for pkg-config, with the end result that the LDPATH output from pkg-config is wrong.
There is an open bug for this upstream: <https://github.com/openssl/openssl/issues/23569>
From the discussion there, it appears that part of the problem is that the OpenSSL config script accepts a parameter "--libdir" which behaves differently from the same named parameter in autoconf. Autoconf expects it to be the full path to the install library directory (and that's what the pkgsrc Makefile is setting it to), but OpenSSL expects it to be a relative directory path (with default value "lib").
I noticed this trying to build devel/rust - when it tries to build the cargo binary, the rust build was failing with an error saying that it couldn't find "-l ssl", and the root cause was that it was getting the wrong libdir from pkg-config.
>How-To-Repeat:
Install OpenSSL 3.3.0
$ pkg-config --libs openssl
-L/opt/pkg -lssl -lcrypto
$ pkg-config --libs libssl
-L/opt/pkg -lssl
$ pkg-config --libs libcrypto
-L/opt/pkg -lcrypto
Where the first entry for all three queries should be "-L/opt/pkg/lib" instead.
>Fix:
The simple workaround is to manually edit the three .pc files in the openssl package after installation to add "/lib" to the end, and then running pkg-config for openssl gives the expected results.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 16 Apr 2024 07:20:14 +0000
State-Changed-Why:
Fixed, thanks!
From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58157 CVS commit: pkgsrc/security/openssl
Date: Tue, 16 Apr 2024 07:19:48 +0000
Module Name: pkgsrc
Committed By: wiz
Date: Tue Apr 16 07:19:48 UTC 2024
Modified Files:
pkgsrc/security/openssl: Makefile
Log Message:
openssl: use --libdir as openssl wants it
Fixes pkg-config files.
Closes PR 58157 by Colin Simmonds.
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 pkgsrc/security/openssl/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.