I attempted to build a fresh kernel for Nexus 5X following Google's instructions on this page
- Build system: Ubuntu 14.04 x86_64
- Target system: MTC19T/bullhead (Actually any marshmallow version on 5X)
- Toolchain: android-6.0.1_r25/prebuilts/gcc/linux-x86/aarch64/
Exact sequence of commands I executed are:
$ git clone https://android.googlesource.com/kernel/msm$ export ARCH=arm64$ export CROSS_COMPILE=aarch64-linux-android-$ cd msm$ git checkout -b android-msm-bullhead-3.10-marshmallow-mr1 origin/android-msm-bullhead-3.10-marshmallow-mr1$ make bullhead_defconfig$ make
I am greeted with following error after last command:
Makefile:796: *** multiple target patterns. Stop.
Investigations:
Now line 796 in makefile is:
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
and other relevant lines are:
vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN)export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y)export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
I found that if I remove $(libs-y)
from $(KBUILD_VMLINUX_MAIN)
this error disappears, and build continues for some time. I am sure I wil find some or other issue later, so I decided to debug further.
Disclaimer: Rest of this is a bit gray area for me
$(libs-y)
is defined as:
libs-y := lib/libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))libs-y := $(libs-y1) $(libs-y2)
So I called scripts/link-vmlinux.sh
with parameters lib/lib.a lib/built-in.o FORCE
and am greeted with this error:
gps@gps-HP-ProBook-4540s:~/andsrc/kernel/msm$ ./scripts/link-vmlinux.sh lib/lib.a lib/built-in.o FORCEtrap: SIGHUP: bad trap
Since this output has :
, this probably explains the original make error.
Now, disabling the line containing trap does not help, we get another error:
gps@gps-HP-ProBook-4540s:~/andsrc/kernel/msm$ ./scripts/link-vmlinux.sh lib/lib.a lib/built-in.o FORCE LD vmlinux.o./scripts/link-vmlinux.sh: 44: ./scripts/link-vmlinux.sh: -r: not found
I am not very sure what to try next. Any help is appreciated.