[superh-gnu-discuss] SH2A uCLinux toolchain

Andrew Stubbs ams at codesourcery.com
Mon May 16 16:09:44 UTC 2011


On 16/05/11 16:32, PHIL.EDWORTHY at renesas.com wrote:
> The toolchain is only provided with fdpic libraries, but this is only
> useful for userspace code afaik. The kernel already forces -mno-fdpic,
> so should I use this option with U-Boot as well?
>
> The problem is that both the kernel, when building a zImage, and U-Boot,
> link against libgcc. This leads to "attempt to mix FDPIC and non-FDPIC
> objects" errors.

The problem is that libgcc (a behind-the-scenes library containing 
essential helper functions for compiled code) is compiled for FDPIC. 
This is necessary for user-space, as you say.

The kernel and u-boot are special cases in that they are bare-metal 
applications that are typically built with a (normally unsuitable) 
Linux/uClinux user-space toolchain. This means they should provide a 
complete set of libgcc-compatible replacement routines that work in a 
bare-metal context.

The kernel does, in fact, provide sufficient routines to build a normal 
kernel, but apparently is missing (at least) one used by the compressed 
kernel. I'm not familiar with U-boot, but presumably it should be doing 
the same. You can probably copy many of the routines from the kernel 
sources. The rest can be obtained from the compiler sources, or by 
building a reconfigured compiler.

Note that this problem is not SH-specific, but true on all platforms. 
That said, the FDPIC user-space *is* more incompatible with bare-metal 
than in most cases.

> So my question is, how can I use this toolchain for uCLinux development?

The toolchain can be used for user-space uClinux development, but the 
kernel and u-boot must either be built with a bare-metal toolchain, or 
else have patches applied to work with the Linux toolchain (as the 
kernel mostly does).

Sorry, but the our Renesas contract does not specify any bare-metal 
configurations. If you think that should be changed, I believe you 
should talk to Paul Mundt or Hisao Munakata on your side. Paul might 
also have a technical solution for u-boot already.

Andrew



More information about the superh-gnu-discuss mailing list