Hi Greg and Sasha,
Attached are three mbox files containing patches that bring the Clang backports that Nick did in 4.9.139 up to date with what is currently in 4.14 and mainline, as well as fix warnings that are present in the arm64 and x86_64 defconfigs here and in AOSP (cuttlefish_defconfig). All of these warnings are fixed in 4.14 so there will be no regressions from upgrading.
They were tested with Arch Linux's GCC 8.2.1 and AOSP's clang-r349610 [1] and boot tested in QEMU 3.1.0 with our rootfs files [2].
Additionally, for Greg, I have provided a merge resolution for the Makefile conflict you will get when doing the android-4.9 merge. You will also get a conflict in arch/arm64/include/asm/arch_gicv3.h, just check out to MERGE_HEAD as the {read,write}_sysreg_s macros have the LTO workaround that causes the conflict in the first place. I tested this resolution by building and booting cuttlefish_defconfig for arm64 with CONFIG_LTO_CLANG and CONFIG_CFI_CLANG enabled.
[1]: https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/8... [2]: https://github.com/ClangBuiltLinux/continuous-integration/tree/8a288264aa71f...
Please let me know if there are any concerns or objections! Nathan