96boards-hikey / aosp-device-linaro-hikey

This repository is based off https://android.googlesource.com/device/linaro/hikey/
12 stars 16 forks source link

Hikey 970 compile error #16

Open ZizhanChen opened 4 years ago

ZizhanChen commented 4 years ago
$ make -j$(nproc)
============================================
PLATFORM_VERSION_CODENAME=S
PLATFORM_VERSION=S
TARGET_PRODUCT=hikey970
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a73
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=cortex-a73
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.3.0-53-generic-x86_64-Ubuntu-18.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=AOSP.MASTER
OUT_DIR=out
============================================

The error:

[  0% 207/77199] Copy non-ELF: out/target/product/hikey970/system/vendor/lib/egl
FAILED: out/target/product/hikey970/system/vendor/lib/egl/libGLES_mali.so
/bin/bash -c "(if prebuilts/clang/host/linux-x86/clang-r383902/bin/llvm-readobj -h device/linaro/hikey/hikey970/hisilicon_libs/lib/libGLES_mali.so >/dev/null 2>&1; then echo -e \"\\033[1mout/target/product/hikey970/system/vendor/lib/egl/libGLES_mali.so: \\033[31merror:\\033[0m\\033[1m\" 'found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead.'  \"\\033[0m\" >&2; echo -e \"\\033[1mout/target/product/hikey970/system/vendor/lib/egl/libGLES_mali.so: \\033[31merror:\\033[0m\\033[1m\" 'found ELF file: device/linaro/hikey/hikey970/hisilicon_libs/lib/libGLES_mali.so'  \"\\033[0m\" >&2; false; fi ) && (mkdir -p out/target/product/hikey970/system/vendor/lib/egl/ ) && (rm -f out/target/product/hikey970/system/vendor/lib/egl/libGLES_mali.so ) && (cp \"device/linaro/hikey/hikey970/hisilicon_libs/lib/libGLES_mali.so\" \"out/target/product/hikey970/system/vendor/lib/egl/libGLES_mali.so\" )"
out/target/product/hikey970/system/vendor/lib/egl/libGLES_mali.so: error: found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead. 
out/target/product/hikey970/system/vendor/lib/egl/libGLES_mali.so: error: found ELF file: device/linaro/hikey/hikey970/hisilicon_libs/lib/libGLES_mali.so 
23:10:46 ninja failed with: exit status 1
BalsamCHIHI commented 2 years ago

hi! I got the same error. yes, we can add this flag to BoardConfig.mk, but it is not a clean solution since Google encourages the use of Android.bp files instead of Makefiles. Thant's what the soong suggested the use of these modules (cc_prebuilt_binary / cc_prebuilt_library_shared). in my case, solved this problem by creating Android.bp file in the repo where I put my prebuilt libraries, then I added them as product packages in the product mk file. this is an example :

Android.bp : cc_prebuilt_library { name: "product_package_name_in_MK_file", relative_install_path: "sub_lib/sub_sub_lib", stem: "output_file_name", // .so will be added automatically to out file name. compile_multilib: "both", multilib: { lib32: { srcs: ["path for src 32bit lib"], }, lib64: { srcs: ["path for src 64bit lib"], }, }, strip: { none:true, }, allow_undefined_symbols: true, check_elf_files: false, vendor: true, enabled: true, }

product_mk file :

... PRODUCT_PACKAGES += product_package_name_in_MK_file ...