From 6c59e71386fddb9e71d2b97c43ad0e7b40637676 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 13 Jul 2024 10:27:06 +0200 Subject: [PATCH] package/x265: replace patch fixing gcc option As we're about to do some other fixes in x265 ARM build, let's replace the patch fixing gcc option by: - A patch generated by git format-patch now that x265 upstream uses Git - Is re-submitted upstream - Only drops the flags, and does not add bogus ARM architecture aliases that don't exist in the CMake world. Signed-off-by: Thomas Petazzoni (cherry picked from commit 9d62687d0024f7e3bac68157f1250970ef45abff) Signed-off-by: Peter Korsgaard --- .checkpackageignore | 1 - ...ists.txt-do-not-force-compiler-flags.patch | 83 +++++++++++++++++ package/x265/0001-fix-gcc-options.patch | 88 ------------------- 3 files changed, 83 insertions(+), 89 deletions(-) create mode 100644 package/x265/0001-CMakeLists.txt-do-not-force-compiler-flags.patch delete mode 100644 package/x265/0001-fix-gcc-options.patch diff --git a/.checkpackageignore b/.checkpackageignore index 3533b1df33..e349e31812 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -1386,7 +1386,6 @@ package/x11r7/xserver_xorg-server/0001-include-misc.h-fix-uClibc-build.patch Ups package/x11r7/xserver_xorg-server/S40xorg Shellcheck Variables package/x11vnc/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch Upstream package/x11vnc/0002-scan-limit-access-to-shared-memory-segments-to-current-user.patch Upstream -package/x265/0001-fix-gcc-options.patch Upstream package/xen/0001-9pfs-include-linux-limits.h-for-XATTR_SIZE_MAX.patch Upstream package/xen/0002-Fix-build-with-64-bits-time_t.patch Upstream package/xen/0003-libs-light-fix-tv_sec-printf-format.patch Upstream diff --git a/package/x265/0001-CMakeLists.txt-do-not-force-compiler-flags.patch b/package/x265/0001-CMakeLists.txt-do-not-force-compiler-flags.patch new file mode 100644 index 0000000000..af0e57f206 --- /dev/null +++ b/package/x265/0001-CMakeLists.txt-do-not-force-compiler-flags.patch @@ -0,0 +1,83 @@ +From b56e9125db34614b2157516df3ee724180f2084f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 13 Jul 2024 09:59:26 +0200 +Subject: [PATCH] CMakeLists.txt: do not force compiler flags + +The compiler flags enforced by CMakeLists.txt can be problematic: + +- When CROSS_COMPILE_ARM is set, one is not necessarily building for + armv6 with soft float-abi: one may be using ARMv7 with hard float + +- When CROSS_COMPILE_ARM is not set, forcing -mfloat-abi=hard is + similarly wrong + +Those compiler flags should be passed by the user depending on the +exact target platform. + +Inspired from +https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/x265/files/arm-r1.patch, +and earlier work from Bertrand Jacquin and +Bernd Kuhls . + +Upstream: https://bitbucket.org/multicoreware/x265_git/pull-requests/26 +Signed-off-by: Thomas Petazzoni +--- + source/CMakeLists.txt | 10 +++------- + source/dynamicHDR10/CMakeLists.txt | 6 +++--- + 2 files changed, 6 insertions(+), 10 deletions(-) + +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index a407271b4..a34bf4d4f 100755 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -239,11 +239,7 @@ if(GCC) + 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() ++ set(ARM_ARGS -fPIC) + message(STATUS "cross compile arm") + elseif(ARM) + if(ARM64) +@@ -252,10 +248,10 @@ if(GCC) + else() + find_package(Neon) + if(CPU_HAS_NEON) +- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) ++ set(ARM_ARGS -mfpu=neon -fPIC) + add_definitions(-DHAVE_NEON) + else() +- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) ++ set(ARM_ARGS -fPIC) + endif() + endif() + endif() +diff --git a/source/dynamicHDR10/CMakeLists.txt b/source/dynamicHDR10/CMakeLists.txt +index 22fb79d44..2cea7c48a 100644 +--- a/source/dynamicHDR10/CMakeLists.txt ++++ b/source/dynamicHDR10/CMakeLists.txt +@@ -43,14 +43,14 @@ if(GCC) + endif() + endif() + if(ARM AND CROSS_COMPILE_ARM) +- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC) ++ set(ARM_ARGS -fPIC) + elseif(ARM) + find_package(Neon) + if(CPU_HAS_NEON) +- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) ++ set(ARM_ARGS -fPIC) + add_definitions(-DHAVE_NEON) + else() +- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) ++ set(ARM_ARGS -fPIC) + endif() + endif() + add_definitions(${ARM_ARGS}) +-- +2.45.2 + diff --git a/package/x265/0001-fix-gcc-options.patch b/package/x265/0001-fix-gcc-options.patch deleted file mode 100644 index 0283da25ea..0000000000 --- a/package/x265/0001-fix-gcc-options.patch +++ /dev/null @@ -1,88 +0,0 @@ -# HG changeset patch -# User Bertrand Jacquin -# Date 1444431941 -3600 -# Node ID 5c6d2a6f2f9a0534933cc999b3845be4344e1af0 -# Parent b6156a08b1def3584647f26096866c1a0c11e54a -build: Disable -march selection from CMakeLists.txt - -x32 arch as defined on https://sites.google.com/site/x32abi is neither -X86 nor X64, then forcing -march=i686 leads to build failure as wrong --march is used. - -Forcing -march, -mfloat-abi and -mfpu for ARM is also wrong - -As a global sanity sake, disable all forced -march in CMakeLists - -Backported from upstream pull request: -https://bitbucket.org/multicoreware/x265/pull-requests/21 - -Signed-off-by: Bernd Kuhls -[Bernd: rebased for 3.5 based on - https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/x265/files/arm-r1.patch] - -diff -r 58dddcf01b7d source/CMakeLists.txt ---- a/source/CMakeLists.txt Mon Jan 23 09:50:33 2017 +0530 -+++ b/source/CMakeLists.txt Mon Jan 23 21:03:10 2017 +0100 -@@ -40,7 +40,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_ - # System architecture detection - string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC) - set(X86_ALIASES x86 i386 i686 x86_64 amd64) --set(ARM_ALIASES armv6l armv7l aarch64) -+set(ARM_ALIASES armv6l armv6l armv7l armv7a aarch64) - list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) - list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) - set(POWER_ALIASES ppc64 ppc64le) -@@ -239,11 +239,7 @@ if(GCC) - 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() -+ set(ARM_ARGS -fPIC) - message(STATUS "cross compile arm") - elseif(ARM) - if(ARM64) -@@ -252,10 +248,10 @@ if(GCC) - else() - find_package(Neon) - if(CPU_HAS_NEON) -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) -+ set(ARM_ARGS -mfpu=neon -fPIC) - add_definitions(-DHAVE_NEON) - else() -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) -+ set(ARM_ARGS -fPIC) - endif() - endif() - endif() ---- a/source/dynamicHDR10/CMakeLists.txt -+++ b/source/dynamicHDR10/CMakeLists.txt -@@ -43,14 +43,14 @@ if(GCC) - endif() - endif() - if(ARM AND CROSS_COMPILE_ARM) -- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC) -+ set(ARM_ARGS -fPIC) - elseif(ARM) - find_package(Neon) - if(CPU_HAS_NEON) -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) -+ set(ARM_ARGS -fPIC) - add_definitions(-DHAVE_NEON) - else() -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) -+ set(ARM_ARGS -fPIC) - endif() - endif() - add_definitions(${ARM_ARGS}) -@@ -150,4 +150,4 @@ set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables") - option(ENABLE_SHARED "Build shared library" OFF) - - install(FILES hdr10plus.h DESTINATION include) --endif() -\ No newline at end of file -+endif() -