Add upstream patch to fix build on aarch64 (NEON issues)

This commit is contained in:
Peter Robinson 2014-11-03 21:36:36 +00:00
parent 98862cde54
commit 85903e107b
2 changed files with 48 additions and 9 deletions

39
libpng-fix-arm-neon.patch Normal file
View File

@ -0,0 +1,39 @@
diff --git a/configure.ac b/configure.ac
index d60a5ab..df399e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -283,17 +283,21 @@ AC_ARG_ENABLE([arm-neon],
[case "$enableval" in
no|off)
# disable the default enabling on __ARM_NEON__ systems:
+ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
[Disable ARM Neon optimizations])
# Prevent inclusion of the assembler files below:
enable_arm_neon=no;;
check)
+ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
[Check for ARM Neon support at run-time]);;
api)
+ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
[Turn on ARM Neon optimizations at run-time]);;
yes|on)
+ AC_DEFINE([PNG_ARM_NEON], [], [ARM NEON support])
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
[Enable ARM Neon optimizations])
AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if]
diff --git a/pngpriv.h b/pngpriv.h
index aa63cfa..a5f72b1 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -123,7 +123,7 @@
* Note that gcc-4.9 defines __ARM_NEON instead of __ARM_NEON__, so we
* check both variants.
*/
-# if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
+# if defined(PNG_ARM_NEON) && (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
defined(PNG_ALIGNED_MEMORY_SUPPORTED)
# define PNG_ARM_NEON_OPT 2
# else

View File

@ -2,7 +2,7 @@ Summary: A library of functions for manipulating PNG image format files
Name: libpng
Epoch: 2
Version: 1.6.14
Release: 1%{?dist}
Release: 2%{?dist}
License: zlib
Group: System Environment/Libraries
URL: http://www.libpng.org/pub/png/
@ -10,14 +10,12 @@ URL: http://www.libpng.org/pub/png/
# Note: non-current tarballs get moved to the history/ subdirectory,
# so look there if you fail to retrieve the version you want
Source0: ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-%{version}.tar.gz
Source1: pngusr.dfa
Patch0: libpng-multilib.patch
Patch1: libpng-fix-arm-neon.patch
BuildRequires: zlib-devel, pkgconfig, libtool
BuildRequires: autoconf >= 2.68
BuildRequires: automake
BuildRequires: zlib-devel
BuildRequires: autoconf automake libtool
%description
The libpng package contains a library of functions for creating and
@ -63,15 +61,14 @@ The libpng-tools package contains tools used by the authors of libpng.
%prep
%setup -q
# Provide pngusr.dfa for build.
cp -p %{SOURCE1} .
%patch0 -p1
%patch1 -p1 -b .arm
%build
autoreconf -vi
autoreconf -vif
%configure
make %{?_smp_mflags} DFA_XTRA=pngusr.dfa
@ -110,6 +107,9 @@ make check
%{_bindir}/pngfix
%changelog
* Mon Nov 3 2014 Peter Robinson <pbrobinson@fedoraproject.org> 2:1.6.14-2
- Add upstream patch to fix build on aarch64 (NEON issues)
* Mon Oct 27 2014 Petr Hracek <phracek@redhat.com> - 2:1.6.14-1
- Update to libpng 1.6.14 for minor bug fixes (#1147423)