Cannot build an Android

Please describe your issue below:

Followed this guide to download source codes : Download The Android Source Code | Khadas Documentation
Followed this guide to build an image : Building Android Source Code | Khadas Documentation

  • Host : Ubuntu 20.04
  • Additional tool chains (may not relevant to this issue)
    • gcc-linaro-7.3.1-2018.05-i686_aarch64-elf
    • gcc-linaro-7.3.1-2018.05-i686_arm-linux-gnueabihf
    • gcc-linaro-aarch64-none-elf-4.8-2013.11_linux
    • gcc-arm-none-eabi-6-2017-q2-update
    • xpack-riscv-none-embed-gcc-8.3.0-1.2

Post a console log of your issue below:


$ . build/envsetup.sh
$ lunch kvim4-userdebug
$ export CROSS_COMPILE=/opt/toolchains/gcc-linaro-7.3.1-2018.05-i686_aarch64-elf/bin/aarch64-elf-
$ export CROSS_COMPILE_ARM64=/opt/toolchains/gcc-linaro-7.3.1-2018.05-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
$ make -j20 otapackage
(...build messages...)
FAILED: out/target/product/kvim4/obj/PACKAGING/depmod_vendor_stripped_intermediates/8723bu.ko
/bin/bash -c "prebuilts/clang/host/linux-x86/clang-r383902b1/bin/llvm-strip -o out/target/product/kvim4/obj/PACKAGING/depmod_vendor_stripped_intermediates/8723bu.ko --strip-debug device/khadas/kvim4-kernel/5.4/lib/modules/8723bu.ko"
prebuilts/clang/host/linux-x86/clang-r383902b1/bin/llvm-strip: error: 'device/khadas/kvim4-kernel/5.4/lib/modules/8723bu.ko': The file was not recognized as a valid object file
ninja failed with: exit status 1

Both files are from the source code repository. And none of them are changed

$ cd prebuilts/clang/host/linux-x86/clang-r383902b1/bin
$ git status .
nothing to commit, working tree clean
$ cd -;cd device/khadas/kvim4-kernel/5.4/lib/modules/
$ git status .
nothing to commit, working tree clean

And, of course, a manual execution also fails

$ prebuilts/clang/host/linux-x86/clang-r383902b1/bin/llvm-strip -o out/target/product/kvim4/obj/PACKAGING/depmod_vendor_stripped_intermediates/8723bu.ko --strip-debug device/khadas/kvim4-kernel/5.4/lib/modules/8723bu.ko
prebuilts/clang/host/linux-x86/clang-r383902b1/bin/llvm-strip: error: 'device/khadas/kvim4-kernel/5.4/lib/modules/8723bu.ko': The file was not recognized as a valid object file

Any suggestion?

Thanks, @goenjoy
I should read guides and forum articles more carefully. :slight_smile: