Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/x265: bump version to 4.2
@ 2026-06-19 14:28 Bernd Kuhls
  2026-10-10 12:46 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2026-06-19 14:28 UTC (permalink / raw)
  To: buildroot; +Cc: Thijs Vermeir

https://mailman.videolan.org/pipermail/x265-devel/2026-April/014533.html

Rebased patch 0001.
Removed remaining patches which are included in this release.

Added dependency to _SYNC_8 for cli due to upstream commit
https://bitbucket.org/multicoreware/x265_git/commits/7ea54bdf5a6a35e3fff44d8454e31695928dc752#Lsource/common/threading.hT70

This bump includes upstream commit
https://bitbucket.org/multicoreware/x265_git/commits/f74b2f38ad850a09524f331f64870e6300fd923b
that uses vst1q_s16_x2() which was first added to gcc 9:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=568421baa5a4cdb7bb7c5ac323c939492ee3f052

causing build errors detected by the Gitlab pipelines:
/builds/bkuhls/buildroot/br-test-pkg/bootlin-aarch64-glibc-old/build/x265-4.2/source/common/aarch64/pixel-prim.cpp:936:25:
 error: ‘vst1q_s16_x2’ was not declared in this scope

Disable asm for i386 with musl toolchains to fix linking error detected
by the Gitlab pipelines:

/builds/bkuhls/buildroot/br-test-pkg/bootlin-x86-i686-musl/build/x265-4.2/source/common/x86/cpu-a.asm:181:
 error: ELF format cannot produce non-PC-relative PLT references

Partly reverting
https://bitbucket.org/multicoreware/x265_git/commits/b2950952dcbb28f7aa053e84663c384064c88a4e

does not fix the problem but shows:

/home/bernd/buildroot/buildroot/output/per-package/x265/host/opt/ext-toolchain/bin/../lib/gcc/i686-buildroot-linux-musl/14.3.0/../../../../i686-buildroot-linux-musl/bin/ld:
 common/CMakeFiles/common.dir/x86/pixel-a.asm.o:
 warning: relocation in read-only section `.text'
[ 86%] Built target x265-static
/home/bernd/buildroot/buildroot/output/per-package/x265/host/opt/ext-toolchain/bin/../lib/gcc/i686-buildroot-linux-musl/14.3.0/../../../../i686-buildroot-linux-musl/bin/ld:
 read-only segment has dynamic relocations

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
Gitlab pipelines passed:
https://gitlab.com/bkuhls/buildroot/-/commits/57754edebebb2264acc9d70a3bbdb4c278fe9653

 ...ists.txt-do-not-force-compiler-flags.patch |  4 +-
 ...-error-with-latest-CMake-4.0-release.patch | 35 -----------
 ...-Fix-for-CMake-Build-Errors-in-MacOS.patch | 60 -------------------
 ...n-undefined-symbols-in-armv6l-armv7l.patch | 28 ---------
 package/x265/Config.in                        |  1 +
 package/x265/x265.hash                        |  2 +-
 package/x265/x265.mk                          | 11 +++-
 7 files changed, 14 insertions(+), 127 deletions(-)
 delete mode 100644 package/x265/0002-Fix-CMake-build-error-with-latest-CMake-4.0-release.patch
 delete mode 100644 package/x265/0003-Fix-for-CMake-Build-Errors-in-MacOS.patch
 delete mode 100644 package/x265/0004-Fix-neon-undefined-symbols-in-armv6l-armv7l.patch

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
index 4a12c15ca4..1aa37461a1 100644
--- a/package/x265/0001-CMakeLists.txt-do-not-force-compiler-flags.patch
+++ b/package/x265/0001-CMakeLists.txt-do-not-force-compiler-flags.patch
@@ -21,7 +21,7 @@ Bernd Kuhls <bernd.kuhls@t-online.de>.
 
 Upstream: https://bitbucket.org/multicoreware/x265_git/pull-requests/26
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-[Bernd: rebased for 4.1]
+[Bernd: rebased for 4.2]
 Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
 ---
  source/CMakeLists.txt              | 6 +++---
@@ -32,7 +32,7 @@ diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
 index c14489ea6..fa331e8af 100755
 --- a/source/CMakeLists.txt
 +++ b/source/CMakeLists.txt
-@@ -270,14 +270,14 @@ if(GCC)
+@@ -304,14 +304,14 @@ if(GCC)
      endif()
      if(ARM AND CROSS_COMPILE_ARM)
          message(STATUS "cross compile arm")
diff --git a/package/x265/0002-Fix-CMake-build-error-with-latest-CMake-4.0-release.patch b/package/x265/0002-Fix-CMake-build-error-with-latest-CMake-4.0-release.patch
deleted file mode 100644
index 95d7a7c7b2..0000000000
--- a/package/x265/0002-Fix-CMake-build-error-with-latest-CMake-4.0-release.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From b354c009a60bcd6d7fc04014e200a1ee9c45c167 Mon Sep 17 00:00:00 2001
-From: yaswanthsastry <yaswanth.sastry@multicorewareinc.com>
-Date: Mon, 24 Feb 2025 17:07:03 +0530
-Subject: [PATCH] Fix CMake build error with latest CMake 4.0 release
-
-Upstream: https://bitbucket.org/multicoreware/x265_git/commits/b354c009a60bcd6d7fc04014e200a1ee9c45c167
-
-Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
----
- source/CMakeLists.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
-index 37dbe1a87..4f5b3ed82 100755
---- a/source/CMakeLists.txt
-+++ b/source/CMakeLists.txt
-@@ -7,13 +7,13 @@ if(NOT CMAKE_BUILD_TYPE)
- endif()
- message(STATUS "cmake version ${CMAKE_VERSION}")
- if(POLICY CMP0025)
--    cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
-+    cmake_policy(SET CMP0025 NEW) # report Apple's Clang as just Clang
- endif()
- if(POLICY CMP0042)
-     cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
- endif()
- if(POLICY CMP0054)
--    cmake_policy(SET CMP0054 OLD) # Only interpret if() arguments as variables or keywords when unquoted
-+    cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted
- endif()
- 
- project (x265)
--- 
-2.51.0
-
diff --git a/package/x265/0003-Fix-for-CMake-Build-Errors-in-MacOS.patch b/package/x265/0003-Fix-for-CMake-Build-Errors-in-MacOS.patch
deleted file mode 100644
index 200ba15be4..0000000000
--- a/package/x265/0003-Fix-for-CMake-Build-Errors-in-MacOS.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 51ae8e922bcc4586ad4710812072289af91492a8 Mon Sep 17 00:00:00 2001
-From: yaswanthsastry <yaswanth.sastry@multicorewareinc.com>
-Date: Mon, 7 Apr 2025 11:27:36 +0530
-Subject: [PATCH] Fix for CMake Build Errors in MacOS
-
-Upstream: https://bitbucket.org/multicoreware/x265_git/commits/51ae8e922bcc4586ad4710812072289af91492a8
-
-Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
----
- source/CMakeLists.txt | 15 +++++++--------
- 1 file changed, 7 insertions(+), 8 deletions(-)
-
-diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
-index 4f5b3ed82..7183fd3ce 100755
---- a/source/CMakeLists.txt
-+++ b/source/CMakeLists.txt
-@@ -6,18 +6,14 @@ if(NOT CMAKE_BUILD_TYPE)
-         FORCE)
- endif()
- message(STATUS "cmake version ${CMAKE_VERSION}")
--if(POLICY CMP0025)
--    cmake_policy(SET CMP0025 NEW) # report Apple's Clang as just Clang
--endif()
-+
- if(POLICY CMP0042)
-     cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
- endif()
--if(POLICY CMP0054)
--    cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted
--endif()
-+
- 
- project (x265)
--cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
-+cmake_minimum_required (VERSION 2.8.8...3.10) # OBJECT libraries require 2.8.8
- include(CheckIncludeFiles)
- include(CheckFunctionExists)
- include(CheckSymbolExists)
-@@ -168,7 +164,7 @@ if(APPLE)
-   add_definitions(-DMACOS=1)
- endif()
- 
--if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
-+if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
-     set(CLANG 1)
- endif()
- if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
-@@ -740,6 +736,9 @@ if((MSVC_IDE OR XCODE OR GCC) AND ENABLE_ASSEMBLY)
-     if(ARM OR CROSS_COMPILE_ARM)
-     # compile ARM 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/arm/${ASM})
-             list(APPEND ASM_SRCS ${ASM_SRC})
--- 
-2.51.0
-
diff --git a/package/x265/0004-Fix-neon-undefined-symbols-in-armv6l-armv7l.patch b/package/x265/0004-Fix-neon-undefined-symbols-in-armv6l-armv7l.patch
deleted file mode 100644
index 75f1d4c532..0000000000
--- a/package/x265/0004-Fix-neon-undefined-symbols-in-armv6l-armv7l.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From ddb1933598736394b646cb0f78da4a4201ffc656 Mon Sep 17 00:00:00 2001
-From: Uthayakumar Muthu <uthayakumar.muthu@multicorewareinc.com>
-Date: Sun, 12 Jan 2025 13:17:21 +0530
-Subject: [PATCH] Fix neon undefined symbols in armv6l,armv7l
-
-Upstream: https://bitbucket.org/multicoreware/x265_git/commits/ddb1933598736394b646cb0f78da4a4201ffc656
-
-Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
----
- source/common/cpu.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/source/common/cpu.cpp b/source/common/cpu.cpp
-index ae0907890..35c43deaf 100644
---- a/source/common/cpu.cpp
-+++ b/source/common/cpu.cpp
-@@ -352,7 +352,7 @@ uint32_t cpu_detect(bool benableavx512)
- {
-     int flags = 0;
- 
--#if HAVE_ARMV6
-+#if HAVE_ARMV6 && ENABLE_ASSEMBLY
-     flags |= X265_CPU_ARMV6;
- 
-     // don't do this hack if compiled with -mfpu=neon
--- 
-2.51.0
-
diff --git a/package/x265/Config.in b/package/x265/Config.in
index 1067505d31..c585c7a43a 100644
--- a/package/x265/Config.in
+++ b/package/x265/Config.in
@@ -17,6 +17,7 @@ if BR2_PACKAGE_X265
 
 config BR2_PACKAGE_X265_CLI
 	bool "CLI"
+	depends on BR2_TOOLCHAIN_HAS_SYNC_8
 	help
 	  Command-line tool to encode video streams into the
 	  H.265/HEVC compression format.
diff --git a/package/x265/x265.hash b/package/x265/x265.hash
index 640cd9ce0d..de86e7ef2c 100644
--- a/package/x265/x265.hash
+++ b/package/x265/x265.hash
@@ -1,3 +1,3 @@
 # Locally generated
-sha256  a31699c6a89806b74b0151e5e6a7df65de4b49050482fe5ebf8a4379d7af8f29  x265_4.1.tar.gz
+sha256  40b1ea0453e0309f0eba934e0ddf533f8f6295966679e8894e8f1c1c8d5e1210  x265_4.2.tar.gz
 sha256  d8afb1bcc7a2cfc603683b168d6987ef0a48e59e0da3693bf55c5d33b67e2b49  COPYING
diff --git a/package/x265/x265.mk b/package/x265/x265.mk
index ad4285fb16..eff067007e 100644
--- a/package/x265/x265.mk
+++ b/package/x265/x265.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-X265_VERSION = 4.1
+X265_VERSION = 4.2
 X265_SOURCE = x265_$(X265_VERSION).tar.gz
 X265_SITE = https://bitbucket.org/multicoreware/x265_git/downloads
 X265_LICENSE = GPL-2.0+
@@ -29,9 +29,18 @@ X265_CONF_OPTS += -DENABLE_NEON=OFF
 endif
 endif
 
+# x265 uses vst1q_s16_x2 on aarch64 which was implemented in gcc 9
+ifeq ($(BR2_aarch64):$(BR2_TOOLCHAIN_GCC_AT_LEAST_9),y:)
+X265_CONF_OPTS += -DENABLE_ASSEMBLY=0
+endif
+
 ifeq ($(BR2_i386)$(BR2_x86_64),y)
+ifeq ($(BR2_i386)$(BR2_TOOLCHAIN_USES_MUSL),yy)
+X265_CONF_OPTS += -DENABLE_ASSEMBLY=0
+else
 X265_DEPENDENCIES += host-nasm
 endif
+endif
 
 # disable altivec, it has build issues
 # https://bitbucket.org/multicoreware/x265/issues/320/
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/x265: bump version to 4.2
  2026-06-19 14:28 [Buildroot] [PATCH 1/1] package/x265: bump version to 4.2 Bernd Kuhls
@ 2026-10-10 12:46 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2026-10-10 12:46 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot, Thijs Vermeir

>>>>> "Bernd" == Bernd Kuhls <bernd@kuhls.net> writes:

 > https://mailman.videolan.org/pipermail/x265-devel/2026-April/014533.html
 > Rebased patch 0001.
 > Removed remaining patches which are included in this release.

 > Added dependency to _SYNC_8 for cli due to upstream commit
 > https://bitbucket.org/multicoreware/x265_git/commits/7ea54bdf5a6a35e3fff44d8454e31695928dc752#Lsource/common/threading.hT70

This points to the #if NO_ATOMICS conditional, so you probably instead
mean:

https://bitbucket.org/multicoreware/x265_git/commits/7ea54bdf5a6a35e3fff44d8454e31695928dc752#Lsource/common/threading.hT88

As there is a NO_ATOMICS logic, perhaps we should just pass
-DNO_ATOMICS=ON if !BR2_TOOLCHAIN_HAS_SYNC_8? In any case, it is not
specific to the CLI, but should be for the x265 package instead (the
dependency on __sync_fetch_and_add_8 comes from the library, not the
cli).


 > This bump includes upstream commit
 > https://bitbucket.org/multicoreware/x265_git/commits/f74b2f38ad850a09524f331f64870e6300fd923b
 > that uses vst1q_s16_x2() which was first added to gcc 9:
 > https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=568421baa5a4cdb7bb7c5ac323c939492ee3f052

 > causing build errors detected by the Gitlab pipelines:
 > /builds/bkuhls/buildroot/br-test-pkg/bootlin-aarch64-glibc-old/build/x265-4.2/source/common/aarch64/pixel-prim.cpp:936:25:
 >  error: ‘vst1q_s16_x2’ was not declared in this scope

 > Disable asm for i386 with musl toolchains to fix linking error detected
 > by the Gitlab pipelines:

 > /builds/bkuhls/buildroot/br-test-pkg/bootlin-x86-i686-musl/build/x265-4.2/source/common/x86/cpu-a.asm:181:
 >  error: ELF format cannot produce non-PC-relative PLT references

It sounds odd to me that the C library would matter for an error
generated for nasm. I did a test build with i686/glibc and see the same
issue:

[ 13%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/mc-a.asm.o
/home/peko/source/buildroot/output-x265b/build/x265-4.2/source/common/x86/cpu-a.asm:181: error: ELF format cannot produce non-PC-relative PLT references

Looking upstream, I see there is a 4.3 release which among bugfixes
lists:

Fix i686 build failure (non-PC-relative PLT references) and PowerPC64
build with Clang.

So maybe worth bumping to that instead?

Care to fix that and resend?

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-10 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-19 14:28 [Buildroot] [PATCH 1/1] package/x265: bump version to 4.2 Bernd Kuhls
2026-10-10 12:46 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox