This is a cache of It is a snapshot of the page at 2020-03-14T00:02:47.063+0000.
[Hikey960] build break on android-hikey-linaro-4.19 - HiKey 960 - 96Boards Forum

[Hikey960] build break on android-hikey-linaro-4.19

I cloned the 960 kernel from “” but encounter the build break on branch “android-hikey-linaro-4.19” by following the steps from the website.

git clone
cd hikey-linaro
git checkout -b android-hikey-linaro-4.19 origin/android-hikey-linaro-4.19
make ARCH=arm64 hikey960_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24

The error log is showing as below and does anyone have an idea for how to fix it? Thanks.

In file included from ././include/linux/compiler_types.h:64:0,
                 from <command-line>:0:
./arch/arm64/include/asm/jump_label.h: In function 'br_nf_post_routing':
./include/linux/compiler-gcc.h:164:38: warning: asm operand 0 probably doesn't match constraints
 #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
./arch/arm64/include/asm/jump_label.h:31:2: note: in expansion of macro 'asm_volatile_goto'
  asm_volatile_goto("1: nop\n\t"
./include/linux/compiler-gcc.h:164:38: error: impossible constraint in 'asm'
 #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
./arch/arm64/include/asm/jump_label.h:31:2: note: in expansion of macro 'asm_volatile_goto'
  asm_volatile_goto("1: nop\n\t"
scripts/ recipe for target 'net/bridge/br_netfilter_hooks.o' failed
make[2]: *** [net/bridge/br_netfilter_hooks.o] Error 1
scripts/ recipe for target 'net/bridge' failed
make[1]: *** [net/bridge] Error 2
Makefile:1113: recipe for target 'net' failed
make: *** [net] Error 2

#### failed to build some targets (05:31 (mm:ss)) ####

It will work if you use the branch “android-hikey-linaro-4.14”. For now, it seems no one knows how to solve the problem in branch 4.19 here.


I think the building error is related with compiler. I use the toolchain is:

$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

Please check if you are using an old version cross compiler and need to update to newer one.

hi aachen,
i am getting same issue with 4.19 kernel.
please let me know, have u solved thr compailer issue.


do you mean that CROSS_COMPILE=aarch64-linux-android- is same as aarch64-linux-gnu-gcc ? i found that , after source ./build/ and lunch hikey960-userdebug in aosp dir, i found the error aarch64-linux-android-gcc not found, while build hikey-linaro kernel.
wait for your response.Thanks.

Thanks for reporting this. It’s true that I cannot find aarch64-linux-android-gcc from AOSP’s aarch64 toolchain; I am not sure if this is because now Android is mainly using LLVM/Clang for the building so GCC toolchain is not updated anymore. I need to check internally for this.

At the mean time, you could try the toolchain [1] or [2] for Linux kernel building; usually you need to select the toolchian for aarch64 GNU/Linux target (aarch64-none-linux-gnu).

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz dtbs

Updated: GCC is deprecated in AOSP; either download GCC toolchain from Arm or Linaro website, or refer the thread [3] to use Clang for building kernel.

[3] Is it able to use clang to build hikey-linaro?