Date: Tuesday, August 8, 2017 @ 08:17:13 Author: zorun Revision: 249561
argon2: remove -march=native build optimisation Added: argon2/trunk/fix-cflags.patch Modified: argon2/trunk/PKGBUILD ------------------+ PKGBUILD | 15 +++++++++++---- fix-cflags.patch | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2017-08-08 08:13:36 UTC (rev 249560) +++ PKGBUILD 2017-08-08 08:17:13 UTC (rev 249561) @@ -1,7 +1,7 @@ # Maintainer: Baptiste Jonglez <baptiste--aur at jonglez dot org> pkgname=argon2 pkgver=20161029 -pkgrel=2 +pkgrel=3 pkgdesc="A password-hashing function (reference C implementation)" arch=("x86_64" "i686") url="https://github.com/P-H-C/phc-winner-argon2" @@ -8,12 +8,19 @@ license=('Apache') depends=("glibc") source=("https://github.com/P-H-C/phc-winner-argon2/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz" - "libargon2.pc") + "libargon2.pc" + "fix-cflags.patch") sha256sums=('fe0049728b946b58b94cc6db89b34e2d050c62325d16316a534d2bedd78cd5e7' - '4189ce6c183319ceaf2c4ec96facd424deeaa9e2819efb7511893bcf3ef5c836') + '4189ce6c183319ceaf2c4ec96facd424deeaa9e2819efb7511893bcf3ef5c836' + '9cbebcb3aab9477d4f1c2021f2014a707b3721072322d69c98dc97d3de4b48bb') prepare() { cd "$srcdir/phc-winner-$pkgname-$pkgver" + # Fix an attempt at voodoo magic with the build flags (resulting in + # -march=native, which produces invalid opcodes when run on older CPUs) + # Similar issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828779 + patch -p1 < "${srcdir}/fix-cflags.patch" + # Copy custom pkg-config file cp "${srcdir}/libargon2.pc" libargon2.pc sed -i -e "s/@UPSTREAM_VER@/${pkgver}/" libargon2.pc } @@ -20,7 +27,7 @@ build() { cd "$srcdir/phc-winner-$pkgname-$pkgver" - make argon2 libs + make argon2 libargon2.so } check() { Added: fix-cflags.patch =================================================================== --- fix-cflags.patch (rev 0) +++ fix-cflags.patch 2017-08-08 08:17:13 UTC (rev 249561) @@ -0,0 +1,36 @@ +diff --git a/Makefile b/Makefile +index 1838c13..4d5523b 100644 +--- a/Makefile ++++ b/Makefile +@@ -21,29 +21,16 @@ GENKAT = genkat + + DIST = phc-winner-argon2 + +-SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c ++SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/opt.c + SRC_RUN = src/run.c + SRC_BENCH = src/bench.c + SRC_GENKAT = src/genkat.c + OBJ = $(SRC:.c=.o) + +-CFLAGS += -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc ++CFLAGS += -std=c89 -pthread -Iinclude -Isrc + CI_CFLAGS := $(CFLAGS) -Werror=declaration-after-statement -D_FORTIFY_SOURCE=2 \ + -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM + +-OPTTARGET ?= native +-OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \ +- -o /dev/null 2>/dev/null; echo $$?) +-# Detect compatible platform +-ifneq ($(OPTTEST), 0) +-$(info Building without optimizations) +- SRC += src/ref.c +-else +-$(info Building with optimizations for $(OPTTARGET)) +- CFLAGS += -march=$(OPTTARGET) +- SRC += src/opt.c +-endif +- + BUILD_PATH := $(shell pwd) + KERNEL_NAME := $(shell uname -s) +