Skip to content

Commit 17f690b

Browse files
committed
[MIPS] Kbuild: Use the new cc-cross-prefix feature.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 9490094 commit 17f690b

2 files changed

Lines changed: 10 additions & 20 deletions

File tree

‎arch/mips/Kconfig.debug‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@ config TRACE_IRQFLAGS_SUPPORT
66

77
source "lib/Kconfig.debug"
88

9-
config CROSSCOMPILE
10-
bool "Are you using a crosscompiler"
11-
help
12-
Say Y here if you are compiling the kernel on a different
13-
architecture than the one it is intended to run on. This is just a
14-
convenience option which will select the appropriate value for
15-
the CROSS_COMPILE make variable which otherwise has to be passed on
16-
the command line from mips-linux-, mipsel-linux-, mips64-linux- and
17-
mips64el-linux- as appropriate for a particular kernel configuration.
18-
You will have to pass the value for CROSS_COMPILE manually if the
19-
name prefix for your tools is different.
20-
219
config CMDLINE
2210
string "Default kernel command string"
2311
default ""

‎arch/mips/Makefile‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,34 @@ cflags-y :=
1818
# Select the object file format to substitute into the linker script.
1919
#
2020
ifdef CONFIG_CPU_LITTLE_ENDIAN
21-
32bit-tool-prefix = mipsel-linux-
22-
64bit-tool-prefix = mips64el-linux-
21+
32bit-tool-archpref = mipsel
22+
64bit-tool-archpref = mips64el
2323
32bit-bfd = elf32-tradlittlemips
2424
64bit-bfd = elf64-tradlittlemips
2525
32bit-emul = elf32ltsmip
2626
64bit-emul = elf64ltsmip
2727
else
28-
32bit-tool-prefix = mips-linux-
29-
64bit-tool-prefix = mips64-linux-
28+
32bit-tool-archpref = mips
29+
64bit-tool-archpref = mips64
3030
32bit-bfd = elf32-tradbigmips
3131
64bit-bfd = elf64-tradbigmips
3232
32bit-emul = elf32btsmip
3333
64bit-emul = elf64btsmip
3434
endif
3535

3636
ifdef CONFIG_32BIT
37-
tool-prefix = $(32bit-tool-prefix)
37+
tool-archpref = $(32bit-tool-archpref)
3838
UTS_MACHINE := mips
3939
endif
4040
ifdef CONFIG_64BIT
41-
tool-prefix = $(64bit-tool-prefix)
41+
tool-archpref = $(64bit-tool-archpref)
4242
UTS_MACHINE := mips64
4343
endif
4444

45-
ifdef CONFIG_CROSSCOMPILE
46-
CROSS_COMPILE := $(tool-prefix)
45+
ifneq ($(SUBARCH),$(ARCH))
46+
ifeq ($(CROSS_COMPILE),)
47+
CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-gnu-linux- $(tool-archpref)-unknown-gnu-linux-)
48+
endif
4749
endif
4850

4951
ifdef CONFIG_32BIT

0 commit comments

Comments
 (0)