Accepting request 669458 from graphics

- fix arm build [bsc#1121829]
  + libpng-arm-free.patch

- asan_build: build ASAN included
- debug_build: build more suitable for debugging, install pngcp

OBS-URL: https://build.opensuse.org/request/show/669458
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libpng16?expand=0&rev=41
This commit is contained in:
Stephan Kulow 2019-02-04 20:24:19 +00:00 committed by Git OBS Bridge
commit 003ccb84a9
3 changed files with 51 additions and 3 deletions

16
libpng-arm-free.patch Normal file
View File

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

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Jan 28 11:43:05 UTC 2019 - Petr Gajdos <pgajdos@suse.com>
- fix arm build [bsc#1121829]
+ libpng-arm-free.patch
-------------------------------------------------------------------
Mon Jan 14 13:11:39 UTC 2019 - Petr Gajdos <pgajdos@suse.com>
- asan_build: build ASAN included
- debug_build: build more suitable for debugging, install pngcp
-------------------------------------------------------------------
Mon Dec 31 09:41:53 UTC 2018 - Petr Gajdos <pgajdos@suse.com>

View File

@ -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
@ -16,7 +16,9 @@
#
#
%define debug_build 0
%define asan_build 0
%define major 1
%define minor 6
%define micro 36
@ -30,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
@ -95,17 +98,28 @@ 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
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 -Og"
%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 +128,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 +157,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