patches/linux/2.6.5/linux-2.6.5-x86_64-unistd.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 01 16:49:15 2007 +0000 (2007-05-01)
changeset 56 07a6a48962b7
permissions -rw-r--r--
Merge patches sent by Robert P. J. Day <rpjday@mindspring.com>.
Warning: the buildroot folks purposedly removed the skip-comment patch but didn't really said why. Keeping it for the sake of having it in svn just in case (removing it will be easier thant not having it at all).
yann@1
     1
Retrieved with wget http://www.x86-64.org/lists/discuss/msg04963.html
yann@1
     2
then tabs fixed up by rediffing
yann@1
     3
yann@1
     4
Message-Id: EFF62C7EE88E71429E38641A1172F4C2077104@net.teracruz.com
yann@1
     5
To: discuss@xxxxxxxxxx
yann@1
     6
Subject: Compile error with glibc 2.3.2 + Linux 2.6.5 ARCH=x86_64
yann@1
     7
From: "David Lee" david.lee@xxxxxxxxxxxx
yann@1
     8
Date: Wed, 21 Apr 2004 15:26:04 -0500</li>
yann@1
     9
yann@1
    10
I am getting compiler errors when trying to compile glibc 2.3.2 using
yann@1
    11
the kernel headers from linux 2.6.5.  The headers from linux 2.6.3 work
yann@1
    12
fine.
yann@1
    13
yann@1
    14
I've traced the cause of the problem to a change made in
yann@1
    15
./include/asm-x86_64/unistd.h in the 2.6.4 release.
yann@1
    16
yann@1
    17
+#ifndef __ASSEMBLY__
yann@1
    18
+
yann@1
    19
+#include <linux/linkage.h>
yann@1
    20
+#include <linux/compiler.h>
yann@1
    21
+#include <linux/types.h>
yann@1
    22
+#include <asm/ptrace.h>
yann@1
    23
+
yann@1
    24
+asmlinkage long sys_ptrace(long request, long pid,
yann@1
    25
+                                unsigned long addr, long data);
yann@1
    26
+asmlinkage long sys_iopl(unsigned int level, struct pt_regs regs);
yann@1
    27
+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int
yann@1
    28
turn_on);
yann@1
    29
+struct sigaction;
yann@1
    30
+asmlinkage long sys_rt_sigaction(int sig,
yann@1
    31
+                                const struct sigaction __user *act,
yann@1
    32
+                                struct sigaction __user *oact,
yann@1
    33
+                                size_t sigsetsize);
yann@1
    34
+
yann@1
    35
+#endif  /* __ASSEMBLY__ */
yann@1
    36
yann@1
    37
Within glibc, ./sysdeps/unix/sysv/linux/x86_64/syscall.S ends up
yann@1
    38
including this file, which chokes the assembler with the struct
yann@1
    39
declarations in the above #include's.
yann@1
    40
yann@1
    41
/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86
yann@1
    42
_64-linux/glibcinclude/linux/posix_types.h: Assembler messages:
yann@1
    43
/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86
yann@1
    44
_64-linux/glibcinclude/linux/posix_types.h:36: Error: no such
yann@1
    45
instruction: `typedef struct{'
yann@1
    46
yann@1
    47
There are also errors about conflicting re-declarations further along in
yann@1
    48
the glibc build.
yann@1
    49
yann@1
    50
../posix/sys/types.h:62: error: conflicting types for `dev_t'
yann@1
    51
/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86
yann@1
    52
_64-linux/glibcinclude/linux/types.h:23: error: previous declaration of
yann@1
    53
`dev_t'
yann@1
    54
yann@1
    55
Changing the '#ifndef __ASSEMBLY__' to '#if ((!defined __ASSEMBLY__) &&
yann@1
    56
(defined __KERNEL__))' clears up the problem.  My patch is below.
yann@1
    57
yann@1
    58
dave
yann@1
    59
yann@1
    60
yann@1
    61
--- linux-2.6.5/include/asm-x86_64/unistd.h.old	2004-04-03 19:37:36.000000000 -0800
yann@1
    62
+++ linux-2.6.5/include/asm-x86_64/unistd.h	2004-05-05 11:07:11.000000000 -0700
yann@1
    63
@@ -713,7 +713,7 @@
yann@1
    64
 
yann@1
    65
 #endif /* __KERNEL_SYSCALLS__ */
yann@1
    66
 
yann@1
    67
-#ifndef __ASSEMBLY__
yann@1
    68
+#if ((!defined __ASSEMBLY__) && (defined __KERNEL__))
yann@1
    69
 
yann@1
    70
 #include <linux/linkage.h>
yann@1
    71
 #include <linux/compiler.h>
yann@1
    72
@@ -730,7 +730,7 @@
yann@1
    73
 				struct sigaction __user *oact,
yann@1
    74
 				size_t sigsetsize);
yann@1
    75
 
yann@1
    76
-#endif	/* __ASSEMBLY__ */
yann@1
    77
+#endif /* ((!defined __ASSEMBLY__) && (defined __KERNEL__) */
yann@1
    78
 
yann@1
    79
 #endif /* __NO_STUBS */
yann@1
    80