build: mipsel cross compiler support

This patch introduces support for building a MIPS cross compiler
targetting little endian machines by default.

Change-Id: I116f6f431cdf80f5f5f58d2743357a9f70a7347d
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-on: https://chromium-review.googlesource.com/207970
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
Paul Burton 2014-05-27 15:18:42 +01:00 committed by chrome-internal-fetch
commit d6c9603c41
3 changed files with 17 additions and 2 deletions

View file

@ -19,11 +19,12 @@
#######################################################################
ARCH_SUPPORTED := ARM ARM64 X86_32
ARCH_SUPPORTED := ARM ARM64 X86_32 MIPS
ARCH_TO_TOOLCHAIN_X86_32 := x86_32
ARCH_TO_TOOLCHAIN_ARM := arm
ARCH_TO_TOOLCHAIN_ARM64 := arm64
ARCH_TO_TOOLCHAIN_MIPS := mipsel
COREBOOT_STANDARD_STAGES := bootblock verstage romstage ramstage
@ -31,10 +32,13 @@ ARCHDIR-i386 := x86
ARCHDIR-arm := arm
ARCHDIR-arm64 := arm64
ARCHDIR-x86_32 := x86
ARCHDIR-mipsel := mips
CFLAGS_arm := -mno-unaligned-access -ffunction-sections -fdata-sections
CFLAGS_arm64 := -ffunction-sections -fdata-sections
CFLAGS_mipsel := -mips32r2 -G 0
toolchain_to_dir = \
$(foreach arch,$(ARCH_SUPPORTED),\
$(eval INCLUDES_$(ARCH_TO_TOOLCHAIN_$(arch)) = \

View file

@ -4,12 +4,14 @@ build:
bash ./buildgcc -G -p i386-elf
bash ./buildgcc -G -p armv7a-eabi
bash ./buildgcc -G -p aarch64-elf
bash ./buildgcc -G -p mipsel-elf
.PHONY: build-without-gdb
build-without-gdb:
bash ./buildgcc -p i386-elf
bash ./buildgcc -p armv7a-eabi
bash ./buildgcc -p aarch64-elf
bash ./buildgcc -p mipsel-elf
clean:
rm -rf xgcc

View file

@ -115,6 +115,9 @@ detect_special_flags() {
arm )
testcc "$CC" "$CFLAGS" && CFLAGS="$CFLAGS"
;;
mipsel )
testcc "$CC" "$CFLAGS"
;;
esac
}
@ -140,7 +143,7 @@ touch "$TMPFILE"
trap clean_up EXIT
# Architecture definition
SUPPORTED_ARCHITECTURE="x86 arm aarch64"
SUPPORTED_ARCHITECTURE="x86 arm aarch64 mipsel"
# ARM Architecture
TARCH_arm="arm"
@ -161,6 +164,12 @@ TCLIST_x86="i386 x86_64"
TWIDTH_x86="32"
XGCCPATH=${1:-"`pwd`/util/crossgcc/xgcc/bin/"}
# MIPS Architecture (Little Endian)
TARCH_mipsel="mipsel"
TBFDARCH_mipsel="littlemips"
TCLIST_mipsel="mipsel"
TWIDTH_mipsel="32"
# This loops over all supported architectures.
for architecture in $SUPPORTED_ARCHITECTURE; do
GCCPREFIX="invalid"