Skip to content

Commit

Permalink
benchmarks/unixbench: remove march optimization
Browse files Browse the repository at this point in the history
Introducing OPTIMIZED_CFLAGS option to enable march.
march is disable by default, as pkg shouldn't be build with this kind
of low level optimization.
  • Loading branch information
pizzamig committed Mar 26, 2023
1 parent 9694390 commit bb383ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 32 deletions.
11 changes: 11 additions & 0 deletions benchmarks/unixbench/Makefile
Expand Up @@ -2,6 +2,7 @@ PORTNAME= unixbench
DISTVERSIONPREFIX= v
DISTVERSION= 5.1.3-51
DISTVERSIONSUFFIX= -g6705203
PORTREVISION= 1
CATEGORIES= benchmarks

MAINTAINER= pizzamig@FreeBSD.org
Expand All @@ -22,9 +23,19 @@ USE_XORG= x11 xext
CFLAGS+= -I${LOCALBASE}/include \
-L${LOCALBASE}/lib

OPTIONS_DEFINE= OPTIMIZED_CFLAGS
OPTIONS_EXCLUDE_aarch64= OPTIMIZED_CFLAGS
MAKE_ENV= "UB_GCC_OPTIONS=-O3 -ffast-math -fomit-frame-pointer"
#march generates code that can be incompatibe with previous CPU generations
OPTIMIZED_CFLAGS_MAKE_ENV= "UB_GCC_OPTIONS=-O3 -ffast-math -fomit-frame-pointer -march=native"

SUB_FILES= unixbench
SHEBANG_FILES= Run pgms/gfx-x11

post-patch:
${REINPLACE_CMD} -e 's/^CC=gcc/#CC=gcc/' ${WRKSRC}/Makefile
${REINPLACE_CMD} -e 's/^# GRAPHIC_TESTS = defined/GRAPHIC_TESTS = defined/' ${WRKSRC}/Makefile

do-install:
${INSTALL_SCRIPT} ${WRKDIR}/unixbench ${STAGEDIR}${PREFIX}/bin/
${MKDIR} ${STAGEDIR}${PREFIX}/libexec/unixbench
Expand Down
32 changes: 0 additions & 32 deletions benchmarks/unixbench/files/patch-Makefile

This file was deleted.

0 comments on commit bb383ff

Please sign in to comment.