The hunk that includes elf.h into include/linux/mm.h breaks the build on ia64. 2.6.2-mm1 Thanks for testing it. Does the below fix it? Begin forwarded message: Date: Thu, 5 Feb 2004 18:01:21 +0100 From: Andi Kleen To: Andi Kleen Cc: akpm@osdl.org, torvalds@osdl.org, discuss@x86-64.org Subject: Re: [PATCH] Fix x86-64 compilation on 2.6.2-bk1 - new patch On Thu, 5 Feb 2004 17:07:14 +0100 Andi Kleen wrote: > > The new linux/elf.h include in linux/mm.h caused all kinds of problems for the x86-64 > 32bit emulation code. > > This patch avoids the dependency by moving the depending functions out of > line. It makes x86-64 compile again. > > Please apply. [...] Unfortunately that patch broke the build on some other architectures (e.g. s390) due to a wrong ifdef. Here is the corrected version: diff -u linux-2.6.2bk1/include/linux/mm.h-o linux-2.6.2bk1/include/linux/mm.h --- linux-2.6.2bk1/include/linux/mm.h-o 2004-02-05 17:48:27.000000000 +0100 +++ linux-2.6.2bk1/include/linux/mm.h 2004-02-05 17:53:44.295452824 +0100 @@ -12,7 +12,6 @@ #include #include #include -#include #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr; @@ -644,24 +643,8 @@ #endif #ifndef CONFIG_ARCH_GATE_AREA -static inline int in_gate_area(struct task_struct *task, unsigned long addr) -{ -#ifdef AT_SYSINFO_EHDR - if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) - return 1; -#endif - return 0; -} - -extern struct vm_area_struct gate_vma; -static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) -{ -#ifdef AT_SYSINFO_EHDR - return &gate_vma; -#else - return 0; -#endif -} +extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); +int in_gate_area(struct task_struct *task, unsigned long addr); #endif #endif /* __KERNEL__ */ diff -u linux-2.6.2bk1/mm/memory.c-o linux-2.6.2bk1/mm/memory.c --- linux-2.6.2bk1/mm/memory.c-o 2004-02-05 12:23:20.000000000 +0100 +++ linux-2.6.2bk1/mm/memory.c 2004-02-05 17:59:58.308594184 +0100 @@ -55,6 +55,7 @@ #include #include +#include #ifndef CONFIG_DISCONTIGMEM /* use the per-pgdat data instead for discontigmem - mbligh */ @@ -1688,7 +1689,9 @@ EXPORT_SYMBOL(vmalloc_to_page); -#if !defined(CONFIG_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR) +#if !defined(CONFIG_ARCH_GATE_AREA) + +#if defined(AT_SYSINFO_EHDR) struct vm_area_struct gate_vma; static int __init gate_vma_init(void) @@ -1702,3 +1705,23 @@ } __initcall(gate_vma_init); #endif + +struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ +#ifdef AT_SYSINFO_EHDR + return &gate_vma; +#else + return 0; +#endif +} + +int in_gate_area(struct task_struct *task, unsigned long addr) +{ +#ifdef AT_SYSINFO_EHDR + if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) + return 1; +#endif + return 0; +} + +#endif