[x265] [PATCH] Experimental ARMv7-A Crosscompilation

Peter Kovář peter.kovar at reflexion.tv
Tue Sep 29 17:44:28 CEST 2015


# HG changeset patch
# User Peter Kovář <peter.kovar at reflexion.tv>
# Date 1443541451 -7200
#      Tue Sep 29 17:44:11 2015 +0200
# Node ID efa150f37b6d5a9472deff52f642a40034a94b69
# Parent  f4c267f28487161fa78c43cabb30dc4f4f82570c
Experimental ARMv7-A Crosscompilation

diff -r f4c267f28487 -r efa150f37b6d build/linux/arm-linux-gnu.cmake
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/linux/arm-linux-gnu.cmake	Tue Sep 29 17:44:11 2015 +0200
@@ -0,0 +1,9 @@
+set(triple arm-linux-gnu)
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR arm)
+set(CMAKE_SYSROOT /usr/${triple}/sys-root)
+set(CMAKE_INSTALL_PREFIX /usr/${triple}/sys-root/usr/local)
+set(CMAKE_C_COMPILER ${triple}-gcc)
+set(CMAKE_C_FLAGS)
+set(CMAKE_CXX_COMPILER ${triple}-c++ "-Wl,-rpath=/usr/${triple}/sys-root/usr/lib64 -Wl,-L/usr/${triple}/sys-root/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/5.1.1")
+set(CMAKE_CXX_FLAGS "-I/usr/${triple}/sys-root/usr/include/c++/5.1.1 -I/usr/${triple}/sys-root/usr/include/c++/5.1.1/armv7hl-redhat-linux-gnueabi -DHAVE_STRTOK_R=1")
diff -r f4c267f28487 -r efa150f37b6d build/linux/make-Makefiles.bash
--- a/build/linux/make-Makefiles.bash	Mon Sep 28 13:38:33 2015 +0530
+++ b/build/linux/make-Makefiles.bash	Tue Sep 29 17:44:11 2015 +0200
@@ -1,3 +1,6 @@
 #!/bin/bash
+
+CROSS="-DCMAKE_TOOLCHAIN_FILE=arm-linux-gnu.cmake"
+
 # Run this from within a bash shell
-cmake -G "Unix Makefiles" ../../source && ccmake ../../source
+cmake $CROSS -G "Unix Makefiles" ../../source && ccmake $CROSS ../../source
diff -r f4c267f28487 -r efa150f37b6d source/CMakeLists.txt
--- a/source/CMakeLists.txt	Mon Sep 28 13:38:33 2015 +0530
+++ b/source/CMakeLists.txt	Tue Sep 29 17:44:11 2015 +0200
@@ -44,6 +44,8 @@
 list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
 set(POWER_ALIASES ppc64 ppc64le)
 list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
+set(ARM_ALIASES arm armv6l aarch64)
+list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
 if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
     message(STATUS "Detected x86 target processor")
     set(X86 1)
@@ -56,10 +58,10 @@
     message(STATUS "Detected POWER target processor")
     set(POWER 1)
     add_definitions(-DX265_ARCH_POWER=1)
-elseif(${SYSPROC} STREQUAL "armv6l")
+elseif(ARMMATCH GREATER "-1")
     message(STATUS "Detected ARM target processor")
     set(ARM 1)
-    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
+    add_definitions(-fPIC -DX265_ARCH_ARM=1)
 else()
     message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
     message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
@@ -174,7 +176,7 @@
         add_definitions(-march=i686)
     endif()
     if(ARM)
-        add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
+        # add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
     endif()
     if(FPROFILE_GENERATE)
         if(INTEL_CXX)


More information about the x265-devel mailing list