这是一个奇怪的问题,我真的不知道该怎么问。
我正在修补内核,当我尝试构建它时,我得到了这个
devshark@ubuntu:~/KERNEL/linux_3.2.17$ make arch/arm/vfp
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
AS arch/arm/vfp/entry.o
include/linux/thread_info.h: Assembler messages:
include/linux/thread_info.h:12: Error: bad instruction `struct timespec'
include/linux/thread_info.h:13: Error: bad instruction `struct compat_timespec'
include/linux/thread_info.h:18: Error: bad instruction `struct restart_block{'
include/linux/thread_info.h:19: Error: bad instruction `long (*fn)(struct restart_block*)'
include/linux/thread_info.h:20: Error: bad instruction `union {'
include/linux/thread_info.h:22: Error: bad instruction `struct {'
include/linux/thread_info.h:23: Error: bad instruction `u32 __user*uaddr'
include/linux/thread_info.h:24: Error: bad instruction `u32 val'
include/linux/thread_info.h:25: Error: bad instruction `u32 flags'
include/linux/thread_info.h:26: Error: bad instruction `u32 bitset'
include/linux/thread_info.h:27: Error: bad instruction `u64 time'
include/linux/thread_info.h:28: Error: bad instruction `u32 __user*uaddr2'
include/linux/thread_info.h:29: Error: junk at end of line, first unrecognized character is `}'
...
它继续列出一些 .h 和 .c 文件。我可以很好地构建其他所有东西(到目前为止),但此时构建中断。
编辑:
好的,所以我做了一些研究,事情是这样的:
/arch/arm/include/asm/thread_info.h 报告一个
/home/devshark/KERNEL/linux_3.2.17/arch/arm/include/asm/thread_info.h:68:23: error: field 'restart_block' has incomplete type
struct restart_block 在 /include/linux/thread_info.h 中定义
当我将它包含在文件中时,我得到了上述错误。这就是我包含它的方式
#ifndef __ASM_ARM_THREAD_INFO_H
#define __ASM_ARM_THREAD_INFO_H
#ifdef __KERNEL__
#include <linux/compiler.h>
//#include <linux/thread_info.h>
#include <asm/fpstate.h>
#define THREAD_SIZE_ORDER 1
#define THREAD_SIZE 8192
#define THREAD_START_SP (THREAD_SIZE - 8)
#ifndef __ASSEMBLY__
...
但结果非常糟糕。所以我所做的就是退后一步,发现在 kernel/io.ci 中包含 asm/thread_info.h 而不是 linux/thread_info.h
因此,在发生了更多的欢闹之后,我将根源追溯到 mach_types 中缺少的条目。
我会回来提供更多信息,但这段旅程让我意识到我是多么讨厌(讨厌)包括我自己的文件:)