From 2642e3f1d9f4e0a13e8aa9553e4825cfde7bbef384d230473f5db56d2cc3d5b0 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Mon, 14 Jan 2019 14:31:27 +0000 Subject: [PATCH 1/3] - asan_build: build ASAN included - debug_build: build more suitable for debugging, install pngcp OBS-URL: https://build.opensuse.org/package/show/graphics/libpng16?expand=0&rev=113 --- libpng16.changes | 6 ++++++ libpng16.spec | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/libpng16.changes b/libpng16.changes index 660fd75..66c5455 100644 --- a/libpng16.changes +++ b/libpng16.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 14 13:11:39 UTC 2019 - Petr Gajdos + +- asan_build: build ASAN included +- debug_build: build more suitable for debugging, install pngcp + ------------------------------------------------------------------- Mon Dec 31 09:41:53 UTC 2018 - Petr Gajdos diff --git a/libpng16.spec b/libpng16.spec index 81bb922..e54c111 100644 --- a/libpng16.spec +++ b/libpng16.spec @@ -16,7 +16,9 @@ # -# +%define debug_build 0 +%define asan_build 0 + %define major 1 %define minor 6 %define micro 36 @@ -100,12 +102,22 @@ PNG files. # PNG_SAFE_LIMITS_SUPPORTED: http://www.openwall.com/lists/oss-security/2015/01/10/1 export CFLAGS="%{optflags} -O3 -DPNG_SAFE_LIMITS_SUPPORTED -DPNG_SKIP_SETJMP_CHECK $(getconf LFS_CFLAGS)" export LDFLAGS="-Wl,-z,relro,-z,now" - +%if %{debug_build} +export CFLAGS="$CFLAGS -O0" +%endif %configure \ --disable-static +%if %{asan_build} +sed -i -e 's/^\(CFLAGS.*\)$/\1 -fsanitize=address/' \ + -e 's/\(^LIBS =.*\)/\1 -lasan/' Makefile +%endif make %{?_smp_mflags} %check +%if %{asan_build} +# ASAN needs /proc to be mounted +exit 0 +%endif make -j1 check %install @@ -114,6 +126,9 @@ rm %{buildroot}/%{_libdir}/libpng*.la mkdir -p %{buildroot}%{_sysconfdir}/rpm cp -a %{SOURCE3} \ %{buildroot}%{_sysconfdir}/rpm/macros.libpng-tools +%if %{debug_build} ||%{asan_build} +install -m755 .libs/pngcp %{buildroot}/%{_bindir} +%endif %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig @@ -140,6 +155,9 @@ cp -a %{SOURCE3} \ %files tools %{_bindir}/png-fix-itxt %{_bindir}/pngfix +%if %{debug_build} || %{asan_build} +%{_bindir}/pngcp +%endif %{_sysconfdir}/rpm/macros.libpng-tools %changelog From 774495c1aebc84c27191a3b3e3da53cc50b3bed82a370749d8ab2fd6d2bfc820 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Mon, 28 Jan 2019 11:50:38 +0000 Subject: [PATCH 2/3] - fix arm build [bsc#1121829] + libpng-arm-free.patch OBS-URL: https://build.opensuse.org/package/show/graphics/libpng16?expand=0&rev=114 --- libpng-arm-free.patch | 16 ++++++++++++++++ libpng16.changes | 6 ++++++ libpng16.spec | 4 +++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 libpng-arm-free.patch diff --git a/libpng-arm-free.patch b/libpng-arm-free.patch new file mode 100644 index 0000000..a7a10a4 --- /dev/null +++ b/libpng-arm-free.patch @@ -0,0 +1,16 @@ +Index: libpng-1.6.36/pngread.c +=================================================================== +--- libpng-1.6.36.orig/pngread.c 2018-12-01 15:36:00.000000000 +0100 ++++ libpng-1.6.36/pngread.c 2019-01-28 12:41:14.044709070 +0100 +@@ -994,6 +994,11 @@ png_read_destroy(png_structrp png_ptr) + png_ptr->chunk_list = NULL; + #endif + ++#if PNG_ARM_NEON_IMPLEMENTATION == 1 ++ png_free(png_ptr, png_ptr->riffled_palette); ++ png_ptr->riffled_palette = NULL; ++#endif ++ + /* NOTE: the 'setjmp' buffer may still be allocated and the memory and error + * callbacks are still set at this point. They are required to complete the + * destruction of the png_struct itself. diff --git a/libpng16.changes b/libpng16.changes index 66c5455..0d5d5c0 100644 --- a/libpng16.changes +++ b/libpng16.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 28 11:43:05 UTC 2019 - Petr Gajdos + +- fix arm build [bsc#1121829] + + libpng-arm-free.patch + ------------------------------------------------------------------- Mon Jan 14 13:11:39 UTC 2019 - Petr Gajdos diff --git a/libpng16.spec b/libpng16.spec index e54c111..80de3d6 100644 --- a/libpng16.spec +++ b/libpng16.spec @@ -1,7 +1,7 @@ # # spec file for package libpng16 # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,6 +32,7 @@ Summary: Library for the Portable Network Graphics Format (PNG) License: Zlib Group: Development/Libraries/C and C++ Url: http://www.libpng.org/pub/png/libpng.html +Patch0: libpng-arm-free.patch Source0: http://prdownloads.sourceforge.net/libpng/libpng-%{version}.tar.xz Source2: libpng16.keyring Source3: rpm-macros.libpng-tools @@ -97,6 +98,7 @@ PNG files. %prep %setup -q -n libpng-%{version} +%patch0 -p1 %build # PNG_SAFE_LIMITS_SUPPORTED: http://www.openwall.com/lists/oss-security/2015/01/10/1 From b7377afde8162eb7cbef4352b726072bb821aae60c2a38ef70f7bfe2e04f8800 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Tue, 29 Jan 2019 08:09:10 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/graphics/libpng16?expand=0&rev=115 --- libpng16.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpng16.spec b/libpng16.spec index 80de3d6..bfe45c5 100644 --- a/libpng16.spec +++ b/libpng16.spec @@ -105,7 +105,7 @@ PNG files. export CFLAGS="%{optflags} -O3 -DPNG_SAFE_LIMITS_SUPPORTED -DPNG_SKIP_SETJMP_CHECK $(getconf LFS_CFLAGS)" export LDFLAGS="-Wl,-z,relro,-z,now" %if %{debug_build} -export CFLAGS="$CFLAGS -O0" +export CFLAGS="$CFLAGS -Og" %endif %configure \ --disable-static