From owner-dev-commits-src-branches@freebsd.org Mon Feb 22 05:24:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC13654820C; Mon, 22 Feb 2021 05:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DkVwK5QQwz4c0F; Mon, 22 Feb 2021 05:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACB5F20079; Mon, 22 Feb 2021 05:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11M5O1Bt043558; Mon, 22 Feb 2021 05:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11M5O1lU043557; Mon, 22 Feb 2021 05:24:01 GMT (envelope-from git) Date: Mon, 22 Feb 2021 05:24:01 GMT Message-Id: <202102220524.11M5O1lU043557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 9c59d7533731 - stable/12 - libpmc: fix linking with C programs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9c59d753373189f83b4447fe6a5456573451e014 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2021 05:24:01 -0000 The branch stable/12 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=9c59d753373189f83b4447fe6a5456573451e014 commit 9c59d753373189f83b4447fe6a5456573451e014 Author: Alan Somers AuthorDate: 2021-02-21 20:56:57 +0000 Commit: Alan Somers CommitDate: 2021-02-22 05:23:12 +0000 libpmc: fix linking with C programs Revision r334749 Added some C++ code to libpmc. It didn't change the ABI, but it did introduce a dependency on libc++. Nobody noticed because every program that in the base system that uses libpmc is also C++. Reported-by: Dom Dwyer Reviewed By: vangyzen Differential Revision: https://reviews.freebsd.org/D28550 (cherry picked from commit 04e34c0202ea50cea67d5779f54bc612c74e6532) --- lib/libpmc/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile index 35bacb26bd11..1e204e13fdb2 100644 --- a/lib/libpmc/Makefile +++ b/lib/libpmc/Makefile @@ -8,6 +8,12 @@ INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${.CURDIR} CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align +.include +.if ${COMPILER_TYPE} == "gcc" +LDADD+= -lstdc++ +.else +LDADD+= -lc++ +.endif .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"