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 42
42
- os : ubuntu-latest
43
43
env :
44
44
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
45
49
46
50
steps :
47
51
- uses : actions/checkout@v3
79
83
sudo apt-get update
80
84
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
81
85
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
+
82
92
- name : Prepare dependencies
83
93
run : |
84
94
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(
119
119
120
120
if host_triple != target_triple {
121
121
// 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 ,
126
126
} ;
127
127
build_clif_sysroot_for_triple (
128
128
dirs,
Original file line number Diff line number Diff line change @@ -526,6 +526,15 @@ impl TestRunner {
526
526
"/usr/aarch64-linux-gnu" . to_owned( ) ,
527
527
] ;
528
528
}
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
+ }
529
538
"x86_64-pc-windows-gnu" => {
530
539
// We are cross-compiling for Windows. Run tests in wine.
531
540
runner = vec ! [ "wine" . to_owned( ) ] ;
You can’t perform that action at this time.
0 commit comments