[Android Q&A, Help & Troubleshooting] IGambleNull:
I have installed Linux Mint 19.3 Cinnamon (Kernel 5.3.0-40-generic) with 8 GB ram and an i5-8265U. But i also got the same error on my PC at home that's running on Ubuntu 19.10 with an Ryzen 5 3600 and 16 GB ram.

As toolchain have i installed on both machines the android nougat-aarch64 toolchain version 4.9 (android googlesource com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/nougat-release.tar.gz)

I want to compile the kernel for the Wiko View. So i downloaded the source code, of the Wiko View 32GB, from wiko's site (wikogeek com) and i followed the instructions of the BUILD-INSTRUCTIONS-WORKINGPROGRESS.txt, which is located inside the archive.

The BUILD-INSTRUCTIONS-WORKINGPROGRESS.txt content

These are the instructions to rebuilding the source code for the Lenny 3 device.

In the archive you will find sources for:

* Linux kernel
* platform
* toolchain

First of all, install Ubuntu 12.04 (64 bit)

It is recommended to use the prebuilt toolchain from Google, which can be downloaded from:

https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/master.tar.gz

Create a directory (for example: /tmp/toolchain ) and unpack the prebuilt toolchain:

1. Rebuilding kernel:

Create a directory (for example: /tmp/toolchain ) and unpack the prebuilt toolchain:
$ mkdir -p /tmp/toolchain
$ wget 'https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/master.tar.gz'
$ tar -zxvf aarch64-linux-android-4.9-master.tar.gz -C /tmp/toolchain

unpack kernel for rebuild
Must keep the kernel-3.18 and vendor in the same dir
$ tar -zxvf kernel-3.18.tar.gz
$ cd kernel/msm-3.18
$ gedit Makefile

Then modify the top level Makefile to set the right prefix for the cross compiler. Specifically, change
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
to
CROSS_COMPILE ?= /tmp/toolchain/aarch64-linux-android-4.9-master/bin/aarch64-linux-android-
(or wherever your toolchain is located)

$ export TARGET_BUILD_VARIANT=user
$ export ARCH=arm64
$ mkdir out
$ make O=out TARGET_ARCH=arm64 v12bnlite-perf_defconfig
$ make O=out TARGET_ARCH=arm64

Output files:
Kernel: out/arch/arm64/boot/Image.gz or Image.gz-dtb
module: out/drivers/*/*.ko

How to clean
$ make clean

2. Rebuilding Mobule for Platform

It is only for modules are needed to using Android build system.
Please check its own install information under its folder for other module.

First install build envirment
$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

install JDK 1.8
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk

install repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Get android open source: version info - Android 7.1.0
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
$ repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.0_r1
$ repo sync

Copy module that you want to build - to original android open source
If same module exist in android open source, you should replace it. (no overwrite)

Use the android build method to rebuild every module
$ cd WORKING_DIRECTORY
$ source build/envsetup.sh
$ lunch aosp_arm-user
$ make -j4

3.Rebuilding the toolchain

To rebuild the toolchain please follow the instructions as provided by Google.

Everything worked, but when i execute the last command (make O=out TARGET_ARCH=arm64) it failes with missing separator in the Makefile

Log:

mika ~ mika-HP-Laptop-15-da1xxx ~ Documents > code > view-source > kernel > msm-3.18 > $ make O=out TARGET_ARCH=arm64
. . .
LD drivers/idle/built-in.o
../drivers/input/Makefile:34: --singyue-user----CONFIG_TINNO_FINGERPRINT2_N--------------y--
../drivers/input/Makefile:36: --singyue-user------------------Fingerprint2-N---
/home/mika/Documents/code/view-source/kernel/msm-3.18/vendor/tinno/Fingerprint2-N/kernel_macro_cfg:14: -- v12bnlite -- wik_fr -- msm8937 -- elan_96sa silead_6163 --
CC drivers/input/input.o
CC drivers/input/input-compat.o
CC drivers/input/input-mt.o
CC drivers/input/ff-core.o
LD drivers/input/input-core.o
CC drivers/input/mousedev.o
CC drivers/input/evdev.o
../drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/Makefile:11: ---------------fingerprint_supprot--elan_96sa silead_6163--------------
CC drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/elan_96sa/elan_fp_qsee.o
LD drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/elan_96sa/built-in.o
CC drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/fp_drv/fp_drv.o
LD drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/fp_drv/built-in.o
CC drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/silead_6163/slspi_qsee.o
LD drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/silead_6163/built-in.o
LD drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/built-in.o
CC drivers/input/joystick/xpad.o
LD drivers/input/joystick/built-in.o
CC drivers/input/keyboard/atkbd.o
CC drivers/input/keyboard/gpio_keys.o
LD drivers/input/keyboard/built-in.o
CC drivers/input/misc/gpio_event.o
CC drivers/input/misc/gpio_matrix.o
CC drivers/input/misc/gpio_input.o
CC drivers/input/misc/gpio_output.o
CC drivers/input/misc/gpio_axis.o
CC drivers/input/misc/keychord.o
CC drivers/input/misc/uinput.o
CC drivers/input/misc/hall_sensor.o
LD drivers/input/misc/built-in.o
LD drivers/input/tablet/built-in.o
CC drivers/input/touchscreen/of_touchscreen.o
CC drivers/input/touchscreen/gen_vkeys.o
../drivers/input/touchscreen/ft5364i/Makefile:11: *** missing separator. Stop.
../scripts/Makefile.build:402: recipe for target 'drivers/input/touchscreen/ft5364i' failed
make[4]: *** [drivers/input/touchscreen/ft5364i] Error 2
../scripts/Makefile.build:402: recipe for target 'drivers/input/touchscreen' failed
make[3]: *** [drivers/input/touchscreen] Error 2
../scripts/Makefile.build:402: recipe for target 'drivers/input' failed
make[2]: *** [drivers/input] Error 2
/home/mika/Documents/code/view-source/kernel/msm-3.18/Makefile:946: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: Leaving directory '/home/mika/Documents/code/view-source/kernel/msm-3.18/out'
Makefile:145: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

So i changed the "drivers/input/touchscreen/ft5364i/Makefile" from:

#
# Makefile for the input core drivers.
#

# Each configuration option enables a list of files.
obj-$(CONFIG_TOUCHSCREEN_FT5364I) += fts_ts.o
#obj-y += fts_ts.o
fts_ts-y += focaltech_core.o focaltech_ctl.o focaltech_ex_fun.o focaltech_gesture.o focaltech_flash.o
extlibs :=$(PWD)/drivers/input/touchscreen/ft5364i/ft_gesture_64bit_lib_v1.0_20140820.a
ldflagobj-y += fts_ts.o
obj-y s-y +=--whole-archive $(extlibs) --no-whole-archive

to:

#
# Makefile for the input core drivers.
#

# Each configuration option enables a list of files.
all:
[TAB]obj-$(CONFIG_TOUCHSCREEN_FT5364I) += fts_ts.o
[TAB]#obj-y += fts_ts.o
[TAB]fts_ts-y += focaltech_core.o focaltech_ctl.o focaltech_ex_fun.o focaltech_gesture.o focaltech_flash.o
[TAB]extlibs :=$(PWD)/drivers/input/touchscreen/ft5364i/ft_gesture_64bit_lib_v1.0_20140820.a
[TAB]ldflagobj-y += fts_ts.o
[TAB]obj-y s-y +=--whole-archive $(extlibs) --no-whole-archive

But now i get an error, that he can't find an file, but i don't know why the file will not be compiled.

Log:

mika ~ mika-HP-Laptop-15-da1xxx ~ Documents > code > view-source > kernel > msm-3.18 > $ make O=out TARGET_ARCH=arm64
make[1]: Entering directory '/home/mika/Documents/code/view-source/kernel/msm-3.18/out'
CHK include/config/kernel.release
Using .. as source for kernel
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL ../scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
../drivers/input/Makefile:34: --singyue-user----CONFIG_TINNO_FINGERPRINT2_N--------------y--
../drivers/input/Makefile:36: --singyue-user------------------Fingerprint2-N---
/home/mika/Documents/code/view-source/kernel/msm-3.18/vendor/tinno/Fingerprint2-N/kernel_macro_cfg:14: -- v12bnlite -- wik_fr -- msm8937 -- elan_96sa silead_6163 --
../drivers/input/../../../../vendor/tinno/Fingerprint2-N/KERNEL/qcom/kernel-3.18/drivers/input/fingerprint/Makefile:11: ---------------fingerprint_supprot--elan_96sa silead_6163--------------
CC drivers/input/touchscreen/tgesture/tgesture.o
LD drivers/input/touchscreen/tgesture/built-in.o
CC drivers/input/touchscreen/high_sensitive.o
LD drivers/input/touchscreen/built-in.o
/home/mika/aarch64-nougat-build-tools/bin/aarch64-linux-android-ld: cannot find drivers/input/touchscreen/ft5364i/built-in.o: No such file or directory
../scripts/Makefile.build:336: recipe for target 'drivers/input/touchscreen/built-in.o' failed
make[4]: *** [drivers/input/touchscreen/built-in.o] Error 1
../scripts/Makefile.build:402: recipe for target 'drivers/input/touchscreen' failed
make[3]: *** [drivers/input/touchscreen] Error 2
../scripts/Makefile.build:402: recipe for target 'drivers/input' failed
make[2]: *** [drivers/input] Error 2
/home/mika/Documents/code/view-source/kernel/msm-3.18/Makefile:946: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: Leaving directory '/home/mika/Documents/code/view-source/kernel/msm-3.18/out'
Makefile:145: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

Dose someone know why the error occurs.