From owner-freebsd-current@freebsd.org Sun Jun 3 05:27:27 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA693EF3653 for ; Sun, 3 Jun 2018 05:27:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-2.consmr.mail.bf2.yahoo.com (sonic301-2.consmr.mail.bf2.yahoo.com [74.6.129.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8444370338 for ; Sun, 3 Jun 2018 05:27:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: KVYQ760VM1kEyJVQPrUHfherAji4BEZD_8LxyUfkr078Y8Px.Ij9u5uJr8tdsEo iYzmv3RtGyKecif3B19U68g2YWgXwd2nT3pgesb.sgSYi3M9_HenjrsfdJMzzR96c64IXwluO3Jb 660_0J2_YYFchI6XdTh9VxUhGLCawRXEgrLUwtBiuxyZ2xESw5K_bOAwv0AQeJ3SpOqcmQzBOe3A fidBtQe2nidH8taIudSc.Xnjw7EukxNa3MOMwdFXrCqyCGmLUNseklfBKJR7DCRsjBkDWk.rlk3U eYOeqVVAej1WskpvjaqEYIC9kcO7zMBPidqmSHHYYXEyAaOEfeGtKlt114fJgVCQZyhkvpkr.K0f qOHpUUJULI3LK1v9G0DtNaJ16ifZULGrXtOSOcgUJAdRvEjdyVdi2LrbokZsJ3qctNZ6DbSXoWsi LhYyydZq4I4AIxW64g2Yysg01DEGo4M77gZ.D5w_dFnXGb7A7knY1YFm62_hwpo9NxtjcuMskJRV KfR4_EQcTWpaf0qGo2FAV2Q1UAWOWJrPocTX0zGHFcYVWSufZwAF03kcdyD2jeyKGaRxT25mQYDZ pOOzmfZ7p31bbD_Fg6lM2CFhd7eX99ajTfVbOmnXpY2wKfVpFPA2SW9m6qcHSMiJ4qOXRnyrMyui .4aL7Hvrql7BcwRNWz2.kxZRWJi6OoU15hfmF Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Sun, 3 Jun 2018 05:27:26 +0000 Received: from ip70-189-131-151.lv.lv.cox.net (EHLO [192.168.0.109]) ([70.189.131.151]) by smtp419.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 36999e1161658bf229fd8e2d47e713cf; Sun, 03 Jun 2018 05:27:24 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: Weird conditional logic in lib/libpmc/Makefile Message-Id: Date: Sat, 2 Jun 2018 22:27:22 -0700 Cc: mmacy@mattmacy.io To: shawn.webb@hardenedbsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2018 05:27:27 -0000 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)