package/icu: fix static linking with icu-uc for musl static toolchains
PATCH 1/1 package/icu: fix static linking with icu-uc for musl static toolchains
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]
--- ...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
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch new file +30 -0
@@ -0,0 +1,30 @@ +From 2107f9dfb39eeb6559fb4271c7af8b39aef521ca Mon Sep 17 00:00:00 2001 +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. + +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 +@@ -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++ >> $@
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 1/1 package/icu: fix static linking with icu-uc for musl static toolchains
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]
---
Changes v1 -> v2:
- Fixed the malformed patch
- Removed unnecessary whitespace
--- ...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.patch
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch new file +26 -0
@@ -0,0 +1,26 @@ +From 2107f9dfb39eeb6559fb4271c7af8b39aef521ca Mon Sep 17 00:00:00 2001 +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. + +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}" '$${baselibs}' >> $@ ++ @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' -lstdc++ >> $@ + else
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 1/1 package/icu: fix static linking with icu-uc
Extend the existing patch to also add -lstdc++ to the Libs field, fixing static linking issues with libicuuc.a.
This combines the previous 0003 and 0004 changes into a single patch, following review feedback from Andreas.
---
Changes v2 -> v3:
- Merge previous 0003 and 0004 into a single patch
- Extend existing fix to also add -lstdc++ to Libs (static linking case)
- Keep original authorship and add my Signed-off-by below Romain's
- Update commit message and description based on review feedback
--- .../0003-fix-static-linking-with-icu-uc.patch | 29 ++++++++++++------- ...atic-linking-with-icu-uc-static-musl.patch | 26 ----------------- 2 files changed, 19 insertions(+), 36 deletions(-) delete mode 100644 package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch
package/icu/0003-fix-static-linking-with-icu-uc.patch +19 -10
@@ -3,9 +3,6 @@ From: Romain Naour <[email protected]> Date: Wed, 22 Jul 2015 22:43:25 +0200 Subject: [PATCH] fix static linking with icu-uc -During static linking with a C application and libicuuc.a, --lstdc++ is required. - Add -lstdc++ in Libs.private of icu-uc.pc. Fixes:
@@ -13,14 +10,26 @@ http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 Signed-off-by: Romain Naour <[email protected]> --- - source/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) +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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -diff -git icu.orig/source/Makefile.in icu/source/Makefile.in ---- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 -+++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' >> $@ +diff --git icu.orig/source/Makefile.in icu/source/Makefile.in +--- icu.orig/source/Makefile.in ++++ icu/source/Makefile.in +@@ -279,10 +279,10 @@ 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}' >> $@
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch deleted +0 -26
@@ -1,26 +0,0 @@ -From 2107f9dfb39eeb6559fb4271c7af8b39aef521ca Mon Sep 17 00:00:00 2001 -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. - -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}" '$${baselibs}' >> $@ -+ @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' -lstdc++ >> $@ - else
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3] package/icu: fix static linking with icu-uc
Hi Shubham,
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch
Quoted 81 lines · Shubham Chakraborty
Extend the existing patch to also add -lstdc++ to the Libs field, fixing static linking issues with libicuuc.a.
This combines the previous 0003 and 0004 changes into a single patch, following review feedback from Andreas.
Signed-off-by Shubham Chakraborty <[email protected]>---
Changes v2 -> v3:
- Merge previous 0003 and 0004 into a single patch
- Extend existing fix to also add -lstdc++ to Libs (static linking
case)
- Keep original authorship and add my Signed-off-by below Romain's
- Update commit message and description based on review feedback--- .../0003-fix-static-linking-with-icu-uc.patch | 29 ++++++++++++------- ...atic-linking-with-icu-uc-static-musl.patch | 26 ----------------- 2 files changed, 19 insertions(+), 36 deletions(-) delete mode 100644
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patchpackage/icu/0003-fix-static-linking-with-icu-uc.patch +0
-3@@ -3,9 +3,6 @@ From: Romain Naour <[email protected]> Date: Wed, 22 Jul 2015 22:43:25 +0200 Subject: [PATCH] fix static linking with icu-uc -During static linking with a C application and libicuuc.a, --lstdc++ is required. - Add -lstdc++ in Libs.private of icu-uc.pc. Fixes:@@ -13,14 +10,26 @@http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52
Signed-off-by Romain Naour <[email protected]>---
- source/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-) +This patch currently addresses linking against stdc++ for shared-librarypackage/icu/0003-fix-static-linking-with-icu-uc.patch +9
-5+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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -diff -git icu.orig/source/Makefile.in icu/source/Makefile.in ---- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 -+++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}"'$${baselibs}' >> $@
+diff --git icu.orig/source/Makefile.in icu/source/Makefile.in +--- icu.orig/source/Makefile.in
++++ icu/source/Makefile.in
+@@ -279,10 +279,10 @@ config/icu-uc.pc: config/icu.pcMakefileicudefs.mkpackage/icu/0003-fix-static-linking-with-icu-uc.patch +1
-0+ @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Datalibraries" >> $@
package/icu/0003-fix-static-linking-with-icu-uc.patch +3
-0+ @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}' >> $@package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch deleted +0
-0
Your patch seems not to be based on the current Buildroot master branch. It cannot be applied, unfortunately.
Quoted 25 lines
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch deleted +0
-24@@ -1,26 +0,0 @@ -From 2107f9dfb39eeb6559fb4271c7af8b39aef521ca Mon Sep 17 00:00:00 2001 -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. - -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
Re: [Buildroot] [PATCH v3] package/icu: fix static linking with icu-uc
Hi Andreas,
I have sent a v4 patch which addresses the issue and is based on the current Buildroot master branch.
Best regards,
Shubham Chakraborty
Quoted 118 lines · Andreas Ziegler,
Hi Shubham,
Quoted 37 lines · Shubham Chakraborty
Extend the existing patch to also add -lstdc++ to the Libs field, fixing static linking issues with libicuuc.a.
This combines the previous 0003 and 0004 changes into a single patch, following review feedback from Andreas.
Signed-off-by Shubham Chakraborty <[email protected]>---
Changes v2 -> v3:
- Merge previous 0003 and 0004 into a single patch
- Extend existing fix to also add -lstdc++ to Libs (static linking
case)
- Keep original authorship and add my Signed-off-by below Romain's
- Update commit message and description based on review feedback--- .../0003-fix-static-linking-with-icu-uc.patch | 29 ++++++++++++------- ...atic-linking-with-icu-uc-static-musl.patch | 26 ----------------- 2 files changed, 19 insertions(+), 36 deletions(-) delete mode 100644
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patchpackage/icu/0003-fix-static-linking-with-icu-uc.patch +0
-3@@ -3,9 +3,6 @@ From: Romain Naour <[email protected]> Date: Wed, 22 Jul 2015 22:43:25 +0200 Subject: [PATCH] fix static linking with icu-uc -During static linking with a C application and libicuuc.a, --lstdc++ is required. - Add -lstdc++ in Libs.private of icu-uc.pc. Fixes:package/icu/0003-fix-static-linking-with-icu-uc.patch line 10
Quoted 1 line
package/icu/0003-fix-static-linking-with-icu-uc.patch +0
-0@@ -13,14 +10,26 @@http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch
Quoted 46 lines
package/icu/0003-fix-static-linking-with-icu-uc.patch +1
-2Signed-off-by: Romain Naour <[email protected]> --- - source/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) +This patch currently addresses linking against stdc++ forshared-library
package/icu/0003-fix-static-linking-with-icu-uc.patch +9
-5+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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -diff -git icu.orig/source/Makefile.in icu/source/Makefile.in ---- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 -+++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}"'$${baselibs}' >> $@
+diff --git icu.orig/source/Makefile.in icu/source/Makefile.in +--- icu.orig/source/Makefile.in
++++ icu/source/Makefile.in
+@@ -279,10 +279,10 @@ config/icu-uc.pc: config/icu.pcMakefileicudefs.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}' >> $@
diff --gita/package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patchb/package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patchdeleted file mode 100644
index e17f6ac775..0000000000package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch deleted +0
-0Your patch seems not to be based on the current Buildroot master branch. It cannot be applied, unfortunately.
Quoted 26 lines
package/icu/0004-fix-static-linking-with-icu-uc-static-musl.patch deleted +0
-24@@ -1,26 +0,0 @@ -From 2107f9dfb39eeb6559fb4271c7af8b39aef521ca Mon Sep 17 00:00:00 2001 -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. - -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}"'$${baselibs}' >> $@
Quoted 9 lines
Quoted 5 lines
-+ @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}"
'$${baselibs}' -lstdc++ >> $@
- else
--
2.53.0Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 1/1 Extend the existing patch to also add -lstdc++ to the Libs field, fixing static linking issues with libicuuc.a.
In reply to Shubham ChakrabortyThis combines the previous 0003 and 0004 changes into a single patch, following review feedback from Andreas.
---
Changes v3 -> v4:
- Clean up patch to remove deleted 0004 patch file
- Ensure only 0003 patch is modified; no extra files or deletions
- Remove any rebase or history artifacts that caused previous patch failures
--- .../0003-fix-static-linking-with-icu-uc.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
package/icu/0003-fix-static-linking-with-icu-uc.patch +16 -4
@@ -13,14 +13,26 @@ http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 Signed-off-by: Romain Naour <[email protected]> --- - source/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) +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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff -git icu.orig/source/Makefile.in icu/source/Makefile.in --- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 +++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' >> $@ +@@ -276,10 +276,10 @@ 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}' >> $@
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v4] Extend the existing patch to also add -lstdc++ to the Libs field, fixing static linking issues with libicuuc.a.
Hi Shubham,
Applying this patch now works, build fails, please see below ...
Quoted 2 lines · Shubham Chakraborty
This combines the previous 0003 and 0004 changes into a single patch, following review feedback from Andreas.
Your previous commit messages were more descriptive. Also 0004 never existed in the Buildroot sources ...
Quoted 40 lines
Signed-off-by Shubham Chakraborty <[email protected]>------
Changes v3 -> v4:
- Clean up patch to remove deleted 0004 patch file
- Ensure only 0003 patch is modified; no extra files or deletions
- Remove any rebase or history artifacts that caused previous patch
failures--- .../0003-fix-static-linking-with-icu-uc.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)package/icu/0003-fix-static-linking-with-icu-uc.patch +0
-0@@ -13,14 +13,26 @@http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52
Signed-off-by Romain Naour <[email protected]>---
- source/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-) +This patch currently addresses linking against stdc++ for shared-librarypackage/icu/0003-fix-static-linking-with-icu-uc.patch +9
-2+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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff -git icu.orig/source/Makefile.in icu/source/Makefile.in --- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 +++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}"
Quoted 6 lines
'$${baselibs}' >> $@
+@@ -276,10 +276,10 @@ config/icu-uc.pc: config/icu.pcMakefileicudefs.mk
+ @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data
libraries" >> $@
+ @echo "Name: $(PACKAGE)-uc" >> $@
There are eight space characters in the resulting patch, the icu Makefile uses one tab. The build fails with:
Applying 0003-fix-static-linking-with-icu-uc.patch using patch:
patching file source/Makefile.in
Hunk #1 FAILED at 276.
1 out of 1 hunk FAILED -- saving rejects to file source/Makefile.in.rej
Quoted 10 lines
+ 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}' >> $@
--
2.53.0
Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v4] Extend the existing patch to also add -lstdc++ to the Libs field, fixing static linking issues with libicuuc.a.
Hey Andreas,
Apologies for sending a messy patch again. I'll clean up the formatting and ensure only the necessary changes from 0003 and more descriptive commit message are present in v5.
Best regards,
Shubham
Quoted 79 lines · Andreas Ziegler,
Hi Shubham,
Applying this patch now works, build fails, please see below ...
Quoted 2 lines · Shubham Chakraborty
This combines the previous 0003 and 0004 changes into a single patch, following review feedback from Andreas.
Your previous commit messages were more descriptive. Also 0004 never existed in the Buildroot sources ...
Quoted 18 lines
Signed-off-by Shubham Chakraborty <[email protected]>------
Changes v3 -> v4:
- Clean up patch to remove deleted 0004 patch file
- Ensure only 0003 patch is modified; no extra files or deletions
- Remove any rebase or history artifacts that caused previous patch
failures--- .../0003-fix-static-linking-with-icu-uc.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)package/icu/0003-fix-static-linking-with-icu-uc.patch +0
-0package/icu/0003-fix-static-linking-with-icu-uc.patch line 13
Quoted 1 line
package/icu/0003-fix-static-linking-with-icu-uc.patch +0
-0@@ -13,14 +13,26 @@http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52
Quoted 22 lines
package/icu/0003-fix-static-linking-with-icu-uc.patch +1
-2Signed-off-by: Romain Naour <[email protected]> --- - source/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) +This patch currently addresses linking against stdc++ forshared-library
package/icu/0003-fix-static-linking-with-icu-uc.patch +9
-2+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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff -git icu.orig/source/Makefile.in icu/source/Makefile.in --- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 +++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}"Quoted 6 lines
'$${baselibs}' >> $@
+@@ -276,10 +276,10 @@ config/icu-uc.pc: config/icu.pcMakefileicudefs.mk
+ @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data
libraries" >> $@
+ @echo "Name: $(PACKAGE)-uc" >> $@There are eight space characters in the resulting patch, the icu
Makefileuses one tab. The build fails with:Applying 0003-fix-static-linking-with-icu-uc.patch using patch:
patching file source/Makefile.in
Hunk #1 FAILED at 276.
1 out of 1 hunk FAILED -- saving rejects to file source/Makefile.in.rejQuoted 10 lines
+ 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}' >> $@
--
2.53.0
Quoted 3 lines
Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 1/1 icu: fix static linking by adding -lstdc++ to pkg-config
In reply to Shubham ChakrabortyThe ICU library requires C++ standard library when linking statically. Without this, applications using pkg-config --libs --static icu-uc will fail to link with undefined reference errors to C++ symbols.
This patch extends the existing fix for static linking to also add -lstdc++ to the Libs field in the pkg-config file when building in static-only mode (ENABLE_SHARED is not set).
--- .../0003-fix-static-linking-with-icu-uc.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
package/icu/0003-fix-static-linking-with-icu-uc.patch +16 -4
@@ -13,14 +13,26 @@ http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 Signed-off-by: Romain Naour <[email protected]> --- - source/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) +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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff -git icu.orig/source/Makefile.in icu/source/Makefile.in --- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 +++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' >> $@ +@@ -276,10 +276,10 @@ + @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}' >> $@
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v5] icu: fix static linking by adding -lstdc++ to pkg-config
Hi Shubham,
Thank you!
Quoted 4 lines · Shubham Chakraborty
The ICU library requires C++ standard library when linking statically. Without this, applications using pkg-config --libs --static icu-uc will fail to link with undefined reference errors to C++ symbols.
Quoted 9 lines
This patch extends the existing fix for static linking to also add -lstdc++ to the Libs field in the pkg-config file when building in static-only mode (
ENABLE_SHAREDis not set).Signed-off-by Shubham Chakraborty <[email protected]>--- .../0003-fix-static-linking-with-icu-uc.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v5] icu: fix static linking by adding -lstdc++ to pkg-config
In reply to Shubham ChakrabortyQuoted 5 lines · Shubham Chakraborty
The ICU library requires C++ standard library when linking statically. Without this, applications using pkg-config --libs --static icu-uc will fail to link with undefined reference errors to C++ symbols.
This patch extends the existing fix for static linking to also add
Write this imperatively: "Extend the existing fix ...".
Quoted 4 lines
-lstdc++ to the Libs field in the pkg-config file when building in static-only mode (
ENABLE_SHAREDis not set).Signed-off-by Shubham Chakraborty <[email protected]>
Applied to master, thanks!
One important thing that was missing is a link to the autobuild failure.
Quoted 9 lines
--- .../0003-fix-static-linking-with-icu-uc.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)package/icu/0003-fix-static-linking-with-icu-uc.patch +0
-0
package/icu/0003-fix-static-linking-with-icu-uc.patch http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 · line 19
Quoted 9 lines
package/icu/0003-fix-static-linking-with-icu-uc.patch +4
-2@@ -13,14 +13,26 @@ http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 Signed-off-by: Romain Naour <[email protected]> --- - source/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) +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.
This should have been added to the original message, not below it.
package/icu/0003-fix-static-linking-with-icu-uc.patch http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 · line 21
Quoted 2 lines
package/icu/0003-fix-static-linking-with-icu-uc.patch +2
-0+ +Upstream: Inactive-Upstream [Buildroot specific]
It's not actually Buildroot specific, it could certainly be submitted upstream.
It's just that nobody ever did that.
Regards,
Arnout
Quoted 21 lines
package/icu/0003-fix-static-linking-with-icu-uc.patch +10
-2+Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff -git icu.orig/source/Makefile.in icu/source/Makefile.in --- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 +++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@ - @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' >> $@ +@@ -276,10 +276,10 @@ + @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}' >> $@Signature · 1 line
2.53.0
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Raphaël Mélotte via buildroot
AppliedRe: [Buildroot] [PATCH v5] icu: fix static linking by adding -lstdc++ to pkg-config
In reply to Shubham ChakrabortyIn reply of:
Quoted 10 lines
The ICU library requires C++ standard library when linking statically. Without this, applications using pkg-config --libs --static icu-uc will fail to link with undefined reference errors to C++ symbols.
This patch extends the existing fix for static linking to also add -lstdc++ to the Libs field in the pkg-config file when building in static-only mode (
ENABLE_SHAREDis not set).Signed-off-by Shubham Chakraborty <[email protected]>Acked-by Andreas Ziegler <[email protected]>
Applied to 2026.08.x. Thanks
Quoted 29 lines
--- .../0003-fix-static-linking-with-icu-uc.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)package/icu/0003-fix-static-linking-with-icu-uc.patch +10
-3@@ -13,14 +13,26 @@ http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 Signed-off-by: Romain Naour <[email protected]> --- - source/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) +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] +Signed-off-by: Shubham Chakraborty <[email protected]> +--- + source/Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff -git icu.orig/source/Makefile.in icu/source/Makefile.in --- icu.orig/source/Makefile.in 2025-03-13 19:31:23.000000000 +0100 +++ icu/source/Makefile.in 2025-09-22 08:56:36.791792784 +0200 -@@ -279,7 +279,7 @@
package/icu/0003-fix-static-linking-with-icu-uc.patch http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52 · line 38
Quoted 10 lines
package/icu/0003-fix-static-linking-with-icu-uc.patch +6
-1- @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" '$${baselibs}' >> $@ +@@ -276,10 +276,10 @@ + @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}' >> $@
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/1 DEVELOPERS: add entry for Shubham Chakraborty (unrar)
In reply to Shubham Chakraborty--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)
DEVELOPERS +1 -0
@@ -3049,6 +3049,7 @@ F: package/dos2unix/ F: package/htop/ F: package/hyperfine/ F: package/pv/ +F: package/unrar/ N: Simon Dawson <[email protected]> F: boot/at91bootstrap3/
Signature · 6 lines
2.54.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH] DEVELOPERS: add entry for Shubham Chakraborty (unrar)
Quoted 1 line · Shubham Chakraborty
Signed-off-by Shubham Chakraborty <[email protected]>
Applied both to master, thanks.
Regards,
Arnout
Quoted 9 lines
--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)DEVELOPERS +0
-0
DEVELOPERS F: package/dos2unix/ · line 3055
Quoted 7 lines
DEVELOPERS +1
-0@@ -3049,6 +3049,7 @@ F: package/dos2unix/ F: package/htop/ F: package/hyperfine/ F: package/pv/ +F: package/unrar/ N: Simon Dawson <[email protected]> F: boot/at91bootstrap3/
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/1 DEVELOPERS: add entry for Shubham Chakraborty (xterm)
In reply to Shubham Chakraborty--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)
DEVELOPERS +1 -0
@@ -3049,6 +3049,7 @@ F: package/dos2unix/ F: package/htop/ F: package/hyperfine/ F: package/pv/ +F: package/xterm/ N: Simon Dawson <[email protected]> F: boot/at91bootstrap3/
Signature · 6 lines
2.54.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot