git: c6b3f47fedd3 - main - libpmc: Use LIB_CXX instead of explicit LDADD to link a C++ library.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 23 Mar 2023 16:32:10 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=c6b3f47fedd3f94f74cc4f7c40761b1d0e777f17

commit c6b3f47fedd3f94f74cc4f7c40761b1d0e777f17
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-03-23 16:31:29 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-03-23 16:31:58 +0000

    libpmc: Use LIB_CXX instead of explicit LDADD to link a C++ library.
    
    This uses the C++ compiler as the linker instead of the C compiler
    letting the compiler driver pick the right libraries.  This is a no-op
    on main and stable/13 but matters for stable/12 where the current
    logic breaks for external GCC since it tries to use a non-existent
    libstdc++.
    
    Reviewed by:    emaste
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D39197
---
 lib/libpmc/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile
index 81e43b696841..01cb562c3fcd 100644
--- a/lib/libpmc/Makefile
+++ b/lib/libpmc/Makefile
@@ -1,12 +1,11 @@
 # $FreeBSD$
 
-LIB=	pmc
+LIB_CXX= pmc
 
 SRCS=	libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc
 INCS=	pmc.h pmclog.h pmcformat.h
 
 CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat
-LDADD+=	-lc++
 
 .if ${MACHINE_CPUARCH} == "aarch64"
 EVENT_ARCH="arm64"