aboutsummaryrefslogtreecommitdiff
path: root/net/ipvsadm/patches/100_allow_to_redefine_ar_libipvs.patch
blob: 440193a2e46d760d39a0f82335158bf50641f81e (plain)
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
36
37
38
39
40
41
42
43
From: http://archive.linuxvirtualserver.org/html/lvs-devel/2022-02/msg00000.html

From: "Sergey V. Lobanov" <sergey@lobanov.in>
To: lvs-devel@vger.kernel.org
Cc: "Sergey V. Lobanov" <sergey@lobanov.in>
Subject: [PATCH] ipvsadm: allow to redefine AR (libipvs)
Date: Sat,  5 Feb 2022 00:52:15 +0300
Message-Id: <20220204215215.94422-1-sergey@lobanov.in>
X-Mailer: git-send-email 2.32.0 (Apple Git-132)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Return-Path: sergey@lobanov.in

libipvs Makefile uses `ar` to build archive. On cross-compile
cross-platfrom build it fails due system ar might be incompatible
with the objects generated by $(CC). It happens if build ipvsadm
on macos using GCC Toolchain (Linux target)

This patch allows to redefine `ar` using AR var in libipvs Makefile

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
---
 libipvs/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/libipvs/Makefile
+++ b/libipvs/Makefile
@@ -1,5 +1,6 @@
 # Makefile for libipvs
 
+AR		= ar
 CC		= gcc
 CFLAGS		+= -Wall -Wunused -Wstrict-prototypes -g -fPIC
 ifneq (0,$(HAVE_NL))
@@ -30,7 +31,7 @@ SHARED_LIB	= libipvs.so
 all:		$(STATIC_LIB) $(SHARED_LIB)
 
 $(STATIC_LIB):	libipvs.o ip_vs_nl_policy.o
-		ar rv $@ $^
+		$(AR) rv $@ $^
 
 $(SHARED_LIB):	libipvs.o ip_vs_nl_policy.o
 		$(CC) -shared -Wl,-soname,$@ -o $@ $^