Skip to contentSkip to conversation

parisc: dont unconditionally override CROSS_COMPILE for 64 bit.

PATCH Superseded Paul Gortmaker 6 participants 17 messages Feb 26, 2012 – Feb 28, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parisc: dont unconditionally override CROSS_COMPILE for 64 bit.

Using the 64 bit toolchains from kernel.org[1], one finds that you can't build the a500_defconfig, because the Makefile will stomp whatever value you have in your env. for CROSS_COMPILE.

This shows up since the kernel.org toolchains for parisc-64 do not have the "-gnu" prefix, and so you run into it always saying hppa64-linux-gnu-gcc not found, regardless of the fact you've not got "-gnu" put anywhere into CROSS_COMPILE.

[1] ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.2/

arch/parisc/Makefile +3 -1
index 55cca1d..cefff6d 100644
@@ -31,7 +31,9 @@ ifdef CONFIG_64BIT
 UTS_MACHINE	:= parisc64
 CHECKFLAGS	+= -D__LP64__=1 -m64
 WIDTH		:= 64
-CROSS_COMPILE	:= hppa64-linux-gnu-
+ifndef CROSS_COMPILE
+ CROSS_COMPILE	:= hppa64-linux-gnu-
+endif
 else # 32-bit
 WIDTH		:=
 endif
Signature · 1 line
1.7.9.1
#1 lore raw

arch/parisc/Makefile ifdef CONFIG_64BIT · line 36

Quoted 7 lines · On Sunday 26 February 2012 18:26:53 Paul Gortmaker wrote:
arch/parisc/Makefile +3 -1
 
-CROSS_COMPILE	:= hppa64-linux-gnu-
+ifndef CROSS_COMPILE
+ CROSS_COMPILE	:= hppa64-linux-gnu-
+endif

this should accomplish the same thing in practice:
CROSS_COMPILE ?= hppa64-linux-gnu-
-mike

#2 lore raw
Quoted 11 lines · [Re: [PATCH] parisc: dont unconditionally override CROSS_COMPILE for 64 bit.]…

arch/parisc/Makefile ifdef CONFIG_64BIT · line 36

Quoted 7 lines · On Sunday 26 February 2012 18:26:53 Paul Gortmaker wrote:
arch/parisc/Makefile +3 -1
 
-CROSS_COMPILE	:= hppa64-linux-gnu-
+ifndef CROSS_COMPILE
+ CROSS_COMPILE	:= hppa64-linux-gnu-
+endif

this should accomplish the same thing in practice:
CROSS_COMPILE ?= hppa64-linux-gnu-

Good point, I'll wait for a bit in case I was missing something else obvious, and then resend.

THanks,
P.

Quoted 1 line

-mike

#3 lore raw
In reply to Paul Gortmaker
Quoted 18 lines · Paul Gortmaker

Using the 64 bit toolchains from kernel.org[1], one finds that you can't build the a500_defconfig, because the Makefile will stomp whatever value you have in your env. for CROSS_COMPILE.

This shows up since the kernel.org toolchains for parisc-64 do not have the "-gnu" prefix, and so you run into it always saying hppa64-linux-gnu-gcc not found, regardless of the fact you've not got "-gnu" put anywhere into CROSS_COMPILE.

[1] ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.2/

arch/parisc/Makefile +0 -0
index 55cca1d..cefff6d 100644

arch/parisc/Makefile ifdef CONFIG_64BIT · line 39

Quoted 10 lines
arch/parisc/Makefile +3 -1
@@ -31,7 +31,9 @@ ifdef CONFIG_64BIT
  UTS_MACHINE	:= parisc64
  CHECKFLAGS	+= -D__LP64__=1 -m64
  WIDTH		:= 64
-CROSS_COMPILE	:= hppa64-linux-gnu-
+ifndef CROSS_COMPILE
+ CROSS_COMPILE	:= hppa64-linux-gnu-
+endif
  else # 32-bit
  WIDTH		:=
  endif

This change breaks native builds. So, I assume CROSS_COMPILE must be previously defined.

I couldn't figure out where it is defined. CONFIG_CROSS_COMPILE in my .config was an empty string and CROSS_COMPILE was not defined in my build environment.

The default toolchain prefix on Debian systems contains "gnu-".

Given that users can use CONFIG_CROSS_COMPILE or set CROSS_COMPILE in their build env, maybe setting CROSS_COMPILE in the Makefile is a mistake.

Dave

Signature · 1 line
John David Anglin    [email protected]
#4 lore raw
Quoted 23 lines · John David Anglin
Quoted 22 lines · Paul Gortmaker

Using the 64 bit toolchains from kernel.org[1], one finds that you can't build the a500_defconfig, because the Makefile will stomp whatever value you have in your env. for CROSS_COMPILE.

This shows up since the kernel.org toolchains for parisc-64 do not have the "-gnu" prefix, and so you run into it always saying hppa64-linux-gnu-gcc not found, regardless of the fact you've not got "-gnu" put anywhere into CROSS_COMPILE.

[1] ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.2/

arch/parisc/Makefile +0 -1
index 55cca1d..cefff6d 100644
@@ -31,7 +31,9 @@ ifdef CONFIG_64BIT
  UTS_MACHINE	:= parisc64
  CHECKFLAGS	+= -D__LP64__=1 -m64
  WIDTH		:= 64
-CROSS_COMPILE	:= hppa64-linux-gnu-
Quoted 8 lines

arch/parisc/Makefile ifdef CONFIG_64BIT · line 39

Quoted 6 lines
arch/parisc/Makefile +3 -0
+ifndef CROSS_COMPILE
+ CROSS_COMPILE	:= hppa64-linux-gnu-
+endif
  else # 32-bit
  WIDTH		:=
  endif

This change breaks native builds. So, I assume CROSS_COMPILE must be previously defined.

You lost me here. As in a native 32bit env. doing a build for the 64 bit case is setting CROSS_COMPILE?

Quoted 10 lines

I couldn't figure out where it is defined. CONFIG_CROSS_COMPILE in my .config was an empty string and CROSS_COMPILE was not defined in my build environment.

The default toolchain prefix on Debian systems contains "gnu-".

Given that users can use CONFIG_CROSS_COMPILE or set CROSS_COMPILE in their build env, maybe setting CROSS_COMPILE in the Makefile is a mistake.

Yeah, I'd support a complete nuke-and-pave of the whole Makefile chunk as well. It does seem redundant and causes more issues than it solves.

Paul.

Quoted 3 lines

Dave

#5 lore raw
Quoted 30 lines · Paul Gortmaker
Quoted 29 lines · John David Anglin
Quoted 29 lines · Paul Gortmaker
Quoted 28 lines
Quoted 28 lines

Using the 64 bit toolchains from kernel.org[1], one finds that you can't build the a500_defconfig, because the Makefile will stomp whatever value you have in your env. for CROSS_COMPILE.

This shows up since the kernel.org toolchains for parisc-64 do not have the "-gnu" prefix, and so you run into it always saying hppa64-linux-gnu-gcc not found, regardless of the fact you've not got "-gnu" put anywhere into CROSS_COMPILE.

[1]ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.2/

diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 55cca1d..cefff6d 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -31,7 +31,9 @@ ifdef CONFIG_64BIT

    UTS_MACHINE	:= parisc64
    CHECKFLAGS	+= -D__LP64__=1 -m64
    WIDTH		:= 64
 -CROSS_COMPILE	:= hppa64-linux-gnu-
 +ifndef CROSS_COMPILE
 + CROSS_COMPILE	:= hppa64-linux-gnu-
 +endif
    else # 32-bit
    WIDTH		:=
    endif
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

This change breaks native builds. So, I assume CROSS_COMPILE must be previously defined.

You lost me here. As in a native 32bit env. doing a build for the 64 bit case is setting CROSS_COMPILE?

Yes, native hppa is 32 bit . Building a 64-bit kernel with CONFIG_64BIT causes the setting of CROSS_COMPILE and the selection of hppa64-linux-gnu-gcc, etc. If CROSS_COMPILE wasn't previously defined, your change wouldn't have have affected the 64-bit build.

Dave

Signature · 1 line
John David Anglin    [email protected]
#6 lore raw

PATCH v2 1/1 parisc: dont unconditionally override CROSS_COMPILE for 64 bit.

In reply to Paul Gortmaker

Using the 64 bit toolchains from kernel.org[1], one finds that you can't build the a500_defconfig, because the Makefile will stomp whatever value you have in your env. for CROSS_COMPILE.

This shows up since the kernel.org toolchains for parisc-64 do not have the "-gnu" prefix, and so you run into it always saying hppa64-linux-gnu-gcc not found, regardless of the fact you've not got "-gnu" put anywhere into CROSS_COMPILE.

Since you can set CROSS_COMPILE from the environment and/or set it in your .config file, there really is no need for it to be poked at by the Makefile at all. So just delete it.

[1] ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.2/

---

[v2: no ifdef/endif -- just delete the offending line.]

arch/parisc/Makefile +0 -1
index 55cca1d..a533367 100644
@@ -31,7 +31,6 @@ ifdef CONFIG_64BIT
 UTS_MACHINE	:= parisc64
 CHECKFLAGS	+= -D__LP64__=1 -m64
 WIDTH		:= 64
-CROSS_COMPILE	:= hppa64-linux-gnu-
 else # 32-bit
 WIDTH		:=
 endif
Signature · 1 line
1.7.9.1
#7 lore raw
Quoted 25 lines · Paul Gortmaker

Using the 64 bit toolchains from kernel.org[1], one finds that you can't build the a500_defconfig, because the Makefile will stomp whatever value you have in your env. for CROSS_COMPILE.

This shows up since the kernel.org toolchains for parisc-64 do not have the "-gnu" prefix, and so you run into it always saying hppa64-linux-gnu-gcc not found, regardless of the fact you've not got "-gnu" put anywhere into CROSS_COMPILE.

Since you can set CROSS_COMPILE from the environment and/or set it in your .config file, there really is no need for it to be poked at by the Makefile at all. So just delete it.

[1] ftp://ftp.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.5.2/

---

[v2: no ifdef/endif -- just delete the offending line.]

arch/parisc/Makefile +0 -0
index 55cca1d..a533367 100644

arch/parisc/Makefile ifdef CONFIG_64BIT · line 36

Quoted 7 lines
arch/parisc/Makefile +0 -1
@@ -31,7 +31,6 @@ ifdef CONFIG_64BIT
 UTS_MACHINE	:= parisc64
 CHECKFLAGS	+= -D__LP64__=1 -m64
 WIDTH		:= 64
-CROSS_COMPILE	:= hppa64-linux-gnu-
 else # 32-bit
 WIDTH		:=
 endif

We can't do that ... it crashes a standard build almost immediately because it doesn't pick the 64 bit compiler (and we have no biarch solution).

We need make on a 64 bit config to work out of the box. It breaks with ?= as JDA pointed out because CROSS_COMPILE is always defined. Does this satisfy everyone?

James

---

arch/parisc/Makefile +4 -0
index 55cca1d..19ab7b2 100644
@@ -31,7 +31,11 @@ ifdef CONFIG_64BIT
 UTS_MACHINE	:= parisc64
 CHECKFLAGS	+= -D__LP64__=1 -m64
 WIDTH		:= 64
+
+# FIXME: if no default set, should really try to locate dynamically
+ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE	:= hppa64-linux-gnu-
+endif
 else # 32-bit
 WIDTH		:=
 endif
#8 lore raw

T24gTW9uLCAyMDEyLTAyLTI3IGF0IDIxOjQxICswMDAwLCBKYW1lcyBCb3R0b21sZXkgd3JvdGU6 DQo+IE9uIE1vbiwgMjAxMi0wMi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jIGF0dGVtcHQgdG8gaGVscCBv dXQgZm9sa3Mgd2hvIGFyZSBjcm9zcy1jb21waWxpbmcNCi1pZmVxICgkKE5BVElWRSksMSkNCi1D Uk9TU19DT01QSUxFCTo9IGhwcGEkKFdJRFRIKS1saW51eC0NCi1lbmRpZg0KLQ0KIE9CSkNPUFlf RkxBR1MgPS1PIGJpbmFyeSAtUiAubm90ZSAtUiAuY29tbWVudCAtUw0KIA0KIGNmbGFncy15CTo9 IC1waXBlDQoNCg0KDQo=

#9 lore raw

arch/parisc/Makefile

Quoted 9 lines · On Monday 27 February 2012 17:03:10 James Bottomley wrote:
arch/parisc/Makefile +5 -1
 
-CROSS_COMPILE	:= hppa64-linux-gnu-
+
+# if no default set, try to find the corresponding 64 bit compiler
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE	:= $(shell $(CC) -dumpmachine | sed s/hppa-\\\(.*\\\)/hppa64-\\1-/)
+endif

fails when using "hppa2.0-xxx". perhaps:
CROSS_COMPILE ?= $(shell $(CC) -dumpmachine | sed 's/^hppa[^-]*-/hppa64-/')

don't even need the ifeq check then
-mike

#10 lore raw
Quoted 14 lines · Mike Frysinger

arch/parisc/Makefile

Quoted 9 lines · On Monday 27 February 2012 17:03:10 James Bottomley wrote:
arch/parisc/Makefile +5 -1
 
-CROSS_COMPILE	:= hppa64-linux-gnu-
+
+# if no default set, try to find the corresponding 64 bit compiler
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE	:= $(shell $(CC) -dumpmachine | sed s/hppa-\\\(.*\\\)/hppa64-\\1-/)
+endif

fails when using "hppa2.0-xxx". perhaps:
CROSS_COMPILE ?= $(shell $(CC) -dumpmachine | sed 's/^hppa[^-]*-/hppa64-/')

Quoted 1 line

don't even need the ifeq check then

How is that different from Carlos' suggestion? The reason it doesn't work is the same ... CROSS_COMPILE is defined to be empty.

James

#11 lore raw
Quoted 16 lines · On Monday 27 February 2012 22:17:01 James Bottomley wrote:
Quoted 15 lines · Mike Frysinger
Quoted 9 lines · On Monday 27 February 2012 17:03:10 James Bottomley wrote:
arch/parisc/Makefile +4 -1
 
-CROSS_COMPILE	:= hppa64-linux-gnu-
+
+# if no default set, try to find the corresponding 64 bit compiler
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE	:= $(shell $(CC) -dumpmachine | sed

s/hppa-\\\(.*\\\)/hppa64-\\1-/) +endif

fails when using "hppa2.0-xxx". perhaps:
CROSS_COMPILE ?= $(shell $(CC) -dumpmachine | sed
's/^hppa[^-]*-/hppa64-/')

Quoted 3 lines
Quoted 1 line

don't even need the ifeq check then

How is that different from Carlos' suggestion?

sorry, but i'm not seeing any e-mails from Carlos in this thread. what is his suggestion ?

Quoted 2 lines

The reason it doesn't work is the same ... CROSS_COMPILE is defined to be empty.

my suggestion was purely an incremental improvement on the patch you posted. it improves two things:
- detection when the default tuple is hppa2.0-xxx rather than hppa-xxx
- one line for set-variable-only-when-its-unset rather than three lines
-mike

maintainer
#12 lore raw
Quoted 6 lines · Mike Frysinger
Quoted 5 lines · On Monday 27 February 2012 22:17:01 James Bottomley wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Monday 27 February 2012 17:03:10 James Bottomley wrote:
arch/parisc/Makefile +0 -0
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
arch/parisc/Makefile +4 -1
-CROSS_COMPILE	:= hppa64-linux-gnu-
+
+# if no default set, try to find the corresponding 64 bit compiler
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE	:= $(shell $(CC) -dumpmachine | sed

s/hppa-\\\(.*\\\)/hppa64-\\1-/) +endif

fails when using "hppa2.0-xxx". perhaps:

Is that a valid prefix? I was thinking hppa32 might be, but hppa2.0 is supposed to be hppa-xxx with -mpa-risc-2-0.

But anyway, I think being clever and removing unused stuff is likely orthogonal to the first patch which is just making it all work.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

CROSS_COMPILE ?= $(shell $(CC) -dumpmachine | sed
's/^hppa[^-]*-/hppa64-/')

don't even need the ifeq check then

How is that different from Carlos' suggestion?

sorry, but i'm not seeing any e-mails from Carlos in this thread. what is his suggestion ?

Actually, I misspoke, it was your suggestion in the first thread.

Quoted 8 lines
Quoted 2 lines

The reason it doesn't work is the same ... CROSS_COMPILE is defined to be empty.

my suggestion was purely an incremental improvement on the patch you posted. it improves two things:
- detection when the default tuple is hppa2.0-xxx rather than hppa-xxx
- one line for set-variable-only-when-its-unset rather than three lines
-mike

It can't be done ... defined but empty is different from not defined in makefiles (ifdef or ?= only checks for not defined). CROSS_COMPILE gets automatically defined by the top level Makefile ... that's why we need a check for empty not a check for not defined.

James

#13 lore raw
Quoted 16 lines · On Tuesday 28 February 2012 09:10:45 James Bottomley wrote:
Quoted 6 lines · Mike Frysinger
Quoted 5 lines · On Monday 27 February 2012 22:17:01 James Bottomley wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Monday 27 February 2012 17:03:10 James Bottomley wrote:
arch/parisc/Makefile +0 -0
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
arch/parisc/Makefile +4 -1
-CROSS_COMPILE	:= hppa64-linux-gnu-
+
+# if no default set, try to find the corresponding 64 bit compiler
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE	:= $(shell $(CC) -dumpmachine | sed

s/hppa-\\\(.*\\\)/hppa64-\\1-/) +endif

fails when using "hppa2.0-xxx". perhaps:

Quoted 2 lines

Is that a valid prefix? I was thinking hppa32 might be, but hppa2.0 is supposed to be hppa-xxx with -mpa-risc-2-0.

we've been using hppa2.0 for years. gnuconfig certainly recognizes it:

$ grep hppa /usr/share/gnuconfig/config.sub 
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \

and i've seen diff projects key off of the hppa2.0* to enable newer features by default.

Quoted 2 lines

But anyway, I think being clever and removing unused stuff is likely orthogonal to the first patch which is just making it all work.

sure, but your new patch added the sed :)

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

The reason it doesn't work is the same ... CROSS_COMPILE is defined to be empty.

my suggestion was purely an incremental improvement on the patch you posted.

Quoted 8 lines
Quoted 3 lines

it improves two things:
- detection when the default tuple is hppa2.0-xxx rather than hppa-xxx
- one line for set-variable-only-when-its-unset rather than three lines

It can't be done ... defined but empty is different from not defined in makefiles (ifdef or ?= only checks for not defined). CROSS_COMPILE gets automatically defined by the top level Makefile ... that's why we need a check for empty not a check for not defined.

yeah, OK ... this behavior changed from what i was remembering. ?= used to work until the top level Makefile was improved.
-mike

#14 lore raw
Quoted 7 lines · Mike Frysinger

we've been using hppa2.0 for years. gnuconfig certainly recognizes it:

$ grep hppa /usr/share/gnuconfig/config.sub
         | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
         | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \

and i've seen diff projects key off of the hppa2.0* to enable newer features by default.

Some of the above are specific to HP-UX, but hppa1.1, hppa2.0, hppa and hppa64 are valid for Linux based on config.guess.

Dave

Signature · 1 line
John David Anglin    [email protected]

A message that is not in the archive (sent off-list or not yet received): CANEJEGv2Zgtd8TGOzSNO8opMLQT8RsGRP=m2rBPUBBOJ9f+fKQ@mail.gmail.com

#16 lore raw
Quoted 19 lines · On Tuesday 28 February 2012 13:22:50 Grant Grundler wrote:
Quoted 10 lines · John David Anglin
Quoted 9 lines · Mike Frysinger

we've been using hppa2.0 for years. gnuconfig certainly recognizes it:

$ grep hppa /usr/share/gnuconfig/config.**sub
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] |

hppa64 \

        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
Quoted 7 lines
Quoted 3 lines

and i've seen diff projects key off of the hppa2.0* to enable newer features by
default.

Some of the above are specific to HP-UX, but hppa1.1, hppa2.0, hppa and hppa64 are
valid for Linux based on config.guess.

Quoted 6 lines

Mike, et al,
I'd suggest NOT using hppa2.0 as a surrogate for 64-bit build. I'd prefer hppa64 if 64-bit is meant.

hppa2.0 can also mean PA2.0 compliant binary compiled using ILP32 model. right?

i don't think that's what the proposed change does. James' patch runs $(CC) to find the active tuple, then replaces the first part with "hppa64" to get a 64bit toolchain automatically. but that magic only works when the tuple is "hppa-xxx" and so will fail when the system is using "hppa2.0-xxx".

short story: the proposed change will additionally support turning "hppa2.0- linux-gnu" into "hppa64-linux-gnu" rather than the existing "only turns hppa- linux-gnu" into "hppa64-linux-gnu".
-mike

#17 lore raw
Quoted 27 lines · Mike Frysinger
Quoted 19 lines · On Tuesday 28 February 2012 13:22:50 Grant Grundler wrote:
Quoted 10 lines · John David Anglin
Quoted 9 lines · Mike Frysinger

we've been using hppa2.0 for years. gnuconfig certainly recognizes it:

$ grep hppa /usr/share/gnuconfig/config.**sub
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] |

hppa64 \

        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
Quoted 7 lines
Quoted 3 lines

and i've seen diff projects key off of the hppa2.0* to enable newer features by
default.

Some of the above are specific to HP-UX, but hppa1.1, hppa2.0, hppa and hppa64 are
valid for Linux based on config.guess.

Quoted 6 lines

Mike, et al,
I'd suggest NOT using hppa2.0 as a surrogate for 64-bit build. I'd prefer hppa64 if 64-bit is meant.

hppa2.0 can also mean PA2.0 compliant binary compiled using ILP32 model. right?

Quoted 8 lines

i don't think that's what the proposed change does. James' patch runs $(CC) to find the active tuple, then replaces the first part with "hppa64" to get a 64bit toolchain automatically. but that magic only works when the tuple is "hppa-xxx" and so will fail when the system is using "hppa2.0-xxx".

short story: the proposed change will additionally support turning "hppa2.0- linux-gnu" into "hppa64-linux-gnu" rather than the existing "only turns hppa- linux-gnu" into "hppa64-linux-gnu".

There is a small helper:

cc-cross-prefix

Which may be used ifyou have two or mroe candidated for CROSS_COMPILE.

Quoted 1 line

From mips:

CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-)

Dunno if this would help parisc in this case..

Sam