Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jun 2018 22:27:22 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        shawn.webb@hardenedbsd.org, FreeBSD Current <freebsd-current@freebsd.org>
Cc:        mmacy@mattmacy.io
Subject:   Re: Weird conditional logic in lib/libpmc/Makefile
Message-ID:  <C3892FC0-DD53-404E-8F6E-0772F52FCB99@yahoo.com>

next in thread | raw e-mail | index | archive | help
Shawn Webb shawn.webb at hardenedbsd.org wrote on
Sun Jun 3 01:08:19 UTC 2018 :

> Below is some logic pasted from lib/libpmc/Makefile:
> 
> .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> 
> .if ${MACHINE_ARCH} == "aarch64"
> EVENT_ARCH="arm64"
> .elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> EVENT_ARCH="x86"
> .elif ${MACHINE_ARCH} == "powerpc"
> EVENT_ARCH="powerpc"
> .endif
> 
> JEVENTS= ${BTOOLSPATH:U.}/pmu-events/jevents
> # This file is built in a subdirectory so never try to rebuild
> # it here due to missing meta file.
> ${JEVENTS}: .NOMETA
> 
> libpmc_events.c: ${JEVENTS}
> 	${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch libpmc_events.c
> SRCS+= libpmc_events.c
> .endif
> 
> Why perform the conditionals for aarch64 and powerpc when it can't be
> those? "Am I missing something?
> 
> I'm looping in Matt Macy, who was the last person to touch the file.



It appears that every version of lib/libpmc/Makefile from head -r334242
and later has some variation of the odd nesting/value combinations that
has "EVENT_ARCH" examples that are impossible to select as the code is
structured.

(The file version prior to -r334242 is from -r298107 .)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C3892FC0-DD53-404E-8F6E-0772F52FCB99>