lvs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipvsadm: allow to redefine AR (libipvs)
@ 2022-02-04 21:52 Sergey V. Lobanov
  2022-02-20 11:02 ` Julian Anastasov
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey V. Lobanov @ 2022-02-04 21:52 UTC (permalink / raw)
  To: lvs-devel; +Cc: Sergey V. Lobanov

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(-)

diff --git a/libipvs/Makefile b/libipvs/Makefile
index f845c8b..7e02d4d 100644
--- 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 $@ $^
-- 
2.32.0 (Apple Git-132)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipvsadm: allow to redefine AR (libipvs)
  2022-02-04 21:52 [PATCH] ipvsadm: allow to redefine AR (libipvs) Sergey V. Lobanov
@ 2022-02-20 11:02 ` Julian Anastasov
  0 siblings, 0 replies; 2+ messages in thread
From: Julian Anastasov @ 2022-02-20 11:02 UTC (permalink / raw)
  To: Sergey V. Lobanov; +Cc: Jesper Dangaard Brouer, Simon Horman, lvs-devel


	Hello,

On Sat, 5 Feb 2022, Sergey V. Lobanov wrote:

> 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>

	Looks good to me, thanks!

Acked-by: Julian Anastasov <ja@ssi.bg>

> ---
>  libipvs/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libipvs/Makefile b/libipvs/Makefile
> index f845c8b..7e02d4d 100644
> --- 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 $@ $^
> -- 
> 2.32.0 (Apple Git-132)

Regards

--
Julian Anastasov <ja@ssi.bg>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-20 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-04 21:52 [PATCH] ipvsadm: allow to redefine AR (libipvs) Sergey V. Lobanov
2022-02-20 11:02 ` Julian Anastasov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).