diff --git a/argon2.spec b/argon2.spec index 5cf67525b1a6555bec6a80fe3e9d1557f7657c41..177027adf77ac9fb4a6ef71816bf02251431f097 100644 --- a/argon2.spec +++ b/argon2.spec @@ -1,6 +1,6 @@ Name: argon2 Version: 20190702 -Release: 5 +Release: 6 Summary: A password-hashing tool License: CC0-1.0 OR Apache-2.0 URL: https://github.com/P-H-C/phc-winner-argon2 @@ -8,6 +8,7 @@ Source0: https://github.com/P-H-C/phc-winner-argon2/archive/62358ba2123abd Patch1: backport-fix-3-spelling-mistakes.patch Patch2: backport-Don-t-fail-on-existing-symlink.patch +Patch3: backport-Fix-cross-compilation-on-some-systems.patch BuildRequires: gcc Requires: libargon2%{?_isa} = %{version}-%{release} @@ -105,6 +106,9 @@ make test %{_mandir}/man1/* %changelog +* Mon Sep 1 2025 yixiangzhike - 20190702-6 +- backport upstream patch to fix cross-compilation on some systems + * Mon May 05 2025 Funda Wang - 20190702-5 - fix build with package notes - cleanup spec diff --git a/backport-Fix-cross-compilation-on-some-systems.patch b/backport-Fix-cross-compilation-on-some-systems.patch new file mode 100644 index 0000000000000000000000000000000000000000..bcaba685ac014d4329ab6989e444517589494219 --- /dev/null +++ b/backport-Fix-cross-compilation-on-some-systems.patch @@ -0,0 +1,37 @@ +From cd1c1d8d204e4ec4557e358013567c097cb70562 Mon Sep 17 00:00:00 2001 +From: Vika +Date: Mon, 26 Aug 2019 14:05:22 +0300 +Subject: [PATCH] Fix cross-compilation on some systems + +Some Linux distributions (e.g. NixOS, where this issue was spotted) don't provide an unprefixed ar when cross-compiling. This PR aims to fix this. + +See[NixOS/nixpkgs#67490](https://github.com/NixOS/nixpkgs/pull/67490) for information on where did it start. +--- + Makefile | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 837e7f7..38f16fc 100644 +--- a/Makefile ++++ b/Makefile +@@ -123,6 +123,8 @@ ifdef LINKED_LIB_EXT + LINKED_LIB_SH := lib$(LIB_NAME).$(LINKED_LIB_EXT) + endif + ++# Some systems don't provide an unprefixed ar when cross-compiling. ++AR=ar + + LIBRARIES = $(LIB_SH) $(LIB_ST) + HEADERS = include/argon2.h +@@ -182,7 +184,7 @@ $(LIB_SH): $(SRC) + $(CC) $(CFLAGS) $(LIB_CFLAGS) $(LDFLAGS) $(SO_LDFLAGS) $^ -o $@ + + $(LIB_ST): $(OBJ) +- ar rcs $@ $^ ++ $(AR) rcs $@ $^ + + .PHONY: clean + clean: +-- +2.43.0 +