From 00085dc245fefba4a80418d2dd9ea7a3d64cfe27 Mon Sep 17 00:00:00 2001 From: sthen Date: Mon, 8 Jun 2026 20:34:34 +0000 Subject: [PATCH] fix FLAVOR=editline build on llvm 22 by backporting upstream commit to pass correct pointer types to el_gets(). bonus fix for gcc 15 while there which I happened to notice. --- plan9/rc/Makefile | 2 +- plan9/rc/patches/patch-edit-edit_c | 26 ++++++++++++++++++++++++++ plan9/rc/patches/patch-edit-editline_c | 26 ++++++++++++++++++++++++++ plan9/rc/patches/patch-edit-vrl_c | 26 ++++++++++++++++++++++++++ plan9/rc/patches/patch-rc_h | 23 +++++++++++++++++++++++ 5 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 plan9/rc/patches/patch-edit-edit_c create mode 100644 plan9/rc/patches/patch-edit-editline_c create mode 100644 plan9/rc/patches/patch-edit-vrl_c create mode 100644 plan9/rc/patches/patch-rc_h diff --git a/plan9/rc/Makefile b/plan9/rc/Makefile index c23479fa2d4..94a1dd40ff7 100644 --- a/plan9/rc/Makefile +++ b/plan9/rc/Makefile @@ -1,7 +1,7 @@ COMMENT= shell (clone of plan9 shell) DISTNAME= rc-1.7.4 -REVISION= 1 +REVISION= 2 CATEGORIES= plan9 shells SITES= http://static.tobold.org/rc/ diff --git a/plan9/rc/patches/patch-edit-edit_c b/plan9/rc/patches/patch-edit-edit_c new file mode 100644 index 00000000000..2f2801a56fb --- /dev/null +++ b/plan9/rc/patches/patch-edit-edit_c @@ -0,0 +1,26 @@ +From 6c9b748f309753f86bae1632c71b8992294894c1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bert=20M=C3=BCnnich?= +Date: Sun, 11 Jun 2023 18:45:47 +0200 +Subject: [PATCH] Fix type of pointer passed to el_gets() + +Index: edit-edit.c +--- edit-edit.c.orig ++++ edit-edit.c +@@ -43,6 +43,7 @@ static void edit_catcher(int sig) { + } + + char *edit_alloc(void *cookie, size_t *count) { ++ int len = 0; + const char *r; + HistEvent he; + struct cookie *c = cookie; +@@ -51,7 +52,8 @@ char *edit_alloc(void *cookie, size_t *count) { + oldint = sys_signal(SIGINT, edit_catcher); + oldquit = sys_signal(SIGQUIT, edit_catcher); + +- r = el_gets(c->el, count); ++ r = el_gets(c->el, &len); ++ *count = len; + + sys_signal(SIGINT, oldint); + sys_signal(SIGQUIT, oldquit); diff --git a/plan9/rc/patches/patch-edit-editline_c b/plan9/rc/patches/patch-edit-editline_c new file mode 100644 index 00000000000..53a46a43040 --- /dev/null +++ b/plan9/rc/patches/patch-edit-editline_c @@ -0,0 +1,26 @@ +From 6c9b748f309753f86bae1632c71b8992294894c1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bert=20M=C3=BCnnich?= +Date: Sun, 11 Jun 2023 18:45:47 +0200 +Subject: [PATCH] Fix type of pointer passed to el_gets() + +Index: edit-editline.c +--- edit-editline.c.orig ++++ edit-editline.c +@@ -39,6 +39,7 @@ static void edit_catcher(int sig) { + char *edit_alloc(void *cookie, size_t *count) { + struct cookie *c = cookie; + /* ++ int len = 0; + const char *r; + HistEvent he; + struct cookie *c = cookie; +@@ -47,7 +48,8 @@ char *edit_alloc(void *cookie, size_t *count) { + oldint = sys_signal(SIGINT, edit_catcher); + oldquit = sys_signal(SIGQUIT, edit_catcher); + +- r = el_gets(c->el, count); ++ r = el_gets(c->el, &len); ++ *count = len; + + sys_signal(SIGINT, oldint); + sys_signal(SIGQUIT, oldquit); diff --git a/plan9/rc/patches/patch-edit-vrl_c b/plan9/rc/patches/patch-edit-vrl_c new file mode 100644 index 00000000000..e5c0fa4ebac --- /dev/null +++ b/plan9/rc/patches/patch-edit-vrl_c @@ -0,0 +1,26 @@ +From 6c9b748f309753f86bae1632c71b8992294894c1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bert=20M=C3=BCnnich?= +Date: Sun, 11 Jun 2023 18:45:47 +0200 +Subject: [PATCH] Fix type of pointer passed to el_gets() + +Index: edit-vrl.c +--- edit-vrl.c.orig ++++ edit-vrl.c +@@ -42,6 +42,7 @@ static void edit_catcher(int sig) { + char *edit_alloc(void *cookie, size_t *count) { + struct cookie *c = cookie; + /* ++ int len = 0; + const char *r; + HistEvent he; + struct cookie *c = cookie; +@@ -50,7 +51,8 @@ char *edit_alloc(void *cookie, size_t *count) { + oldint = sys_signal(SIGINT, edit_catcher); + oldquit = sys_signal(SIGQUIT, edit_catcher); + +- r = el_gets(c->el, count); ++ r = el_gets(c->el, &len); ++ *count = len; + + sys_signal(SIGINT, oldint); + sys_signal(SIGQUIT, oldquit); diff --git a/plan9/rc/patches/patch-rc_h b/plan9/rc/patches/patch-rc_h new file mode 100644 index 00000000000..2411d0a7a1c --- /dev/null +++ b/plan9/rc/patches/patch-rc_h @@ -0,0 +1,23 @@ +From 429f81caf8af998e59075c86b777b2ecef7956cf Mon Sep 17 00:00:00 2001 +From: Jacob Mealey +Date: Sun, 28 Sep 2025 20:14:18 -0400 +Subject: [PATCH] Fix build for gcc 15 + +Index: rc.h +--- rc.h.orig ++++ rc.h +@@ -44,9 +44,14 @@ typedef enum ecodes { + eError, eBreak, eReturn, eVarstack, eArena, eFifo, eFd + } ecodes; + ++#if __STDC_VERSION__ >= 202311L ++#define FALSE false ++#define TRUE true ++#else + typedef enum bool { + FALSE, TRUE + } bool; ++#endif + + typedef enum redirtype { + rFrom, rCreate, rAppend, rHeredoc, rHerestring