You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

  1. From: http://archive.linuxvirtualserver.org/html/lvs-devel/2022-02/msg00000.html
  2. From: "Sergey V. Lobanov" <sergey@lobanov.in>
  3. To: lvs-devel@vger.kernel.org
  4. Cc: "Sergey V. Lobanov" <sergey@lobanov.in>
  5. Subject: [PATCH] ipvsadm: allow to redefine AR (libipvs)
  6. Date: Sat, 5 Feb 2022 00:52:15 +0300
  7. Message-Id: <20220204215215.94422-1-sergey@lobanov.in>
  8. X-Mailer: git-send-email 2.32.0 (Apple Git-132)
  9. MIME-Version: 1.0
  10. Content-Transfer-Encoding: 8bit
  11. Return-Path: sergey@lobanov.in
  12. libipvs Makefile uses `ar` to build archive. On cross-compile
  13. cross-platfrom build it fails due system ar might be incompatible
  14. with the objects generated by $(CC). It happens if build ipvsadm
  15. on macos using GCC Toolchain (Linux target)
  16. This patch allows to redefine `ar` using AR var in libipvs Makefile
  17. Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
  18. ---
  19. libipvs/Makefile | 3 ++-
  20. 1 file changed, 2 insertions(+), 1 deletion(-)
  21. --- a/libipvs/Makefile
  22. +++ b/libipvs/Makefile
  23. @@ -1,5 +1,6 @@
  24. # Makefile for libipvs
  25. +AR = ar
  26. CC = gcc
  27. CFLAGS += -Wall -Wunused -Wstrict-prototypes -g -fPIC
  28. ifneq (0,$(HAVE_NL))
  29. @@ -30,7 +31,7 @@ SHARED_LIB = libipvs.so
  30. all: $(STATIC_LIB) $(SHARED_LIB)
  31. $(STATIC_LIB): libipvs.o ip_vs_nl_policy.o
  32. - ar rv $@ $^
  33. + $(AR) rv $@ $^
  34. $(SHARED_LIB): libipvs.o ip_vs_nl_policy.o
  35. $(CC) -shared -Wl,-soname,$@ -o $@ $^