SHA256
1
0
forked from pool/gnuplot

Accepting request 885661 from home:wfrisch:branches:Publishing

Hardening: compile with PIC and link with PIE.

OBS-URL: https://build.opensuse.org/request/show/885661
OBS-URL: https://build.opensuse.org/package/show/Publishing/gnuplot?expand=0&rev=124
This commit is contained in:
Dr. Werner Fink 2021-04-22 05:57:48 +00:00 committed by Git OBS Bridge
parent c756463425
commit 9f4366e873
3 changed files with 42 additions and 6 deletions

28
gnuplot-PIE.patch Normal file
View File

@ -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)
#

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Apr 15 13:04:05 UTC 2021 - Wolfgang Frisch <wolfgang.frisch@suse.com>
- Hardening: compile with PIC and link with PIE.
-------------------------------------------------------------------
Thu Dec 10 07:11:15 UTC 2020 - Dr. Werner Fink <werner@suse.de>

View File

@ -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
@ -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