AOSP build stopped: subcommand failed - android

I got this error when tried to build the AOSP build
repo init -u https://android.googlesource.com/platform/manifest -b android-8.0.0_r33 --depth=1
I can't find anyone who experienced the same.
[ 5% 3232/63193] Lex: applypatch <= bootable/recovery/edify/lexer.ll
FAILED: out/target/product/generic/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp
/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/target/product/generic/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp bootable/recovery/edify/lexer.ll"
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
[ 5% 3239/63193] target StaticLib: li...IES/libv8src_intermediates/libv8src.a)
ninja: build stopped: subcommand failed.
14:04:56 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
Which bring me to the point the issue may lay down in the environment.
VirtualBox, 8gb RAM, 160gb space, Ubuntu 18.04
Does anyone have a proposal what might go wrong here?

Try running export LC_ALL=C before building.
I had a similar error when building on Ubuntu 18.04.

Related

Import source code of lineage os to Android Studio

I want to import source code of Lineage OS to Android studio, for that I am executing below commands
source build/envsetup.sh
then I am executing below command
make idegen && development/tools/idegen/idegen.sh
After executing the above command, I am getting below error
/home/amit/android/lineage/out/s.../android/lineage/out/soong/build.ninja
FAILED: /home/amit/android/lineage/out/soong/build.ninja
/home/amit/android/lineage/out/soong/.bootstrap/bin/soong_build -t -l /home/amit/android/lineage/out/.module_paths/Android.bp.list -b /home/amit/android/lineage/out/soong -n /home/amit/android/lineage/out -d /home/amit/android/lineage/out/soong/build.ninja.d -o /home/amit/android/lineage/out/soong/build.ninja Android.bp
error: vendor/lineage/build/soong/Android.bp:31:8: module "generated_kernel_includes": cmd: unknown variable \'$(KERNEL_MAKE_FLAGS)\'
ninja: build stopped: subcommand failed.
21:52:50 soong bootstrap failed with: exit status 1
#### failed to build some targets (10 seconds) ####
Does anyone have an idea, how to resolve this issue, thanks
I had the same error after following the LOS instructions for using Android Studio. I fixed it by lunching my lineage project:
source build/envsetup.sh
lunch lineage_XYZ-eng
make idegen && development/tools/idegen/idegen.sh
"lineage_XYZ-eng" is defined in my vendorsetup.sh at the root of my LOS device tree.

Ubuntu14.04 First time make whole Android 8.1 or 9 project on QCOM platform failed with abl.elf

I make Android N or P project on QCOM platform first time, it fails immediately with errors as follow:
[ 0% 106/102275] build out/target/product/XXXX/abl.elf
FAILED: out/target/product/XXXX/abl.elf
/bin/bash -c "make -j4 -C bootable/bootloader/edk2 BOOTLOADER_OUT=../../../out/target/product/XXXX/obj/ABL_OBJ all BUILD_SYSTEM_ROOT_IMAGE=1 VERIFIED_BOOT=0 VERIFIED_BOOT_2=1 VERIFIED_BOOT_LE=0 USER_BUILD_VARIANT=0 DISABLE_PARALLEL_DOWNLOAD_FLASH=0 CLANG_BIN=/home/abc/3tb_volume/projects/PROJECT_QP/vendor/qcom/proprietary/llvm-arm-toolchain-ship/6.0/bin/ CLANG_PREFIX=/home/abc/3tb_volume/projects/PROJECT_QP/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android- ABL_USE_SDLLVM=true ABL_SAFESTACK=true SAFESTACK_SUPPORTED_CLANG_VERSION=6.0 CLANG_GCC_TOOLCHAIN=/home/abc/3tb_volume/projects/PROJECT_QP/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 TARGET_ARCHITECTURE=AARCH64 BOARD_BOOTLOADER_PRODUCT_NAME=XXXX"
...
make[1]: * read jobs pipe: Bad file descriptor. Stop.
make[1]: * Waiting for unfinished jobs....
make[1]: Leaving directory '/home/abc/3tb_volume/projects/PROJECT_QP/out/target/product/XXXX/obj/ABL_OBJ/Build/DEBUG_CLANG35/AARCH64/ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm'
build.py...
: error 7000: Failed to execute command
make tbuild [/home/abc/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2/../../../out/target/product/XXXX/obj/ABL_OBJ/Build/DEBUG_CLANG35/AARCH64/ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm]
build.py...
: error F002: Failed to build module
/home/abc/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2/ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf [AARCH64, CLANG35, DEBUG]
Failed -
Build end time: 11:08:39, Oct.30 2018
Build total time: 00:00:01
make: *** [makefile:133: ABL_FV_IMG] Error 1
make: Leaving directory '/home/abc/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2'
[ 0% 109/102275] target thumb C++: memory_replay_tests_32 <= system/extras/memory_replay/Action.cpp
ninja: build stopped: subcommand failed.
11:08:40 ninja failed with: exit status 1
failed to build some targets (01:23 (mm:ss))
I have checked the "bootable/bootloader/edk2" directory with command:
. edksetup.sh
The result is OK!
abc#abc:~/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2$ . edksetup.sh
Loading previous configuration from /home/abc/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2/Conf/BuildEnv.sh
WORKSPACE: /home/abc/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2
EDK_TOOLS_PATH: /home/abc/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2/BaseTools
CONF_PATH: /home/abc/3tb_volume/projects/PROJECT_QP/bootable/bootloader/edk2/Con
I ran into this issue as well. I found the solution here:
https://patchwork.kernel.org/patch/10780137/
It is not the same code but the problem is the exact same problem.
The issue is that the command is expecting to inherit file descriptors from previous commands, but by default in make this does not happen. So you need to add the '+' to that line in the edk2 makefile Here is the patch I used to get it to work:
--- a/makefile 2019-09-25 13:00:28.064160817 -0500
+++ b/makefile 2019-09-25 13:00:34.957369325 -0500
## -129,7 +129,7 ##
$(MAKEPATH)make -C $(EDK_TOOLS) $(PREBUILT_HOST_TOOLS) -j1
ABL_FV_IMG: EDK_TOOLS_BIN
- #. ./edksetup.sh BaseTools && \
+ +#. ./edksetup.sh BaseTools && \
build -p $(WORKSPACE)/QcomModulePkg/QcomModulePkg.dsc \
-a $(ARCHITECTURE) \
-t $(TARGET_TOOLS) \

Build android CopperheadOS for sailfish (AOSP) issue

I am not able to build the source tree whith
make target-files-package -j20
results into :
Starting build with ninja
ninja: Entering directory `.'
[ 0% 5/42089] build out/target/product/marlin/obj/ETC/file_contexts.bin_intermediates/file_contexts.local.tmp
FAILED: /bin/bash -c "m4 -s system/sepolicy/file_contexts out/target/product/marlin/obj/ETC/sectxfile_nl_intermediates/sectxfile_nl > out/target/product/marlin/obj/ETC/file_contexts.bin_intermediates/file_contexts.local.tmp"
/bin/bash: m4: command not found
[ 0% 5/42089] build out/target/product/marlin/obj/ETC/file_contexts.bin_intermediates/file_contexts.device.tmp
FAILED: /bin/bash -c "m4 -s device/google/marlin/sepolicy/file_contexts out/target/product/marlin/obj/ETC/sectxfile_nl_intermediates/sectxfile_nl > out/target/product/marlin/obj/ETC/file_contexts.bin_intermediates/file_contexts.device.tmp"
/bin/bash: m4: command not found
[ 0% 5/42089] Lex: checkpolicy <= external/selinux/libsepol/cil/src/cil_lexer.l
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libsepol_intermediates/cil/src/cil_lexer.c external/selinux/libsepol/cil/src/cil_lexer.l"
flex-2.5.39: fatal internal error, exec of /usr/bin/m4 failed
[ 0% 5/42089] host Executable: mkbootfs (out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
It seems m4 is not installed on your system. If you're running Ubuntu, execute the following command:
sudo apt-get install m4

I try to build android source, make clobber got some errors about "depends on disabled module"

I'm a newbie at aosp. I just following the guild on https://source.android.com/source/building.html in "preparing to build" section.
After I execute repo sync successfully, I run make clobber and got some errors:
ninja: no work to do.
[1/2] glob external/*/Android.bp
[1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -b out/soong -d out/soong/build.ninja.d -o out/soong/build.ninja Android.bp
error: external/llvm/tools/gold/Android.bp:20:1: module "LLVMgold" variant "linux_x86_64_shared": depends on disabled module "libLLVM"
error: development/vndk/tools/vtable-dumper/Android.bp:17:1: module "vndk-vtable-dumper" variant "linux_x86_64": depends on disabled module "libLLVM"
error: external/llvm/tools/llvm-ar/Android.bp:5:1: module "llvm-ar" variant "linux_x86_64": depends on disabled module "libLLVM"
error: external/spirv-llvm/lib/SPIRV/Android.bp:22:1: module "libSPIRV" variant "linux_x86_64_shared": depends on disabled module "libLLVM"
error: frameworks/compile/libbcc/tools/bcc_strip_attr/Android.bp:19:1: module "bcc_strip_attr" variant "linux_x86_64": depends on disabled module "libLLVM"
ninja: build stopped: subcommand failed.
23:55:27 soong bootstrap failed with: exit status 1
build/core/main.mk:24: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
I have no idea about this.It's looks like there are some disabled modules.How can I handle it? I just want to build aosp and import into Intellij Idea to read some java codes.
Try using Ubuntu 14.04 LTS. I had the same error when trying to compile using Ubuntu 16.04 LTS.
It seems export FORCE_BUILD_LLVM_COMPONENTS=true gets you past that...

AOSP Build error: EXECUTABLES/iw_intermediates/version.c

I've made a AOSP build 7.1.1 couple of days ago and it works well. Today I decided to make a clean build (make clean) and start working on it. After that when I'm trying to compile by make otapackage after some time it gives me below error.
[ 44% 7552/17136] build out/target/product/hikari/gen/EXECUTABLES/iw_intermediates/version.c
FAILED: /bin/bash -c "external/iw/version.sh out/target/product/hikari/gen/EXECUTABLES/iw_intermediates/version.c"
fatal: No names found, cannot describe anything.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (01:39:34 (hh:mm:ss)) ####
Everytime, its the same. Any solution ?
Its failing when it is trying to check the git version number.
Inside external/iw/version.sh, it is failing when it gets to:
descr=$(git describe --match=v*):
if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
git update-index --refresh --unmerged > /dev/null
descr=$(git describe --match=v*)
# on git builds check that the version number above
# is correct...
[ "${descr%%-*}" = "v$VERSION" ] || exit 2
v="${descr#v}"
if git diff-index --name-only HEAD | read dummy ; then
v="$v"-dirty
fi
else
v="$VERSION"
fi
echo '#include "iw.h"' > "$OUT"
echo "const char iw_version[] = \"$v\";" >> "$OUT"
I had the same problem and there is two ways to go about it:
You can comment out everything except v="$VERSION" and the last two
echo lines.But this is a temporary fix.
Another way to solve this is by doing a repo sync before you execute make. I fixed it by simply doing a repo sync and that updated and
fixed everything for me.

Categories

Resources