From 890fff51f6805bb6ac2c004795d0e1443d42ab21 Mon Sep 17 00:00:00 2001 From: newbluemoon Date: Wed, 25 Oct 2017 08:22:33 +0200 Subject: [PATCH] freeimage: disable ARM Neon in libpng + fix narrowing patch --- .../freeimage/patches/disable_arm_neon.patch | 20 +++ .../patches/fix-gcc6-dcraw_narrowing.patch | 138 ++++++++++-------- srcpkgs/freeimage/template | 2 +- 3 files changed, 99 insertions(+), 61 deletions(-) create mode 100644 srcpkgs/freeimage/patches/disable_arm_neon.patch diff --git a/srcpkgs/freeimage/patches/disable_arm_neon.patch b/srcpkgs/freeimage/patches/disable_arm_neon.patch new file mode 100644 index 00000000000..e324767612f --- /dev/null +++ b/srcpkgs/freeimage/patches/disable_arm_neon.patch @@ -0,0 +1,20 @@ +--- fi/Source/LibPNG/pngpriv.h.orig 2015-03-02 01:50:58.000000000 +0100 ++++ fi/Source/LibPNG/pngpriv.h 2017-10-24 21:04:35.110537516 +0200 +@@ -107,6 +107,7 @@ + * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely + * do this. + */ ++#define PNG_ARM_NEON_OPT 0 + #ifndef PNG_ARM_NEON_OPT + /* ARM NEON optimizations are being controlled by the compiler settings, + * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon +--- fip/Source/LibPNG/pngpriv.h.orig 2015-03-02 01:50:58.000000000 +0100 ++++ fip/Source/LibPNG/pngpriv.h 2017-10-24 21:04:35.110537516 +0200 +@@ -107,6 +107,7 @@ + * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely + * do this. + */ ++#define PNG_ARM_NEON_OPT 0 + #ifndef PNG_ARM_NEON_OPT + /* ARM NEON optimizations are being controlled by the compiler settings, + * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon diff --git a/srcpkgs/freeimage/patches/fix-gcc6-dcraw_narrowing.patch b/srcpkgs/freeimage/patches/fix-gcc6-dcraw_narrowing.patch index 1e20a5e1dd4..d4d5af5144d 100644 --- a/srcpkgs/freeimage/patches/fix-gcc6-dcraw_narrowing.patch +++ b/srcpkgs/freeimage/patches/fix-gcc6-dcraw_narrowing.patch @@ -47,59 +47,6 @@ + +0,+1,+1,+2,0,'\x10', +0,+1,+2,-1,1,'\x40', +0,+1,+2,+0,0,'\x60', + +0,+1,+2,+1,0,'\x20', +0,+1,+2,+2,0,'\x10', +1,-2,+1,+0,0,'\x80', + +1,-1,+1,+1,0,'\x88', +1,+0,+1,+2,0,'\x08', +1,+0,+2,-1,0,'\x40', -+ +1,+0,+2,+1,0,'\x10' - }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; - ushort (*brow[5])[4], *pix; - int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4]; ---- fi/Source/LibRawLite/internal/dcraw_common.cpp 2015-03-08 21:27:50.000000000 +0100 -+++ fi/Source/LibRawLite/internal/dcraw_common.cpp 2016-09-15 10:09:37.423698411 +0200 -@@ -4520,28 +4520,28 @@ - void CLASS vng_interpolate() - { - static const signed char *cp, terms[] = { -- -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01, -- -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01, -- -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, -- -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06, -- -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04, -- -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01, -- -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40, -- -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11, -- -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11, -- -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22, -- -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44, -- -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10, -- -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04, -- +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40, -- +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20, -- +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08, -- +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20, -- +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44, -- +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60, -- +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80, -- +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40, -- +1,+0,+2,+1,0,0x10 -+ -2,-2,+0,-1,0,'\x01', -2,-2,+0,+0,1,'\x01', -2,-1,-1,+0,0,'\x01', -+ -2,-1,+0,-1,0,'\x02', -2,-1,+0,+0,0,'\x03', -2,-1,+0,+1,1,'\x01', -+ -2,+0,+0,-1,0,'\x06', -2,+0,+0,+0,1,'\x02', -2,+0,+0,+1,0,'\x03', -+ -2,+1,-1,+0,0,'\x04', -2,+1,+0,-1,1,'\x04', -2,+1,+0,+0,0,'\x06', -+ -2,+1,+0,+1,0,'\x02', -2,+2,+0,+0,1,'\x04', -2,+2,+0,+1,0,'\x04', -+ -1,-2,-1,+0,0,'\x80', -1,-2,+0,-1,0,'\x01', -1,-2,+1,-1,0,'\x01', -+ -1,-2,+1,+0,1,'\x01', -1,-1,-1,+1,0,'\x88', -1,-1,+1,-2,0,'\x40', -+ -1,-1,+1,-1,0,'\x22', -1,-1,+1,+0,0,'\x33', -1,-1,+1,+1,1,'\x11', -+ -1,+0,-1,+2,0,'\x08', -1,+0,+0,-1,0,'\x44', -1,+0,+0,+1,0,'\x11', -+ -1,+0,+1,-2,1,'\x40', -1,+0,+1,-1,0,'\x66', -1,+0,+1,+0,1,'\x22', -+ -1,+0,+1,+1,0,'\x33', -1,+0,+1,+2,1,'\x10', -1,+1,+1,-1,1,'\x44', -+ -1,+1,+1,+0,0,'\x66', -1,+1,+1,+1,0,'\x22', -1,+1,+1,+2,0,'\x10', -+ -1,+2,+0,+1,0,'\x04', -1,+2,+1,+0,1,'\x04', -1,+2,+1,+1,0,'\x04', -+ +0,-2,+0,+0,1,'\x80', +0,-1,+0,+1,1,'\x88', +0,-1,+1,-2,0,'\x40', -+ +0,-1,+1,+0,0,'\x11', +0,-1,+2,-2,0,'\x40', +0,-1,+2,-1,0,'\x20', -+ +0,-1,+2,+0,0,'\x30', +0,-1,+2,+1,1,'\x10', +0,+0,+0,+2,1,'\x08', -+ +0,+0,+2,-2,1,'\x40', +0,+0,+2,-1,0,'\x60', +0,+0,+2,+0,1,'\x20', -+ +0,+0,+2,+1,0,'\x30', +0,+0,+2,+2,1,'\x10', +0,+1,+1,+0,0,'\x44', -+ +0,+1,+1,+2,0,'\x10', +0,+1,+2,-1,1,'\x40', +0,+1,+2,+0,0,'\x60', -+ +0,+1,+2,+1,0,'\x20', +0,+1,+2,+2,0,'\x10', +1,-2,+1,+0,0,'\x80', -+ +1,-1,+1,+1,0,'\x88', +1,+0,+1,+2,0,'\x08', +1,+0,+2,-1,0,'\x40', + +1,+0,+2,+1,0,'\x10' }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; ushort (*brow[5])[4], *pix; @@ -157,8 +104,17 @@ }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; ushort (*brow[5])[4], *pix; int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4]; ---- fip/Source/LibRawLite/internal/dcraw_common.cpp 2015-03-08 21:27:50.000000000 +0100 -+++ fip/Source/LibRawLite/internal/dcraw_common.cpp 2016-09-15 10:09:37.423698411 +0200 +--- fi/Source/LibRawLite/internal/dcraw_common.cpp 2015-03-08 21:27:50.000000000 +0100 ++++ fi/Source/LibRawLite/internal/dcraw_common.cpp 2016-09-15 10:09:37.423698411 +0200 +@@ -2479,7 +2479,7 @@ + + void CLASS kodak_radc_load_raw() + { +- static const char src[] = { ++ static const signed char src[] = { + 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8, + 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8, + 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8, @@ -4520,28 +4520,28 @@ void CLASS vng_interpolate() { @@ -190,22 +146,84 @@ + -2,+0,+0,-1,0,'\x06', -2,+0,+0,+0,1,'\x02', -2,+0,+0,+1,0,'\x03', + -2,+1,-1,+0,0,'\x04', -2,+1,+0,-1,1,'\x04', -2,+1,+0,+0,0,'\x06', + -2,+1,+0,+1,0,'\x02', -2,+2,+0,+0,1,'\x04', -2,+2,+0,+1,0,'\x04', -+ -1,-2,-1,+0,0,'\x80', -1,-2,+0,-1,0,'\x01', -1,-2,+1,-1,0,'\x01', -+ -1,-2,+1,+0,1,'\x01', -1,-1,-1,+1,0,'\x88', -1,-1,+1,-2,0,'\x40', ++ -1,-2,-1,+0,0,-128, -1,-2,+0,-1,0,'\x01', -1,-2,+1,-1,0,'\x01', ++ -1,-2,+1,+0,1,'\x01', -1,-1,-1,+1,0,-120, -1,-1,+1,-2,0,'\x40', + -1,-1,+1,-1,0,'\x22', -1,-1,+1,+0,0,'\x33', -1,-1,+1,+1,1,'\x11', + -1,+0,-1,+2,0,'\x08', -1,+0,+0,-1,0,'\x44', -1,+0,+0,+1,0,'\x11', + -1,+0,+1,-2,1,'\x40', -1,+0,+1,-1,0,'\x66', -1,+0,+1,+0,1,'\x22', + -1,+0,+1,+1,0,'\x33', -1,+0,+1,+2,1,'\x10', -1,+1,+1,-1,1,'\x44', + -1,+1,+1,+0,0,'\x66', -1,+1,+1,+1,0,'\x22', -1,+1,+1,+2,0,'\x10', + -1,+2,+0,+1,0,'\x04', -1,+2,+1,+0,1,'\x04', -1,+2,+1,+1,0,'\x04', -+ +0,-2,+0,+0,1,'\x80', +0,-1,+0,+1,1,'\x88', +0,-1,+1,-2,0,'\x40', ++ +0,-2,+0,+0,1,-128, +0,-1,+0,+1,1,-120, +0,-1,+1,-2,0,'\x40', + +0,-1,+1,+0,0,'\x11', +0,-1,+2,-2,0,'\x40', +0,-1,+2,-1,0,'\x20', + +0,-1,+2,+0,0,'\x30', +0,-1,+2,+1,1,'\x10', +0,+0,+0,+2,1,'\x08', + +0,+0,+2,-2,1,'\x40', +0,+0,+2,-1,0,'\x60', +0,+0,+2,+0,1,'\x20', + +0,+0,+2,+1,0,'\x30', +0,+0,+2,+2,1,'\x10', +0,+1,+1,+0,0,'\x44', + +0,+1,+1,+2,0,'\x10', +0,+1,+2,-1,1,'\x40', +0,+1,+2,+0,0,'\x60', -+ +0,+1,+2,+1,0,'\x20', +0,+1,+2,+2,0,'\x10', +1,-2,+1,+0,0,'\x80', -+ +1,-1,+1,+1,0,'\x88', +1,+0,+1,+2,0,'\x08', +1,+0,+2,-1,0,'\x40', ++ +0,+1,+2,+1,0,'\x20', +0,+1,+2,+2,0,'\x10', +1,-2,+1,+0,0,-128, ++ +1,-1,+1,+1,0,-120, +1,+0,+1,+2,0,'\x08', +1,+0,+2,-1,0,'\x40', ++ +1,+0,+2,+1,0,'\x10' + }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; + ushort (*brow[5])[4], *pix; + int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4]; +--- fip/Source/LibRawLite/internal/dcraw_common.cpp 2015-03-08 21:27:50.000000000 +0100 ++++ fip/Source/LibRawLite/internal/dcraw_common.cpp 2016-09-15 10:09:37.423698411 +0200 +@@ -2479,7 +2479,7 @@ + + void CLASS kodak_radc_load_raw() + { +- static const char src[] = { ++ static const signed char src[] = { + 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8, + 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8, + 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8, +@@ -4520,28 +4520,28 @@ + void CLASS vng_interpolate() + { + static const signed char *cp, terms[] = { +- -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01, +- -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01, +- -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, +- -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06, +- -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04, +- -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01, +- -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40, +- -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11, +- -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11, +- -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22, +- -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44, +- -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10, +- -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04, +- +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40, +- +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20, +- +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08, +- +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20, +- +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44, +- +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60, +- +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80, +- +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40, +- +1,+0,+2,+1,0,0x10 ++ -2,-2,+0,-1,0,'\x01', -2,-2,+0,+0,1,'\x01', -2,-1,-1,+0,0,'\x01', ++ -2,-1,+0,-1,0,'\x02', -2,-1,+0,+0,0,'\x03', -2,-1,+0,+1,1,'\x01', ++ -2,+0,+0,-1,0,'\x06', -2,+0,+0,+0,1,'\x02', -2,+0,+0,+1,0,'\x03', ++ -2,+1,-1,+0,0,'\x04', -2,+1,+0,-1,1,'\x04', -2,+1,+0,+0,0,'\x06', ++ -2,+1,+0,+1,0,'\x02', -2,+2,+0,+0,1,'\x04', -2,+2,+0,+1,0,'\x04', ++ -1,-2,-1,+0,0,-128, -1,-2,+0,-1,0,'\x01', -1,-2,+1,-1,0,'\x01', ++ -1,-2,+1,+0,1,'\x01', -1,-1,-1,+1,0,-120, -1,-1,+1,-2,0,'\x40', ++ -1,-1,+1,-1,0,'\x22', -1,-1,+1,+0,0,'\x33', -1,-1,+1,+1,1,'\x11', ++ -1,+0,-1,+2,0,'\x08', -1,+0,+0,-1,0,'\x44', -1,+0,+0,+1,0,'\x11', ++ -1,+0,+1,-2,1,'\x40', -1,+0,+1,-1,0,'\x66', -1,+0,+1,+0,1,'\x22', ++ -1,+0,+1,+1,0,'\x33', -1,+0,+1,+2,1,'\x10', -1,+1,+1,-1,1,'\x44', ++ -1,+1,+1,+0,0,'\x66', -1,+1,+1,+1,0,'\x22', -1,+1,+1,+2,0,'\x10', ++ -1,+2,+0,+1,0,'\x04', -1,+2,+1,+0,1,'\x04', -1,+2,+1,+1,0,'\x04', ++ +0,-2,+0,+0,1,-128, +0,-1,+0,+1,1,-120, +0,-1,+1,-2,0,'\x40', ++ +0,-1,+1,+0,0,'\x11', +0,-1,+2,-2,0,'\x40', +0,-1,+2,-1,0,'\x20', ++ +0,-1,+2,+0,0,'\x30', +0,-1,+2,+1,1,'\x10', +0,+0,+0,+2,1,'\x08', ++ +0,+0,+2,-2,1,'\x40', +0,+0,+2,-1,0,'\x60', +0,+0,+2,+0,1,'\x20', ++ +0,+0,+2,+1,0,'\x30', +0,+0,+2,+2,1,'\x10', +0,+1,+1,+0,0,'\x44', ++ +0,+1,+1,+2,0,'\x10', +0,+1,+2,-1,1,'\x40', +0,+1,+2,+0,0,'\x60', ++ +0,+1,+2,+1,0,'\x20', +0,+1,+2,+2,0,'\x10', +1,-2,+1,+0,0,-128, ++ +1,-1,+1,+1,0,-120, +1,+0,+1,+2,0,'\x08', +1,+0,+2,-1,0,'\x40', + +1,+0,+2,+1,0,'\x10' }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; ushort (*brow[5])[4], *pix; diff --git a/srcpkgs/freeimage/template b/srcpkgs/freeimage/template index c7363e82a3a..bbd47b418d5 100644 --- a/srcpkgs/freeimage/template +++ b/srcpkgs/freeimage/template @@ -1,7 +1,7 @@ # Template file for 'freeimage' pkgname=freeimage version=3.17.0 -revision=2 +revision=3 wrksrc=FreeImage build_style=gnu-makefile hostmakedepends="unzip"