diff options
| -rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch | 67 | ||||
| -rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript/0001-Fix-32-bit-build.patch | 63 | ||||
| -rw-r--r-- | meta/recipes-extended/ghostscript/ghostscript_10.06.0.bb (renamed from meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb) | 6 |
3 files changed, 66 insertions, 70 deletions
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 deleted file mode 100644 index 78f3fc1c34..0000000000 --- a/meta/recipes-extended/ghostscript/ghostscript/0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch +++ /dev/null | |||
| @@ -1,67 +0,0 @@ | |||
| 1 | From c595086bfe206776676e290df98cd09e91210e27 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Cherepanov <alex@coscript.biz> | ||
| 3 | Date: Thu, 3 Apr 2025 17:19:41 +0100 | ||
| 4 | Subject: [PATCH] Bug 708160: Fix compatibility with C23 compilers | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | * fixes: | ||
| 10 | http://errors.yoctoproject.org/Errors/Details/853021/ | ||
| 11 | |||
| 12 | In file included from ./base/genconf.c:18: | ||
| 13 | ./base/stdpre.h:348:13: error: ‘bool’ cannot be defined via ‘typedef’ | ||
| 14 | 348 | typedef int bool; | ||
| 15 | | ^~~~ | ||
| 16 | ./base/stdpre.h:348:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards | ||
| 17 | ./base/stdpre.h:348:1: warning: useless type name in empty declaration | ||
| 18 | 348 | typedef int bool; | ||
| 19 | | ^~~~~~~ | ||
| 20 | |||
| 21 | Upstream-Status: Backport [Partial backport of https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/base/stdpre.h?id=ae940946473ceb8c5353bc6e7f04673c6e60502d] | ||
| 22 | |||
| 23 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
| 24 | --- | ||
| 25 | base/stdpre.h | 6 ++++-- | ||
| 26 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/base/stdpre.h b/base/stdpre.h | ||
| 29 | index dda30b6..2f9c84e 100644 | ||
| 30 | --- a/base/stdpre.h | ||
| 31 | +++ b/base/stdpre.h | ||
| 32 | @@ -1,4 +1,4 @@ | ||
| 33 | -/* Copyright (C) 2001-2023 Artifex Software, Inc. | ||
| 34 | +/* Copyright (C) 2001-2025 Artifex Software, Inc. | ||
| 35 | All Rights Reserved. | ||
| 36 | |||
| 37 | This software is provided AS-IS with no warranty, either express or | ||
| 38 | @@ -341,7 +341,9 @@ typedef signed char schar; | ||
| 39 | * and the MetroWerks C++ compiler insists that bool be equivalent to | ||
| 40 | * unsigned char. | ||
| 41 | */ | ||
| 42 | -#ifndef __cplusplus | ||
| 43 | + | ||
| 44 | +/* C23 has bool as a builtin type. */ | ||
| 45 | +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L) | ||
| 46 | #ifdef __BEOS__ | ||
| 47 | typedef unsigned char bool; | ||
| 48 | #else | ||
| 49 | diff --git a/base/gp.h b/base/gp.h | ||
| 50 | index ad5bb61..cf2c9cf 100644 | ||
| 51 | --- a/base/gp.h | ||
| 52 | +++ b/base/gp.h | ||
| 53 | @@ -1,4 +1,4 @@ | ||
| 54 | -/* Copyright (C) 2001-2023 Artifex Software, Inc. | ||
| 55 | +/* Copyright (C) 2001-2025 Artifex Software, Inc. | ||
| 56 | All Rights Reserved. | ||
| 57 | |||
| 58 | This software is provided AS-IS with no warranty, either express or | ||
| 59 | @@ -646,7 +646,7 @@ int gp_fseek_impl(FILE *strm, gs_offset_t offset, int origin); | ||
| 60 | /* Create a second open gp_file on the basis of a given one */ | ||
| 61 | FILE *gp_fdup_impl(FILE *f, const char *mode); | ||
| 62 | |||
| 63 | -int gp_fseekable_impl(FILE *f); | ||
| 64 | +bool gp_fseekable_impl(FILE *f); | ||
| 65 | |||
| 66 | /* Force given file into binary mode (no eol translations, etc) */ | ||
| 67 | /* if 2nd param true, text mode if 2nd param false */ | ||
diff --git a/meta/recipes-extended/ghostscript/ghostscript/0001-Fix-32-bit-build.patch b/meta/recipes-extended/ghostscript/ghostscript/0001-Fix-32-bit-build.patch new file mode 100644 index 0000000000..8d1e9d46e6 --- /dev/null +++ b/meta/recipes-extended/ghostscript/ghostscript/0001-Fix-32-bit-build.patch | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | From 3c0be6e4fcffa63e4a5a1b0aec057cebc4d2562f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ken Sharp <Ken.Sharp@artifex.com> | ||
| 3 | Date: Wed, 10 Sep 2025 08:55:30 +0100 | ||
| 4 | Subject: [PATCH] Fix 32-bit build | ||
| 5 | |||
| 6 | Bug #708824 "ghostscript 10.06.0 compilation failure on 32-bit archs" | ||
| 7 | |||
| 8 | nbytes shiouldn't be an intptr_t, it doesn't get used for pointer | ||
| 9 | arithmetic. Previously it was a uint, should be a int64_t, to fit with | ||
| 10 | all the other devices. | ||
| 11 | |||
| 12 | Checked other warnings, and found a (very minor) one in gdevdbit.c, fix | ||
| 13 | that while we're here (signed/unsigned mismatch, we don't really care). | ||
| 14 | |||
| 15 | Upstream-Status: Backport [https://github.com/ArtifexSoftware/ghostpdl/commit/3c0be6e4fcffa63e4a5a1b0aec057cebc4d2562f] | ||
| 16 | |||
| 17 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 18 | --- | ||
| 19 | base/gdevdbit.c | 2 +- | ||
| 20 | base/gdevmpla.c | 6 +++--- | ||
| 21 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/base/gdevdbit.c b/base/gdevdbit.c | ||
| 24 | index e07cc3f3b8..1b5c69325b 100644 | ||
| 25 | --- a/base/gdevdbit.c | ||
| 26 | +++ b/base/gdevdbit.c | ||
| 27 | @@ -191,7 +191,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x, | ||
| 28 | fit_copy(dev, data, data_x, raster, id, x, y, width, height); | ||
| 29 | row_alpha = data; | ||
| 30 | out_raster = bitmap_raster(width * (size_t)byte_depth); | ||
| 31 | - if (check_64bit_multiply(out_raster, ncomps, &product) != 0) | ||
| 32 | + if (check_64bit_multiply(out_raster, ncomps, (int64_t *) &product) != 0) | ||
| 33 | return gs_note_error(gs_error_undefinedresult); | ||
| 34 | gb_buff = gs_alloc_bytes(mem, product, "copy_alpha_hl_color(gb_buff)"); | ||
| 35 | if (gb_buff == 0) { | ||
| 36 | diff --git a/base/gdevmpla.c b/base/gdevmpla.c | ||
| 37 | index 2f0d522561..ffc5ff42e6 100644 | ||
| 38 | --- a/base/gdevmpla.c | ||
| 39 | +++ b/base/gdevmpla.c | ||
| 40 | @@ -1954,12 +1954,12 @@ mem_planar_strip_copy_rop2(gx_device * dev, | ||
| 41 | int i; | ||
| 42 | int j; | ||
| 43 | intptr_t chunky_sraster; | ||
| 44 | - intptr_t nbytes; | ||
| 45 | + int64_t nbytes; | ||
| 46 | byte **line_ptrs; | ||
| 47 | byte *sbuf, *buf; | ||
| 48 | |||
| 49 | chunky_sraster = sraster * (intptr_t)mdev->num_planar_planes; | ||
| 50 | - if (check_64bit_multiply(height, chunky_sraster, (size_t *)&nbytes) != 0) | ||
| 51 | + if (check_64bit_multiply(height, chunky_sraster, &nbytes) != 0) | ||
| 52 | return gs_note_error(gs_error_undefinedresult); | ||
| 53 | buf = gs_alloc_bytes(mdev->memory, nbytes, "mem_planar_strip_copy_rop(buf)"); | ||
| 54 | if (buf == NULL) { | ||
| 55 | @@ -2003,7 +2003,7 @@ mem_planar_strip_copy_rop2(gx_device * dev, | ||
| 56 | intptr_t i; | ||
| 57 | intptr_t chunky_t_raster; | ||
| 58 | int chunky_t_height; | ||
| 59 | - intptr_t nbytes; | ||
| 60 | + int64_t nbytes; | ||
| 61 | byte **line_ptrs; | ||
| 62 | byte *tbuf, *buf; | ||
| 63 | gx_strip_bitmap newtex; | ||
diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb b/meta/recipes-extended/ghostscript/ghostscript_10.06.0.bb index 417bf52a99..4f6cb45412 100644 --- a/meta/recipes-extended/ghostscript/ghostscript_10.05.1.bb +++ b/meta/recipes-extended/ghostscript/ghostscript_10.06.0.bb | |||
| @@ -24,10 +24,10 @@ def gs_verdir(v): | |||
| 24 | SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \ | 24 | SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \ |
| 25 | file://ghostscript-9.16-Werror-return-type.patch \ | 25 | file://ghostscript-9.16-Werror-return-type.patch \ |
| 26 | file://avoid-host-contamination.patch \ | 26 | file://avoid-host-contamination.patch \ |
| 27 | file://0001-Bug-708160-Fix-compatibility-with-C23-compilers.patch \ | 27 | file://0001-Fix-32-bit-build.patch \ |
| 28 | " | 28 | " |
| 29 | 29 | ||
| 30 | SRC_URI[sha256sum] = "121861b6d29b2461dec6575c9f3cab665b810bd408d4ec02c86719fa708b0a49" | 30 | SRC_URI[sha256sum] = "5bd6da34794928cc7e616f288e32bd0be7f9a5ca2d3c206a0af2c19a4e3a318f" |
| 31 | 31 | ||
| 32 | PACKAGECONFIG ??= "" | 32 | PACKAGECONFIG ??= "" |
| 33 | PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3" | 33 | PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3" |
| @@ -47,7 +47,7 @@ EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0" | |||
| 47 | EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}" | 47 | EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}" |
| 48 | EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}" | 48 | EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}" |
| 49 | 49 | ||
| 50 | TARGET_CFLAGS += "-std=gnu17" | 50 | TARGET_CFLAGS += "-std=gnu17 -fPIC" |
| 51 | 51 | ||
| 52 | # Uses autoconf but not automake, can't do out-of-tree | 52 | # Uses autoconf but not automake, can't do out-of-tree |
| 53 | inherit autotools-brokensep pkgconfig | 53 | inherit autotools-brokensep pkgconfig |
