Skip to content

Commit

Permalink
external libs, libwebp: apply two build fixes to source from mainstream
Browse files Browse the repository at this point in the history
- prebuilt binaries not affected
  • Loading branch information
sezero committed Dec 8, 2019
1 parent 1970df7 commit b1fb872
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
29 changes: 29 additions & 0 deletions external/libwebp-1.0.3/0002-libwebp.git-cf0e903c.patch
@@ -0,0 +1,29 @@
From cf0e903c898b378365439b410c50dcde74573713 Mon Sep 17 00:00:00 2001
From: Oliver Wolff <oliver.wolff@qt.io>
Date: Wed, 27 Nov 2019 15:03:57 +0100
Subject: [PATCH] dsp/lossless: Fix non gcc ARM builds

The workaround for GCC ARM must not be applied when another toolchain
(like MSVC) is used for the build.

Change-Id: I11ec4558902063ccb085d3f435e24b3a60739dd5
---
src/dsp/lossless.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/dsp/lossless.c b/src/dsp/lossless.c
index b2fbf17..aad5f43 100644
--- a/src/dsp/lossless.c
+++ b/src/dsp/lossless.c
@@ -81,7 +81,7 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,

// gcc <= 4.9 on ARM generates incorrect code in Select() when Sub3() is
// inlined.
-#if defined(__arm__) && LOCAL_GCC_VERSION <= 0x409
+#if defined(__arm__) && defined(__GNUC__) && LOCAL_GCC_VERSION <= 0x409
# define LOCAL_INLINE __attribute__ ((noinline))
#else
# define LOCAL_INLINE WEBP_INLINE
--
1.7.1

34 changes: 34 additions & 0 deletions external/libwebp-1.0.3/0003-libwebp.git-b0e09e34.patch
@@ -0,0 +1,34 @@
From b0e09e346fd7b0befec5cd77b7ca3ae518447f1b Mon Sep 17 00:00:00 2001
From: Cheng Yi <cyi@google.com>
Date: Fri, 6 Dec 2019 01:08:21 +0000
Subject: [PATCH] dec_neon: Fix build failure under some toolchains

some toolchains may implement vcreate_u64 as an assignment to a vector
causing a type mismatch:
invalid conversion between vector type 'uint64x1_t' (vector of 1
'uint64_t' value) and integer type 'unsigned int' of different size
const uint64x1_t LKJI____ = vcreate_u64(L | (K << 8) | (J << 16) | (I << 24));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I5c7b0076ad66d4b3fcdcb7ee9f59bbaa6f19b783
---
src/dsp/dec_neon.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/dsp/dec_neon.c b/src/dsp/dec_neon.c
index ffa697f..7d132af 100644
--- a/src/dsp/dec_neon.c
+++ b/src/dsp/dec_neon.c
@@ -1361,7 +1361,8 @@ static void RD4_NEON(uint8_t* dst) { // Down-right
const uint32_t J = dst[-1 + 1 * BPS];
const uint32_t K = dst[-1 + 2 * BPS];
const uint32_t L = dst[-1 + 3 * BPS];
- const uint64x1_t LKJI____ = vcreate_u64(L | (K << 8) | (J << 16) | (I << 24));
+ const uint64x1_t LKJI____ =
+ vcreate_u64((uint64_t)L | (K << 8) | (J << 16) | (I << 24));
const uint64x1_t LKJIXABC = vorr_u64(LKJI____, ____XABC);
const uint8x8_t KJIXABC_ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 8));
const uint8x8_t JIXABC__ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 16));
--
1.7.1

3 changes: 2 additions & 1 deletion external/libwebp-1.0.3/src/dsp/dec_neon.c
Expand Up @@ -1361,7 +1361,8 @@ static void RD4_NEON(uint8_t* dst) { // Down-right
const uint32_t J = dst[-1 + 1 * BPS];
const uint32_t K = dst[-1 + 2 * BPS];
const uint32_t L = dst[-1 + 3 * BPS];
const uint64x1_t LKJI____ = vcreate_u64(L | (K << 8) | (J << 16) | (I << 24));
const uint64x1_t LKJI____ =
vcreate_u64((uint64_t)L | (K << 8) | (J << 16) | (I << 24));
const uint64x1_t LKJIXABC = vorr_u64(LKJI____, ____XABC);
const uint8x8_t KJIXABC_ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 8));
const uint8x8_t JIXABC__ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 16));
Expand Down
2 changes: 1 addition & 1 deletion external/libwebp-1.0.3/src/dsp/lossless.c
Expand Up @@ -81,7 +81,7 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,

// gcc <= 4.9 on ARM generates incorrect code in Select() when Sub3() is
// inlined.
#if defined(__arm__) && LOCAL_GCC_VERSION <= 0x409
#if defined(__arm__) && defined(__GNUC__) && LOCAL_GCC_VERSION <= 0x409
# define LOCAL_INLINE __attribute__ ((noinline))
#else
# define LOCAL_INLINE WEBP_INLINE
Expand Down

0 comments on commit b1fb872

Please sign in to comment.