diff mbox series

[OSSTEST,11/15] cross builds: ts-kernel-build: Support cross target armhf

Message ID 20190426164002.22381-12-ian.jackson@eu.citrix.com (mailing list archive)
State Superseded
Headers show
Series Do armhf kernel builds on amd64 | expand

Commit Message

Ian Jackson April 26, 2019, 4:39 p.m. UTC
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Julien Grall <julien.grall@arm.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
---
 ts-kernel-build | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Comments

Julien Grall April 26, 2019, 9:23 p.m. UTC | #1
Hi Ian,

Thank you for looking into this.

On 4/26/19 5:39 PM, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Julien Grall <julien.grall@arm.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> ---
>   ts-kernel-build | 19 ++++++++++++++++++-
>   1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/ts-kernel-build b/ts-kernel-build
> index 72ca98a1..29c6c43d 100755
> --- a/ts-kernel-build
> +++ b/ts-kernel-build
> @@ -21,6 +21,7 @@ BEGIN { unshift @INC, qw(.); }
>   use Osstest;
>   use Osstest::TestSupport;
>   use Osstest::BuildSupport;
> +use Carp;
>   
>   tsreadconfig();
>   
> @@ -48,9 +49,24 @@ my $parms = $archparms->{ $r{arch} };
>   
>   sub enable_xen_config ();
>   
> +our $arch_envvars = '';
> +
>   sub cmd ($$) {
>       my ($timeout, $script) = @_;
> -    target_cmd_build($ho, $timeout, $builddir, $script);
> +    target_cmd_build($ho, $timeout, $builddir, $arch_envvars.$script);
> +}
> +
> +sub checkarch () {
> +    return if $r{arch} eq $ho->{Arch};
> +    my $cc = 'gcc';
> +    if ($r{arch} eq 'armhf') {
> +	target_install_packages($ho, "crossbuild-essential-$r{arch}");
> +	$arch_envvars = <<END;
> +    export ARCH=arm HOSTCC=$cc CROSS_COMPILE=arm-linux-gnueabihf-

NIT: HOSTCC is not necessary. It will be default to gcc if not passed.

Otherwise, the export looks write to me.

> +END
> +    } else {
> +	confess "unknown cross target (gnu 'host') $r{arch}";
> +    }
>   }
>   
>   sub checkout () {
> @@ -450,6 +466,7 @@ sub fwinstall () {
>   END
>   }
>   
> +checkarch();
>   checkout();
>   config();
>   build();
> 

Cheers,
Julien Grall April 26, 2019, 9:26 p.m. UTC | #2
On 4/26/19 10:23 PM, Julien Grall wrote:
> Hi Ian,
> 
> Thank you for looking into this.
> 
> On 4/26/19 5:39 PM, Ian Jackson wrote:
>> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
>> CC: Julien Grall <julien.grall@arm.com>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> ---
>>   ts-kernel-build | 19 ++++++++++++++++++-
>>   1 file changed, 18 insertions(+), 1 deletion(-)
>>
>> diff --git a/ts-kernel-build b/ts-kernel-build
>> index 72ca98a1..29c6c43d 100755
>> --- a/ts-kernel-build
>> +++ b/ts-kernel-build
>> @@ -21,6 +21,7 @@ BEGIN { unshift @INC, qw(.); }
>>   use Osstest;
>>   use Osstest::TestSupport;
>>   use Osstest::BuildSupport;
>> +use Carp;
>>   tsreadconfig();
>> @@ -48,9 +49,24 @@ my $parms = $archparms->{ $r{arch} };
>>   sub enable_xen_config ();
>> +our $arch_envvars = '';
>> +
>>   sub cmd ($$) {
>>       my ($timeout, $script) = @_;
>> -    target_cmd_build($ho, $timeout, $builddir, $script);
>> +    target_cmd_build($ho, $timeout, $builddir, $arch_envvars.$script);
>> +}
>> +
>> +sub checkarch () {
>> +    return if $r{arch} eq $ho->{Arch};
>> +    my $cc = 'gcc';
>> +    if ($r{arch} eq 'armhf') {
>> +    target_install_packages($ho, "crossbuild-essential-$r{arch}");
>> +    $arch_envvars = <<END;
>> +    export ARCH=arm HOSTCC=$cc CROSS_COMPILE=arm-linux-gnueabihf-
> 
> NIT: HOSTCC is not necessary. It will be default to gcc if not passed.
> 
> Otherwise, the export looks write to me.

I forgot to mention that you can add my ack one in any case:

Acked-by: Julien Grall <julien.grall@arm.com>

Cheers,
Ian Jackson April 29, 2019, 3:09 p.m. UTC | #3
Julien Grall writes ("Re: [OSSTEST PATCH 11/15] cross builds: ts-kernel-build: Support cross target armhf"):
> On 4/26/19 10:23 PM, Julien Grall wrote:
> > NIT: HOSTCC is not necessary. It will be default to gcc if not passed.

I will drop it.

> > Otherwise, the export looks write to me.

Thanks for the review.

> I forgot to mention that you can add my ack one in any case:
> 
> Acked-by: Julien Grall <julien.grall@arm.com>

:-).

Regards,
Ian.
diff mbox series

Patch

diff --git a/ts-kernel-build b/ts-kernel-build
index 72ca98a1..29c6c43d 100755
--- a/ts-kernel-build
+++ b/ts-kernel-build
@@ -21,6 +21,7 @@  BEGIN { unshift @INC, qw(.); }
 use Osstest;
 use Osstest::TestSupport;
 use Osstest::BuildSupport;
+use Carp;
 
 tsreadconfig();
 
@@ -48,9 +49,24 @@  my $parms = $archparms->{ $r{arch} };
 
 sub enable_xen_config ();
 
+our $arch_envvars = '';
+
 sub cmd ($$) {
     my ($timeout, $script) = @_;
-    target_cmd_build($ho, $timeout, $builddir, $script);
+    target_cmd_build($ho, $timeout, $builddir, $arch_envvars.$script);
+}
+
+sub checkarch () {
+    return if $r{arch} eq $ho->{Arch};
+    my $cc = 'gcc';
+    if ($r{arch} eq 'armhf') {
+	target_install_packages($ho, "crossbuild-essential-$r{arch}");
+	$arch_envvars = <<END;
+    export ARCH=arm HOSTCC=$cc CROSS_COMPILE=arm-linux-gnueabihf-
+END
+    } else {
+	confess "unknown cross target (gnu 'host') $r{arch}";
+    }
 }
 
 sub checkout () {
@@ -450,6 +466,7 @@  sub fwinstall () {
 END
 }
 
+checkarch();
 checkout();
 config();
 build();