From: Masahiro Yamada Date: Fri, 28 Feb 2014 05:33:30 +0000 (+0900) Subject: kbuild: fix CROSS_COMPILE settings in config.mk X-Git-Tag: v2014.04-rc2~38 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9b6e2c363f2686d6f7bf61fbe58b7591b71d3e8b;p=u-boot kbuild: fix CROSS_COMPILE settings in config.mk The syntax CROSS_COMIPLE ?= does not work because config.mk is parsed after exporting CROSS_COMPILE. Like Linux Kernel's arch/$(ARCH)/Makefile, we must write as follows: ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := endif Signed-off-by: Masahiro Yamada --- diff --git a/arch/arc/config.mk b/arch/arc/config.mk index 76f4f7c0dd..d9f5d9d787 100644 --- a/arch/arc/config.mk +++ b/arch/arc/config.mk @@ -9,14 +9,18 @@ CONFIG_SYS_LITTLE_ENDIAN = 1 endif ifdef CONFIG_SYS_LITTLE_ENDIAN -CROSS_COMPILE ?= arc-buildroot-linux-uclibc- +ARC_CROSS_COMPILE := arc-buildroot-linux-uclibc- endif ifdef CONFIG_SYS_BIG_ENDIAN -CROSS_COMPILE ?= arceb-buildroot-linux-uclibc- +ARC_CROSS_COMPILE := arceb-buildroot-linux-uclibc- PLATFORM_LDFLAGS += -EB endif +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := $(ARC_CROSS_COMPILE) +endif + PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -DCONFIG_ARC -gdwarf-2 LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 1db80be354..792cb43450 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= arm-linux- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := arm-linux- +endif ifndef CONFIG_STANDALONE_LOAD_ADDR ifneq ($(CONFIG_OMAP_COMMON),) diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk index b9b96313c5..28a371c806 100644 --- a/arch/avr32/config.mk +++ b/arch/avr32/config.mk @@ -5,7 +5,10 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= avr32-linux- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := avr32-linux- +endif + PLATFORM_CPPFLAGS += -DCONFIG_AVR32 CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index c752025aaf..adc97125b5 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= bfin-uclinux- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := bfin-uclinux- +endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk index 79ae2987ea..33b3d51af0 100644 --- a/arch/m68k/config.mk +++ b/arch/m68k/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= m68k-elf- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := m68k-elf- +endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000 diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index fc545a9ee6..cdb321ac26 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -8,7 +8,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= mb- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := mb- +endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000 diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 2abdebbe13..1899f51872 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= mips_4KC- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := mips_4KC- +endif # Handle special prefix in ELDK 4.0 toolchain ifneq (,$(findstring 4KCle,$(CROSS_COMPILE))) diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk index 550f8a440e..0cbc4ad058 100644 --- a/arch/nds32/config.mk +++ b/arch/nds32/config.mk @@ -8,7 +8,9 @@ # # SPDX-License-Identifier: GPL-2.0+ -CROSS_COMPILE ?= nds32le-linux- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := nds32le-linux- +endif CONFIG_STANDALONE_LOAD_ADDR = 0x300000 -T $(srctree)/$(src)/nds32.lds diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk index 7d546eff69..65a5a40b6d 100644 --- a/arch/nios2/config.mk +++ b/arch/nios2/config.mk @@ -6,7 +6,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= nios2-elf- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := nios2-elf- +endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x02000000 diff --git a/arch/openrisc/config.mk b/arch/openrisc/config.mk index 13015ebc21..981edff01a 100644 --- a/arch/openrisc/config.mk +++ b/arch/openrisc/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= or32-elf- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := or32-elf- +endif # r10 used for global object pointer, already set in OR32 GCC but just to be # clear diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index f75c3bf187..e398f97982 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= ppc_8xx- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := ppc_8xx- +endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000 LDFLAGS_FINAL += --gc-sections diff --git a/arch/sh/config.mk b/arch/sh/config.mk index eefcbcd124..0578fa3fd8 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= sh4-linux- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := sh4-linux- +endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000 ifeq ($(CPU),sh2) diff --git a/arch/sparc/config.mk b/arch/sparc/config.mk index 9bb37241d2..e2327ecfac 100644 --- a/arch/sparc/config.mk +++ b/arch/sparc/config.mk @@ -5,7 +5,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -CROSS_COMPILE ?= sparc-elf- +ifeq ($(CROSS_COMPILE),) +CROSS_COMPILE := sparc-elf- +endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) \ -T $(srctree)/$(src)/sparc.lds