diff mbox series

[1/2] flac: fix compile failed on musl

Message ID 20260113124504.961856-1-hongxu.jia@windriver.com
State New
Headers show
Series [1/2] flac: fix compile failed on musl | expand

Commit Message

Hongxu Jia Jan. 13, 2026, 12:45 p.m. UTC
$ echo "TCLIBC = 'musl'" >> conf/local.conf
$ echo "MACHINE = 'qemux86'" >> conf/local.conf
$ bitbake flac
...
| libtool: link: (cd .libs/libFLAC++-static.lax/libFLAC-static.a && i686-oe-linux-musl-gcc-arx
"/buildarea5/hjia/oe-core/build/tmp/work/core2-32-oe-linux-musl/flac/1.5.0/build/src/libFLAC++/
../libFLAC/.libs/libFLAC-static.a")
| build/tmp/work/core2-32-oe-linux-musl/flac/1.5.0/recipe-sysroot-native/usr/bin/
i686-oe-linux-musl/../../libexec/i686-oe-linux-musl/gcc/i686-oe-linux-musl/15.2.0/ld:
.libs/metadata.o: in function `FLAC::Metadata::VorbisCo
mment::set_comment(unsigned int, FLAC::Metadata::VorbisComment::Entry const&)':
| /usr/src/debug/flac/1.5.0/src/libFLAC++/metadata.cpp:913:(.text+0x2032): undefined reference to `__stack_chk_fail_local'
...

Disable stack smash protection to workaround the failure

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-multimedia/flac/flac_1.5.0.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ross Burton Jan. 19, 2026, 6:07 p.m. UTC | #1
> On 13 Jan 2026, at 12:45, hongxu via lists.openembedded.org <hongxu.jia=windriver.com@lists.openembedded.org> wrote:
> 
> $ echo "TCLIBC = 'musl'" >> conf/local.conf
> $ echo "MACHINE = 'qemux86'" >> conf/local.conf
> $ bitbake flac
> ...
> | libtool: link: (cd .libs/libFLAC++-static.lax/libFLAC-static.a && i686-oe-linux-musl-gcc-arx
> "/buildarea5/hjia/oe-core/build/tmp/work/core2-32-oe-linux-musl/flac/1.5.0/build/src/libFLAC++/
> ../libFLAC/.libs/libFLAC-static.a")
> | build/tmp/work/core2-32-oe-linux-musl/flac/1.5.0/recipe-sysroot-native/usr/bin/
> i686-oe-linux-musl/../../libexec/i686-oe-linux-musl/gcc/i686-oe-linux-musl/15.2.0/ld:
> .libs/metadata.o: in function `FLAC::Metadata::VorbisCo
> mment::set_comment(unsigned int, FLAC::Metadata::VorbisComment::Entry const&)':
> | /usr/src/debug/flac/1.5.0/src/libFLAC++/metadata.cpp:913:(.text+0x2032): undefined reference to `__stack_chk_fail_local'
> ...
> 
> Disable stack smash protection to workaround the failure

Disabling stack smash protection in a library whose sole job is to parse untrusted files sounds dangerous. Can we just fix the linkage instead?

If this is a case where musl doesn’t implement enough support for GCC’s functionality then the disabling should probably be done globally in security_flags.inc with good references as to why that is being done.

Ross
diff mbox series

Patch

diff --git a/meta/recipes-multimedia/flac/flac_1.5.0.bb b/meta/recipes-multimedia/flac/flac_1.5.0.bb
index d6df801aec..1813b75faa 100644
--- a/meta/recipes-multimedia/flac/flac_1.5.0.bb
+++ b/meta/recipes-multimedia/flac/flac_1.5.0.bb
@@ -26,6 +26,10 @@  EXTRA_OECONF = "--disable-oggtest \
                 --without-libiconv-prefix \
                 "
 
+# /usr/src/debug/flac/1.5.0/src/libFLAC++/metadata.cpp:913:
+# (.text+0x2032): undefined reference to `__stack_chk_fail_local'
+EXTRA_OECONF:append:libc-musl = " --disable-stack-smash-protection"
+
 PACKAGECONFIG ??= " \
     ogg \
 "