Skip to contentSkip to conversation

package/harfbuzz: fix build failure with GCC 15

PATCH In review Giulio Benetti 2 participants 2 messages Oct 29 – Nov 6

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/harfbuzz: fix build failure with GCC 15

HarfBuzz 15.0.0 enables _GLIBCXX_ASSERTIONS, which introduces references to std::__glibcxx_assert_fail(). By default, HarfBuzz uses the C linker, which does not link against libstdc++. This results in undefined references to std::__glibcxx_assert_fail() when building with GCC 15.

So let's enable the with_libstdcxx Meson option to use the C++ linker and fix the build.

Fixes:
https://autobuild.buildroot.org/results/f88449ca8a3846ed2bdbcabc00a701ba73ebd5ac/

---
 package/harfbuzz/harfbuzz.mk | 3 +++
 1 file changed, 3 insertions(+)
package/harfbuzz/harfbuzz.mk +3 -0
index a68d8658b8..7395a2a93c 100644
@@ -94,5 +94,8 @@ ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
 HARFBUZZ_CXXFLAGS += $(TARGET_CXXFLAGS) -DHB_NO_MT
 endif
 
+# Harfbuzz uses C linker by default, force C++ linker
+HARFBUZZ_CONF_OPTS += -Dwith_libstdcxx=true
+
 $(eval $(meson-package))
 $(eval $(host-meson-package))
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Tested-by Michael Nosthoff on v1 1/1
#1 lore raw

Hi Giulio, all

Quoted 8 lines · Giulio Benetti

HarfBuzz 15.0.0 enables _GLIBCXX_ASSERTIONS, which introduces references to std::__glibcxx_assert_fail(). By default, HarfBuzz uses the C linker, which does not link against libstdc++. This results in undefined references to std::__glibcxx_assert_fail() when building with GCC 15.

So let's enable the with_libstdcxx Meson option to use the C++ linker and fix the build.

The issue seems to only appear when BR2_OPTIMIZE_0=y is set. With the default BR2_OPTIMIZE=2 the build succeeds.

Quoted 2 lines

Fixes:
https://autobuild.buildroot.org/results/f88449ca8a3846ed2bdbcabc00a701ba73ebd5ac/

I think we should also add

Fixes b82efddfa9 ("package/harfbuzz: bump version to 15.0.0")

Regards,
Michael

Quoted 26 lines
---
 package/harfbuzz/harfbuzz.mk | 3 +++
 1 file changed, 3 insertions(+)
package/harfbuzz/harfbuzz.mk +3 -0
index a68d8658b8..7395a2a93c 100644
@@ -94,5 +94,8 @@ ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
 HARFBUZZ_CXXFLAGS += $(TARGET_CXXFLAGS) -DHB_NO_MT
 endif
 
+# Harfbuzz uses C linker by default, force C++ linker
+HARFBUZZ_CONF_OPTS += -Dwith_libstdcxx=true
+
 $(eval $(meson-package))
 $(eval $(host-meson-package))
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot