[vlc-commits] contrib: x264: Fix building for windows on arm

Martin Storsjö git at videolan.org
Sun Feb 25 21:18:56 CET 2018


vlc | branch: master | Martin Storsjö <martin at martin.st> | Tue Dec 19 11:05:47 2017 +0200| [1374a33c83ead6eced5a6dc67bb860b74361dcda] | committer: Martin Storsjö

contrib: x264: Fix building for windows on arm

This includes a backport of one patch (from original git commit
7b13b31be60, included in the x264 master branch since Dec 24 2017),
and passing the necessary configure parameters for setting up
gas-preprocessor for this configuration.

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

 contrib/src/x264/arm-asm-win.patch | 34 ++++++++++++++++++++++++++++++++++
 contrib/src/x264/rules.mak         |  6 +++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/contrib/src/x264/arm-asm-win.patch b/contrib/src/x264/arm-asm-win.patch
new file mode 100644
index 0000000000..32d2f1410b
--- /dev/null
+++ b/contrib/src/x264/arm-asm-win.patch
@@ -0,0 +1,34 @@
+From 064d3bbd30e3dc8d7096ee267de66b6d0a56cd02 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Mon, 16 Oct 2017 22:50:26 +0300
+Subject: [PATCH] arm: Check for __ELF__ instead of !__APPLE__, for using
+ .arch/.fpu
+
+For windows, when building with armasm, we already filtered these out
+with gas-preprocessor.
+
+By filtering them out already in the source, we can also build directly
+with clang for windows (which also require wrapping the assembler in
+gas-preprocessor for converting instructions to thumb form, but
+gas-preprocessor doesn't and shouldn't filter out them in the clang
+configuration).
+---
+ common/arm/asm.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/common/arm/asm.S b/common/arm/asm.S
+index 619a509..37a4229 100644
+--- a/common/arm/asm.S
++++ b/common/arm/asm.S
+@@ -28,7 +28,7 @@
+ 
+ .syntax unified
+ 
+-#ifndef __APPLE__
++#ifdef __ELF__
+ .arch armv7-a
+ .fpu neon
+ #endif
+-- 
+2.7.4
+
diff --git a/contrib/src/x264/rules.mak b/contrib/src/x264/rules.mak
index 9d7e7a657f..a1ff5c1b29 100644
--- a/contrib/src/x264/rules.mak
+++ b/contrib/src/x264/rules.mak
@@ -35,6 +35,9 @@ ifndef HAVE_WIN32
 X264CONF += --enable-pic
 else
 X264CONF += --enable-win32thread
+ifeq ($(ARCH), arm)
+X264_AS = AS="./tools/gas-preprocessor.pl -arch arm -as-type clang -force-thumb -- $(CC) -mimplicit-it=always"
+endif
 endif
 ifdef HAVE_CROSS_COMPILE
 X264CONF += --cross-prefix="$(HOST)-"
@@ -77,6 +80,7 @@ x264 x26410b: %: x264-git.tar.bz2 .sum-%
 	mkdir -p $*-git
 	tar xvjf "$<" --strip-components=1 -C $*-git
 	$(UPDATE_AUTOCONFIG)
+	$(APPLY) $(SRC)/x264/arm-asm-win.patch
 	mv $*-git $*
 
 x262: x262-git.tar.gz .sum-x262
@@ -89,7 +93,7 @@ x262: x262-git.tar.gz .sum-x262
 
 .x264: x264
 	$(REQUIRE_GPL)
-	cd $< && $(HOSTVARS) ./configure $(X264CONF)
+	cd $< && $(HOSTVARS) $(X264_AS) ./configure $(X264CONF)
 	cd $< && $(MAKE) install
 	touch $@
 



More information about the vlc-commits mailing list