From 68e71cde3069d0875e8bf30ebed509b157044de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Sat, 24 Aug 2024 22:11:02 +0200 Subject: [PATCH] package/x264: disable assembly code on x86 + musl + PIC/PIE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The x264 package uses large amounts of non-PIC assembly code (e.g. common/x86/dct-a.asm), which results in textrels, which aren't supported by musl-libc's dynamic linker. Disable x264's assembly code when compiling for x86 with PIC/PIE and musl-libc to avoid this particular incompatibility. Reported-by: Yann Morin Fixes: https://lore.kernel.org/buildroot/ZrsirnrvgsEIpAJI@tl-lnx-nyma7486-2/ Signed-off-by: J. Neuschäfer Signed-off-by: Thomas Petazzoni (cherry picked from commit 0196ec4198771e5fe83d6df02c7cd3b13c0ce05f) Signed-off-by: Peter Korsgaard --- package/x264/x264.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/x264/x264.mk b/package/x264/x264.mk index 97caf19466..e96d993017 100644 --- a/package/x264/x264.mk +++ b/package/x264/x264.mk @@ -14,9 +14,15 @@ X264_INSTALL_STAGING = YES X264_CONF_OPTS = --disable-avs --disable-lavf --disable-swscale ifeq ($(BR2_i386)$(BR2_x86_64),y) +ifeq ($(BR2_TOOLCHAIN_USES_MUSL)$(BR2_PIC_PIE),yy) +# libx264 uses large amounts of non-pic assembly code, resulting in text +# section relocations, which are not supported on musl-libc's ld.so. +X264_CONF_OPTS += --disable-asm +else # nasm needed for assembly files X264_DEPENDENCIES += host-nasm X264_CONF_ENV += AS="$(HOST_DIR)/bin/nasm" +endif else ifeq ($(BR2_ARM_CPU_ARMV7A)$(BR2_aarch64),y) # We need to pass gcc as AS, because the ARM assembly files have to be # preprocessed