[U-Boot] using different architecture / toolchain for SPL build

Allen Martin AMartin at nvidia.com
Wed Apr 11 18:44:55 CEST 2012


> > How would others feel about a CROSS_COMPILE_SPL variable that allowed
> > one to override the toolchain used during the SPL build?
> 
> This makes no sense to me.  The need to use a specific tool chain for
> some SoC type usuallyonly comes into play when dealing with user space
> code, i. e. when you have to make sure that you also use libraries
> that were built with appropriate options.  U-Boot however is pretty
> much self-contained - if you are careful (see USE_PRIVATE_LIBGCC) we
> do not even depend on the compiler-provided libraries.
> 
> All you should have to do is making sure the build is done using
> appropriate build options.  I can see no reason why different tool
> chains would be needed (not to mention that such an approch would be
> a maintainance nightmare for all involved parties).

So the particular problem that pushed me over the edge on this was trying to apply the ARM thumb patches that Aneesh V posted.  As I discovered, it's not the compiler but the linker that inserts the thumb interworking code.  As far as I can tell it's not possible to get a linker targeted for armv7 to emit interworking code that works on armv4 regardless of what options are used.  I was banging my head on this for a few days so I would love to be proven wrong, but the only option I found that worked was to use an armv4 toolchain for the armv4 bits and armv7 toolchain for the armv7 bits.

> > The architecture seems harder to fix.  It seems like I really have to
> > have two entries in boards.cfg, which means two passes of config/make.
> 
> This should be not needed; I also do not think this would be an
> acceptable approach.

How is it possible then to build an SPL that builds from a different arch subdirectory?  It seems like the arch subdirectory is decided during the "make config" step.  I really don't like how fragile it is today where we build an armv4 loader from the armv7 directory.  Anytime anybody touches start.S or touches compiler options it potentially breaks us.  For example the same thumb patches broke tegra even with CONFIG_THUMB turned off because it changed -march to armv7-a.  And why wouldn't you want -march=armv7-a for a armv7 build?


-Allen

nvpublic



More information about the U-Boot mailing list