1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/linux/2.4.26/linux-2.4.21-allow-gcc-3.3-arm-lib.patch Mon May 21 22:01:28 2007 +0000
1.3 @@ -0,0 +1,203 @@
1.4 +Reconstructed from http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2003-December/018647.html
1.5 +See also http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=1540
1.6 +
1.7 +Message-ID: <DDA001.8070502@de.bosch.com>
1.8 +Subject: Help cross compiling the kernel for arm.
1.9 +From: dirk.behme at de.bosch.com
1.10 +
1.11 +Aitor Garcia wrote:
1.12 +> Hello everybody,
1.13 +>
1.14 +> I am having problems cross compiling the kernel for arm.
1.15 +>
1.16 +> This is the error message I get:
1.17 +>
1.18 +> blkpg.c: In function `blk_ioctl':
1.19 +> blkpg.c:252: error: asm-specifier for variable `__r1' conflicts with asm clobber list
1.20 +> blkpg.c:252: confused by earlier errors, bailing out make[3]: *** [blkpg.o] Error 1
1.21 +> make[3]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block'
1.22 +> make[2]: *** [first_rule] Error 2
1.23 +> make[2]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block'
1.24 +> make[1]: *** [_subdir_block] Error 2
1.25 +> make[1]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers'
1.26 +> make: *** [_dir_drivers] Error 2
1.27 +>
1.28 +> These are the toolchain versions I am using:
1.29 +> host=i686-pc-linux-gnu
1.30 +> binutils_version=2.14
1.31 +> gcc_version=3.3.2
1.32 +> glibc_version=2.3.2
1.33 +> kernel_version=2.4.21
1.34 +> and applied the kernel patch for arm. 2.4.21-rmk1.
1.35 +> ...
1.36 +> I have also seen references to this bug in ARM linux
1.37 +> Developer. Patch Number = 1540. But this patch is
1.38 +> classified as discarded.
1.39 +
1.40 +You need something like 1540 to compile 2.4.21 with gcc 3.3.2. 1540 was
1.41 +discarded because of AFLAGS change.
1.42 +
1.43 +Try the attachment.
1.44 +
1.45 +Dirk
1.46 +-------------- next part --------------
1.47 +--- linux/arch/arm/lib/getuser.S.orig Mon Nov 17 07:41:51 2003
1.48 ++++ linux/arch/arm/lib/getuser.S Mon Nov 17 07:43:16 2003
1.49 +@@ -17,7 +17,7 @@
1.50 + *
1.51 + * Inputs: r0 contains the address
1.52 + * Outputs: r0 is the error code
1.53 +- * r1, r2 contains the zero-extended value
1.54 ++ * r1, ip contains the zero-extended value
1.55 + * lr corrupted
1.56 + *
1.57 + * No other registers must be altered. (see include/asm-arm/uaccess.h
1.58 +@@ -42,14 +42,14 @@ __get_user_1:
1.59 +
1.60 + .global __get_user_2
1.61 + __get_user_2:
1.62 +- bic r2, sp, #0x1f00
1.63 +- bic r2, r2, #0x00ff
1.64 +- ldr r2, [r2, #TSK_ADDR_LIMIT]
1.65 +- sub r2, r2, #2
1.66 +- cmp r0, r2
1.67 ++ bic ip, sp, #0x1f00
1.68 ++ bic ip, ip, #0x00ff
1.69 ++ ldr ip, [ip, #TSK_ADDR_LIMIT]
1.70 ++ sub ip, ip, #2
1.71 ++ cmp r0, ip
1.72 + 2: ldrlsbt r1, [r0], #1
1.73 +-3: ldrlsbt r2, [r0]
1.74 +- orrls r1, r1, r2, lsl #8
1.75 ++3: ldrlsbt ip, [r0]
1.76 ++ orrls r1, r1, ip, lsl #8
1.77 + movls r0, #0
1.78 + movls pc, lr
1.79 + b __get_user_bad
1.80 +@@ -68,20 +68,20 @@ __get_user_4:
1.81 +
1.82 + .global __get_user_8
1.83 + __get_user_8:
1.84 +- bic r2, sp, #0x1f00
1.85 +- bic r2, r2, #0x00ff
1.86 +- ldr r2, [r2, #TSK_ADDR_LIMIT]
1.87 +- sub r2, r2, #8
1.88 +- cmp r0, r2
1.89 ++ bic ip, sp, #0x1f00
1.90 ++ bic ip, ip, #0x00ff
1.91 ++ ldr ip, [ip, #TSK_ADDR_LIMIT]
1.92 ++ sub ip, ip, #8
1.93 ++ cmp r0, ip
1.94 + 5: ldrlst r1, [r0], #4
1.95 +-6: ldrlst r2, [r0]
1.96 ++6: ldrlst ip, [r0]
1.97 + movls r0, #0
1.98 + movls pc, lr
1.99 +
1.100 + /* fall through */
1.101 +
1.102 + __get_user_bad_8:
1.103 +- mov r2, #0
1.104 ++ mov ip, #0
1.105 + __get_user_bad:
1.106 + mov r1, #0
1.107 + mov r0, #-14
1.108 +--- linux/arch/arm/lib/putuser.S.orig Mon Nov 17 07:41:57 2003
1.109 ++++ linux/arch/arm/lib/putuser.S Mon Nov 17 07:42:26 2003
1.110 +@@ -16,7 +16,7 @@
1.111 + * __put_user_X
1.112 + *
1.113 + * Inputs: r0 contains the address
1.114 +- * r1, r2 contains the value
1.115 ++ * r1, ip contains the value
1.116 + * Outputs: r0 is the error code
1.117 + * lr corrupted
1.118 + *
1.119 +@@ -30,11 +30,11 @@
1.120 +
1.121 + .global __put_user_1
1.122 + __put_user_1:
1.123 +- bic r2, sp, #0x1f00
1.124 +- bic r2, r2, #0x00ff
1.125 +- ldr r2, [r2, #TSK_ADDR_LIMIT]
1.126 +- sub r2, r2, #1
1.127 +- cmp r0, r2
1.128 ++ bic ip, sp, #0x1f00
1.129 ++ bic ip, ip, #0x00ff
1.130 ++ ldr ip, [ip, #TSK_ADDR_LIMIT]
1.131 ++ sub ip, ip, #1
1.132 ++ cmp r0, ip
1.133 + 1: strlsbt r1, [r0]
1.134 + movls r0, #0
1.135 + movls pc, lr
1.136 +@@ -42,11 +42,11 @@ __put_user_1:
1.137 +
1.138 + .global __put_user_2
1.139 + __put_user_2:
1.140 +- bic r2, sp, #0x1f00
1.141 +- bic r2, r2, #0x00ff
1.142 +- ldr r2, [r2, #TSK_ADDR_LIMIT]
1.143 +- sub r2, r2, #2
1.144 +- cmp r0, r2
1.145 ++ bic ip, sp, #0x1f00
1.146 ++ bic ip, ip, #0x00ff
1.147 ++ ldr ip, [ip, #TSK_ADDR_LIMIT]
1.148 ++ sub ip, ip, #2
1.149 ++ cmp r0, ip
1.150 + 2: strlsbt r1, [r0], #1
1.151 + movls r1, r1, lsr #8
1.152 + 3: strlsbt r1, [r0]
1.153 +@@ -56,11 +56,11 @@ __put_user_2:
1.154 +
1.155 + .global __put_user_4
1.156 + __put_user_4:
1.157 +- bic r2, sp, #0x1f00
1.158 +- bic r2, r2, #0x00ff
1.159 +- ldr r2, [r2, #TSK_ADDR_LIMIT]
1.160 +- sub r2, r2, #4
1.161 +- cmp r0, r2
1.162 ++ bic ip, sp, #0x1f00
1.163 ++ bic ip, ip, #0x00ff
1.164 ++ ldr ip, [ip, #TSK_ADDR_LIMIT]
1.165 ++ sub ip, ip, #4
1.166 ++ cmp r0, ip
1.167 + 4: strlst r1, [r0]
1.168 + movls r0, #0
1.169 + movls pc, lr
1.170 +@@ -74,7 +74,7 @@ __put_user_8:
1.171 + sub ip, ip, #8
1.172 + cmp r0, ip
1.173 + 5: strlst r1, [r0], #4
1.174 +-6: strlst r2, [r0]
1.175 ++6: strlst ip, [r0]
1.176 + movls r0, #0
1.177 + movls pc, lr
1.178 +
1.179 +--- linux/include/asm-arm/uaccess.h.orig Mon Nov 17 07:41:04 2003
1.180 ++++ linux/include/asm-arm/uaccess.h Mon Nov 17 07:41:37 2003
1.181 +@@ -86,7 +86,7 @@ extern int __get_user_bad(void);
1.182 + __get_user_x(__r1, __p, __e, 1, "lr"); \
1.183 + break; \
1.184 + case 2: \
1.185 +- __get_user_x(__r1, __p, __e, 2, "r2", "lr"); \
1.186 ++ __get_user_x(__r1, __p, __e, 2, "ip", "lr"); \
1.187 + break; \
1.188 + case 4: \
1.189 + __get_user_x(__r1, __p, __e, 4, "lr"); \
1.190 +@@ -122,13 +122,13 @@ extern int __put_user_bad(void);
1.191 + register int __e asm("r0"); \
1.192 + switch (sizeof(*(p))) { \
1.193 + case 1: \
1.194 +- __put_user_x(__r1, __p, __e, 1, "r2", "lr"); \
1.195 ++ __put_user_x(__r1, __p, __e, 1, "ip", "lr"); \
1.196 + break; \
1.197 + case 2: \
1.198 +- __put_user_x(__r1, __p, __e, 2, "r2", "lr"); \
1.199 ++ __put_user_x(__r1, __p, __e, 2, "ip", "lr"); \
1.200 + break; \
1.201 + case 4: \
1.202 +- __put_user_x(__r1, __p, __e, 4, "r2", "lr"); \
1.203 ++ __put_user_x(__r1, __p, __e, 4, "ip", "lr"); \
1.204 + break; \
1.205 + case 8: \
1.206 + __put_user_x(__r1, __p, __e, 8, "ip", "lr"); \