diff options
author | Helge Deller <deller@gmx.de> | 2013-05-11 15:04:09 -0400 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2013-05-13 16:11:57 -0400 |
commit | 6880b0150a7c25fd75c5ece80abc49ebf53c38c1 (patch) | |
tree | 512bb920b95327efedfbec2453627e152f40c439 /arch/parisc | |
parent | f0a18819e261afc5fdbd8c5c6f9943123c5461ba (diff) |
parisc: make default cross compiler search more robust (v3)
People/distros vary how they prefix the toolchain name for 64bit builds.
Rather than enforce one convention over another, add a for loop which
does a search for all the general prefixes.
For 64bit builds, we now search for (in order):
hppa64-unknown-linux-gnu
hppa64-linux-gnu
hppa64-linux
For 32bit builds, we look for:
hppa-unknown-linux-gnu
hppa-linux-gnu
hppa-linux
hppa2.0-unknown-linux-gnu
hppa2.0-linux-gnu
hppa2.0-linux
hppa1.1-unknown-linux-gnu
hppa1.1-linux-gnu
hppa1.1-linux
This patch was initiated by Mike Frysinger, with feedback from Jeroen
Roovers, John David Anglin and Helge Deller.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/Makefile | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 2f967cc6649e..197690068f88 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile | |||
@@ -23,24 +23,21 @@ NM = sh $(srctree)/arch/parisc/nm | |||
23 | CHECKFLAGS += -D__hppa__=1 | 23 | CHECKFLAGS += -D__hppa__=1 |
24 | LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 24 | LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
25 | 25 | ||
26 | MACHINE := $(shell uname -m) | ||
27 | NATIVE := $(if $(filter parisc%,$(MACHINE)),1,0) | ||
28 | |||
29 | ifdef CONFIG_64BIT | 26 | ifdef CONFIG_64BIT |
30 | UTS_MACHINE := parisc64 | 27 | UTS_MACHINE := parisc64 |
31 | CHECKFLAGS += -D__LP64__=1 -m64 | 28 | CHECKFLAGS += -D__LP64__=1 -m64 |
32 | WIDTH := 64 | 29 | CC_ARCHES = hppa64 |
33 | else # 32-bit | 30 | else # 32-bit |
34 | WIDTH := | 31 | CC_ARCHES = hppa hppa2.0 hppa1.1 |
35 | endif | 32 | endif |
36 | 33 | ||
37 | # attempt to help out folks who are cross-compiling | 34 | ifneq ($(SUBARCH),$(UTS_MACHINE)) |
38 | ifeq ($(NATIVE),1) | 35 | ifeq ($(CROSS_COMPILE),) |
39 | CROSS_COMPILE := hppa$(WIDTH)-linux- | 36 | CC_SUFFIXES = linux linux-gnu unknown-linux-gnu |
40 | else | 37 | CROSS_COMPILE := $(call cc-cross-prefix, \ |
41 | ifeq ($(CROSS_COMPILE),) | 38 | $(foreach a,$(CC_ARCHES), \ |
42 | CROSS_COMPILE := hppa$(WIDTH)-linux-gnu- | 39 | $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-))) |
43 | endif | 40 | endif |
44 | endif | 41 | endif |
45 | 42 | ||
46 | OBJCOPY_FLAGS =-O binary -R .note -R .comment -S | 43 | OBJCOPY_FLAGS =-O binary -R .note -R .comment -S |