From 17352656f6e3c09e810d329b45a9026315319471 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Mon, 18 Oct 2021 21:53:26 -0400 Subject: [PATCH] Fix s390x build failure --- gnuplot-signed-char.patch | 39 +++++++++++++++++++++++++++++++++++++++ gnuplot.spec | 3 +++ 2 files changed, 42 insertions(+) create mode 100644 gnuplot-signed-char.patch diff --git a/gnuplot-signed-char.patch b/gnuplot-signed-char.patch new file mode 100644 index 0000000..b9a43dc --- /dev/null +++ b/gnuplot-signed-char.patch @@ -0,0 +1,39 @@ +From 10995e7043211c793d545e7b2cc95acb4760e479 Mon Sep 17 00:00:00 2001 +From: Ethan A Merritt +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}, diff --git a/gnuplot.spec b/gnuplot.spec index c0d1383..ee6cf78 100644 --- a/gnuplot.spec +++ b/gnuplot.spec @@ -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