Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2021 15:25:23 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b44f0bd4109f - stable/13 - libpmc: always generate libpmc_events.c
Message-ID:  <202107291525.16TFPNYn009804@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mhorne:

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

commit b44f0bd4109fd2dcbedd2dcab19c4bd1c3037153
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2021-05-31 14:24:04 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2021-07-29 15:01:10 +0000

    libpmc: always generate libpmc_events.c
    
    The jevents build tool will create an empty table if it doesn't find any
    events, so we can remove the extra $MACHINE_CPUARCH checks.
    
    Reviewed by:    gnn, ray, emaste
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D30531
    
    (cherry picked from commit 689c7e7975cdee38ca6fd60ad3372d55c43c948c)
---
 Makefile.inc1       | 4 +---
 Makefile.libcompat  | 2 +-
 lib/libpmc/Makefile | 7 +++----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 288d16a7574e..a595dfbb76c9 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2535,9 +2535,7 @@ _tcsh=bin/csh
 _libmagic=lib/libmagic
 .endif
 
-.if ${MK_PMC} != "no" && \
-    (${TARGET_ARCH} == "aarch64" || ${TARGET_ARCH} == "amd64" || \
-    ${TARGET_ARCH} == "i386")
+.if ${MK_PMC} != "no"
 _jevents=lib/libpmc/pmu-events
 .endif
 
diff --git a/Makefile.libcompat b/Makefile.libcompat
index e4d9cd94e835..779bcb163cf7 100644
--- a/Makefile.libcompat
+++ b/Makefile.libcompat
@@ -51,7 +51,7 @@ _LC_INCDIRS=	\
 .if ${MK_FILE} != "no"
 _libmagic=	lib/libmagic
 .endif
-.if ${MK_PMC} != "no" && ${TARGET_ARCH} == "amd64"
+.if ${MK_PMC} != "no"
 _jevents=	lib/libpmc/pmu-events
 .endif
 
diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile
index 42aa14e58471..1006b6f93469 100644
--- a/lib/libpmc/Makefile
+++ b/lib/libpmc/Makefile
@@ -8,15 +8,15 @@ INCS=	pmc.h pmclog.h pmcformat.h
 CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat
 LDADD+=	-lc++
 
-.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
-    ${MACHINE_ARCH} == "i386"
-
 .if ${MACHINE_CPUARCH} == "aarch64"
 EVENT_ARCH="arm64"
 .elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 EVENT_ARCH="x86"
 .elif ${MACHINE_ARCH} == "powerpc"
 EVENT_ARCH="powerpc"
+.else
+# This will generate an empty events table
+EVENT_ARCH="none"
 .endif
 
 .if ${MK_DIRDEPS_BUILD} == "yes"
@@ -40,7 +40,6 @@ libpmc_events.c: ${JEVENTS} .META
 	fi
 CLEANFILES+=	libpmc_events.c libpmc_events.c.tmp
 SRCS+=	libpmc_events.c
-.endif
 
 WARNS?=	3
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107291525.16TFPNYn009804>