ARC: Don't set CROSS_COMPILE in arch's Makefile

Message ID
State New
Headers show
  • ARC: Don't set CROSS_COMPILE in arch's Makefile
Related show

Commit Message

Alexey Brodkin Sept. 16, 2018, 8:47 p.m.
There's not much sense in doing that because if user or
his build-system didn't set CROSS_COMPILE we still may
very well make incorrect guess.

But as it turned out setting CROSS_COMPILE is not as harmless
as one may think: with recent changes that implemented automatic
discovery of __host__ gcc features unconditional setup of
CROSS_COMPILE leads to failures on execution of "make xxx_defconfig"
with absent cross-compiler, for more info see [1].

Set CROSS_COMPILE as well gets in the way if we want only to build
.dtb's (again with absent cross-compiler which is not really needed
for building .dtb's), see [2].

Note, we had to change LIBGCC assignment type from ":=" to "="
so that is is resolved on its usage, otherwise if it is resolved
at declaration time with missing CROSS_COMPILE we're getting this
error message from host GCC:
gcc: error: unrecognized command line option ‘-mmedium-calls’
gcc: error: unrecognized command line option ‘-mno-sdata’; did you mean ‘-fno-stats’?


Signed-off-by: Alexey Brodkin <>
Cc: Masahiro Yamada <>
Cc: Rob Herring <>
 arch/arc/Makefile | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)


diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 99cce77ab98f..5f6b67917dc2 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -6,14 +6,6 @@ 
 # published by the Free Software Foundation.
-ifeq ($(CROSS_COMPILE),)
-CROSS_COMPILE := arc-linux-
-CROSS_COMPILE := arceb-linux-
 KBUILD_DEFCONFIG := nsim_700_defconfig
 cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
@@ -79,7 +71,7 @@  cflags-$(disable_small_data)		+= -mno-sdata -fcall-used-gp
 cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= -mbig-endian
 ldflags-$(CONFIG_CPU_BIG_ENDIAN)	+= -EB
-LIBGCC	:= $(shell $(CC) $(cflags-y) --print-libgcc-file-name)
+LIBGCC	= $(shell $(CC) $(cflags-y) --print-libgcc-file-name)
 # Modules with short calls might break for calls into builtin-kernel
 KBUILD_CFLAGS_MODULE	+= -mlong-calls -mno-millicode