I am trying to compile androir 12_2.0.0 for i.mx8m plus board. I executed these commands :
source ./imx-android-12.0.0_2.0.0/imx_android_setup.sh
source build/envsetup.sh
lunch evk_8mp-userdebug
./imx-make.sh -j4 2>&1 | tee build-log.txt
error log is :
[ 26% 24327/93012] //external/gptfdisk:sgdisk link sgdisk [linux_glibc]
FAILED: out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/sgdisk
prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++ @out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/sgdisk.rsp prebuilts/clang/host/linux-x86/clang-r416183b1/lib64/clang/12.0.7/lib/linux/libclang_rt.builtins-x86_64.a out/soong/.intermediates/external/gptfdisk/libgptf/linux_glibc_x86_64_static/libgptf.a out/soong/.intermediates/external/e2fsprogs/lib/uuid/libext2_uuid/linux_glibc_x86_64_shared/libext2_uuid-host.so out/soong/.intermediates/external/libcxx/libc++/linux_glibc_x86_64_shared/libc++.so -o out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/sgdisk -target x86_64-linux-gnu -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/x86_64-linux/bin -fuse-ld=lld -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--no-undefined-version --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/sysroot -m64 -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/lib/gcc/x86_64-linux/4.8.3 -Lprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/lib/gcc/x86_64-linux/4.8.3 -Lprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/x86_64-linux/lib64 -ldl -lpthread -lm -lrt -Wl,--exclude-libs=libclang_rt.builtins-x86_64.a -Wl,-rpath,\$ORIGIN/../lib64 -Wl,-rpath,\$ORIGIN/lib64 -pie -nostdlib++
ld.lld: error: undefined symbol: BasicMBRData::BasicMBRData()
>>> referenced by sgdisk.cc:34 (external/gptfdisk/sgdisk.cc:34)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTData::GPTData()
>>> referenced by sgdisk.cc:35 (external/gptfdisk/sgdisk.cc:35)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTPart::GPTPart()
>>> referenced by sgdisk.cc:36 (external/gptfdisk/sgdisk.cc:36)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: BasicMBRData::ReadMBRData(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by sgdisk.cc:46 (external/gptfdisk/sgdisk.cc:46)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: BasicMBRData::GetType(int)
>>> referenced by sgdisk.cc:57 (external/gptfdisk/sgdisk.cc:57)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: BasicMBRData::GetLength(int)
>>> referenced by sgdisk.cc:55 (external/gptfdisk/sgdisk.cc:55)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTData::LoadPartitions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by sgdisk.cc:63 (external/gptfdisk/sgdisk.cc:63)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTData::GetDiskGUID() const
>>> referenced by sgdisk.cc:68 (external/gptfdisk/sgdisk.cc:68)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, GUIDData const&)
>>> referenced by sgdisk.cc:68 (external/gptfdisk/sgdisk.cc:68)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
>>> referenced by sgdisk.cc:73 (external/gptfdisk/sgdisk.cc:73)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
>>> referenced by sgdisk.cc:74 (external/gptfdisk/sgdisk.cc:74)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTData::operator[](unsigned int) const
>>> referenced by sgdisk.cc:71 (external/gptfdisk/sgdisk.cc:71)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTPart::operator=(GPTPart const&)
>>> referenced by sgdisk.cc:71 (external/gptfdisk/sgdisk.cc:71)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GUIDData::GUIDData(GUIDData const&)
>>> referenced by gptpart.h:64 (external/gptfdisk/gptpart.h:64)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTPart::GetDescription()
>>> referenced by sgdisk.cc:75 (external/gptfdisk/sgdisk.cc:75)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GUIDData::~GUIDData()
>>> referenced by sgdisk.cc:73 (external/gptfdisk/sgdisk.cc:73)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTPart::~GPTPart()
>>> referenced by sgdisk.cc:88 (external/gptfdisk/sgdisk.cc:88)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTData::~GPTData()
>>> referenced by sgdisk.cc:88 (external/gptfdisk/sgdisk.cc:88)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: BasicMBRData::~BasicMBRData()
>>> referenced by sgdisk.cc:88 (external/gptfdisk/sgdisk.cc:88)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTDataCL::GPTDataCL()
>>> referenced by sgdisk.cc:97 (external/gptfdisk/sgdisk.cc:97)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTDataCL::DoOptions(int, char**)
>>> referenced by sgdisk.cc:98 (external/gptfdisk/sgdisk.cc:98)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
ld.lld: error: undefined symbol: GPTDataCL::~GPTDataCL()
>>> referenced by sgdisk.cc:99 (external/gptfdisk/sgdisk.cc:99)
>>> out/soong/.intermediates/external/gptfdisk/sgdisk/linux_glibc_x86_64/obj/external/gptfdisk/sgdisk.o:(main)
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
[ 26% 24328/93012] //system/vold:secdiscard clang-tidy secdiscard.cpp
[ 26% 24329/93012] //external/mksh:sh clang src/eval.c
[ 26% 24330/93012] //external/mksh:sh clang src/edit.c
ninja: build stopped: subcommand failed.
11:18:23 ninja failed with: exit status 1
#### failed to build some targets (54:08 (mm:ss)) ####
Solved! Go to Solution.
Hello @hector_delgado.
This issue because of missing include. I added "#include basicmbr.h" to sgdisk.cc file and it is resolved.
regards
Hello @hector_delgado.
This issue because of missing include. I added "#include basicmbr.h" to sgdisk.cc file and it is resolved.
regards
Hi @2744194 ,
I hope you're having a great day. For what board are you building android for? Thank you.
Best regards,
Hector.