File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 4242 - os : ubuntu-latest
4343 env :
4444 TARGET_TRIPLE : aarch64-unknown-linux-gnu
45+ # s390x requires QEMU 6.1 or greater, we could build it from source, but ubuntu 22.04 comes with 6.2 by default
46+ - os : ubuntu-latest
47+ env :
48+ TARGET_TRIPLE : s390x-unknown-linux-gnu
4549
4650 steps :
4751 - uses : actions/checkout@v3
7983 sudo apt-get update
8084 sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
8185
86+ - name : Install s390x toolchain and qemu
87+ if : matrix.env.TARGET_TRIPLE == 's390x-unknown-linux-gnu'
88+ run : |
89+ sudo apt-get update
90+ sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
91+
8292 - name : Prepare dependencies
8393 run : |
8494 git config --global user.email "user@example.com"
Original file line number Diff line number Diff line change @@ -119,10 +119,10 @@ pub(crate) fn build_sysroot(
119119
120120 if host_triple != target_triple {
121121 // When cross-compiling it is often necessary to manually pick the right linker
122- let linker = if target_triple == "aarch64-unknown-linux-gnu" {
123- Some ( "aarch64-linux-gnu-gcc" )
124- } else {
125- None
122+ let linker = match target_triple {
123+ "aarch64-unknown-linux-gnu" => Some ( "aarch64-linux-gnu-gcc" ) ,
124+ "s390x-unknown-linux-gnu" => Some ( "s390x-linux-gnu-gcc" ) ,
125+ _ => None ,
126126 } ;
127127 build_clif_sysroot_for_triple (
128128 dirs,
Original file line number Diff line number Diff line change @@ -526,6 +526,15 @@ impl TestRunner {
526526 "/usr/aarch64-linux-gnu" . to_owned( ) ,
527527 ] ;
528528 }
529+ "s390x-unknown-linux-gnu" => {
530+ // We are cross-compiling for s390x. Use the correct linker and run tests in qemu.
531+ rustflags = format ! ( "-Clinker=s390x-linux-gnu-gcc{}" , rustflags) ;
532+ runner = vec ! [
533+ "qemu-s390x" . to_owned( ) ,
534+ "-L" . to_owned( ) ,
535+ "/usr/s390x-linux-gnu" . to_owned( ) ,
536+ ] ;
537+ }
529538 "x86_64-pc-windows-gnu" => {
530539 // We are cross-compiling for Windows. Run tests in wine.
531540 runner = vec ! [ "wine" . to_owned( ) ] ;
You can’t perform that action at this time.
0 commit comments