yann@402: Retrieved with wget http://www.x86-64.org/lists/discuss/msg04963.html yann@402: then tabs fixed up by rediffing yann@402: yann@402: Message-Id: EFF62C7EE88E71429E38641A1172F4C2077104@net.teracruz.com yann@402: To: discuss@xxxxxxxxxx yann@402: Subject: Compile error with glibc 2.3.2 + Linux 2.6.5 ARCH=x86_64 yann@402: From: "David Lee" david.lee@xxxxxxxxxxxx yann@402: Date: Wed, 21 Apr 2004 15:26:04 -0500 yann@402: yann@402: I am getting compiler errors when trying to compile glibc 2.3.2 using yann@402: the kernel headers from linux 2.6.5. The headers from linux 2.6.3 work yann@402: fine. yann@402: yann@402: I've traced the cause of the problem to a change made in yann@402: ./include/asm-x86_64/unistd.h in the 2.6.4 release. yann@402: yann@402: +#ifndef __ASSEMBLY__ yann@402: + yann@402: +#include yann@402: +#include yann@402: +#include yann@402: +#include yann@402: + yann@402: +asmlinkage long sys_ptrace(long request, long pid, yann@402: + unsigned long addr, long data); yann@402: +asmlinkage long sys_iopl(unsigned int level, struct pt_regs regs); yann@402: +asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int yann@402: turn_on); yann@402: +struct sigaction; yann@402: +asmlinkage long sys_rt_sigaction(int sig, yann@402: + const struct sigaction __user *act, yann@402: + struct sigaction __user *oact, yann@402: + size_t sigsetsize); yann@402: + yann@402: +#endif /* __ASSEMBLY__ */ yann@402: yann@402: Within glibc, ./sysdeps/unix/sysv/linux/x86_64/syscall.S ends up yann@402: including this file, which chokes the assembler with the struct yann@402: declarations in the above #include's. yann@402: yann@402: /home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 yann@402: _64-linux/glibcinclude/linux/posix_types.h: Assembler messages: yann@402: /home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 yann@402: _64-linux/glibcinclude/linux/posix_types.h:36: Error: no such yann@402: instruction: `typedef struct{' yann@402: yann@402: There are also errors about conflicting re-declarations further along in yann@402: the glibc build. yann@402: yann@402: ../posix/sys/types.h:62: error: conflicting types for `dev_t' yann@402: /home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 yann@402: _64-linux/glibcinclude/linux/types.h:23: error: previous declaration of yann@402: `dev_t' yann@402: yann@402: Changing the '#ifndef __ASSEMBLY__' to '#if ((!defined __ASSEMBLY__) && yann@402: (defined __KERNEL__))' clears up the problem. My patch is below. yann@402: yann@402: dave yann@402: yann@402: yann@402: --- linux-2.6.5/include/asm-x86_64/unistd.h.old 2004-04-03 19:37:36.000000000 -0800 yann@402: +++ linux-2.6.5/include/asm-x86_64/unistd.h 2004-05-05 11:07:11.000000000 -0700 yann@402: @@ -713,7 +713,7 @@ yann@402: yann@402: #endif /* __KERNEL_SYSCALLS__ */ yann@402: yann@402: -#ifndef __ASSEMBLY__ yann@402: +#if ((!defined __ASSEMBLY__) && (defined __KERNEL__)) yann@402: yann@402: #include yann@402: #include yann@402: @@ -730,7 +730,7 @@ yann@402: struct sigaction __user *oact, yann@402: size_t sigsetsize); yann@402: yann@402: -#endif /* __ASSEMBLY__ */ yann@402: +#endif /* ((!defined __ASSEMBLY__) && (defined __KERNEL__) */ yann@402: yann@402: #endif /* __NO_STUBS */ yann@402: