[x265] [PATCH] Experimental ARMv8-A Crosscompilation

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


# HG changeset patch
# User Peter Kovář <peter.kovar at reflexion.tv>
# Date 1443540916 -7200
#      Tue Sep 29 17:35:16 2015 +0200
# Node ID 1768e5dd8feaa1b998d371f62ecd5554e3825f4b
# Parent  f4c267f28487161fa78c43cabb30dc4f4f82570c
Experimental ARMv8-A Crosscompilation

Compile x265 for 64-bit ARM CPU

diff -r f4c267f28487 -r 1768e5dd8fea build/linux/aarch64-linux-gnu.cmake
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/linux/aarch64-linux-gnu.cmake	Tue Sep 29 17:35:16 2015 +0200
@@ -0,0 +1,9 @@
+set(triple aarch64-linux-gnu)
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
+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/aarch64-redhat-linux/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/aarch64-redhat-linux -DHAVE_STRTOK_R=1")
diff -r f4c267f28487 -r 1768e5dd8fea 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:35:16 2015 +0200
@@ -1,3 +1,6 @@
 #!/bin/bash
+
+CROSS="-DCMAKE_TOOLCHAIN_FILE=aarch64-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 1768e5dd8fea source/CMakeLists.txt
--- a/source/CMakeLists.txt	Mon Sep 28 13:38:33 2015 +0530
+++ b/source/CMakeLists.txt	Tue Sep 29 17:35:16 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 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}")
@@ -173,9 +175,6 @@
     elseif(X86 AND NOT X64)
         add_definitions(-march=i686)
     endif()
-    if(ARM)
-        add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
-    endif()
     if(FPROFILE_GENERATE)
         if(INTEL_CXX)
             add_definitions(-prof-gen -prof-dir="${CMAKE_CURRENT_BINARY_DIR}")


More information about the x265-devel mailing list