From 85c4e40ea8e7875639b8412a260e701e3d532266 Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Wed, 1 Oct 2025 23:34:17 +0200 Subject: [PATCH] main/unixbench: Upgrade to 6.0.0, fix build errors Signed-off-by: Jens Reidel Part-of: --- ...-Stop-using-native-CPU-optimizations.patch | 39 +++++++++++++++++++ .../0002-Specify-the-C-standard.patch | 23 +++++++++++ main/unixbench/APKBUILD | 13 ++++--- 3 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 main/unixbench/0001-Stop-using-native-CPU-optimizations.patch create mode 100644 main/unixbench/0002-Specify-the-C-standard.patch diff --git a/main/unixbench/0001-Stop-using-native-CPU-optimizations.patch b/main/unixbench/0001-Stop-using-native-CPU-optimizations.patch new file mode 100644 index 000000000..f36da0e50 --- /dev/null +++ b/main/unixbench/0001-Stop-using-native-CPU-optimizations.patch @@ -0,0 +1,39 @@ +From 378b3eaff1354ed9fb861d7cbcbb549072842ec1 Mon Sep 17 00:00:00 2001 +From: Jens Reidel +Date: Wed, 1 Oct 2025 23:28:10 +0200 +Subject: [PATCH] Stop using native CPU optimizations + +This is not portable for packaging in distributions and may result in +illegal instructions on CPUs older than the ones used by the builder. + +Signed-off-by: Jens Reidel +--- + Makefile | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/Makefile b/Makefile +index 3169c03..158e204 100644 +--- a/Makefile ++++ b/Makefile +@@ -90,18 +90,6 @@ else + ## OS detection. Comment out if gmake syntax not supported by other 'make'. + OSNAME:=$(shell uname -s) + ARCH ?= $(shell uname -m) +- ifeq ($(OSNAME),Linux) +- # Not all CPU architectures support "-march" or "-march=native". +- # - Supported : x86, x86_64, ARM, AARCH64, riscv64, etc.. +- # - Not Supported: IBM Power, etc... +- ifeq ($(ARCH),$(filter $(ARCH),ppc64 ppc64le)) +- OPTON += -mcpu=native -mtune=native +- else ifeq ($(ARCH),riscv64) +- OPTON += -march=rv64g -mabi=lp64d +- else +- OPTON += -march=native -mtune=native +- endif +- endif + + ifeq ($(OSNAME),Darwin) + # (adjust flags or comment out this section for older versions of XCode or OS X) +-- +2.51.0 + diff --git a/main/unixbench/0002-Specify-the-C-standard.patch b/main/unixbench/0002-Specify-the-C-standard.patch new file mode 100644 index 000000000..bd47fc241 --- /dev/null +++ b/main/unixbench/0002-Specify-the-C-standard.patch @@ -0,0 +1,23 @@ +From 66dc9854073e0683219b7fd8f4b568d5b56e7447 Mon Sep 17 00:00:00 2001 +From: Suyun +Date: Sat, 5 Jul 2025 15:06:29 +0800 +Subject: [PATCH] Specify the C standard to avoid errors from new compilers + +--- + Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 3169c03..31202f4 100644 +--- a/Makefile ++++ b/Makefile +@@ -85,7 +85,8 @@ else + + ## gcc optimization flags + ## (-ffast-math) disables strict IEEE or ISO rules/specifications for math funcs +- OPTON = -O3 -ffast-math ++ ## (-std=c89) specifies the C standard to avoid errors from new compilers ++ OPTON = -O3 -ffast-math -std=c89 + + ## OS detection. Comment out if gmake syntax not supported by other 'make'. + OSNAME:=$(shell uname -s) diff --git a/main/unixbench/APKBUILD b/main/unixbench/APKBUILD index 1c702e6ff..6fe849146 100644 --- a/main/unixbench/APKBUILD +++ b/main/unixbench/APKBUILD @@ -1,6 +1,5 @@ pkgname=unixbench -pkgver=5.1.3_git20230411 -_commit="a07fcc03264915c624f0e4818993c5b4df3fa703" +pkgver=6.0.0 pkgrel=0 pkgdesc="The original BYTE UNIX benchmark suite" url="https://github.com/kdlucas/byte-unixbench" @@ -9,10 +8,12 @@ license="GPL-2.0-or-later" depends="perl make" options="!check" source=" - $pkgname-$_commit.tar.gz::https://github.com/kdlucas/byte-unixbench/archive/$_commit.tar.gz + $pkgname-$pkgver.tar.gz::https://github.com/kdlucas/byte-unixbench/archive/v$pkgver.tar.gz + 0001-Stop-using-native-CPU-optimizations.patch + 0002-Specify-the-C-standard.patch ubench " -builddir="$srcdir/byte-unixbench-$_commit/UnixBench" +builddir="$srcdir/byte-unixbench-$pkgver/UnixBench" build() { make @@ -26,6 +27,8 @@ package() { } sha512sums=" -43bb6cbbb4ed1c1e564c6b17cb1b8f0ee3852a5ef9133200e1cb0891c4809615cf9a3b69cf4ffe62bdee6ef9ecc0f05dc9d3d83bbff929013d17199eaad11a4a unixbench-a07fcc03264915c624f0e4818993c5b4df3fa703.tar.gz +9f30091b4300cb01235b36679aa62b5c7034dc1ebbbfe345f30622cf46fb39431acd5e206a3b2422d2c0566bf3b807968f2b70689238e593003a6a190dd24e8c unixbench-6.0.0.tar.gz +10138fd425365cfd9fc624f6f47d5f49f087d763cd7c7a329fa6639c15d29224aae9ac8fbd02d2632e8a01559ba47ff7381418b2f31fdbc478159e779c299ce4 0001-Stop-using-native-CPU-optimizations.patch +4165d0204c70eb0f27ef27a214d0284ad444c77c4607d717946d13037dd649a28d3b2158fcbf2520db8c2a2c7c0b134580bd6a513ffc82aaffed35d50a390a37 0002-Specify-the-C-standard.patch 91590bfaac3b118ad9a7ec66200ecc7b5ff88b84f5e8552c6b30fcc4436669eb4467d6b9a89d0be8682903e88b843fc4e40e3c7f90406c398449edb187ad6771 ubench "