[packages/x265] update arm flags handling

atler atler at pld-linux.org
Mon May 27 11:18:56 CEST 2024


commit e80ad00bf569fc910d0da3db2f1cce7738197b12
Author: Jan Palus <atler at pld-linux.org>
Date:   Mon May 27 10:10:27 2024 +0200

    update arm flags handling

 x265-arm_flags.patch | 72 +++++++++++++++++++++++++++++++++++++++-------------
 x265.spec            |  4 +++
 2 files changed, 58 insertions(+), 18 deletions(-)
---
diff --git a/x265.spec b/x265.spec
index 615e2de..d9e5f98 100644
--- a/x265.spec
+++ b/x265.spec
@@ -102,6 +102,10 @@ export CXXFLAGS="%{rpmcxxflags} -fPIC"
 export CFLAGS="$CFLAGS -DHAVE_NEON"
 export CXXFLAGS="$CXXFLAGS -DHAVE_NEON"
 %endif
+%ifarch aarch64
+export CFLAGS="$CFLAGS -flax-vector-conversions"
+export CXXFLAGS="$CXXFLAGS -flax-vector-conversions"
+%endif
 %endif
 %cmake .. \
 	-DENABLE_ASSEMBLY=%{!?with_asm:OFF}%{?with_asm:ON} \
diff --git a/x265-arm_flags.patch b/x265-arm_flags.patch
index 67c48b6..d7b7d1c 100644
--- a/x265-arm_flags.patch
+++ b/x265-arm_flags.patch
@@ -1,31 +1,67 @@
-diff -ur x265_3.5.orig/source/CMakeLists.txt x265_3.5/source/CMakeLists.txt
---- x265_3.5.orig/source/CMakeLists.txt	2021-06-30 10:18:05.027691945 +0200
-+++ x265_3.5/source/CMakeLists.txt	2021-06-30 10:22:34.076437753 +0200
-@@ -235,28 +235,7 @@
+--- x265_3.6/source/CMakeLists.txt.orig	2024-05-26 20:21:11.842336919 +0200
++++ x265_3.6/source/CMakeLists.txt	2024-05-26 20:28:09.917087813 +0200
+@@ -44,10 +44,8 @@
+     string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
+ endif()
+ set(X86_ALIASES x86 i386 i686 x86_64 amd64)
+-set(ARM_ALIASES armv6l armv7l)
+ set(ARM64_ALIASES arm64 arm64e aarch64)
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
+-list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
+ list(FIND ARM64_ALIASES "${SYSPROC}" ARM64MATCH)
+ set(POWER_ALIASES powerpc64 powerpc64le ppc64 ppc64le)
+ list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
+@@ -70,7 +68,7 @@
+         add_definitions(-DPPC64=1)
+         message(STATUS "Detected POWER PPC64 target processor")
+     endif()
+-elseif(ARMMATCH GREATER "-1")
++elseif(${SYSPROC} MATCHES "armv[67]")
+     if(CROSS_COMPILE_ARM)
+         message(STATUS "Cross compiling for ARM arch")
+     else()
+@@ -244,45 +244,7 @@
              endif()
          endif()
      endif()
 -    if(ARM AND CROSS_COMPILE_ARM)
--        if(ARM64)
--            set(ARM_ARGS -fPIC)
--        else()
--            set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
--        endif()
 -        message(STATUS "cross compile arm")
+-		set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
 -    elseif(ARM)
--        if(ARM64)
--            set(ARM_ARGS -fPIC)
+-        find_package(Neon)
+-        if(CPU_HAS_NEON)
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
 -            add_definitions(-DHAVE_NEON)
 -        else()
--            find_package(Neon)
--            if(CPU_HAS_NEON)
--                set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
--                add_definitions(-DHAVE_NEON)
--            else()
--                set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
--            endif()
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
 -        endif()
 -    endif()
+-	if(ARM64 OR CROSS_COMPILE_ARM64)
+-        find_package(Neon)
+-        find_package(SVE)
+-        find_package(SVE2)
+-        if(CPU_HAS_SVE2 OR CROSS_COMPILE_SVE2)
+-            message(STATUS "Found SVE2")
+-	        set(ARM_ARGS -O3 -march=armv8-a+sve2 -fPIC -flax-vector-conversions)
+-            add_definitions(-DHAVE_SVE2)
+-            add_definitions(-DHAVE_SVE)
+-            add_definitions(-DHAVE_NEON) # for NEON c/c++ primitives, as currently there is no implementation that use SVE2
+-        elseif(CPU_HAS_SVE OR CROSS_COMPILE_SVE)
+-            message(STATUS "Found SVE")
+-	        set(ARM_ARGS -O3 -march=armv8-a+sve -fPIC -flax-vector-conversions)
+-            add_definitions(-DHAVE_SVE)
+-            add_definitions(-DHAVE_NEON) # for NEON c/c++ primitives, as currently there is no implementation that use SVE
+-        elseif(CPU_HAS_NEON)
+-            message(STATUS "Found NEON")
+-            set(ARM_ARGS -fPIC -flax-vector-conversions)
+-            add_definitions(-DHAVE_NEON)
+-        else()
+-            set(ARM_ARGS -fPIC -flax-vector-conversions)
+-        endif()        
+-    endif()
+-	if(ENABLE_PIC)
+-	list(APPEND ARM_ARGS -DPIC)
+-	endif()
 -    add_definitions(${ARM_ARGS})
 +    string(REPLACE " " ";" ARM_ARGS ${CMAKE_CXX_FLAGS})
      if(FPROFILE_GENERATE)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/x265.git/commitdiff/e80ad00bf569fc910d0da3db2f1cce7738197b12



More information about the pld-cvs-commit mailing list