libedit: fix build on clang+musl
PATCH 1/1 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 <[email protected]>
--- .../libedit/0001-include-stdc-predef.patch | 47 +++++++++++++++++++ .../libedit/libedit_20260512-3.1.bb | 4 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/libedit/libedit/0001-include-stdc-predef.patch
meta/recipes-devtools/libedit/libedit/0001-include-stdc-predef.patch new file +47 -0
@@ -0,0 +1,47 @@ +From 8c92784f65bfd6828bcb05abbbdc0d4d6b3c003d Mon Sep 17 00:00:00 2001 +From: Ross Burton <[email protected]> +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 <[email protected]> +--- + 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 <stdc-predef.h> ++ + /* 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
meta/recipes-devtools/libedit/libedit_20260512-3.1.bb +3 -1
@@ -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
Signature · 1 line
2.43.0