From: Ross Burton Date: Wed, 10 Jun 2026 16:06:49 +0000 (+0100) Subject: libedit: fix build on clang+musl X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4eafea679e0fb71dfeee75ffb2012935167182eb;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git libedit: fix build on clang+musl It turns out that the patch I deleted previously[1] is actually needed in builds with both clang and musl. Bring it back, whilst both talking to upstream and resurrecting an old clang patch to resolve the underlying issue. [1] oe-core 1e31746fdc6 ("libedit: upgrade 20251016 -> 20260512") Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-devtools/libedit/libedit/0001-include-stdc-predef.patch b/meta/recipes-devtools/libedit/libedit/0001-include-stdc-predef.patch new file mode 100644 index 0000000000..760044823a --- /dev/null +++ b/meta/recipes-devtools/libedit/libedit/0001-include-stdc-predef.patch @@ -0,0 +1,47 @@ +From 8c92784f65bfd6828bcb05abbbdc0d4d6b3c003d Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Tue, 9 Jun 2026 16:20:56 +0100 +Subject: [PATCH] Explictly include stdc-predef.h + +This header checks the definition of __STDC_ISO_10646__, which according to the +ISO C23 standard[1] will be conditionally defined by the implementation[2]. + +- glibc defines this in stdc-predef.h, which is included by features.h. + +- musl defines this in stdc-predef.h, but nothing else in musl includes it. + +- gcc implicitly includes stdc-predef.h automatically + +- clang does not implicitly include stdc-predef.h (by choice[3]) + +Thus on clang+musl builds this symbol is not defined. Fix the build by +explicitly including this header. + +There is work to fix this upstream in clang[4] but do the easy option and +patch in the missing include for now. + +[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf is a public + draft that is identical to the final standard +[2] § 6.10.10.3 +[3] https://clang.llvm.org/c_dr_status.html +[4] https://github.com/llvm/llvm-project/pull/202919 + +Upstream-Status: Submitted [mail to maintainer] +Signed-off-by: Ross Burton +--- + src/chartype.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/chartype.h b/src/chartype.h +index bcdb293..cb1203d 100644 +--- a/src/chartype.h ++++ b/src/chartype.h +@@ -29,6 +29,8 @@ + #ifndef _h_chartype_f + #define _h_chartype_f + ++#include ++ + /* Ideally we should also test the value of the define to see if it + * supports non-BMP code points without requiring UTF-16, but nothing + * seems to actually advertise this properly, despite Unicode 3.1 having diff --git a/meta/recipes-devtools/libedit/libedit_20260512-3.1.bb b/meta/recipes-devtools/libedit/libedit_20260512-3.1.bb index 897bfbd6f6..9d1b9a9972 100644 --- a/meta/recipes-devtools/libedit/libedit_20260512-3.1.bb +++ b/meta/recipes-devtools/libedit/libedit_20260512-3.1.bb @@ -10,7 +10,9 @@ DEPENDS = "ncurses" inherit autotools -SRC_URI = "http://www.thrysoee.dk/editline/${BP}.tar.gz" +SRC_URI = "http://www.thrysoee.dk/editline/${BP}.tar.gz \ + file://0001-include-stdc-predef.patch \ + " SRC_URI[sha256sum] = "432d5e7ea8b0116dd39f2eca7bc11d0eed77faa6b77ea526ace89907c23ea4a0" # configure hardcodes /usr/bin search path bypassing HOSTTOOLS