All of lore.kernel.org
 help / color / mirror / Atom feed
* [scarthgap][PATCH 1/2] ghostscript: Pin to C17 std
@ 2026-04-28  6:43 Mikko Rapeli
  2026-04-28  6:43 ` [scarthgap][PATCH 2/2] ghostscript: fix build with gcc-15 on host Mikko Rapeli
  0 siblings, 1 reply; 4+ messages in thread
From: Mikko Rapeli @ 2026-04-28  6:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Richard Purdie, Mikko Rapeli

From: Khem Raj <raj.khem@gmail.com>

The code defines a custom 'bool' type (as an 'int'), which is incompatible
with C23 in which bool is a keyword, and trying to use <stdbool.h> fails
because 'int' and 'bool' are used interchangeably in the code.

Add the flag to CC variable, since CFLAGS is used by both c and c++ compilers
and clang++ is less forgiving when C compiler only option is used on its
cmdline so it complains about -std=gnu17 and bails out.

(From OE-Core rev: 49657089ef215824f8f79a81deb7baf4f27d0030)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
index a48ad671c7..57a1098521 100644
--- a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
+++ b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
@@ -50,6 +50,8 @@ EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0"
 EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
 EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
 
+CC += "-std=gnu17"
+
 # Uses autoconf but not automake, can't do out-of-tree
 inherit autotools-brokensep pkgconfig
 
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [scarthgap][PATCH 2/2] ghostscript: fix build with gcc-15 on host
  2026-04-28  6:43 [scarthgap][PATCH 1/2] ghostscript: Pin to C17 std Mikko Rapeli
@ 2026-04-28  6:43 ` Mikko Rapeli
  2026-04-28  6:52   ` Martin Jansa
  0 siblings, 1 reply; 4+ messages in thread
From: Mikko Rapeli @ 2026-04-28  6:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Martin Jansa, Richard Purdie, Mikko Rapeli

From: Martin Jansa <martin.jansa@gmail.com>

(From OE-Core rev: 02e282f6417274a93c6f01978bf33e2d171297b0)

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 ...Fix-compatibility-with-C23-compilers.patch | 67 +++++++++++++++++++
 .../ghostscript/ghostscript_10.05.1.bb        |  4 +-
 2 files changed, 68 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch

diff --git a/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch b/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch
new file mode 100644
index 0000000000..78f3fc1c34
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch
@@ -0,0 +1,67 @@
+From c595086bfe206776676e290df98cd09e91210e27 Mon Sep 17 00:00:00 2001
+From: Alex Cherepanov <alex@coscript.biz>
+Date: Thu, 3 Apr 2025 17:19:41 +0100
+Subject: [PATCH] Bug 708160: Fix compatibility with C23 compilers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* fixes:
+  http://errors.yoctoproject.org/Errors/Details/853021/
+
+In file included from ./base/genconf.c:18:
+./base/stdpre.h:348:13: error: ‘bool’ cannot be defined via ‘typedef’
+  348 | typedef int bool;
+      |             ^~~~
+./base/stdpre.h:348:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
+./base/stdpre.h:348:1: warning: useless type name in empty declaration
+  348 | typedef int bool;
+      | ^~~~~~~
+
+Upstream-Status: Backport [Partial backport of https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/base/stdpre.h?id=ae940946473ceb8c5353bc6e7f04673c6e60502d]
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+---
+ base/stdpre.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/base/stdpre.h b/base/stdpre.h
+index dda30b6..2f9c84e 100644
+--- a/base/stdpre.h
++++ b/base/stdpre.h
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2001-2023 Artifex Software, Inc.
++/* Copyright (C) 2001-2025 Artifex Software, Inc.
+    All Rights Reserved.
+ 
+    This software is provided AS-IS with no warranty, either express or
+@@ -341,7 +341,9 @@ typedef signed char schar;
+  * and the MetroWerks C++ compiler insists that bool be equivalent to
+  * unsigned char.
+  */
+-#ifndef __cplusplus
++
++/* C23 has bool as a builtin type. */
++#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L)
+ #ifdef __BEOS__
+ typedef unsigned char bool;
+ #else
+diff --git a/base/gp.h b/base/gp.h
+index ad5bb61..cf2c9cf 100644
+--- a/base/gp.h
++++ b/base/gp.h
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2001-2023 Artifex Software, Inc.
++/* Copyright (C) 2001-2025 Artifex Software, Inc.
+    All Rights Reserved.
+ 
+    This software is provided AS-IS with no warranty, either express or
+@@ -646,7 +646,7 @@ int gp_fseek_impl(FILE *strm, gs_offset_t offset, int origin);
+ /* Create a second open gp_file on the basis of a given one */
+ FILE *gp_fdup_impl(FILE *f, const char *mode);
+ 
+-int gp_fseekable_impl(FILE *f);
++bool gp_fseekable_impl(FILE *f);
+ 
+ /* Force given file into binary mode (no eol translations, etc) */
+ /* if 2nd param true, text mode if 2nd param false */
diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
index 57a1098521..8f132d55c6 100644
--- a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
+++ b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
@@ -25,9 +25,7 @@ def gs_verdir(v):
 SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \
            file://ghostscript-9.16-Werror-return-type.patch \
            file://avoid-host-contamination.patch \
-           file://CVE-2025-59798.patch \
-           file://CVE-2025-59799.patch \
-           file://CVE-2025-59800.patch \
+           file://0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch \
            "
 
 SRC_URI[sha256sum] = "121861b6d29b2461dec6575c9f3cab665b810bd408d4ec02c86719fa708b0a49"
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [scarthgap][PATCH 2/2] ghostscript: fix build with gcc-15 on host
  2026-04-28  6:43 ` [scarthgap][PATCH 2/2] ghostscript: fix build with gcc-15 on host Mikko Rapeli
@ 2026-04-28  6:52   ` Martin Jansa
  2026-04-28  6:57     ` Mikko Rapeli
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Jansa @ 2026-04-28  6:52 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: openembedded-core, Richard Purdie

On Tue, Apr 28, 2026 at 8:46 AM Mikko Rapeli <mikko.rapeli@linaro.org> wrote:
>
> From: Martin Jansa <martin.jansa@gmail.com>
>
> (From OE-Core rev: 02e282f6417274a93c6f01978bf33e2d171297b0)
>
> Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  ...Fix-compatibility-with-C23-compilers.patch | 67 +++++++++++++++++++
>  .../ghostscript/ghostscript_10.05.1.bb        |  4 +-
>  2 files changed, 68 insertions(+), 3 deletions(-)
>  create mode 100644 meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch
...
> diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
> index 57a1098521..8f132d55c6 100644
> --- a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
> +++ b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
> @@ -25,9 +25,7 @@ def gs_verdir(v):
>  SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \
>             file://ghostscript-9.16-Werror-return-type.patch \
>             file://avoid-host-contamination.patch \
> -           file://CVE-2025-59798.patch \
> -           file://CVE-2025-59799.patch \
> -           file://CVE-2025-59800.patch \
> +           file://0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch \
>             "

This part doesn't look right, did you remove CVE patches by accident
when resolving conflict?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [scarthgap][PATCH 2/2] ghostscript: fix build with gcc-15 on host
  2026-04-28  6:52   ` Martin Jansa
@ 2026-04-28  6:57     ` Mikko Rapeli
  0 siblings, 0 replies; 4+ messages in thread
From: Mikko Rapeli @ 2026-04-28  6:57 UTC (permalink / raw)
  To: Martin Jansa; +Cc: openembedded-core, Richard Purdie

Hi,

On Tue, Apr 28, 2026 at 08:52:37AM +0200, Martin Jansa wrote:
> On Tue, Apr 28, 2026 at 8:46 AM Mikko Rapeli <mikko.rapeli@linaro.org> wrote:
> >
> > From: Martin Jansa <martin.jansa@gmail.com>
> >
> > (From OE-Core rev: 02e282f6417274a93c6f01978bf33e2d171297b0)
> >
> > Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > ---
> >  ...Fix-compatibility-with-C23-compilers.patch | 67 +++++++++++++++++++
> >  .../ghostscript/ghostscript_10.05.1.bb        |  4 +-
> >  2 files changed, 68 insertions(+), 3 deletions(-)
> >  create mode 100644 meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch
> ...
> > diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
> > index 57a1098521..8f132d55c6 100644
> > --- a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
> > +++ b/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb
> > @@ -25,9 +25,7 @@ def gs_verdir(v):
> >  SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \
> >             file://ghostscript-9.16-Werror-return-type.patch \
> >             file://avoid-host-contamination.patch \
> > -           file://CVE-2025-59798.patch \
> > -           file://CVE-2025-59799.patch \
> > -           file://CVE-2025-59800.patch \
> > +           file://0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch \
> >             "
> 
> This part doesn't look right, did you remove CVE patches by accident
> when resolving conflict?

Thanks! Completely wrong conflict resolution. Need more coffee...

Cheers,

-Mikko


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-28  6:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  6:43 [scarthgap][PATCH 1/2] ghostscript: Pin to C17 std Mikko Rapeli
2026-04-28  6:43 ` [scarthgap][PATCH 2/2] ghostscript: fix build with gcc-15 on host Mikko Rapeli
2026-04-28  6:52   ` Martin Jansa
2026-04-28  6:57     ` Mikko Rapeli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.