Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/xterm: fix compilation with uClibc
@ 2023-09-03  7:51 Waldemar Brodkorb
  2023-09-11 20:55 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Waldemar Brodkorb @ 2023-09-03  7:51 UTC (permalink / raw)
  To: buildroot

Compile errors out with:
./util.c: In function 'decode_wcwidth':
./util.c:5506:26: error: 'wcwidth' undeclared (first use in this function); did you mean 'mk_wcwidth'?
 5506 |             my_wcwidth = wcwidth;
      |                          ^~~~~~~
      |                          mk_wcwidth
./util.c:5506:26: note: each undeclared identifier is reported only once for each function it appears in

uClibc only exposes wcwidth when __USE_XOPEN is defined.

Fixes:
 - http://autobuild.buildroot.net/results/1c0/1c03a8016d480d9c3fc3112849b1a125df243cab

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 package/xterm/0001-uClibc-wcwidth.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 package/xterm/0001-uClibc-wcwidth.patch

diff --git a/package/xterm/0001-uClibc-wcwidth.patch b/package/xterm/0001-uClibc-wcwidth.patch
new file mode 100644
index 0000000000..ee0416ec78
--- /dev/null
+++ b/package/xterm/0001-uClibc-wcwidth.patch
@@ -0,0 +1,13 @@
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+Upstream: N/A patch sent via email
+diff -Nur xterm-376.orig/util.c xterm-376/util.c
+--- xterm-376.orig/util.c	2022-09-25 19:46:22.000000000 +0200
++++ xterm-376/util.c	2023-09-03 09:05:36.227133537 +0200
+@@ -69,6 +69,7 @@
+ 
+ #if OPT_WIDE_CHARS
+ #if defined(HAVE_WCHAR_H) && defined(HAVE_WCWIDTH)
++#define __USE_XOPEN
+ #include <wchar.h>
+ #endif
+ #include <wcwidth.h>
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH] package/xterm: fix compilation with uClibc
  2023-09-03  7:51 [Buildroot] [PATCH] package/xterm: fix compilation with uClibc Waldemar Brodkorb
@ 2023-09-11 20:55 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-09-11 20:55 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

On Sun, 3 Sep 2023 09:51:43 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:

> Compile errors out with:
> ./util.c: In function 'decode_wcwidth':
> ./util.c:5506:26: error: 'wcwidth' undeclared (first use in this function); did you mean 'mk_wcwidth'?
>  5506 |             my_wcwidth = wcwidth;
>       |                          ^~~~~~~
>       |                          mk_wcwidth
> ./util.c:5506:26: note: each undeclared identifier is reported only once for each function it appears in
> 
> uClibc only exposes wcwidth when __USE_XOPEN is defined.

According to the wcwidth manpage, it's _XOPEN_SOURCE that needs to be
defined:

SYNOPSIS
       #define _XOPEN_SOURCE       /* See feature_test_macros(7) */
       #include <wchar.h>

       int wcwidth(wchar_t c);

I guess __USE_XOPEN is a more "internal" thing.

> diff --git a/package/xterm/0001-uClibc-wcwidth.patch b/package/xterm/0001-uClibc-wcwidth.patch
> new file mode 100644
> index 0000000000..ee0416ec78
> --- /dev/null
> +++ b/package/xterm/0001-uClibc-wcwidth.patch
> @@ -0,0 +1,13 @@
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +Upstream: N/A patch sent via email

Meh these upstream projects not using Git... :/

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-11 20:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-03  7:51 [Buildroot] [PATCH] package/xterm: fix compilation with uClibc Waldemar Brodkorb
2023-09-11 20:55 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox