参考步骤是: https://makiras.org/archives/173?amp
内核源码是: https://github.com/LineageOS/android_kernel_oneplus_msm8998/tree/lineage-17.1
make 最后几行信息是:
CC kernel/trace/ring_buffer.o
LD kernel/sched/built-in.o
CC mm/cma.o
CC mm/cma_debug.o
CC kernel/profile.o
CC mm/usercopy.o
CC kernel/trace/trace.o
LD mm/built-in.o
CC kernel/trace/trace_output.o
CC kernel/stacktrace.o
CC kernel/futex.o
CC kernel/trace/trace_seq.o
CC kernel/trace/trace_stat.o
CC kernel/trace/trace_printk.o
CC kernel/trace/trace_sched_switch.o
CC kernel/trace/trace_cpu_freq_switch.o
CC kernel/futex_compat.o
CC kernel/trace/trace_nop.o
In function 'ftrace_dump',
inlined from 'ftrace_dump' at ../kernel/trace/trace.c:7244:6:
../kernel/trace/trace.c:7321:3: warning: 'memset' offset [8385, 8440] from the object at 'iter' is out of the bounds of referenced subobject 'seq' with type 'struct trace_seq' at offset 4248 [-Warray-bounds]
error, forbidden warning: trace.c:7321
../scripts/Makefile.build:282: recipe for target 'kernel/trace/trace.o' failed
make[3]: *** [kernel/trace/trace.o] Error 1
make[3]: *** Waiting for unfinished jobs....
CC kernel/smp.o
CC kernel/uid16.o
../scripts/Makefile.build:489: recipe for target 'kernel/trace' failed
make[2]: *** [kernel/trace] Error 2
make[2]: *** Waiting for unfinished jobs....
/root/android_kernel_oneplus_msm8998-lineage-17.1/Makefile:1012: recipe for target 'kernel' failed
make[1]: *** [kernel] Error 2
make[1]: Leaving directory '/root/android_kernel_oneplus_msm8998-lineage-17.1/out'
Makefile:152: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
这个是源码本身有问题吗?编译环境 docker 上的 ubuntu18.04 ,官方容器,同时编译了 16.0 的分支也是也是提示类似错误。
使用的编译参数是
export ARCH=arm64
export SUBARCH=arm64
export PATH=~/.gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin:$PATH
export CROSS_COMPILE=aarch64-none-linux-gnu-
make -j$(nproc --all) O=out lineage_oneplus5_defconfig
make -j$(nproc --all) O=out ARCH=arm64\
SUBARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- \
CONFIG_DEBUG_SECTION_MISMATCH=y
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.