Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/x264: disable assembly code on x86 + musl + PIC/PIE
@ 2024-08-24 20:11 J. Neuschäfer via buildroot
  2024-08-25 13:06 ` Thomas Petazzoni via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: J. Neuschäfer via buildroot @ 2024-08-24 20:11 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Yann Morin, David du Colombier, J. Neuschäfer

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 <yann.morin@orange.com>
Fixes: https://lore.kernel.org/buildroot/ZrsirnrvgsEIpAJI@tl-lnx-nyma7486-2/
Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
---
 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

---
base-commit: 8bd00c16d8af2b4b620a0b2c136e6830b9d6b3a0
change-id: 20240824-x264-textrel-61f3a8689d9f

Best regards,
--
J. Neuschäfer <j.neuschaefer@gmx.net>

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

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

end of thread, other threads:[~2024-09-18 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-24 20:11 [Buildroot] [PATCH] package/x264: disable assembly code on x86 + musl + PIC/PIE J. Neuschäfer via buildroot
2024-08-25 13:06 ` Thomas Petazzoni via buildroot
2024-08-25 18:41   ` J. Neuschäfer via buildroot
     [not found] ` <20240825150652.09dcab72__4297.44312293536$1724591243$gmane$org@windsurf>
2024-08-25 13:33   ` Bernd Kuhls
2024-09-18 17:05 ` Peter Korsgaard

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