-
Notifications
You must be signed in to change notification settings - Fork 291
/
Copy pathfix-cross-compilation.patch
35 lines (28 loc) · 1.11 KB
/
fix-cross-compilation.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# upstream patch merged but unreleased https://github.com/P-H-C/phc-winner-argon2/pull/277
From cd1c1d8d204e4ec4557e358013567c097cb70562 Mon Sep 17 00:00:00 2001
From: Vika <kisik21@fireburn.ru>
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: