[Android Q&A, Help & Troubleshooting] duowing:
So I'm brand new to this kernel building, and I've successfully built two kernels following tutorials, at least I think successfully, as I can't test because I do not have those devices. Anyway I'm currently trying to build a kernel for the HTC 10 as I do have that device from the N source 2.28.617.8. I've uploaded the untouched sources to my brand new github, and I believe I have everything setup on Ubuntu 16.04LTS.

https://github.com/duowing/HTC10

So to start I extracted the sources to my ~/android/kernel/htc10 directory, ran make clean and make mrproper. Then did:

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-android-
make msm_defconfig

I'm then greeted by:

HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
drivers/soc/qcom/Kconfig:358:warning: choice value used outside its choice group
drivers/soc/qcom/Kconfig:363:warning: choice value used outside its choice group
arch/arm64/configs/msm_defconfig:240:warning: override: reassigning to symbol UID_CPUTIME
arch/arm64/configs/msm_defconfig:737:warning: override: reassigning to symbol NETFILTER_XT_MATCH_QUOTA2_LOG
arch/arm64/configs/msm_defconfig:748:warning: override: reassigning to symbol IP_MULTICAST
arch/arm64/configs/msm_defconfig:787:warning: override: reassigning to symbol HTC_POWER_DEBUG
arch/arm64/configs/msm_defconfig:851:warning: override: reassigning to symbol EEPROM_AT24
arch/arm64/configs/msm_defconfig:885:warning: override: reassigning to symbol BLK_DEV_IO_TRACE
arch/arm64/configs/msm_defconfig:893:warning: override: reassigning to symbol CORESIGHT_STM
#
# configuration written to .config
#

Seems ok though, as I go ahead and just type make and hit enter. It runs for a while and seems like everything is good to go until I get here:

In file included from drivers/gud/310a/MobiCoreDriver/fastcall.c:24:0:
drivers/gud/310a/MobiCoreDriver/mci/mcifc.h:17:22: fatal error: platform.h: No such file or directory
#include "platform.h"
^
compilation terminated.
make[3]: *** [drivers/gud/310a/MobiCoreDriver/fastcall.o] Error 1
make[2]: *** [drivers/gud/310a/MobiCoreDriver] Error 2
make[1]: *** [drivers/gud] Error 2
make: *** [drivers] Error 2

So I look into the file: https://github.com/duowing/HTC10/blob/stock/drivers/gud/310a/MobiCoreDriver/mci/mcifc.h

and I see it's trying to include platform.h, but platform.h exists in a directory below. Also a quick disclaimer I have pretty much zero knowledge of java, but I figure I can pcik-up stuff as I go. I then edit that file to say #include "../platform.h"

This is probably wrong, but I type: make, then hit enter and we move on to the next error.

In file included from drivers/gud/310a/MobiCoreDriver/mcp.c:32:0:
drivers/gud/310a/MobiCoreDriver/mci/mcimcp.h:18:30: fatal error: mci/mcloadformat.h: No such file or directory
#include "mci/mcloadformat.h"
^
compilation terminated.
make[3]: *** [drivers/gud/310a/MobiCoreDriver/mcp.o] Error 1
make[2]: *** [drivers/gud/310a/MobiCoreDriver] Error 2
make[1]: *** [drivers/gud] Error 2
make: *** [drivers] Error 2

https://github.com/duowing/HTC10/blob/stock/drivers/gud/310a/MobiCoreDriver/mci/mcimcp.h

so I go into that file and see the #include "mci/mcloadformat.h" and wonder why the mci/ is there because mcloadformat.h is already in that directory. So I edit to #include "mcloadformat.h" save it, and then run make again and away I go. Again, it almost seems like I've achieved success as it runs for a while with no issues until the next error I can't seem to get around.

In file included from drivers/net/ethernet/msm/rndis_ipa_trace.h:81:0,
from drivers/net/ethernet/msm/rndis_ipa.c:32:
include/trace/define_trace.h:83:43: fatal error: ./rndis_ipa_trace.h: No such file or directory
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
^
compilation terminated.
make[4]: *** [drivers/net/ethernet/msm/rndis_ipa.o] Error 1
make[3]: *** [drivers/net/ethernet/msm] Error 2
make[2]: *** [drivers/net/ethernet] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

https://github.com/duowing/HTC10/tree/stock/drivers/net/ethernet/msm

I'm not exactly sure what I'm looking for here, so I've just provided the link to the directory. If anyone can determine what I need to do next and help me that would be appreciated. I'm sure there will be more errors.

I don't know if there's something wrong with the source code, or it's my setup that is causing an error with the source code? Also if there's a better way to list my errors out let me know. I also appreciate the help, also any guidance on if what I'm doing is just completely wrong. I've spent a lot of time flashing, now I want to play with building. So by trial and error I figure I can learn some of this.