Re-compiling kernel on M2 Berry

I’m running 2017-08-25-raspbian-stretch-preview-bpi-m2u-sd-emmc.img on a Banana Pi M2 Berry.

I need to build the kernel and various libraries to support HW video decoding.

I am following the instructions at but option #1 (to Build all) fails (see below).

Can you tell me what I need to do to get builds to succeed? Should I be cross-compiling on eg Intel or should I do all builds directly on the bPi ?

Build log:

drivers/video/sunxi/disp2/disp/de/lowlevel_v2x/de_vsu.c:348:10: warning: passing argument 1 of ‘memcpy’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
In file included from include/linux/string.h:17:0,
                 from include/linux/dynamic_debug.h:111,
                 from include/linux/kernel.h:14,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:4,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from drivers/video/sunxi/disp2/disp/de/lowlevel_v2x/../include.h:8,
                 from drivers/video/sunxi/disp2/disp/de/lowlevel_v2x/de_rtmx.h:16,
                 from drivers/video/sunxi/disp2/disp/de/lowlevel_v2x/de_scaler.h:16,
                 from drivers/video/sunxi/disp2/disp/de/lowlevel_v2x/de_vsu.c:12:
/home/ubuntu/BPI-M2U-bsp/linux-sunxi/arch/arm/include/asm/string.h:16:15: note: expected ‘void *’ but argument is of type ‘volatile union VSU_COEFF_REG (*)[32]’
 extern void * memcpy(void *, const void *, __kernel_size_t);
make[1]: Leaving directory '/home/ubuntu/BPI-M2U-bsp/linux-sunxi'
Makefile:49: recipe for target 'kernel' failed
make: *** [kernel] Error 2

 Build success!

You are compiling with newer GCC version that is more strict checking, you have two choices: a) Build with older GCC version b) Fix the code but you will find this warning as error in a lot of other places.

memcpy((void *)&vsu_dev[sel][chno]->cvcoeff,


Thanks a lot @avaf, everything is fine with gcc-4 it seems.

Have you suceeded with you project ? And was it working ?

Nope. I was trying to build Kodi on the BPI-M2-Berry, but without success.