From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shinya Kuribayashi Date: Tue, 15 Mar 2011 08:54:12 +0900 Subject: [U-Boot] [PATCH v2 3/5] MIPS: Optimize the setup of endianess and CPU optimization flags In-Reply-To: <1300137298-23836-4-git-send-email-daniel.schwierzeck@googlemail.com> References: <1300137298-23836-1-git-send-email-daniel.schwierzeck@googlemail.com> <1300137298-23836-4-git-send-email-daniel.schwierzeck@googlemail.com> Message-ID: <4D7EAAA4.7070309@pobox.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/15/11 6:14 AM, daniel.schwierzeck at googlemail.com wrote: > Replace the current MIPSFLAGS code by cc-option macro and use > -march=mips32r2 as default optimization level for all Mips32 CPUs. > Replace the endianess determination code from toolchain prefix by > a more generic one inspired by the Linux arch/mips/Makefile. [...] > -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE))) > -ENDIANNESS = -EL > -else > -ENDIANNESS = -EB > -endif > +# Optimization flags for all Mips32 CPUs > +MIPSFLAGS = $(call cc-option,-march=mips32r2,-mips32r2 -Wa,-mips32r2) > > -MIPSFLAGS += $(ENDIANNESS) > +# Determine endianess from toolchain prefix > +ENDIANESS = $(shell $(CC) -dumpmachine | \ > + grep -q 'mips.*el-.*'&& echo -EL || echo -EB) > + > +PLATFORM_CPPFLAGS += $(MIPSFLAGS) $(ENDIANESS) > > -PLATFORM_CPPFLAGS += $(MIPSFLAGS) This trick can not work with the ELDK toolchain, which also I don't want to think about and be involved in discussion any more. See: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/81572/focus=81735 Users who need to dig into this area should install the ELDK first, build little-endian targets with it by yourself, then find a way to handle endianness appropriately which works for both the ELDK and non-ELDK toolchains. Or I may miss something. If it's already verified with the ELDK, please let me know, thanks.