[ASUS ROG Phone 5 / 5s] twistedumbrella:
There are changes required to use newer versions of LLVM that were already included in the CAF source, but not in the one from Asus.

ANDROID: vmlinux.lds.h: merge compound literal sections · Skywalker-I005/Skywalker-ZS673KS@210ecf9

After LLVM rG9e33c096476a ("[ELF] Keep orphan section names (.rodata.foo .text.foo) unchanged if !hasSectionsCommand"), LLD splits compound literals to separate sections with -fdata-secti...

github.com

commit 210ecf9a8921bccf197372da9a91efb8aa38202f
Author: Sami Tolvanen <samitolvanen@google.com>
Date: Wed Nov 25 08:44:09 2020 -0800

ANDROID: vmlinux.lds.h: merge compound literal sections

After LLVM rG9e33c096476a ("[ELF] Keep orphan section names
(.rodata.foo .text.foo) unchanged if !hasSectionsCommand"), LLD splits
compound literals to separate sections with -fdata-sections, which
it always enables with LTO. Merge these sections to allow LLVM to be
upgraded.

Bug: 174047799
Change-Id: I858c5fcc48283d5528c1d3e2b2d7a3c72f9e03d6
Link: https://github.com/ClangBuiltLinux/linux/issues/958
Suggested-by: Danny Lin <danny@kdrag0n.dev>
Suggested-by: Fangrui Song <maskray@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
(cherry picked from commit 559c23e691b8d0b25b055ecdf4c07f19c8407794)
(cherry picked from commit 6f7ffcefc7b0ad82dbe0975057ea82b045abe160)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ef257c136f11..b5c86d85f7b3 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -72,10 +72,10 @@
#if defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || defined(CONFIG_LTO_CLANG)
#define TEXT_MAIN .text .text.[0-9a-zA-Z_]*
#define TEXT_CFI_MAIN .text.[0-9a-zA-Z_]*.cfi
-#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..LPBX*
+#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral*
#define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]*
-#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]*
-#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]*
+#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L*
+#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral*
#define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]*
#else
#define TEXT_MAIN .text

The techpack is only a stub and folder layout, but is also missing parts.

For anyone unfamiliar with Asus source, it may not be immediately obvious that there are four additional components that are required.

platform/vendor/qcom/opensource/datarmnet - Unnamed repository; edit this file 'description' to name the repository.

source.codeaurora.org

platform/vendor/qcom/opensource/datarmnet-ext - Unnamed repository; edit this file 'description' to name the repository.

source.codeaurora.org

platform/vendor/opensource/dataipa - Unnamed repository; edit this file 'description' to name the repository.

source.codeaurora.org

platform/vendor/opensource/sched - Unnamed repository; edit this file 'description' to name the repository.

source.codeaurora.org

https://xdaforums.com/t/techpack-for-zs673ks.4329857/

The modules do collide, but can be built in hybrid fashion to overcome the issues.

CONFIG_TOUCHSCREEN_ROG=y
CONFIG_TOUCHSCREEN2_ROG=m

CONFIG_INPUT_SX932X=y
CONFIG_INPUT_SX932X_2ND=m

The easiest method for building the kernel is to make all modules inline (replace m with y).

Modules will still be unable to load on their own, since the signatures and versions may be off. That is why the verification needs to be disabled.

kernel/module.c: safely bypass sig, vermagic, modversion · Skywalker-I005/Skywalker-ZS673KS@e009a01

Contrary to common modifications that disable all checks entirely, we should still verify the integrity of modules that have not been signed by the manufacturer and may be versioned differently. We...

github.com

commit e009a01e9cf2f0c64a87b84b6986fff01e278b3f
Author: Abandoned Cart <***************@gmail.com>
Date: Thu Sep 16 12:16:03 2021 -0400

kernel/module.c: safely bypass sig, vermagic, modversion

diff --git a/kernel/module.c b/kernel/module.c
index ab50f522b662..b9bbde4ad512 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2925,6 +2925,11 @@ static int module_sig_check(struct load_info *info, int flags)
const char *reason;
const void *mod = info->hdr;

+#ifdef CONFIG_MODULE_FORCE_PASS
+ info->sig_ok = true;
+ return 0;
+#endif
+
/*
* Require flags == 0, as a module with version information
* removed is no longer the module that was signed
@@ -3274,10 +3279,12 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
err = try_to_force_load(mod, "bad vermagic");
if (err)
return err;
+#ifndef CONFIG_MODULE_FORCE_PASS
} else if (!same_magic(modmagic, vermagic, info->index.vers)) {
pr_err("%s: version magic '%s' should be '%s'\n",
info->name, modmagic, vermagic);
return -ENOEXEC;
+#endif
}

if (!get_modinfo(info, "intree")) {
@@ -3988,11 +3995,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
goto free_copy;
}

err = rewrite_section_headers(info, flags);
if (err)
goto free_copy;
@@ -4199,9 +4201,11 @@ SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)

pr_debug("finit_module: fd=%d, uargs=%p, flags=%i\n", fd, uargs, flags);

+#ifndef CONFIG_MODULE_FORCE_PASS
if (flags & ~(MODULE_INIT_IGNORE_MODVERSIONS
|MODULE_INIT_IGNORE_VERMAGIC))
return -EINVAL;
+#endif

err = kernel_read_file_from_fd(fd, &hdr, &size, INT_MAX,
READING_MODULE);