File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ permissions:
1414
1515env :
1616 MSRV : 1.69.0
17+ # Rust's Loongarch support merged in 1.71.0
18+ MSRV_LOONGARCH : 1.71.0
1719 RUSTFLAGS : -Dwarnings
1820
1921jobs :
9294 mips64el-unknown-linux-gnuabi64,
9395 mipsel-unknown-linux-gnu,
9496 powerpc64le-unknown-linux-gnu,
97+ loongarch64-unknown-linux-gnu,
9598 ]
9699
97100 steps :
@@ -101,7 +104,8 @@ jobs:
101104 - name : setup Rust
102105 uses : dtolnay/rust-toolchain@master
103106 with :
104- toolchain : ' ${{ env.MSRV }}'
107+ # Use a newer version rustc if the target is Loongarch, remove this workaround after MSRV is newer than 1.71.0
108+ toolchain : " ${{ matrix.target == 'loongarch64-unknown-linux-gnu' && env.MSRV_LOONGARCH || env.MSRV }}"
105109 components : clippy
106110
107111 # cross relies on docker or podman, GitHub Acton already has it installed.
Original file line number Diff line number Diff line change @@ -3,3 +3,6 @@ passthrough = [
33 " RUSTFLAGS" ,
44 " RUST_TEST_THREADS"
55]
6+
7+ [target .loongarch64-unknown-linux-gnu ]
8+ image = " ghcr.io/cross-rs/loongarch64-unknown-linux-gnu:edge"
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ The following targets are supported by `nix`:
8585 <li>arm-unknown-linux-musleabi</li>
8686 <li>armv7-linux-androideabi</li>
8787 <li>i686-linux-android</li>
88+ <li>loongarch64-unknown-linux-gnu</li>
8889 <li>s390x-unknown-linux-gnu</li>
8990 <li>x86_64-linux-android</li>
9091 <li>x86_64-unknown-illumos</li>
Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ mod test_prctl {
9999 prctl:: set_timerslack ( original) . unwrap ( ) ;
100100 }
101101
102+ // Loongarch need to use a newer QEMU that disabled these PRCTL subcodes/methods.
103+ // https://github.com/qemu/qemu/commit/220717a6f46a99031a5b1af964bbf4dec1310440
104+ // So we should ignore them when testing in QEMU environments.
105+ #[ cfg_attr( all( qemu, target_arch = "loongarch64" ) , ignore) ]
102106 #[ test]
103107 fn test_disable_enable_perf_events ( ) {
104108 prctl:: task_perf_events_disable ( ) . unwrap ( ) ;
@@ -112,6 +116,10 @@ mod test_prctl {
112116 assert ! ( no_new_privs) ;
113117 }
114118
119+ // Loongarch need to use a newer QEMU that disabled these PRCTL subcodes/methods
120+ // https://github.com/qemu/qemu/commit/220717a6f46a99031a5b1af964bbf4dec1310440
121+ // So we should ignore them when testing in QEMU environments.
122+ #[ cfg_attr( all( qemu, target_arch = "loongarch64" ) , ignore) ]
115123 #[ test]
116124 fn test_get_set_thp_disable ( ) {
117125 let original = prctl:: get_thp_disable ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments