[U-Boot] *** PROBABLY SPAM *** Re: [PATCH 1/1] mips: unify lds

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sat May 23 01:48:15 CEST 2009


> 
> Background is, we're going to have a single, unified u-boot.lds, hence
> OUTPUT_FORMAT(default, big, little) command would be applied across all
> supported targets as well.  Then, we'd like to pass -EL specifier to the
> linker so that some little-endian builds are processed properly.
> 
> The goal here is,
> 
> * Explicitly add the endianness specifier _if_needed_, this allows
>   to compile kernels with a toolchain for the other endianness.
for the kernel they do not use the libgcc at all
this will allow you to compile it in the endianness specifier evenif your
toolchain does not support it
but to do this in u-boot we will need to re-implement the div64 to allow a
assembly implementation
> 
> * We carefully avoid to add it redundantly because gcc 3.3/3.4
>   complains when fed the toolchain default!
> 
> * Expected behavior
> 
>   # echo mips-linux | grep -q 'mips.*el-.*' || echo -EL
>   -EL
>   # echo mips-linux | grep -q 'mips.*el-.*' && echo -EB
>   # echo mipsel-linux | grep -q 'mips.*el-.*' || echo -EL
>   # echo mipsel-linux | grep -q 'mips.*el-.*' && echo -EB
>   -EB
> 
> * Side-effects
> 
>   Some LE toolchains with 'mips-linux', will have a redundant -LE.
>   Some BE toolchains with 'mipsel-linux', will have a redundant -BE.
> 
>   In these cases, you would see a lot of warnings. It's harmless, so
>   I'd like to ignore them as they're minor enough, and consolidation
>   of lds files is more important here.  Also note that I believe we
>   would never find the latter case.
> 
> 
> So, I'd like to say the patch itself looks basically good.
> But still some work needs to be done.
> 
> * How about splitting the patch into two, 1) CONFIG_CPU_LITTLE_ENDIAN
>   introduction patch, and 2) u-boot.lds consoliation patch ?
> 
> * Just wondered, is there any reason why you didn't use PREDEF_{BE,LE}
>   like Linux kernel does?
no just to avaid double define
> 
>   UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
>   UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
> >>PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__<<
> >>PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__<<
>   ifdef CONFIG_CPU_LITTLE_ENDIAN
>   PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE))
>   else
>   PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
>   endif
> 
> * By the way, s/PLATFORM_CFLAGS/PLATFORM_CPPFLAGS/.
> 
> * And we need -EL/-EB specifier on PLATFORM_LDFLAGS as well.
>   We call the GNU ld directly on the final link, so $(UNDEF_ALL) and
>   $(PREDEF_??) part probably are not required.
yes the PREDEF will not be necessarely
> 
> * We need to fix examples/{Makefile,mips.lds} as well.ind time to work on?
> 
> * We need to remove ENDIANNESS from cpu/mips/config.mk, finally.
> 
>   diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
>   index a173c54..098d6c7 100644
>   --- a/cpu/mips/config.mk
>   +++ b/cpu/mips/config.mk
>   @@ -28,12 +28,4 @@ else \
>           echo "-march=4kc -mtune=4kc"; \
>    fi)
>    
>   -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
>   -ENDIANNESS = -EL
>   -else
>   -ENDIANNESS = -EB
>   -endif
>   -
>   -MIPSFLAGS += $(ENDIANNESS)
>   -
>    PLATFORM_CPPFLAGS += $(MIPSFLAGS)
> 
> If there're any problems or objections, I'll work on the patch on my
> side (to help Jean), and try to queue them toward the next release.
> Revised patches are welcome, of course.
did you find time to work on?

Best Regards,
J.


More information about the U-Boot mailing list