Skip to contentSkip to conversation

libedit: fix build error with musl toolchain

PATCH New Sergio Prado 3 participants 4 messages Jan 7, 2016 – Jan 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libedit: fix build error with musl toolchain

Libedit build fails when __STDC_ISO_10646__ is not defined, and that is the case when compiling with musl toolchains.

chartype.h:52:3: error: #error wchar_t must store ISO 10646 characters
#error wchar_t must store ISO 10646 characters
^

Musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__, so let's define it manually.

Fixes:
http://autobuild.buildroot.net/results/3d12a7e6423d236c9d528bca7cbcf86b1499d738/
http://autobuild.buildroot.net/results/b92f7e2b86ffa575d8a8a0b91fbdd9bcb0f231de/
http://autobuild.buildroot.net/results/c476a48936f8810117bb292fb0d8a43c09068de6/
http://autobuild.buildroot.net/results/a30bb1423cc92137a2deaec0a32c7df947384d49/

---
 package/libedit/libedit.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/libedit/libedit.mk +6 -0
index 87a1cdc136d6..e7ddd1fcb562 100644
@@ -23,6 +23,12 @@ LIBEDIT_POST_EXTRACT_HOOKS += LIBEDIT_FIXUP_M4_DIR
 # Doesn't really support !wchar, but support is disabled otherwise
 LIBEDIT_CONF_OPTS += --enable-widec
 
+# musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__,
+# so let's define it manually
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+LIBEDIT_CONF_OPTS += CFLAGS="$(TARGET_CFLAGS) -D__STDC_ISO_10646__=201103L"
+endif
+
 # Note: libbsd required for *vis functions, but works only with a toolchain
 # with __progname; otherwise, some features are disabled, as if libbsd was
 # missing entirely.
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 libedit: fix build error with musl toolchain

Am Wed, 06 Jan 2016 22:41:17 -0200 schrieb Sergio Prado:

Review

Quoted 4 lines
(quoted diff) +3 -1
+# musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__,
+# so let's define it manually +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+LIBEDIT_CONF_OPTS += CFLAGS="$(TARGET_CFLAGS)
-D__STDC_ISO_10646__=201103L" +endif +

Hi,

compile-tested using this defconfig:
http://autobuild.buildroot.net/toolchains/configs/br-arm-cortex-a9-musl.config

Regards, Bernd

#2 lore raw

PATCH 1/1 libedit: fix build error with musl toolchain

In reply to Sergio Prado
Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sergio" == Sergio Prado <[email protected]> writes:

Libedit build fails when __STDC_ISO_10646__ is not defined, and that is the case when compiling with musl toolchains.

chartype.h:52:3: error: #error wchar_t must store ISO 10646 characters
#error wchar_t must store ISO 10646 characters
^

Musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__, so let's define it manually.

Fixes:
http://autobuild.buildroot.net/results/3d12a7e6423d236c9d528bca7cbcf86b1499d738/
http://autobuild.buildroot.net/results/b92f7e2b86ffa575d8a8a0b91fbdd9bcb0f231de/
http://autobuild.buildroot.net/results/c476a48936f8810117bb292fb0d8a43c09068de6/
http://autobuild.buildroot.net/results/a30bb1423cc92137a2deaec0a32c7df947384d49/

---
 package/libedit/libedit.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/libedit/libedit.mk +0 -0
index 87a1cdc136d6..e7ddd1fcb562 100644

package/libedit/libedit.mk LIBEDIT_POST_EXTRACT_HOOKS += LIBEDIT_FIXUP_M4_DIR · line 30

Quoted 8 lines
package/libedit/libedit.mk +5 -0
@@ -23,6 +23,12 @@ LIBEDIT_POST_EXTRACT_HOOKS += LIBEDIT_FIXUP_M4_DIR
 # Doesn't really support !wchar, but support is disabled otherwise
 LIBEDIT_CONF_OPTS += --enable-widec
 
+# musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__,
+# so let's define it manually
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+LIBEDIT_CONF_OPTS += CFLAGS="$(TARGET_CFLAGS) -D__STDC_ISO_10646__=201103L"
+endif

Committed, thanks. Out of interest, why did you exactly select 201103?

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 libedit: fix build error with musl toolchain

2016-01-18 20:04 GMT-02:00 Peter Korsgaard <[email protected]>:

Quoted 10 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Sergio" == Sergio Prado <[email protected]> writes:

Libedit build fails when __STDC_ISO_10646__ is not defined, and that is the case when compiling with musl toolchains.

chartype.h:52:3: error: #error wchar_t must store ISO 10646 characters
#error wchar_t must store ISO 10646 characters
^

Quoted 5 lines
Quoted 5 lines

Musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__, so let's define it manually.

Fixes:

http://autobuild.buildroot.net/results/3d12a7e6423d236c9d528bca7cbcf86b1499d738/

Quoted 1 line
Quoted 1 line

http://autobuild.buildroot.net/results/b92f7e2b86ffa575d8a8a0b91fbdd9bcb0f231de/

Quoted 1 line
Quoted 1 line

http://autobuild.buildroot.net/results/c476a48936f8810117bb292fb0d8a43c09068de6/

Quoted 1 line
Quoted 1 line

http://autobuild.buildroot.net/results/a30bb1423cc92137a2deaec0a32c7df947384d49/

Quoted 14 lines
Quoted 13 lines
---
 package/libedit/libedit.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/libedit/libedit.mk +0 -0
index 87a1cdc136d6..e7ddd1fcb562 100644
@@ -23,6 +23,12 @@ LIBEDIT_POST_EXTRACT_HOOKS += LIBEDIT_FIXUP_M4_DIR
 # Doesn't really support !wchar, but support is disabled otherwise
 LIBEDIT_CONF_OPTS += --enable-widec
Quoted 4 lines

package/libedit/libedit.mk LIBEDIT_POST_EXTRACT_HOOKS += LIBEDIT_FIXUP_M4_DIR

Quoted 4 lines
package/libedit/libedit.mk +4 -0
+# musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__,
+# so let's define it manually
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+LIBEDIT_CONF_OPTS += CFLAGS="$(TARGET_CFLAGS)

-D__STDC_ISO_10646__=201103L"

Quoted 3 lines

package/libedit/libedit.mk LIBEDIT_POST_EXTRACT_HOOKS += LIBEDIT_FIXUP_M4_DIR · line 30

Quoted 1 line
package/libedit/libedit.mk +1 -0
+endif

Committed, thanks. Out of interest, why did you exactly select 201103?

For no specific reason. I have just selected the same value used by glibc.

Quoted 3 lines

--
Bye, Peter Korsgaard

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160119/0f0fa758/attachment.html>