package/icu: fix static linking with icu-uc for musl static toolchains
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Shubham,
[add Romain Naour -> author of 0003]
The commit message in patch #3 states it addresses the static linking, but changes the shared linking statement instead. Since it obviously works, probably the commit message is wrong? Or can this patch simply be replaced with yours?
(patch related remarks below)
Quoted 7 lines · Shubham Chakraborty
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.
^^^^
This probably affects not only musl toolchains.
Quoted 23 lines
Upstream: Inactive-Upstream [Buildroot specific]
Signed-off-by Shubham Chakraborty <[email protected]>---
Changes v1 -> v2:
- Fixed the malformed patch
- Removed unnecessary whitespaceSigned-off-by Shubham Chakraborty <[email protected]>--- ...atic-linking-with-icu-uc-static-musl.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patchpackage/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch new file +1
-0@@ -0,0 +1,26 @@ +From 2107f9dfb39eeb6559fb4271c7af8b39aef521ca Mon Sep 17 00:00:00 2001
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch line 11
Quoted 10 lines
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch new file +10
-0+From: Shubham Chakraborty <[email protected]> +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.
The existing 0003-fix-static-linking-with-icu-uc.patch could be replaced with a patch that addresses both issues.
Quoted 13 lines
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch new file +13
-0+ +Upstream: Inactive-Upstream [Buildroot specific] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + 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 +@@ -281,3 +281,3 @@ + ifeq ($(ENABLE_SHARED),) +- @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}"
Quoted 6 lines
'$${baselibs}' >> $@
++ @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}"
'$${baselibs}' -lstdc++ >> $@
+ else
--
2.53.0
Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Andreas,
Thanks for the review.
I will send a v3 that replaces both 0003 and 0004 with a single patch adding -lstdc++ to both Libs and Libs.private, with no musl-specific language.
Romain, would you be okay with me adding your Co-developed-by and Signed-off-by tags to the combined patch?
Best regards,
Shubham Chakraborty
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Resending as previous email bounced from [email protected]. Using gmail address from DEVELOPERS file instead.
Quoted 8 lines · Shubham Chakraborty
Hi Andreas,
Thanks for the review.
I will send a v3 that replaces both 0003 and 0004 with a single patch adding -lstdc++ to both Libs and Libs.private, with no musl-specific language.
Quoted 6 lines
Romain, would you be okay with me adding your Co-developed-by and Signed-off-by tags to the combined patch?
Best regards,
Shubham Chakraborty
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Andreas,
Romain doesn’t seem to be active, so I’d like your guidance on how to proceed.
For v3, would you prefer that I:
1. regenerate a single combined patch (replacing 0003 and 0004) using git format-patch, or
2. keep 0003 and update it by editing the existing patch to include my changes?
Also, in this case, should I keep only my Signed-off-by, or retain Romain’s attribution in some form?
Thanks for your guidance.
Best regards,
Shubham
Quoted 21 lines · Shubham Chakraborty
Resending as previous email bounced from [email protected]. Using gmail address from DEVELOPERS file instead.
Quoted 14 lines · Shubham Chakraborty
Hi Andreas,
Thanks for the review.
I will send a v3 that replaces both 0003 and 0004 with a single patch adding -lstdc++ to both Libs and Libs.private, with no musl-specific language.
Romain, would you be okay with me adding your Co-developed-by and Signed-off-by tags to the combined patch?
Best regards,
Shubham Chakraborty
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Shubham,
Quoted 14 lines · Shubham Chakraborty
Hi Andreas,
Romain doesn’t seem to be active, so I’d like your guidance on how to proceed.
For v3, would you prefer that I:
1. regenerate a single combined patch (replacing 0003 and 0004)
using
git format-patch, or
2. keep 0003 and update it by editing the existing patch to include
my
changes?
Quoted 3 lines
Also, in this case, should I keep only my Signed-off-by, or retain Romain’s attribution in some form?
What I would do is this: Add a comment below the last Signed-off-by, add your Signed-off-by, and then modify the patch itself accordingly.
<example>
Add -lstdc++ in Libs.private of icu-uc.pc.
Fixes:
http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef521ca/
---
This patch currently addresses linking against stdc++ for shared-library builds. Add -lstdc++ to the static build flags also, to fix 'undefined reference' errors when linking programs like xmlcatalog (libxml2) with musl static toolchains.
Upstream: Inactive-Upstream [Buildroot specific]
--- source/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff -git icu.orig/source/Makefile.in icu/source/Makefile.in
</example>
Quoted 4 lines
Thanks for your guidance.
Best regards,
Shubham
<cut>
Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot