From 1e280fa92a81cc79c3281d77bb3f68e8fe424cc1 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 3 Feb 2026 14:08:52 +0100 Subject: [PATCH] contrib: x265: fix Apple arm64 cross-compilation --- ...he-arch-flag-when-cross-compiling-ar.patch | 29 +++++++++++++++++++ contrib/src/x265/rules.mak | 1 + 2 files changed, 30 insertions(+) create mode 100644 contrib/src/x265/0012-CMake-also-use-the-arch-flag-when-cross-compiling-ar.patch diff --git a/contrib/src/x265/0012-CMake-also-use-the-arch-flag-when-cross-compiling-ar.patch b/contrib/src/x265/0012-CMake-also-use-the-arch-flag-when-cross-compiling-ar.patch new file mode 100644 index 0000000000..36a956e1e6 --- /dev/null +++ b/contrib/src/x265/0012-CMake-also-use-the-arch-flag-when-cross-compiling-ar.patch @@ -0,0 +1,29 @@ +From e315733100aa08951d859e0ab16e66c1fc6c36be Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Tue, 3 Feb 2026 14:06:23 +0100 +Subject: [PATCH 12/12] CMake: also use the -arch flag when cross-compiling + arm64 for Apple + +Missing from 2bb9b9f83ac7d0daa919bbe73159d57a7d5a1a52. +It's possible to cross-compile from x86_64 to arm64. +--- + source/CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index a8e6b143b..a84df13bd 100755 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -735,6 +735,9 @@ if((MSVC_IDE OR XCODE OR GCC) AND ENABLE_ASSEMBLY) + elseif(ARM64 OR CROSS_COMPILE_ARM64) + # compile ARM64 arch asm files here + enable_language(ASM) ++ if(APPLE) ++ set(ARM_ARGS ${ARM_ARGS} -arch ${CMAKE_OSX_ARCHITECTURES}) ++ endif() + foreach(ASM ${ARM_ASMS}) + set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/aarch64/${ASM}) + list(APPEND ASM_SRCS ${ASM_SRC}) +-- +2.50.1 (Apple Git-155) + diff --git a/contrib/src/x265/rules.mak b/contrib/src/x265/rules.mak index 38b5f9d319..bdd929f156 100644 --- a/contrib/src/x265/rules.mak +++ b/contrib/src/x265/rules.mak @@ -40,6 +40,7 @@ x265: x265_$(X265_VERSION).tar.gz .sum-x265 $(APPLY) $(SRC)/x265/0001-CMake-verify-the-Neon-SVE-compiler-flags-can-be-used.patch $(APPLY) $(SRC)/x265/0002-CMake-don-t-force-_WIN32_WINNT-values.patch $(APPLY) $(SRC)/x265/0010-CMake-allow-lpthread-in-the-pkg-config-file.patch + $(APPLY) $(SRC)/x265/0012-CMake-also-use-the-arch-flag-when-cross-compiling-ar.patch $(call pkg_static,"source/x265.pc.in") $(MOVE)