From 505f1d7b0a6eec0acc2c3b66d98e480920e626db Mon Sep 17 00:00:00 2001 From: Zhou Kang Date: Tue, 4 Jul 2023 14:03:42 +0000 Subject: [PATCH] compat to openEuler 22.03 LTS --- devops-env.sh | 5 ++++- src/binfmt_rto/binfmt_rto.c | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/devops-env.sh b/devops-env.sh index a5e56df..0d1576d 100644 --- a/devops-env.sh +++ b/devops-env.sh @@ -1,5 +1,8 @@ #!/bin/bash set -x +# compat openEuler 22.03 LTS +# update pkg >= kernel-5.10.0-60.99.0.123.oe2203 + # install tools -sudo yum install -y gcc meson cargo xz-devel kernel-devel ncurses-devel +sudo yum install -y gcc meson cargo xz-devel kernel kernel-devel ncurses-devel diff --git a/src/binfmt_rto/binfmt_rto.c b/src/binfmt_rto/binfmt_rto.c index f1a1fe4..2f9ceba 100644 --- a/src/binfmt_rto/binfmt_rto.c +++ b/src/binfmt_rto/binfmt_rto.c @@ -73,6 +73,11 @@ MODULE_PARM_DESC(debug, "debug mode"); #define EF_AARCH64_HUGEPAGE (0x00020000U) #endif +/* compat 22.03 LTS, 22.03 LTS SP2 */ +#ifndef MM_SAVED_AUXV +#define MM_SAVED_AUXV(mm) mm->saved_auxv +#endif + extern int map_vdso(const struct vdso_image *image, unsigned long addr); #define proc_symbol(SYM) typeof(SYM) *(SYM) @@ -1123,8 +1128,10 @@ static inline int try_replace_file(struct linux_binprm *bprm) #undef start_thread #endif +#define start_thread ___start_thread + // arm64 start_thread is inline function, so copy it -static inline void start_thread(struct pt_regs *regs, unsigned long pc, +static inline void ___start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) { start_thread_common(regs, pc); @@ -1133,6 +1140,7 @@ static inline void start_thread(struct pt_regs *regs, unsigned long pc, regs->sp = sp; } #endif /* CONFIG_ARM64 */ + #endif /* CONFIG_ELF_SYSBOOST */ static int load_elf_binary(struct linux_binprm *bprm) -- Gitee