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
Related
PRODUCT_SOONG_NAMESPACES=hardware/google/av hardware/google/interfaces vendor/qcom/opensource/commonsys/packages/apps/Bluetooth vendor/qcom/opensource/commonsys/system/bt/conf
[100% 1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
FAILED: out/soong/.bootstrap/build.ninja
out/soong/.minibootstrap/minibp -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/.bootstrap/build.ninja.d -globFile out/soong/.minibootstrap/build-globs.ninja -o out/soong/.bootstrap/build.ninja Android.bp
internal error: could not open symlink kernel/msm-4.14/Android.bp; its target (../../../../../../../code/SC665S_Android11.0_R02_r020/kernel/msm-4.14/Androidbp) cannot be opened
09:54:32 soong minibootstrap failed with: exit status 1
failed to build some targets
real 0m0.727s
user 0m2.252s
sys 0m0.392s
[build.sh]: FAILED: make dist –j4 ENABLE_AB=true SYSTEMEXT_SEPARATE_PARTITION_ENABLE=true BOARD_DYNAMIC_PARTITION_ENABLE=true ENABLE_VIRTUAL_AB=false SHIPPING_API_LEVEL=29
How to solve this error.
Thanks in advance.
After build u-boot success, I'm trying to build kernel for android 11.5.4 by ubuntu 18.04 but it's getting an error that can't continue. As you can see the error is on the line:
"
/usr/bin/as: unrecognized option '-EL'
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
".
I installed the environment:
"sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip u-boot-tools"
i tried installing clang 11 and llvm 11 but it didn't help at all. Can I refer to more buildable environments?
Thank you.
Here is my log:
===== Build Kernel =====>
CONFIG_KERNEL_VERSION: 5.4
------device/amlogic/vnptt_smb_3/build.config.meson.arm64.trunk-----
KERNEL_DEVICETREE: s4_s905y4_ap222_drm
=====ab update & vendor boot mode=====
=================================
========================================================
= build config: /media/thanhchung/data/s905y4_r_fw/device/amlogic/vnptt_smb_3/build.config.meson.arm64.trunk
. common/build.config.common
. common/build.config.aarch64
. device/amlogic/common/kernelbuild/build.config.common
DEFCONFIG=meson64_a64_defconfig
EXTRA_CMDS=''
#It is a must to set GPU driver's version
GPU_DRV_VERSION=r25p0
KERNEL_DEVICETREE=s4_s905y4_ap222_drm
KERNEL_DEVICETREE_DDR_1G=s4_s905y4_ap222_drm_1g
DTBO_DEVICETREE=android_overlay_dt
PRODUCT_DIRNAME=device/amlogic/vnptt_smb_3
BOARD_DEVICENAME=vnptt_smb_3
ENABLE_KASAN=false
# Not saving any kernel images. This build step is meant purely to generate the .kos.
FILES=""
EXT_MODULES="
vendor/amlogic/common/wifi_bt/wifi/configs/5_4
vendor/amlogic/common/wifi_bt/bluetooth/configs/5_4
vendor/amlogic/common/gpu/bifrost
vendor/amlogic/common/tdk_linuxdriver
hardware/amlogic/media_modules
device/amlogic/common/dolby_ms12/kmod
"
STOP_SHIP_TRACEPRINTK=1
PATH=/media/thanhchung/data/s905y4_r_fw/build/build-tools/path/linux-x86:/media/thanhchung/data/s905y4_r_fw/prebuilts/clang/host/linux-x86/clang-r383902/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
========================================================
Setting up for build
+ '[' ']'
+ '[' '' == true ']'
+ '[' -n '' ']'
+ cp common/arch/arm64/configs/meson64_a64_R_defconfig common/arch/arm64/configs/meson64_a64_gki_defconfig
+ '[' '!' -z '' ']'
+ '[' '' == user ']'
+ cd common
+ make CC=clang HOSTCC=clang LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy O=/media/thanhchung/data/s905y4_r_fw/out/android11-5.4/common meson64_a64_gki_defconfig
make[1]: Entering directory '/media/thanhchung/data/s905y4_r_fw/out/android11-5.4/common'
GEN Makefile
#
# No change to .config
#
make[1]: Leaving directory '/media/thanhchung/data/s905y4_r_fw/out/android11-5.4/common'
+ rm -fr common/arch/arm64/configs/meson64_a64_gki_defconfig
+ set +x
========================================================
Building kernel
+ grep '\.ko$'
+ find /media/thanhchung/data/s905y4_r_fw/out/android11-5.4/common/ -type f
+ xargs rm -fr
+ '[' ']'
+ cd /media/thanhchung/data/s905y4_r_fw/out/android11-5.4/common
+ make O=/media/thanhchung/data/s905y4_r_fw/out/android11-5.4/common CC=clang HOSTCC=clang LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy
arch/arm64/Makefile:52: Detected assembler with broken .inst; disassembly will be unreliable
GEN Makefile
grep: /media/thanhchung/data/s905y4_r_fw/common/.config: No such file or directory
CC scripts/mod/empty.o
/usr/bin/as: unrecognized option '-EL'
clang-11: error: assembler command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/media/thanhchung/data/s905y4_r_fw/common/scripts/Makefile.build:283: scripts/mod/empty.o] Error 1
make[1]: *** [/media/thanhchung/data/s905y4_r_fw/common/Makefile:1229: prepare0] Error 2
make[1]: *** Waiting for unfinished jobs....
DTC arch/arm64/boot/dts/amlogic/s4_s905y4_ap222_drm.dtb
make: *** [/media/thanhchung/data/s905y4_r_fw/common/Makefile:179: sub-make] Error 2
build kernel error
My mistake. I was working on the wrong build environment.
you need get install environment in
Official AOSP build guide : Establishing a build environment | Android Open Source Project
and following command on terminal:
sudo apt-get install gcc-aarch64-linux-gnu
I have done make clean and after that make -j7 but got this build issue. Please help
[61/62] glob vendor/mediatek/proprietary_mt8168/frameworks/ml/nn/tflite/tensorflow/contrib/lite/tflite_static.bp
[113/113] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -o out/soong/build.ninja Android.bp
error: external/doclava/bin/Android.bp:15:1: module "droiddoc-templates-sdk" already defined
external/doclava/Android.bp:15:1 <-- previous definition here
error: external/doclava/bin/Android.bp:20:1: module "doclava" already defined
external/doclava/Android.bp:20:1 <-- previous definition here
ninja: build stopped: subcommand failed.
21:42:48 soong bootstrap failed with: exit status 1```
delete this folder:
external/doclava/bin
and re-run the build
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) \
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.