[U-Boot] sparc and .udiv/.rem/.urem/.umul/etc... link errors

Daniel Hellstrom daniel at gaisler.com
Thu Oct 13 10:45:27 CEST 2011


On 10/13/2011 07:33 AM, Mike Frysinger wrote:
> it seems that these symbols are usually implemented in the C library on sparc
> systems, but under u-boot, we don't have that luxury.  Linux itself simply
> imports the relevant asm files from glibc into their lib subdir.  without
> these, building u-boot for sparc targets with sparc linux compilers fail.  any
> desire to make this work ?  or just continue to force everyone to install a
> dedicated sparc-elf compiler ?
> -mike

The .udiv/.rem ... functions are implemented by libgcc, an suggested implementation is given in the SPARCv8 Appendix E. The functions are needed when compiling for SPARCv7 CPUs which doesn't have a 
hardware multiplier/divider instead they are implemented in software, SPARCv8 CPUs have multiplier/divider in hardware so .mul/.rem etc is not needed. One can switch between V7 or V8 compatible code 
by adding -mv8 (GCC 3.4.4 or earlier) or -mcpu=v8 (in newer GCC). Sparc-linux toolchains will generate ELF binaries for Linux, that is not what we want?

Daniel


More information about the U-Boot mailing list