From: Vagrant Cascadian Date: Tue, 7 Apr 2015 20:42:30 +0000 (+0000) Subject: mipsel-native-endianness X-Git-Tag: archive/raspbian/2016.11+dfsg1-3+rpi1~1^2^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=885f8dbf5bfc9956cd50e79b51ae380828ebd1ac;p=u-boot.git mipsel-native-endianness [MIPS] Fix little-endian build with non-ELDK toolchains We've been in trouble for a long time when cross compiling with non-ELDK toolchains. This is caused by -EB passed to CPPFLAGS incorrectly, by the lack of an endian specifier to LDFLAGS, and by wrong OUTPUT_FORMATs. We're going to implement two workarounds. One is the endianness specifier bugfix not to pass -EB / -EL to CPPFLAGS unless ELDK toolchain is used. Note that ELDK and non-ELDK toolchains know their default endianness, so the endianness specifier may not be necessary in principle. The other is removal of OUTPUT_FORMAT in *.lds files. If we have this, it doesn't work unless an endianness specifier is added to LDFLAGS. As we haven't added that to LDFLAGS so far, it must have not worked properly, except ELDK; I don't know why and how ELDK works, though. With these two changes, all objects will be generated and linked in the toolchain's default endianness. Then MAKEALL mips_el will work even with non-ELDK toolchain. Note that Linux/MIPS kernel has CONFIG_CPU_BIG_ENDIAN and CONFIG_CPU_LITTLE_ENDIAN alternatives to allow users to compile kernels with a toolchain for the other endianness. But U-Boot does not have such feature for now, and it's another story. Signed-off-by: Shinya Kuribayashi Gbp-Pq: Name mipsel-native-endianness.diff --- diff --git a/arch/mips/config.mk b/arch/mips/config.mk index a2d07aff1..a1d213394 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -5,10 +5,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := mips_4KC- -endif - # Handle special prefix in ELDK 4.0 toolchain ifneq (,$(findstring 4KCle,$(CROSS_COMPILE))) ENDIANNESS := -EL diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds index 849f0aabf..94370c961 100644 --- a/examples/standalone/mips.lds +++ b/examples/standalone/mips.lds @@ -5,10 +5,6 @@ * SPDX-License-Identifier: GPL-2.0+ */ -/* -OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips") -*/ -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips") OUTPUT_ARCH(mips) SECTIONS {