[uClinux-dev] [Help] Full C/C++ GNU Toolchain for ARM uClinux

Thuys, Michiel michiel.thuys at intersil.com
Fri Nov 30 03:30:47 EST 2001


Hi all,

More news from Compiler land! Up till now, we were using the Netsilicon
(gcc 2.96) toolchain for compiling kernel and applications on our ARM9
platform. For applications, we use XIP.

As reported in this list, the Netsilicon compiler contains a nasty bug
that can cause (and will in our 2.4.10 kernel!) stack corruption.
Therefore, we switched to gcc 2.95.3.

To make gcc 2.95.3 work for our applications (i.e. support XIP), we took
the standard 2.95.3 and applied the "single-pic-base" patch from Philip
Blundell (refer to http://www.geocities.com/tzengymtw/ARM/toolchain for
the patch and a small HOWTO). However, this patch is not functioning
correctly. Registers are saved 4 bytes "too far" on the stack so they
can be overwritten. To make the 2.95.3 work with XIP, you need to apply
the following patch AFTER THE 'single-pic-base' PATCH:

--- gcc-2.95.3/gcc/config/arm/arm.h     Thu Jan 25 15:03:26 2001
+++ /PIC/gcc-2.95.3/gcc/config/arm/arm.h       Tue Nov 27 10:21:46 2001
@@ -1265,7 +1277,8 @@
            if (regs_ever_live[regno] && ! call_used_regs[regno])
\
              saved_hard_reg = 1, offset += 4;
\
          /* PIC register is a fixed reg, so call_used_regs set.  */
\
-         if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
\
+         if (flag_pic && ! TARGET_SINGLE_PIC_BASE
\
+           && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
\
            saved_hard_reg = 1, offset += 4;
\
           for (regno = 16; regno <=23; regno++)
\
            if (regs_ever_live[regno] && ! call_used_regs[regno])
\
@@ -1379,8 +1392,11 @@

The same problem is in GCC 3.0.2, so we also send this patch to Philip
Blundell.

I hope this gives a stable compiler for all ARM/uClinux platforms with
XIP. Please let me know if this works for you.

Michiel
> -----Original Message-----
> From: Erwin Authried [mailto:eauth at softsys.co.at]
> Sent: donderdag 29 november 2001 23:05
> To: uclinux-dev at uclinux.org
> Subject: Re: [uClinux-dev] [Help] Full C/C++ GNU Toolchain for ARM
> uClinux
> 
> 
> Fabrice Gautier schrieb:
> > What may be not supported is:
> > - nifty patches for XIP that work with C++
> > - maybe elf2flt doesn't support C++
> > - STL
> > 
> Hmmm, has anybody got XIP working with 2.95.3 at all?
> And what's STL?
> 
> -Erwin
> 
> This message resent by the uclinux-dev at uclinux.org list 
> server http://www.uClinux.org/
> 
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/



More information about the uClinux-dev mailing list