]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
cross builds: ts-kernel-build: Support cross target armhf
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 26 Apr 2019 14:00:27 +0000 (15:00 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 1 May 2019 10:34:23 +0000 (11:34 +0100)
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
---
v2: Drop HOSTCC= setting

ts-kernel-build

index 72ca98a113d4b9cf1da421f6bd3988d8499a5d2f..71eda48dfb508ac61f90bf426fd98ede7b23c201 100755 (executable)
@@ -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 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();