[Buildroot] [PATCH] package/icu: fix static linking with icu-uc for musl static toolchains
Shubham Chakraborty
chakrabortyshubham66 at gmail.com
Tue Mar 3 16:28:07 UTC 2026
During static linking with a C application and libicuuc.a,
-lstdc++ is required. The previous patch (0003) only addressed the
shared library case (Libs.private). This patch adds -lstdc++
to the main Libs line for the static case to fix undefined
reference errors when linking programs like xmlcatalog (libxml2)
with musl static toolchains.
Upstream: Inactive-Upstream [Buildroot specific]
Signed-off-by: Shubham Chakraborty <chakrabortyshubham66 at gmail.com>
---
...atic-linking-with-icu-uc-static-musl.patch | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch
diff --git a/package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch b/package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch
new file mode 100644
index 0000000000..40d3aa21a2
--- /dev/null
+++ b/package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch
@@ -0,0 +1,30 @@
+From 2107f9dfb39eeb6559fb4271c7af8b39aef521ca Mon Sep 17 00:00:00 2001
+From: Shubham Chakraborty <chakrabortyshubham66 at gmail.com>
+Date: Tue, 3 Mar 2026 10:00:00 +0000
+Subject: [PATCH] fix static linking with icu-uc (static case)
+
+During static linking with a C application and libicuuc.a,
+-lstdc++ is required. The previous patch (0003) only addressed the
+shared library case (Libs.private). This patch adds -lstdc++ to the
+main Libs line for the static case to fix undefined reference
+errors when linking programs like xmlcatalog (libxml2) with
+musl toolchains.
+
+Upstream: Inactive-Upstream [Buildroot specific]
+Signed-off-by: Shubham Chakraborty <chakrabortyshubham66 at gmail.com>
+---
+ source/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff -git icu.orig/source/Makefile.in icu/source/Makefile.in
+--- icu.orig/source/Makefile.in
++++ icu/source/Makefile.in
+@@ -278,7 +278,7 @@ config/icu-uc.pc: config/icu.pc Makefile icudefs.mk
+ @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data libraries" >> $@
+ @echo "Name: $(PACKAGE)-uc" >> $@
+ ifeq ($(ENABLE_SHARED),)
+- @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' >> $@
++ @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' -lstdc++ >> $@
+ else
+ @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" >> $@
+ @echo "Libs.private:" "${ICULIBS_DT}" '$${baselibs}' -lstdc++ >> $@
--
2.53.0
More information about the buildroot
mailing list