Accepting request 799270 from home:marxin:branches:graphics
- Add ubsan_build and remove not needed patch netpbm-asan.patch. OBS-URL: https://build.opensuse.org/request/show/799270 OBS-URL: https://build.opensuse.org/package/show/graphics/netpbm?expand=0&rev=118
This commit is contained in:
parent
bd8891e6a6
commit
4d3753e87e
@ -1,83 +0,0 @@
|
||||
Index: netpbm-10.86.3/GNUmakefile
|
||||
===================================================================
|
||||
--- netpbm-10.86.3.orig/GNUmakefile 2019-05-14 09:16:35.984991072 +0200
|
||||
+++ netpbm-10.86.3/GNUmakefile 2019-05-16 09:42:17.843531751 +0200
|
||||
@@ -378,7 +378,7 @@ endif
|
||||
netpbm:%:%.o $(OBJECT_DEP) $(NETPBMLIB) $(URTLIBDEP) $(LIBOPT)
|
||||
# Note that LDFLAGS might contain -L options, so order is important.
|
||||
$(LD) -o $@ $< $(OBJECT_LIST) \
|
||||
- $(LDFLAGS) $(shell $(LIBOPT) $(NETPBMLIB) $(MERGELIBS)) \
|
||||
+ $(LDFLAGS) -lasan $(shell $(LIBOPT) $(NETPBMLIB) $(MERGELIBS)) \
|
||||
$(PNGLD) $(XML2LD) $(X11LD) $(MATHLIB) $(NETWORKLD) $(LADD)
|
||||
|
||||
netpbm.o: mergetrylist
|
||||
Index: netpbm-10.86.3/buildtools/Makefile
|
||||
===================================================================
|
||||
--- netpbm-10.86.3.orig/buildtools/Makefile 2019-05-14 09:16:32.160972760 +0200
|
||||
+++ netpbm-10.86.3/buildtools/Makefile 2019-05-16 09:42:13.255509230 +0200
|
||||
@@ -41,10 +41,10 @@ genfontc.o:%.o:%.c importinc
|
||||
$(NETPBM_INCLUDES) \
|
||||
$<
|
||||
genfontc:%:%.o $(NETPBMLIB)
|
||||
- $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< $(NETPBMLIB)
|
||||
+ $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< $(NETPBMLIB) -lasan
|
||||
|
||||
$(BUILDPROGS):%:%.o
|
||||
- $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $<
|
||||
+ $(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< -lasan
|
||||
|
||||
distclean clean: cleanlocal
|
||||
.PHONY: cleanlocal
|
||||
Index: netpbm-10.86.3/common.mk
|
||||
===================================================================
|
||||
--- netpbm-10.86.3.orig/common.mk 2019-05-14 09:16:32.156972741 +0200
|
||||
+++ netpbm-10.86.3/common.mk 2019-05-16 09:42:26.703575262 +0200
|
||||
@@ -386,7 +386,7 @@ LDFLAGS_ALL = $(WINICON_OBJECT) \
|
||||
|
||||
$(PORTBINARIES) $(MATHBINARIES): %: %.o \
|
||||
$(NETPBMLIB) $(LIBOPT) $(WINICON_OBJECT)
|
||||
- $(LD) -o $@$(EXE) $@.o $(ADDL_OBJECTS) $(LDFLAGS_ALL)
|
||||
+ $(LD) -o $@$(EXE) $@.o $(ADDL_OBJECTS) -lasan $(LDFLAGS_ALL)
|
||||
|
||||
|
||||
# MERGE STUFF
|
||||
Index: netpbm-10.86.3/lib/Makefile
|
||||
===================================================================
|
||||
--- netpbm-10.86.3.orig/lib/Makefile 2019-05-14 09:16:32.832975977 +0200
|
||||
+++ netpbm-10.86.3/lib/Makefile 2019-05-16 09:42:22.159552950 +0200
|
||||
@@ -115,7 +115,7 @@ $(SONAME): \
|
||||
-lc \
|
||||
-soname libnetpbm.$(NETPBMLIBSUFFIX) \
|
||||
-set_version $(shell perl -e '$(PERLPROG)') \
|
||||
- $(LADD)
|
||||
+ -lasan $(LADD)
|
||||
endif
|
||||
|
||||
ifeq ($(NETPBMLIBTYPE),unixshared)
|
||||
@@ -131,7 +131,7 @@ $(SONAME): libnetpbm.$(NETPBMLIBSUFFIX).
|
||||
$(SYMLINK) $< $@
|
||||
libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN): $(LIBOBJECTS) $(LIBOBJECTS_X)
|
||||
$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
|
||||
- $(SHLIB_CLIB) -lm $(LADD)
|
||||
+ $(SHLIB_CLIB) -lm -lasan $(LADD)
|
||||
endif
|
||||
|
||||
ifeq ($(NETPBMLIBTYPE),dll)
|
||||
@@ -144,7 +144,7 @@ endif
|
||||
-Wl,-soname,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).dll \
|
||||
-Wl,--output-def,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).def \
|
||||
-Wl,--out-implib,libnetpbm.dll.a -o $@ $(LDFLAGS) \
|
||||
- $(LIBOBJECTS) $(LIBOBJECTS_X) $(LDLIBS) $(LADD)
|
||||
+ $(LIBOBJECTS) $(LIBOBJECTS_X) $(LDLIBS) -lasan $(LADD)
|
||||
endif
|
||||
|
||||
ifeq ($(NETPBMLIBTYPE),dylib)
|
||||
@@ -158,7 +158,7 @@ libnetpbm.$(MAJ).dylib: libnetpbm.$(MAJ)
|
||||
|
||||
libnetpbm.$(MAJ).$(MIN).dylib: $(LIBOBJECTS) $(LIBOBJECTS_X)
|
||||
$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
|
||||
- -lc $(LADD)
|
||||
+ -lc -lasan $(LADD)
|
||||
endif
|
||||
|
||||
#--------------------------------------------------------------------------
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 30 14:14:22 UTC 2020 - Martin Liška <mliska@suse.cz>
|
||||
|
||||
- Add ubsan_build and remove not needed patch netpbm-asan.patch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 20 12:48:25 UTC 2019 - pgajdos@suse.com
|
||||
|
||||
|
18
netpbm.spec
18
netpbm.spec
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package netpbm
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LLC
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
%define debug_build 0
|
||||
%define asan_build 0
|
||||
%define ubsan_build 0
|
||||
%define libmaj 11
|
||||
%define libmin 88
|
||||
%define libver %{libmaj}.%{libmin}
|
||||
@ -35,7 +36,6 @@ Source3: prepare-src-tarball.sh
|
||||
# SUSE specific
|
||||
Patch0: %{name}-make.patch
|
||||
# neccessary for running with ASAN
|
||||
Patch1: %{name}-asan.patch
|
||||
Patch3: %{name}-tmpfile.patch
|
||||
Patch4: %{name}-security-code.patch
|
||||
Patch5: %{name}-security-scripts.patch
|
||||
@ -119,8 +119,12 @@ export CFLAGS="%{optflags} -flax-vector-conversions"
|
||||
export CFLAGS="$CFLAGS -O0"
|
||||
%endif
|
||||
%if %{asan_build}
|
||||
export CFLAGS="$CFLAGS -fsanitize=address"
|
||||
patch -p1 < %{PATCH1}
|
||||
export CFLAGS="$CFLAGS -fsanitize=address -fno-sanitize-recover=all"
|
||||
export LDFLAGS="$LDFLAGS -fsanitize=address"
|
||||
%endif
|
||||
%if %{ubsan_build}
|
||||
export CFLAGS="$CFLAGS -fsanitize=undefined -fno-sanitize-recover=all"
|
||||
export LDFLAGS="$LDFLAGS -fsanitize=undefined"
|
||||
%endif
|
||||
make %{?_smp_mflags} CFLAGS="$CFLAGS"
|
||||
rm doc/INSTALL
|
||||
@ -152,6 +156,12 @@ rm %{buildroot}%{_bindir}/pstopnm # disable due security reasons, e. g. [bsc#110
|
||||
%postun -n libnetpbm%{libmaj} -p /sbin/ldconfig
|
||||
|
||||
%check
|
||||
%if %{asan_build}
|
||||
export LSAN_OPTIONS="detect_leaks=0"
|
||||
%endif
|
||||
%if %{ubsan_build}
|
||||
export UBSAN_OPTIONS="print_stacktrace=1"
|
||||
%endif
|
||||
# do not run unneccesary tests
|
||||
sed -i '/all-in-place/d' test/Test-Order
|
||||
sed -i '/legacy-names/d' test/Test-Order
|
||||
|
Loading…
Reference in New Issue
Block a user