patches/linux/2.4.26/linux-2.4.21-allow-gcc-3.3-arm-lib.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 Reconstructed from http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2003-December/018647.html
     2 See also http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=1540
     3 
     4 Message-ID: <DDA001.8070502@de.bosch.com>
     5 Subject: Help cross compiling the kernel for arm.
     6 From: dirk.behme at de.bosch.com
     7 
     8 Aitor Garcia wrote:
     9 > Hello everybody,
    10 > 
    11 > I am having problems cross compiling the kernel for arm.
    12 > 
    13 > This is the error message I get:
    14 > 
    15 > blkpg.c: In function `blk_ioctl':
    16 > blkpg.c:252: error: asm-specifier for variable `__r1' conflicts with asm clobber list
    17 > blkpg.c:252: confused by earlier errors, bailing out make[3]: *** [blkpg.o] Error 1
    18 > make[3]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block'
    19 > make[2]: *** [first_rule] Error 2
    20 > make[2]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block'
    21 > make[1]: *** [_subdir_block] Error 2
    22 > make[1]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers'
    23 > make: *** [_dir_drivers] Error 2
    24 > 
    25 > These are the toolchain versions I am using:
    26 >  host=i686-pc-linux-gnu
    27 >  binutils_version=2.14           
    28 >  gcc_version=3.3.2                
    29 >  glibc_version=2.3.2             
    30 >  kernel_version=2.4.21  
    31 > and applied the kernel patch for arm. 2.4.21-rmk1.
    32 > ... 
    33 > I have also seen references to this bug in ARM linux
    34 > Developer. Patch Number = 1540. But this patch is
    35 > classified as discarded.
    36 
    37 You need something like 1540 to compile 2.4.21 with gcc 3.3.2. 1540 was 
    38 discarded because of AFLAGS change.
    39 
    40 Try the attachment.
    41 
    42 Dirk
    43 -------------- next part --------------
    44 --- linux/arch/arm/lib/getuser.S.orig	Mon Nov 17 07:41:51 2003
    45 +++ linux/arch/arm/lib/getuser.S	Mon Nov 17 07:43:16 2003
    46 @@ -17,7 +17,7 @@
    47   *
    48   * Inputs:	r0 contains the address
    49   * Outputs:	r0 is the error code
    50 - *		r1, r2 contains the zero-extended value
    51 + *		r1, ip contains the zero-extended value
    52   *		lr corrupted
    53   *
    54   * No other registers must be altered.  (see include/asm-arm/uaccess.h
    55 @@ -42,14 +42,14 @@ __get_user_1:
    56  
    57  	.global	__get_user_2
    58  __get_user_2:
    59 -	bic	r2, sp, #0x1f00
    60 -	bic	r2, r2, #0x00ff
    61 -	ldr	r2, [r2, #TSK_ADDR_LIMIT]
    62 -	sub	r2, r2, #2
    63 -	cmp	r0, r2
    64 +	bic	ip, sp, #0x1f00
    65 +	bic	ip, ip, #0x00ff
    66 +	ldr	ip, [ip, #TSK_ADDR_LIMIT]
    67 +	sub	ip, ip, #2
    68 +	cmp	r0, ip
    69  2:	ldrlsbt	r1, [r0], #1
    70 -3:	ldrlsbt	r2, [r0]
    71 -	orrls	r1, r1, r2, lsl #8
    72 +3:	ldrlsbt	ip, [r0]
    73 +	orrls	r1, r1, ip, lsl #8
    74  	movls	r0, #0
    75  	movls	pc, lr
    76  	b	__get_user_bad
    77 @@ -68,20 +68,20 @@ __get_user_4:
    78  
    79  	.global	__get_user_8
    80  __get_user_8:
    81 -	bic	r2, sp, #0x1f00
    82 -	bic	r2, r2, #0x00ff
    83 -	ldr	r2, [r2, #TSK_ADDR_LIMIT]
    84 -	sub	r2, r2, #8
    85 -	cmp	r0, r2
    86 +	bic	ip, sp, #0x1f00
    87 +	bic	ip, ip, #0x00ff
    88 +	ldr	ip, [ip, #TSK_ADDR_LIMIT]
    89 +	sub	ip, ip, #8
    90 +	cmp	r0, ip
    91  5:	ldrlst	r1, [r0], #4
    92 -6:	ldrlst	r2, [r0]
    93 +6:	ldrlst	ip, [r0]
    94  	movls	r0, #0
    95  	movls	pc, lr
    96  
    97  	/* fall through */
    98  
    99  __get_user_bad_8:
   100 -	mov	r2, #0
   101 +	mov	ip, #0
   102  __get_user_bad:
   103  	mov	r1, #0
   104  	mov	r0, #-14
   105 --- linux/arch/arm/lib/putuser.S.orig	Mon Nov 17 07:41:57 2003
   106 +++ linux/arch/arm/lib/putuser.S	Mon Nov 17 07:42:26 2003
   107 @@ -16,7 +16,7 @@
   108   * __put_user_X
   109   *
   110   * Inputs:	r0 contains the address
   111 - *		r1, r2 contains the value
   112 + *		r1, ip contains the value
   113   * Outputs:	r0 is the error code
   114   *		lr corrupted
   115   *
   116 @@ -30,11 +30,11 @@
   117  
   118  	.global	__put_user_1
   119  __put_user_1:
   120 -	bic	r2, sp, #0x1f00
   121 -	bic	r2, r2, #0x00ff
   122 -	ldr	r2, [r2, #TSK_ADDR_LIMIT]
   123 -	sub	r2, r2, #1
   124 -	cmp	r0, r2
   125 +	bic	ip, sp, #0x1f00
   126 +	bic	ip, ip, #0x00ff
   127 +	ldr	ip, [ip, #TSK_ADDR_LIMIT]
   128 +	sub	ip, ip, #1
   129 +	cmp	r0, ip
   130  1:	strlsbt	r1, [r0]
   131  	movls	r0, #0
   132  	movls	pc, lr
   133 @@ -42,11 +42,11 @@ __put_user_1:
   134  
   135  	.global	__put_user_2
   136  __put_user_2:
   137 -	bic	r2, sp, #0x1f00
   138 -	bic	r2, r2, #0x00ff
   139 -	ldr	r2, [r2, #TSK_ADDR_LIMIT]
   140 -	sub	r2, r2, #2
   141 -	cmp	r0, r2
   142 +	bic	ip, sp, #0x1f00
   143 +	bic	ip, ip, #0x00ff
   144 +	ldr	ip, [ip, #TSK_ADDR_LIMIT]
   145 +	sub	ip, ip, #2
   146 +	cmp	r0, ip
   147  2:	strlsbt	r1, [r0], #1
   148  	movls	r1, r1, lsr #8
   149  3:	strlsbt	r1, [r0]
   150 @@ -56,11 +56,11 @@ __put_user_2:
   151  
   152  	.global	__put_user_4
   153  __put_user_4:
   154 -	bic	r2, sp, #0x1f00
   155 -	bic	r2, r2, #0x00ff
   156 -	ldr	r2, [r2, #TSK_ADDR_LIMIT]
   157 -	sub	r2, r2, #4
   158 -	cmp	r0, r2
   159 +	bic	ip, sp, #0x1f00
   160 +	bic	ip, ip, #0x00ff
   161 +	ldr	ip, [ip, #TSK_ADDR_LIMIT]
   162 +	sub	ip, ip, #4
   163 +	cmp	r0, ip
   164  4:	strlst	r1, [r0]
   165  	movls	r0, #0
   166  	movls	pc, lr
   167 @@ -74,7 +74,7 @@ __put_user_8:
   168  	sub	ip, ip, #8
   169  	cmp	r0, ip
   170  5:	strlst	r1, [r0], #4
   171 -6:	strlst	r2, [r0]
   172 +6:	strlst	ip, [r0]
   173  	movls	r0, #0
   174  	movls	pc, lr
   175  
   176 --- linux/include/asm-arm/uaccess.h.orig	Mon Nov 17 07:41:04 2003
   177 +++ linux/include/asm-arm/uaccess.h	Mon Nov 17 07:41:37 2003
   178 @@ -86,7 +86,7 @@ extern int __get_user_bad(void);
   179  			__get_user_x(__r1, __p, __e, 1, "lr");		\
   180  	       		break;						\
   181  		case 2:							\
   182 -			__get_user_x(__r1, __p, __e, 2, "r2", "lr");	\
   183 +			__get_user_x(__r1, __p, __e, 2, "ip", "lr");	\
   184  			break;						\
   185  		case 4:							\
   186  	       		__get_user_x(__r1, __p, __e, 4, "lr");		\
   187 @@ -122,13 +122,13 @@ extern int __put_user_bad(void);
   188  		register int __e asm("r0");				\
   189  		switch (sizeof(*(p))) {					\
   190  		case 1:							\
   191 -			__put_user_x(__r1, __p, __e, 1, "r2", "lr");	\
   192 +			__put_user_x(__r1, __p, __e, 1, "ip", "lr");	\
   193  			break;						\
   194  		case 2:							\
   195 -			__put_user_x(__r1, __p, __e, 2, "r2", "lr");	\
   196 +			__put_user_x(__r1, __p, __e, 2, "ip", "lr");	\
   197  			break;						\
   198  		case 4:							\
   199 -			__put_user_x(__r1, __p, __e, 4, "r2", "lr");	\
   200 +			__put_user_x(__r1, __p, __e, 4, "ip", "lr");	\
   201  			break;						\
   202  		case 8:							\
   203  			__put_user_x(__r1, __p, __e, 8, "ip", "lr");	\