diff mbox series

Makefile: Search for distro-provided cross-compiler

Message ID 20200114180730.21802-1-bauerman@linux.ibm.com
State Superseded
Headers show
Series Makefile: Search for distro-provided cross-compiler | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (d75e82dbfbb9443efeb3f9a5921ac23605aab469)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Thiago Jung Bauermann Jan. 14, 2020, 6:07 p.m. UTC
Search for powerpc64-linux-gcc in PATH and if not found, also search for
powerpc64-linux-gnu-gcc. The latter can be installed from official distro
packages by at least Debian, Fedora and Ubuntu.

Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andrew Donnellan Jan. 22, 2020, 2:37 a.m. UTC | #1
On 15/1/20 5:07 am, Thiago Jung Bauermann wrote:
> Search for powerpc64-linux-gcc in PATH and if not found, also search for
> powerpc64-linux-gnu-gcc. The latter can be installed from official distro
> packages by at least Debian, Fedora and Ubuntu.
> 
> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
Tested-by: Andrew Donnellan <ajd@linux.ibm.com>
Thiago Jung Bauermann Jan. 22, 2020, 11:45 p.m. UTC | #2
Andrew Donnellan <ajd@linux.ibm.com> writes:

> On 15/1/20 5:07 am, Thiago Jung Bauermann wrote:
>> Search for powerpc64-linux-gcc in PATH and if not found, also search for
>> powerpc64-linux-gnu-gcc. The latter can be installed from official distro
>> packages by at least Debian, Fedora and Ubuntu.
>>
>> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
> Tested-by: Andrew Donnellan <ajd@linux.ibm.com>

Thanks!
Nicholas Piggin Jan. 24, 2020, 3:16 a.m. UTC | #3
Thiago Jung Bauermann's on January 15, 2020 4:07 am:
> Search for powerpc64-linux-gcc in PATH and if not found, also search for
> powerpc64-linux-gnu-gcc. The latter can be installed from official distro
> packages by at least Debian, Fedora and Ubuntu.
> 
> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> ---
>  Makefile | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index f938a062..3b1f36a0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -16,8 +16,13 @@ ifdef CROSS_COMPILE
>  endif
>  ifneq ("$(ARCH)", "ppc64")
>  ifneq ("$(ARCH)", "ppc64le")
> +ifneq ($(shell which powerpc64-linux-gcc 2> /dev/null),)
>  	CROSS ?= powerpc64-linux-
>  endif
> +ifneq ($(shell which powerpc64-linux-gnu-gcc 2> /dev/null),)
> +	CROSS ?= powerpc64-linux-gnu-
> +endif
> +endif
>  endif

What's the chances you could also test powerpc64le-linux- ?

LE compilers can nowadays build BE skiboot (and Linux), so I tend not
to install the BE cross compiler.

Thanks,
Nick
Thiago Jung Bauermann Jan. 24, 2020, 11:06 p.m. UTC | #4
Hello Nick,

Nicholas Piggin <npiggin@gmail.com> writes:

> Thiago Jung Bauermann's on January 15, 2020 4:07 am:
>> Search for powerpc64-linux-gcc in PATH and if not found, also search for
>> powerpc64-linux-gnu-gcc. The latter can be installed from official distro
>> packages by at least Debian, Fedora and Ubuntu.
>> 
>> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
>> ---
>>  Makefile | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/Makefile b/Makefile
>> index f938a062..3b1f36a0 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -16,8 +16,13 @@ ifdef CROSS_COMPILE
>>  endif
>>  ifneq ("$(ARCH)", "ppc64")
>>  ifneq ("$(ARCH)", "ppc64le")
>> +ifneq ($(shell which powerpc64-linux-gcc 2> /dev/null),)
>>  	CROSS ?= powerpc64-linux-
>>  endif
>> +ifneq ($(shell which powerpc64-linux-gnu-gcc 2> /dev/null),)
>> +	CROSS ?= powerpc64-linux-gnu-
>> +endif
>> +endif
>>  endif
>
> What's the chances you could also test powerpc64le-linux- ?

It's 100%

> LE compilers can nowadays build BE skiboot (and Linux), so I tend not
> to install the BE cross compiler.

Good point. I just sent a v2 with that change.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index f938a062..3b1f36a0 100644
--- a/Makefile
+++ b/Makefile
@@ -16,8 +16,13 @@  ifdef CROSS_COMPILE
 endif
 ifneq ("$(ARCH)", "ppc64")
 ifneq ("$(ARCH)", "ppc64le")
+ifneq ($(shell which powerpc64-linux-gcc 2> /dev/null),)
 	CROSS ?= powerpc64-linux-
 endif
+ifneq ($(shell which powerpc64-linux-gnu-gcc 2> /dev/null),)
+	CROSS ?= powerpc64-linux-gnu-
+endif
+endif
 endif
 
 #