FreeBSD Bugzilla – Attachment 230330 Details for
Bug 260625
benchmarks/lzbench: Fix build on arm and riscv64, Remove BROKEN, Respect *FLAGS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
benchmarks/lzbench: fix build on arm and riscv64
0001-benchmarks-lzbench-fix-build-on-ARM-and-RISC-V.patch (text/plain), 4.63 KB, created by
Robert Clausecker
on 2021-12-23 00:05:44 UTC
(
hide
)
Description:
benchmarks/lzbench: fix build on arm and riscv64
Filename:
MIME Type:
Creator:
Robert Clausecker
Created:
2021-12-23 00:05:44 UTC
Size:
4.63 KB
patch
obsolete
>From 40d83ff2b143af86c7c484d51e529a0f1e4adccd Mon Sep 17 00:00:00 2001 >From: Robert Clausecker <fuz@fuz.su> >Date: Wed, 22 Dec 2021 22:55:14 +0100 >Subject: [PATCH] benchmarks/lzbench: fix build on ARM and RISC-V > > - add a type cast clang requires > - patch in a word size check for riscv64 > - remove use of -march=native > - add an SSE option to configure building the lzsse encoder > instead of detecting that from the host > - make the port obey CFLAGS > - pet portlint >--- > benchmarks/lzbench/Makefile | 10 +++-- > benchmarks/lzbench/files/patch-Makefile | 38 +++++++++++++++++++ > .../lzbench/files/patch-pithy_pithy.cpp | 11 ++++++ > .../lzbench/files/patch-tornado_Common.h | 11 ++++++ > 4 files changed, 67 insertions(+), 3 deletions(-) > create mode 100644 benchmarks/lzbench/files/patch-Makefile > create mode 100644 benchmarks/lzbench/files/patch-pithy_pithy.cpp > create mode 100644 benchmarks/lzbench/files/patch-tornado_Common.h > >diff --git a/benchmarks/lzbench/Makefile b/benchmarks/lzbench/Makefile >index ead1d54a6f93..8246ccbfd2a3 100644 >--- a/benchmarks/lzbench/Makefile >+++ b/benchmarks/lzbench/Makefile >@@ -1,23 +1,27 @@ > # Created by: Alexey Dokuchaev <danfe@FreeBSD.org> > > PORTNAME= lzbench >-PORTVERSION= 1.8.1 > DISTVERSIONPREFIX= v >+DISTVERSION= 1.8.1 >+PORTREVISION= 1 > CATEGORIES= benchmarks > > MAINTAINER= danfe@FreeBSD.org > COMMENT= In-memory benchmark of open-source LZ77/LZSS/LZMA compressors > >-BROKEN_riscv64= fails to compile: invalid arch name 'native', string must begin with rv32{i,e,g} or rv64{i,g} >- > USES= compiler:c11 gmake > USE_GITHUB= yes > GH_ACCOUNT= inikep > >+MAKE_ENV= CFLAGS_O2="${CFLAGS}" >+ > PLIST_FILES= bin/lzbench > PORTDOCS= NEWS README.md > > OPTIONS_DEFINE= DOCS >+OPTIONS_DEFINE_amd64= SSE >+OPTIONS_DEFAULT_amd64= SSE >+SSE_MAKE_ARGS= DONT_BUILD_LZSSE=0 > > post-patch: > @${REINPLACE_CMD} -e '/PROGOS/s,Linux,${OPSYS},' \ >diff --git a/benchmarks/lzbench/files/patch-Makefile b/benchmarks/lzbench/files/patch-Makefile >new file mode 100644 >index 000000000000..ccee4657617d >--- /dev/null >+++ b/benchmarks/lzbench/files/patch-Makefile >@@ -0,0 +1,38 @@ >+--- Makefile.orig 2020-09-01 10:03:34 UTC >++++ Makefile >+@@ -11,11 +11,7 @@ vpath wflz/wfLZ.h $(SOURCE_PATH) >+ #BUILD_ARCH = 32-bit >+ #BUILD_STATIC = 1 >+ >+-ifeq ($(BUILD_ARCH),32-bit) >+- CODE_FLAGS += -m32 >+- LDFLAGS += -m32 >+- DONT_BUILD_LZSSE ?= 1 >+-endif >++DONT_BUILD_LZSSE ?= 1 >+ >+ CC?=gcc >+ >+@@ -28,11 +24,6 @@ ifeq (1,$(filter 1,$(shell [ "$(COMPILER)" = "gcc" ] & >+ DONT_BUILD_GLZA ?= 1 >+ endif >+ >+-# LZSSE requires compiler with __SSE4_1__ support and 64-bit CPU >+-ifneq ($(shell echo|$(CC) -dM -E - -march=native|egrep -c '__(SSE4_1|x86_64)__'), 2) >+- DONT_BUILD_LZSSE ?= 1 >+-endif >+- >+ # zling requires c++14 >+ ifeq (1,$(filter 1,$(shell [ "$(COMPILER)" = "gcc" ] && expr $(GCC_VERSION) \< 60000) $(shell [ "$(COMPILER)" = "clang" ] && expr $(CLANG_VERSION) \< 60000))) >+ DONT_BUILD_ZLING ?= 1 >+@@ -87,8 +78,8 @@ else >+ OPT_FLAGS_O3 = $(OPT_FLAGS) -O3 -DNDEBUG >+ endif >+ >+-CFLAGS = $(MOREFLAGS) $(CODE_FLAGS) $(OPT_FLAGS_O3) $(DEFINES) >+-CFLAGS_O2 = $(MOREFLAGS) $(CODE_FLAGS) $(OPT_FLAGS_O2) $(DEFINES) >++CFLAGS += $(MOREFLAGS) $(CODE_FLAGS) $(OPT_FLAGS_O3) $(DEFINES) >++CFLAGS_O2 += $(MOREFLAGS) $(CODE_FLAGS) $(OPT_FLAGS_O2) $(DEFINES) >+ LDFLAGS += $(MOREFLAGS) >+ >+ >diff --git a/benchmarks/lzbench/files/patch-pithy_pithy.cpp b/benchmarks/lzbench/files/patch-pithy_pithy.cpp >new file mode 100644 >index 000000000000..d4a021ea460f >--- /dev/null >+++ b/benchmarks/lzbench/files/patch-pithy_pithy.cpp >@@ -0,0 +1,11 @@ >+--- pithy/pithy.cpp.orig 2021-12-22 21:22:04 UTC >++++ pithy/pithy.cpp >+@@ -117,7 +117,7 @@ PITHY_STATIC_INLINE char *pithy_EmitCopy(char *o >+ #if defined(__arm__) >+ >+ #if defined(__ARM_NEON__) >+-#define pithy_Load64(_p) ((uint64_t)vld1_u64(_p)) >++#define pithy_Load64(_p) ((uint64_t)vld1_u64((uint64_t*)_p)) >+ #define pithy_Store64(_p, _val) vst1_u64(_p, (uint64x1_t)_val) >+ #else >+ #define PITHY_32BIT_MOVE64 >diff --git a/benchmarks/lzbench/files/patch-tornado_Common.h b/benchmarks/lzbench/files/patch-tornado_Common.h >new file mode 100644 >index 000000000000..2239090dd6cc >--- /dev/null >+++ b/benchmarks/lzbench/files/patch-tornado_Common.h >@@ -0,0 +1,11 @@ >+--- tornado/Common.h.orig 2021-12-22 23:34:46 UTC >++++ tornado/Common.h >+@@ -15,7 +15,7 @@ >+ #include <sys/types.h> >+ #include <sys/stat.h> >+ >+-#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) || defined(_ARCH_PPC64) || defined(__arm64__) || defined(__aarch64__) >++#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) || defined(_ARCH_PPC64) || defined(__arm64__) || defined(__aarch64__) || __riscv_xlen == 64 >+ #define FREEARC_64BIT >+ #endif >+ >-- >2.32.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
fuz
:
maintainer-approval+
koobs
:
maintainer-approval+
danfe
:
maintainer-approval-
Actions:
View
|
Diff
Attachments on
bug 260625
: 230330