96boards-hikey / tools-images-hikey960

Tools and images for HiKey960
BSD 2-Clause "Simplified" License
53 stars 47 forks source link

any idea which aarch64-linux-android-gcc I should use #46

Open butterl opened 4 years ago

butterl commented 4 years ago

Hi, I tried with AOSP master code with Hikey960 4.19 kernel build, it turns out that AOSP removed gcc from prebuilts, which gcc should I use for compile the hikey kernel?

~/code/AOSP/hikey-linaro$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j32
arch/arm64/Makefile:40: LSE atomics not supported by binutils
arch/arm64/Makefile:48: Detected assembler with broken .inst; disassembly will be unreliable
/bin/sh: 1: aarch64-linux-android-gcc: not found
./scripts/gcc-version.sh: line 26: aarch64-linux-android-gcc: command not found
./scripts/gcc-version.sh: line 27: aarch64-linux-android-gcc: command not found
make: aarch64-linux-android-gcc: Command not found
/bin/sh: 1: aarch64-linux-android-gcc: not found
/bin/sh: 1: aarch64-linux-android-gcc: not found
scripts/kconfig/conf  --syncconfig Kconfig
./scripts/gcc-version.sh: 26: ./scripts/gcc-version.sh: aarch64-linux-android-gcc: not found
./scripts/gcc-version.sh: 27: ./scripts/gcc-version.sh: aarch64-linux-android-gcc: not found
./scripts/gcc-version.sh: 29: ./scripts/gcc-version.sh: aarch64-linux-android-gcc: not found
./scripts/gcc-version.sh: 26: ./scripts/gcc-version.sh: aarch64-linux-android-gcc: not found
./scripts/gcc-version.sh: 27: ./scripts/gcc-version.sh: aarch64-linux-android-gcc: not found
./scripts/gcc-version.sh: 29: ./scripts/gcc-version.sh: aarch64-linux-android-gcc: not found
init/Kconfig:17: syntax error
init/Kconfig:16: invalid option
./scripts/clang-version.sh: 15: ./scripts/clang-version.sh: aarch64-linux-android-gcc: not found
./scripts/gcc-plugin.sh: 11: ./scripts/gcc-plugin.sh: aarch64-linux-android-gcc: not found
scripts/kconfig/Makefile:69: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 1
Makefile:538: recipe for target 'syncconfig' failed
make[1]: *** [syncconfig] Error 2
Makefile:647: recipe for target 'include/config/auto.conf.cmd' failed
make: *** [include/config/auto.conf.cmd] Error 2

#### failed to build some targets (1 seconds) ####
liuyq commented 4 years ago

Hi, @butterl Since gcc is not supported by aosp master by default, please change to use clang to build the kernel. For the build instructions, please try like this:

$ repo init -u https://android.googlesource.com/kernel/manifest -b hikey-linaro-android-4.19
$ repo sync
$ cd hikey-kernel
$ git fetch "https://android.googlesource.com/kernel/hikey-linaro" refs/changes/40/1259440/5 && git cherry-pick FETCH_HEAD
$ cd -
$ ./build/build.sh
$ ll out/android-hikey-linaro-4.19/dist/Image.gz-dtb

The changes should be merged soon, after that the steps to apply changes are not necessary any more.

The instructions on https://source.android.com/setup/build/devices will updated after the changes merged.

Please let me know if there is any issues.

Thanks, Yongqin Liu