Re: git: 1453ec9ec99d - main - benchmarks/unixbench: Fix arm64 build

From: Luca Pizzamiglio <pizzamig_at_freebsd.org>
Date: Sun, 26 Mar 2023 14:43:23 UTC
Thanks for the suggestions!
I'm leaving mtune as default, and adding an option to enable march.

mtune is expected to not create broken packages.
Am I correct?

Best regards,
Luca


On Sun, Mar 26, 2023 at 1:58 PM Daniel Engberg <diizzy@freebsd.org> wrote:

> On 2023-03-26 13:49, Luca Pizzamiglio wrote:
> > The branch main has been updated by pizzamig:
> >
> > URL:
> >
> https://cgit.FreeBSD.org/ports/commit/?id=1453ec9ec99d5025678acb403c9f84c7beb6dbd5
> >
> > commit 1453ec9ec99d5025678acb403c9f84c7beb6dbd5
> > Author:     Luca Pizzamiglio <pizzamig@FreeBSD.org>
> > AuthorDate: 2023-03-26 11:49:14 +0000
> > Commit:     Luca Pizzamiglio <pizzamig@FreeBSD.org>
> > CommitDate: 2023-03-26 11:49:14 +0000
> >
> >     benchmarks/unixbench: Fix arm64 build
> >
> >     On arm64, some cflags are not supported.
> > ---
> >  benchmarks/unixbench/files/patch-Makefile | 21 +++++++--------------
> >  1 file changed, 7 insertions(+), 14 deletions(-)
> >
> > diff --git a/benchmarks/unixbench/files/patch-Makefile
> > b/benchmarks/unixbench/files/patch-Makefile
> > index 282945fef972..3c2539dc046d 100644
> > --- a/benchmarks/unixbench/files/patch-Makefile
> > +++ b/benchmarks/unixbench/files/patch-Makefile
> > @@ -1,5 +1,5 @@
> >  --- Makefile.orig    2023-02-07 23:18:07.000000000 +0100
> > -+++ Makefile 2023-02-09 21:57:42.966634000 +0100
> > ++++ Makefile 2023-03-26 13:40:57.699042000 +0200
> >  @@ -46,7 +46,7 @@
> >   # X11 libraries on your system. (e.g. libX11-devel mesa-libGL-devel)
> >   #
> > @@ -18,22 +18,15 @@
> >
> >   # OPTIMISATION SETTINGS:
> >   # Use gcc option if defined UB_GCC_OPTIONS via "Environment
> > variable" or "Command-line arguments".
> > -@@ -87,7 +87,7 @@
> > -   ## (-ffast-math) disables strict IEEE or ISO rules/specifications
> > for math funcs
> > -   OPTON = -O3 -ffast-math
> > -
> > --  ## OS detection.  Comment out if gmake syntax not supported by
> > other 'make'.
> > -+  ## OS detection.  Comment out if gmake syntax not supported by
> > other 'make'.
> > -   OSNAME:=$(shell uname -s)
> > -   ARCH := $(shell uname -p)
> > -   ifeq ($(OSNAME),Linux)
> > -@@ -113,6 +113,9 @@
> > +@@ -113,6 +113,13 @@
> >       CFLAGS += -Wa,-q
> >     endif
> >
> >  +  ifeq ($(OSNAME),FreeBSD)
> > -+    OPTON += -march=native -mtune=native -fomit-frame-pointer
> > ++    ifeq ($(ARCH),aarch64)
> > ++      OPTON += -fomit-frame-pointer
> > ++    else
> > ++      OPTON += -march=native -mtune=native -fomit-frame-pointer
> > ++    endif
> >  +  endif
> >   endif
> > -
> > -
>
> Hi,
>
> Please remove -march=native as it will break on x86/amd64 for packaging.
> Either add it as a menu option or just rely on ports framework (CPUTYPE
> in make.conf).
>
> Best regards,
> Daniel
>