diff --git a/recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch b/recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch
new file mode 100644
index 0000000..62317a2
--- /dev/null
+++ b/recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch
@@ -0,0 +1,21 @@
+From: Etienne Cordonnier <ecordonnier@snap.com>
+Subject: [PATCH] chartype.h: don't include stdc-predef.h on Apple
+
+stdc-predef.h is a glibc header which doesn't exist in the macOS SDK
+or the Darwin GCC toolchain.
+
+Upstream-Status: Pending
+Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
+---
+--- a/src/chartype.h
++++ b/src/chartype.h
+@@ -29,7 +29,9 @@
+ #ifndef _h_chartype_f
+ #define _h_chartype_f
+ 
++#ifndef __APPLE__
+ #include <stdc-predef.h>
++#endif
+ /* 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/recipes-devtools/libedit/libedit_%.bbappend b/recipes-devtools/libedit/libedit_%.bbappend
new file mode 100644
index 0000000..75e63a8
--- /dev/null
+++ b/recipes-devtools/libedit/libedit_%.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append:darwin21 = " \
+    file://0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch \
+"
