[General Questions and Answers] jasonmerc:
This is my first time porting a "new" device to a "new" version of Android. I'm trying to port Lineage 14.1 to the LG Leon LTE, which previously only ran CM 12.1. It's based on the msm8916 chipset. Codenames are c50 and ms345 depending on carrier variant but largely the same thing. I know Lineage 14.1 is out of date, but it was the latest version that still had LG-based msm8916 trees so I figured this was good to bump it up to. Hey, still a lot better than Lollipop.

My sources are set up as such: Everything synced is from Lineage 14.1 as a base, except the LG Leon LTE device tree and the vendor tree which are from CM 12.1. So that means:

Leon-specific device tree: CM 12.1

MSM8916-common device tree: Lineage 14.1

Kernel tree: Lineage 14.1

Vendor tree that has Leon blobs: CM 12.1

Other dependencies like qcom_common and such: Lineage 14.1

The Leon CM 12.1 trees were set up to use a prebuilt kernel image which I do not have, so I had to modify the device tree a bit to build from the Lineage 14.1 generic LG MSM8916 kernel source. I set the defconfig to kernel/arch/arm/configs/c50_tmo_us_defconfig (although this error persists with any defconfig I choose including the generic MSM8916 one). Everything builds just fine until I get to kernel compilation. I get one error message which is the following:

FAILED: /bin/bash -c "(make -j3 CFLAGS_MODULE=\"-fno-pic\" -C kernel/lge/msm8916 O=/home/administrator/lin-14.1/out/target/product/ms345/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\" arm-linux-androidkernel-\" zImage ) && (if grep -q '^CONFIG_OF=y' /home/administrator/lin-14.1/out/target/product/ms345/obj/KERNEL_OBJ/.config; then echo \"Building DTBs\"; make -j3 CFLAGS_MODULE=\"-fno-pic\" -C kernel/lge/msm8916 O=/home/administrator/lin-14.1/out/target/product/ms345/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\" arm-linux-androidkernel-\" dtbs; fi ) && (if grep -q '^CONFIG_MODULES=y' /home/administrator/lin-14.1/out/target/product/ms345/obj/KERNEL_OBJ/.config; then echo \"Building Kernel Modules\"; make -j3 CFLAGS_MODULE=\"-fno-pic\" -C kernel/lge/msm8916 O=/home/administrator/lin-14.1/out/target/product/ms345/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=\" arm-linux-androidkernel-\" modules; fi )"

Afterwards I get lots of errors about driver compilation failing for the kernel, but this is the first error message I get. Any guidance would be appreciated, as I feel this is the only major thing standing between me and a successful build.

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

EDIT: I'll post up info about my system and build environment:

Running Ubuntu 18.04.5 with kernel 4.15.0-143, trying to build Lineage 14.1

AMD Phenom tri-core processor with 8GB RAM

Using the following roomservice manifest:

<?xml version="1.0" encoding="UTF-8"?>

<manifest>

<project name="TeamRegular/android_device_lge_ms345" path="device/lge/ms345" remote="github" revision="cm-12.1" />

<project name="TeamRegular/android_device_lge_c50-common" path="device/lge/c50-common" remote="github" revision="cm-12.1" />

<project name="LineageOS/android_device_lge_msm8916-common" path="device/lge/msm8916-common" remote="github" />

<project name="LineageOS/android_kernel_lge_msm8916" path="kernel/lge/msm8916" remote="github" />

<project name="TeamRegular/vendor_lge" path="vendor/lge" remote="github" revision="cm-12.1" />

<project name="LineageOS/android_external_bson" path="external/bson" remote="github" />

<project name="LineageOS/android_device_qcom_common" path="device/qcom/common" remote="github" />

<project name="LineageOS/android_packages_resources_devicesettings" path="packages/resources/devicesettings" remote="github" />

<project name="LineageOS/android_packages_apps_FlipFlap" path="packages/apps/FlipFlap" remote="github" />

</manifest>

The device trees are more split up than usual: there are 3 with 2 common ones. MSM8916-common is expected, but c50-common and ms345 are also split up to account for the different variants of the Leon LTE out there.

To get this far I had to:

Edit c50-common's BoardConfig.mk to point to the kernel source and defconfig

"remove" liblight from c50-common by going to the c50-common/liblight/Android.mk and commenting out every line so the msm8916-common version was used instead (there were conflicts)

Export LC_ALL=C before building to get around some Java issues