summaryrefslogtreecommitdiff
path: root/patches/linux/2.4.26/linux-2.4.21-allow-gcc-3.3-arm-lib.patch
blob: 8f8ddd67045f420a6bedcac5bf3e890f7986391c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
Reconstructed from http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2003-December/018647.html
See also http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=1540

Message-ID: <DDA001.8070502@de.bosch.com>
Subject: Help cross compiling the kernel for arm.
From: dirk.behme at de.bosch.com

Aitor Garcia wrote:
> Hello everybody,
> 
> I am having problems cross compiling the kernel for arm.
> 
> This is the error message I get:
> 
> blkpg.c: In function `blk_ioctl':
> blkpg.c:252: error: asm-specifier for variable `__r1' conflicts with asm clobber list
> blkpg.c:252: confused by earlier errors, bailing out make[3]: *** [blkpg.o] Error 1
> make[3]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block'
> make[2]: *** [first_rule] Error 2
> make[2]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block'
> make[1]: *** [_subdir_block] Error 2
> make[1]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers'
> make: *** [_dir_drivers] Error 2
> 
> These are the toolchain versions I am using:
>  host=i686-pc-linux-gnu
>  binutils_version=2.14           
>  gcc_version=3.3.2                
>  glibc_version=2.3.2             
>  kernel_version=2.4.21  
> and applied the kernel patch for arm. 2.4.21-rmk1.
> ... 
> I have also seen references to this bug in ARM linux
> Developer. Patch Number = 1540. But this patch is
> classified as discarded.

You need something like 1540 to compile 2.4.21 with gcc 3.3.2. 1540 was 
discarded because of AFLAGS change.

Try the attachment.

Dirk
-------------- next part --------------
--- linux/arch/arm/lib/getuser.S.orig	Mon Nov 17 07:41:51 2003
+++ linux/arch/arm/lib/getuser.S	Mon Nov 17 07:43:16 2003
@@ -17,7 +17,7 @@
  *
  * Inputs:	r0 contains the address
  * Outputs:	r0 is the error code
- *		r1, r2 contains the zero-extended value
+ *		r1, ip contains the zero-extended value
  *		lr corrupted
  *
  * No other registers must be altered.  (see include/asm-arm/uaccess.h
@@ -42,14 +42,14 @@ __get_user_1:
 
 	.global	__get_user_2
 __get_user_2:
-	bic	r2, sp, #0x1f00
-	bic	r2, r2, #0x00ff
-	ldr	r2, [r2, #TSK_ADDR_LIMIT]
-	sub	r2, r2, #2
-	cmp	r0, r2
+	bic	ip, sp, #0x1f00
+	bic	ip, ip, #0x00ff
+	ldr	ip, [ip, #TSK_ADDR_LIMIT]
+	sub	ip, ip, #2
+	cmp	r0, ip
 2:	ldrlsbt	r1, [r0], #1
-3:	ldrlsbt	r2, [r0]
-	orrls	r1, r1, r2, lsl #8
+3:	ldrlsbt	ip, [r0]
+	orrls	r1, r1, ip, lsl #8
 	movls	r0, #0
 	movls	pc, lr
 	b	__get_user_bad
@@ -68,20 +68,20 @@ __get_user_4:
 
 	.global	__get_user_8
 __get_user_8:
-	bic	r2, sp, #0x1f00
-	bic	r2, r2, #0x00ff
-	ldr	r2, [r2, #TSK_ADDR_LIMIT]
-	sub	r2, r2, #8
-	cmp	r0, r2
+	bic	ip, sp, #0x1f00
+	bic	ip, ip, #0x00ff
+	ldr	ip, [ip, #TSK_ADDR_LIMIT]
+	sub	ip, ip, #8
+	cmp	r0, ip
 5:	ldrlst	r1, [r0], #4
-6:	ldrlst	r2, [r0]
+6:	ldrlst	ip, [r0]
 	movls	r0, #0
 	movls	pc, lr
 
 	/* fall through */
 
 __get_user_bad_8:
-	mov	r2, #0
+	mov	ip, #0
 __get_user_bad:
 	mov	r1, #0
 	mov	r0, #-14
--- linux/arch/arm/lib/putuser.S.orig	Mon Nov 17 07:41:57 2003
+++ linux/arch/arm/lib/putuser.S	Mon Nov 17 07:42:26 2003
@@ -16,7 +16,7 @@
  * __put_user_X
  *
  * Inputs:	r0 contains the address
- *		r1, r2 contains the value
+ *		r1, ip contains the value
  * Outputs:	r0 is the error code
  *		lr corrupted
  *
@@ -30,11 +30,11 @@
 
 	.global	__put_user_1
 __put_user_1:
-	bic	r2, sp, #0x1f00
-	bic	r2, r2, #0x00ff
-	ldr	r2, [r2, #TSK_ADDR_LIMIT]
-	sub	r2, r2, #1
-	cmp	r0, r2
+	bic	ip, sp, #0x1f00
+	bic	ip, ip, #0x00ff
+	ldr	ip, [ip, #TSK_ADDR_LIMIT]
+	sub	ip, ip, #1
+	cmp	r0, ip
 1:	strlsbt	r1, [r0]
 	movls	r0, #0
 	movls	pc, lr
@@ -42,11 +42,11 @@ __put_user_1:
 
 	.global	__put_user_2
 __put_user_2:
-	bic	r2, sp, #0x1f00
-	bic	r2, r2, #0x00ff
-	ldr	r2, [r2, #TSK_ADDR_LIMIT]
-	sub	r2, r2, #2
-	cmp	r0, r2
+	bic	ip, sp, #0x1f00
+	bic	ip, ip, #0x00ff
+	ldr	ip, [ip, #TSK_ADDR_LIMIT]
+	sub	ip, ip, #2
+	cmp	r0, ip
 2:	strlsbt	r1, [r0], #1
 	movls	r1, r1, lsr #8
 3:	strlsbt	r1, [r0]
@@ -56,11 +56,11 @@ __put_user_2:
 
 	.global	__put_user_4
 __put_user_4:
-	bic	r2, sp, #0x1f00
-	bic	r2, r2, #0x00ff
-	ldr	r2, [r2, #TSK_ADDR_LIMIT]
-	sub	r2, r2, #4
-	cmp	r0, r2
+	bic	ip, sp, #0x1f00
+	bic	ip, ip, #0x00ff
+	ldr	ip, [ip, #TSK_ADDR_LIMIT]
+	sub	ip, ip, #4
+	cmp	r0, ip
 4:	strlst	r1, [r0]
 	movls	r0, #0
 	movls	pc, lr
@@ -74,7 +74,7 @@ __put_user_8:
 	sub	ip, ip, #8
 	cmp	r0, ip
 5:	strlst	r1, [r0], #4
-6:	strlst	r2, [r0]
+6:	strlst	ip, [r0]
 	movls	r0, #0
 	movls	pc, lr
 
--- linux/include/asm-arm/uaccess.h.orig	Mon Nov 17 07:41:04 2003
+++ linux/include/asm-arm/uaccess.h	Mon Nov 17 07:41:37 2003
@@ -86,7 +86,7 @@ extern int __get_user_bad(void);
 			__get_user_x(__r1, __p, __e, 1, "lr");		\
 	       		break;						\
 		case 2:							\
-			__get_user_x(__r1, __p, __e, 2, "r2", "lr");	\
+			__get_user_x(__r1, __p, __e, 2, "ip", "lr");	\
 			break;						\
 		case 4:							\
 	       		__get_user_x(__r1, __p, __e, 4, "lr");		\
@@ -122,13 +122,13 @@ extern int __put_user_bad(void);
 		register int __e asm("r0");				\
 		switch (sizeof(*(p))) {					\
 		case 1:							\
-			__put_user_x(__r1, __p, __e, 1, "r2", "lr");	\
+			__put_user_x(__r1, __p, __e, 1, "ip", "lr");	\
 			break;						\
 		case 2:							\
-			__put_user_x(__r1, __p, __e, 2, "r2", "lr");	\
+			__put_user_x(__r1, __p, __e, 2, "ip", "lr");	\
 			break;						\
 		case 4:							\
-			__put_user_x(__r1, __p, __e, 4, "r2", "lr");	\
+			__put_user_x(__r1, __p, __e, 4, "ip", "lr");	\
 			break;						\
 		case 8:							\
 			__put_user_x(__r1, __p, __e, 8, "ip", "lr");	\