contrib: vncclient: Backport a patch for picking the right AR tool for cross compilation
authorMartin Storsjö <martin@martin.st>
Thu, 14 Jun 2018 07:22:01 +0000 (10:22 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 15 Jun 2018 06:30:36 +0000 (09:30 +0300)
In many cases, the host AR tool just happens to work fine for e.g.
mingw cross builds, but clang targeting x86 mingw recently started
generating code that trips up GNU binutils ar, with cases like this:

/usr/bin/ar: cursor.o: Unrecognized storage class 0 for .rdata symbol `__xmm@01010101010101010101010101010101'

contrib/src/vncclient/cross-ar.patch [new file with mode: 0644]
contrib/src/vncclient/rules.mak

diff --git a/contrib/src/vncclient/cross-ar.patch b/contrib/src/vncclient/cross-ar.patch
new file mode 100644 (file)
index 0000000..92cb82c
--- /dev/null
@@ -0,0 +1,24 @@
+From 2dc984dcaa28fd4df90fe011a58fd8fe329bc7a1 Mon Sep 17 00:00:00 2001
+From: Thomas Anderson <tanderson@caltech.edu>
+Date: Wed, 15 Apr 2015 03:42:32 +0000
+Subject: [PATCH] configure.ac: Use AC_CHECK_TOOL for cross-compiling support.
+
+When cross-compiling the ar program has the appropriate prefix prepended.
+Respect that here and have autotools autodetect the appropriate tool.
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bcf51283..3069eedd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,7 +24,7 @@ test "x$GCC" = "xyes" && CFLAGS="$CFLAGS -Wall"
+ AC_PROG_MAKE_SET
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+-AC_PATH_PROG([AR], [ar], [/usr/bin/ar],
++AC_CHECK_TOOL([AR], [ar], [/usr/bin/ar],
+                   [$PATH:/usr/ccs/bin])
+ # Options
index 12dfaa0..e048fd6 100644 (file)
@@ -24,6 +24,7 @@ vncclient: LibVNCServer-$(VNCCLIENT_VERSION).tar.gz .sum-vncclient
        $(APPLY) $(SRC)/vncclient/vnc-gnutls-pkg.patch
        $(APPLY) $(SRC)/vncclient/gnutls-recent.patch
        $(APPLY) $(SRC)/vncclient/vnc-gnutls-anon.patch
+       $(APPLY) $(SRC)/vncclient/cross-ar.patch
        $(call pkg_static,"libvncclient.pc.in")
        $(UPDATE_AUTOCONFIG)
        $(MOVE)