From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shinya Kuribayashi Date: Tue, 27 Jul 2010 07:00:34 +0900 Subject: [U-Boot] [PATCH] [mips] add $(ENDIANNESS) option when link hello_world example In-Reply-To: <4C4DA45A.7060400@openmobilefree.net> References: <1279708045-16510-1-git-send-email-xiangfu@openmobilefree.net> <4C46FF49.6040205@pobox.com> <4C4DA45A.7060400@openmobilefree.net> Message-ID: <4C4E0582.4020101@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 7/27/10 12:06 AM, Xiangfu Liu wrote: > what about split this patch to two: > one is all *.lds files, > the other one is for the argument, Sounds good. > I have one question here. if we decete the board cpu by > CONFIG_CPU_LITTLE_ENDIAN. > why we need check the toolchina again. The answer is described right above: +# We explicitly add the endianness specifier if needed, this allows +# to compile kernels with a toolchain for the other endianness. We +# carefully avoid to add it redundantly because gcc 3.3/3.4 complains +# when fed the toolchain default! +# +# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of +# 2006-10-10 don't properly change the predefined symbols if -EB / -EL +# are used, so we kludge that here. A bug has been filed at +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413. This part is copied from Linux/MIPS kernel, and has been working with the wide range of GCC versions for years. > the original U-Boot is detect -EL/-EB by toolchain name. maybe the > CONFIG_CPU_LITTLE_ENDIAN option is better. True. CONFIG_CPU_LITTLE_ENDIAN (and CONFIG_CPU_BIG_ENDIAN) configs are also derived from Linux/MIPS kernel, and IMO they're right steps toward cross-endian build support. U-Boot, however, tends to think it less important, so don't hold your breath about this approach to be accepted. Cross-endian build is common practice for MIPS people, but might be uncommon for other architectures. Note that CONFIG_CPU_LITTLE_ENDIAN works not only for cross-endian builds, but also toolchain default endian builds with non-ELDK tools. If CONFIG_CPU_LITTLE_ENDIAN is not accepted, we have to think an alternative way.