[vlc-commits] contrib: gmp: Add a patch for fixing building for windows/arm64

Martin Storsjö git at videolan.org
Fri Nov 23 16:10:45 CET 2018


vlc/vlc-3.0 | branch: master | Martin Storsjö <martin at martin.st> | Wed Jan 10 22:19:08 2018 +0200| [d9361759293f05ec17ba653138c75201c932d79c] | committer: Hugo Beauzée-Luyssen

contrib: gmp: Add a patch for fixing building for windows/arm64

This patch has been sent upstream, but hasn't yet been acted on.

(cherry picked from commit 12847e326ef9f0aa0e73e9c2124d06b1e6c352d4)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d9361759293f05ec17ba653138c75201c932d79c
---

 contrib/src/gmp/rules.mak       |  2 ++
 contrib/src/gmp/win-arm64.patch | 55 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/contrib/src/gmp/rules.mak b/contrib/src/gmp/rules.mak
index b4ab683584..5a698aa4c1 100644
--- a/contrib/src/gmp/rules.mak
+++ b/contrib/src/gmp/rules.mak
@@ -28,6 +28,7 @@ $(TARBALLS)/gmp-$(GMP_VERSION).tar.bz2:
 gmp: gmp-$(GMP_VERSION).tar.bz2 .sum-gmp
 	$(UNPACK)
 	$(APPLY) $(SRC)/gmp/ppc64.patch
+	$(APPLY) $(SRC)/gmp/win-arm64.patch
 	$(MOVE)
 
 # GMP requires either GPLv2 or LGPLv3
@@ -35,6 +36,7 @@ gmp: gmp-$(GMP_VERSION).tar.bz2 .sum-gmp
 ifndef GPL
 	$(REQUIRE_GNUV3)
 endif
+	$(RECONF)
 	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(GMP_CONF)
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/contrib/src/gmp/win-arm64.patch b/contrib/src/gmp/win-arm64.patch
new file mode 100644
index 0000000000..ca84813b21
--- /dev/null
+++ b/contrib/src/gmp/win-arm64.patch
@@ -0,0 +1,55 @@
+From 7b969bbb2e3a0ec9a173a7ddf276b2a03e14452b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Mon, 19 Mar 2018 23:46:02 +0200
+Subject: [PATCH] Add support for building for windows on aarch64
+
+Just as on windows/x86_64, "long" still is 32 bit; tweak the
+arm/aarch64 ABI check to test sizeof(void*) instead of sizeof(long),
+and use long long for mp_limb_t for mingw targets.
+---
+ acinclude.m4 | 4 ++--
+ configure.ac | 6 ++++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 2ea5f5a..6eb7343 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -907,8 +907,8 @@ dnl  a workaround for a HP compiler bug.
+ 
+ AC_DEFUN([GMP_C_TEST_SIZEOF],
+ [echo "configure: testlist $2" >&AC_FD_CC
+-[gmp_sizeof_type=`echo "$2" | sed 's/sizeof-\([a-z]*\).*/\1/'`]
+-[gmp_sizeof_want=`echo "$2" | sed 's/sizeof-[a-z]*-\([0-9]*\).*/\1/'`]
++[gmp_sizeof_type=`echo "$2" | sed 's/sizeof-\([a-z\*]*\).*/\1/'`]
++[gmp_sizeof_want=`echo "$2" | sed 's/sizeof-[a-z\*]*-\([0-9]*\).*/\1/'`]
+ AC_MSG_CHECKING([compiler $1 has sizeof($gmp_sizeof_type)==$gmp_sizeof_want])
+ cat >conftest.c <<EOF
+ [int
+diff --git a/configure.ac b/configure.ac
+index e42599b..071fff0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -602,8 +602,8 @@ case $host in
+     CALLING_CONVENTIONS_OBJS='arm32call.lo arm32check.lo'
+     CALLING_CONVENTIONS_OBJS_64=""
+     cclist_64="gcc cc"
+-    any_32_testlist="sizeof-long-4"
+-    any_64_testlist="sizeof-long-8"
++    any_32_testlist="sizeof-void*-4"
++    any_64_testlist="sizeof-void*-8"
+ 
+     # This is needed for clang, which is not content with flags like -mfpu=neon
+     # alone.
+@@ -612,6 +612,8 @@ case $host in
+         gcc_cflags_fpmode="-mfloat-abi=softfp" ;;
+       *-*-*eabihf)
+         gcc_cflags_fpmode="-mfloat-abi=hard" ;;
++      *-*-mingw*)
++        limb_64=longlong ;;
+     esac
+ 
+     # FIXME: We make mandatory compiler options optional here.  We should
+-- 
+2.7.4
+



More information about the vlc-commits mailing list