1.arch/x86/kernel/ptrace.c:1472:17: error: conflicting types for 'syscall_trace_enter'
解决方法:
Patch
<span class="p_header" style="color: rgb(46, 139, 87); font-weight: bold;">--- linux-2.6.32.59/arch/x86/include/asm/ptrace.h</span> <span class="p_header" style="color: rgb(46, 139, 87); font-weight: bold;">+++ fix_ptrace.o_compile_error/arch/x86/include/asm/ptrace.h</span> <span class="p_chunk" style="color: rgb(165, 42, 42); font-weight: bold;">@@ -130,6 +130,7 @@</span> <span class="p_context" style="color: rgb(160, 32, 240);"></span> #ifdef __KERNEL__ #include <linux/init.h> <span class="p_add" style="color: rgb(0, 139, 139);">+#include <linux/linkage.h></span> struct cpuinfo_x86; struct task_struct; <span class="p_chunk" style="color: rgb(165, 42, 42); font-weight: bold;">@@ -142,8 +143,8 @@</span> <span class="p_context" style="color: rgb(160, 32, 240);"></span> int error_code, int si_code); void signal_fault(struct pt_regs *regs, void __user *frame, char *where); <span class="p_del" style="color: rgb(106, 90, 205);">-extern long syscall_trace_enter(struct pt_regs *);</span> <span class="p_del" style="color: rgb(106, 90, 205);">-extern void syscall_trace_leave(struct pt_regs *);</span> <span class="p_add" style="color: rgb(0, 139, 139);">+extern asmregparm long syscall_trace_enter(struct pt_regs *);</span> <span class="p_add" style="color: rgb(0, 139, 139);">+extern asmregparm void syscall_trace_leave(struct pt_regs *);</span> static inline unsigned long regs_return_value(struct pt_regs *regs) {
2. gcc: error: elf_i386:No such file or directory
原因:
gcc 4.6 不再支持 linker-style 架构。
解决方法:修改 arch/x86/vdso/Makefile: 将以 VDSO_LDFLAGS_vdso.lds 开头所在行的 "-m elf_x86_64" 替换为 "-m64"。 将以 VDSO_LDFLAGS_vdso32.lds 开头所在行的 "-m elf_i386" 替换为 "-m32"。
以上参考http://blog.chinaunix.net/uid-22041495-id-3259660.html
或者也可以将gcc版本降至[3.2, 4.6)