NetBSD Problem Report #57938

From  Thu Feb 15 21:19:43 2024
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 01C4C1A9238
	for <>; Thu, 15 Feb 2024 21:19:42 +0000 (UTC)
Message-Id: <>
Date: Thu, 15 Feb 2024 22:19:27 +0100 (CET)
Subject: cad/occt OpenCASCADEFoundationClassesTargets.cmake sets -ldl
X-Send-Pr-Version: 3.95

>Number:         57938
>Category:       pkg
>Synopsis:       cad/occt OpenCASCADEFoundationClassesTargets.cmake sets -ldl
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 15 21:20:00 +0000 2024
>Closed-Date:    Tue Feb 27 16:34:58 +0000 2024
>Last-Modified:  Tue Feb 27 16:35:01 +0000 2024
>Originator:     Manuel Bouyer
>Release:        NetBSD 10.0_RC2/pkgsrc 2023Q4
System: NetBSD 10.0_RC2 NetBSD 10.0_RC2 (GENERIC_CAN) #12: Wed Jan 10 10:47:49 CET 2024 amd64
Architecture: x86_64
Machine: amd64
	cad/occt installs cmake files to be used by other cmake-using package.
	unconditionally sets dl in INTERFACE_LINK_LIBRARIES for the TKernel
	target. This cause softwares including this file to link with the
	TKernel library to try to link with -ldl, which doesn't exists on
	In a cmakefile:
set(OpenCASCADE_DIR "${CMAKE_PREFIX_PATH}/lib/cmake/occt")
find_package(OpenCASCADE REQUIRED)
target_link_libraries(foo TKernel)

run cmake and see -ldl showing up in link.txt for foo.
INTERFACE_LINK_LIBRARIES "pthread;rt;stdc++;dl"

	works for me but I don't know if it would DTRT on linux.
	An alternative would be to use
	to include dl in the INTERFACE_LINK_LIBRARIES list


From: Thomas Klausner <>
To: NetBSD bugtracking <>
Subject: Re: pkg/57938: cad/occt OpenCASCADEFoundationClassesTargets.cmake
 sets -ldl
Date: Thu, 15 Feb 2024 22:23:17 +0100

 On Thu, Feb 15, 2024 at 09:20:01PM +0000, wrote:
 > 	remplacing
 > INTERFACE_LINK_LIBRARIES "pthread;rt;stdc++;dl"
 > 	with
 > 	works for me but I don't know if it would DTRT on linux.

 This should work, yes. See:
 cmake-3.28.3/Modules/Platform/Linux.cmake:set(CMAKE_DL_LIBS "dl")

 So please add that patch - thanks!

State-Changed-From-To: open->closed
State-Changed-When: Tue, 27 Feb 2024 16:34:58 +0000
A patch using ${CMAKE_DL_LIBS} has been commited.

From: "Manuel Bouyer" <>
Subject: PR/57938 CVS commit: pkgsrc/cad/occt
Date: Tue, 27 Feb 2024 16:33:20 +0000

 Module Name:	pkgsrc
 Committed By:	bouyer
 Date:		Tue Feb 27 16:33:20 UTC 2024

 Modified Files:
 	pkgsrc/cad/occt: Makefile distinfo
 Added Files:
 	pkgsrc/cad/occt/patches: patch-adm_cmake_occt_csf.cmake

 Log Message:
 Don't unconditionally set dl in INTERFACE_LINK_LIBRARIES; use ${CMAKE_DL_LIBS}
 Should fix PR pkg/57938. Bump PKGREVISION

 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/cad/occt/Makefile
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/cad/occt/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/cad/occt/patches/patch-adm_cmake_occt_csf.cmake

 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:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.