Fix s390x build failure

This commit is contained in:
Scott Talbert 2021-10-18 21:53:26 -04:00
parent e174b1e933
commit 17352656f6
2 changed files with 42 additions and 0 deletions

39
gnuplot-signed-char.patch Normal file
View File

@ -0,0 +1,39 @@
From 10995e7043211c793d545e7b2cc95acb4760e479 Mon Sep 17 00:00:00 2001
From: Ethan A Merritt <merritt@u.washington.edu>
Date: Sun, 17 Oct 2021 14:28:41 -0700
Subject: [PATCH] arm and s390 need "signed char"
The default is unsigned, which breaks array bound checks in the
vplot.c isosurface code.
Bugs #2467 #2450
---
src/marching_cubes.h | 2 +-
src/qt_table.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/marching_cubes.h b/src/marching_cubes.h
index 4f7264f93..4f1a5a872 100644
--- a/src/marching_cubes.h
+++ b/src/marching_cubes.h
@@ -58,7 +58,7 @@ static const short cube_edge_flags[256]=
First official public domain release
Version 3.00 dated 8-6-94
*/
-static char triangle_table[256][13]=
+static signed char triangle_table[256][13]=
{
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{ 8, 3, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
diff --git a/src/qt_table.h b/src/qt_table.h
index 9e4ebf8e8..747ef8ec1 100644
--- a/src/qt_table.h
+++ b/src/qt_table.h
@@ -10,7 +10,7 @@
* collapsed them into quadrangles.
* So there is room for improvement in this table.
*/
-static char qt_table[256][13] =
+static signed char qt_table[256][13] =
{
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
{ 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},

View File

@ -39,6 +39,8 @@ Patch6: gnuplot-5.4.2-no-lena.patch
Patch7: gnuplot-5.2.2-doc.patch
Patch8: gnuplot-5.2.8-cmd-opts.patch
Patch9: gnuplot-config.patch
# Upstream patch to fix s390x build failure
Patch20: gnuplot-signed-char.patch
Requires: %{name}-common = %{version}-%{release}
Requires: dejavu-sans-fonts
@ -175,6 +177,7 @@ plotting tool.
%patch7 -p1 -b .doc
%patch8 -p1 -b .cmd-opts
%patch9 -p1 -b .config
%patch20 -p1 -b .signed-char
sed -i -e 's:"/usr/lib/X11/app-defaults":"%{x11_app_defaults_dir}":' src/gplt_x11.c
chmod 644 src/getcolor.h
chmod 644 demo/html/webify.pl