Skip to contentSkip to conversation

package/icu: fix static linking with icu-uc for musl static toolchains

PATCH Superseded Shubham Chakraborty 3 participants 15 messages Mar 3 – Oct 16

lore
Share & tools
lore
#0 lore raw

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
new file mode 100644
index 0000000000..40d3aa21a2
@@ -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
#1 lore raw

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
new file mode 100644
index 0000000000..e17f6ac775
@@ -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
#2 lore raw

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
index 36a3d1f696..ec393254e8 100644
@@ -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
deleted file mode 100644
index e17f6ac775..0000000000
@@ -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
#3 lore raw

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.

---
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 +0 -3
index 36a3d1f696..ec393254e8 100644
@@ -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

---
- source/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-) +This patch currently addresses linking against stdc++ for shared-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.pc Makefile icudefs.mk

package/icu/0003-fix-static-linking-with-icu-uc.patch +1 -0
+ 	@echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data 

libraries" >> $@

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
deleted file mode 100644
index e17f6ac775..0000000000

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

#4 lore raw

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.

---
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 +0 -3
index 36a3d1f696..ec393254e8 100644
@@ -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 -2
 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

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.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}' >> $@
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 deleted file mode 100644
index e17f6ac775..0000000000

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 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.0

Kind regards,
Andreas

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

#5 lore raw

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 Chakraborty

This 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
index 36a3d1f696..c58f2700ee 100644
@@ -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
#6 lore raw

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

---
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
index 36a3d1f696..c58f2700ee 100644
@@ -13,14 +13,26 @@ 

http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef52

---
- source/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-) +This patch currently addresses linking against stdc++ for shared-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.pc Makefile icudefs.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

#7 lore raw

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

---
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
index 36a3d1f696..c58f2700ee 100644

package/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 -2
 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

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.pc Makefile icudefs.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

Quoted 3 lines

Kind regards,
Andreas

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

#8 lore raw

PATCH v5 1/1 icu: fix static linking by adding -lstdc++ to pkg-config

In reply to 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 -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
index 36a3d1f696..d74aca8088 100644
@@ -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
Acked-by on v5 1/1
#9 lore raw

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_SHARED is not set).

---
 .../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

#10 lore raw

Re: [Buildroot] [PATCH v5] icu: fix static linking by adding -lstdc++ to pkg-config

In reply to Shubham Chakraborty
Quoted 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_SHARED is not set).

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
index 36a3d1f696..d74aca8088 100644

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

#11 lore raw

Re: [Buildroot] [PATCH v5] icu: fix static linking by adding -lstdc++ to pkg-config

In reply to Shubham Chakraborty

In 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_SHARED is not set).

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
index 36a3d1f696..d74aca8088 100644
@@ -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

#12 lore raw

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
index a00627b28c..0f47e5e80f 100644
@@ -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
#13 lore raw

Re: [Buildroot] [PATCH] DEVELOPERS: add entry for Shubham Chakraborty (unrar)

Quoted 1 line · Shubham Chakraborty

Applied both to master, thanks.

Regards,
Arnout

Quoted 9 lines
---
  DEVELOPERS | 1 +
  1 file changed, 1 insertion(+)
DEVELOPERS +0 -0
index a00627b28c..0f47e5e80f 100644

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

#14 lore raw

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
index a00627b28c..dc8be7fa9a 100644
@@ -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