package/bayer2rgb-neon: fix aarch64 build with BR2_OPTIMIZE_0

Fix the following build failure with aarch64 and BR2_OPTIMIZE_0 raised
since commit 0512910e49:

src/convert-neon-body-bayer8.inc.h: In function 'bayer2rgb_convert_neon':
src/convert-neon.c:233:17: error: third argument to '__builtin_prefetch' must be a constant
  233 |                 __builtin_prefetch(((void const *)(_addr)) + 64, 0, (_lvl)); \
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/convert-neon-body-bayer8.inc.h:8:9: note: in expansion of macro 'do_prefetch'
    8 |         do_prefetch(&in[+1*stride - 1], (rows_per_loop) < 3 ? 3 : 0);
      |         ^~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/307c1c448becd99dfba3a17b3ef816db0bb5cad6

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 13f8df8ed6)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Fabrice Fontaine 2024-01-06 23:42:33 +01:00 committed by Peter Korsgaard
parent 3526dea52c
commit a1af858ee9

View File

@ -19,6 +19,14 @@ ifeq ($(BR2_arm),y)
BAYER2RGB_NEON_CFLAGS += -mfpu=neon
endif
# __builtin_prefetch() third argument must be a constant, but
# bayer2rgb-neon uses a variable, derived from a constant, so some
# optimization is needed to allow the compiler to turn it into a
# constant, otherwise the build fails
ifeq ($(BR2_OPTIMIZE_0),y)
BAYER2RGB_NEON_CFLAGS += -O1
endif
BAYER2RGB_NEON_CONF_ENV = CFLAGS="$(BAYER2RGB_NEON_CFLAGS)"
$(eval $(autotools-package))