diff --git a/gnuplot-PIE.patch b/gnuplot-PIE.patch new file mode 100644 index 0000000..553b7cc --- /dev/null +++ b/gnuplot-PIE.patch @@ -0,0 +1,28 @@ +Index: gnuplot-5.4.1/src/Makefile.am +=================================================================== +--- gnuplot-5.4.1.orig/src/Makefile.am ++++ gnuplot-5.4.1/src/Makefile.am +@@ -61,6 +61,7 @@ util3d.c util3d.h variable.c variable.h + voxelgrid.c voxelgrid.h vplot.c vplot.h marching_cubes.h + + gnuplot_LDADD = $(GD_LIBS) $(TERMLIBS) $(TERMXLIBS) $(WX_LIBS) $(QT_LIBS) ++gnuplot_LDFLAGS = -pie + + pkglibexec_PROGRAMS = + +@@ -69,6 +70,7 @@ pkglibexec_PROGRAMS += gnuplot_x11 + gnuplot_x11_SOURCES = gplt_x11.c gplt_x11.h gpexecute.c gpexecute.h mousecmn.h version.c version.h + XLIBS = @LIBRARIES_FOR_X@ + gnuplot_x11_LDADD = getcolor_x11.o $(XLIBS) ++gnuplot_x11_LDFLAGS = -pie + endif + + getcolor_x11.o: getcolor.c +@@ -185,6 +187,7 @@ qtterminal/QtGnuplotApplication.cpp qtte + qtterminal/QtGnuplotScene.cpp qtterminal/QtGnuplotItems.cpp \ + qtterminal/QtGnuplotEvent.cpp + gnuplot_qt_LDADD = $(QT_LIBS) ++gnuplot_qt_LDFLAGS = -pie + + # embed example (uncomment to build it) + # diff --git a/gnuplot.changes b/gnuplot.changes index 4d05243..16bba42 100644 --- a/gnuplot.changes +++ b/gnuplot.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Apr 15 13:04:05 UTC 2021 - Wolfgang Frisch + +- Hardening: compile with PIC and link with PIE. + ------------------------------------------------------------------- Thu Dec 10 07:11:15 UTC 2020 - Dr. Werner Fink diff --git a/gnuplot.spec b/gnuplot.spec index 30dc1b7..4ae4acd 100644 --- a/gnuplot.spec +++ b/gnuplot.spec @@ -1,7 +1,7 @@ # -# spec file for package gnuplot +# spec file for package gnuplot%{?psuffix} # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -80,11 +80,11 @@ Release: 0 %global underscore 5_4 %if "%{flavor}" == "" Summary: Function Plotting Utility and more -License: SUSE-Gnuplot AND GPL-2.0-or-later +License: GPL-2.0-or-later AND SUSE-Gnuplot Group: Documentation/Other %else Summary: Documentation of GNUplot -License: SUSE-Gnuplot AND GPL-2.0-or-later +License: GPL-2.0-or-later AND SUSE-Gnuplot Group: Documentation/Other %endif Source0: http://downloads.sourceforge.net/project/gnuplot/gnuplot/%{version}/gnuplot-%{version}.tar.gz @@ -103,6 +103,7 @@ Patch4: gnuplot-4.6.0-demo.diff Patch5: gnuplot-wx3.diff Patch6: gnuplot-QtCore-PIC.dif Patch7: gnuplot-gd.patch +Patch8: gnuplot-PIE.patch %define _x11lib %{_libdir} %define _x11data %{_datadir}/X11 %define _libx11 %{_exec_prefix}/lib/X11 @@ -111,7 +112,7 @@ Patch7: gnuplot-gd.patch %if "%{flavor}" == "doc" Requires: %{sname} Requires(post): %install_info_prereq -Requires(preun): %install_info_prereq +Requires(preun):%install_info_prereq BuildArch: noarch %endif @@ -137,12 +138,14 @@ cp %{_sourcedir}/picins.sty docs %patch5 -p1 -b .w3x %patch6 -p0 -b .pic %patch7 -p1 -b .gd +%patch8 -p1 -b .pie + %build autoreconf -fi export CPPFLAGS="-I%{_includedir}/gd -DAppDefDir=\\\"%{_appdef}\\\"" export CPPFLAGS="$CPPFLAGS -DGNUPLOT_LIB_DEFAULT=\\\"%{_docdir}/%{sname}/demo\\\"" - export CFLAGS="${RPM_OPT_FLAGS} -pipe -D_GNU_SOURCE" + export CFLAGS="${RPM_OPT_FLAGS} -pipe -D_GNU_SOURCE -fpic" export CXXFLAGS="$CFLAGS -fno-strict-aliasing" export LDFLAGS="-L%{_x11lib} -Wl,--as-needed" export ARCHLIB=%_lib