File tree 5 files changed +37
-0
lines changed
compiler/rustc_target/src/spec
5 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -1882,6 +1882,7 @@ supported_targets! {
1882
1882
1883
1883
( "aarch64-unknown-linux-ohos" , aarch64_unknown_linux_ohos) ,
1884
1884
( "armv7-unknown-linux-ohos" , armv7_unknown_linux_ohos) ,
1885
+ ( "loongarch64-unknown-linux-ohos" , loongarch64_unknown_linux_ohos) ,
1885
1886
( "x86_64-unknown-linux-ohos" , x86_64_unknown_linux_ohos) ,
1886
1887
1887
1888
( "x86_64-unknown-linux-none" , x86_64_unknown_linux_none) ,
Original file line number Diff line number Diff line change
1
+ use crate :: spec:: { Target , TargetOptions , base} ;
2
+
3
+ pub ( crate ) fn target ( ) -> Target {
4
+ Target {
5
+ // LLVM 15 doesn't support OpenHarmony yet, use a linux target instead.
6
+ llvm_target : "loongarch64-unknown-linux-musl" . into ( ) ,
7
+ metadata : crate :: spec:: TargetMetadata {
8
+ description : Some ( "LoongArch64 OpenHarmony" . into ( ) ) ,
9
+ tier : Some ( 3 ) ,
10
+ host_tools : Some ( false ) ,
11
+ std : Some ( true ) ,
12
+ } ,
13
+ pointer_width : 64 ,
14
+ data_layout : "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128" . into ( ) ,
15
+ arch : "loongarch64" . into ( ) ,
16
+ options : TargetOptions {
17
+ cpu : "generic" . into ( ) ,
18
+ features : "+f,+d" . into ( ) ,
19
+ llvm_abiname : "lp64d" . into ( ) ,
20
+ max_atomic_width : Some ( 64 ) ,
21
+ ..base:: linux_ohos:: opts ( )
22
+ } ,
23
+ }
24
+ }
Original file line number Diff line number Diff line change @@ -313,6 +313,7 @@ target | std | host | notes
313
313
` i686-uwp-windows-msvc ` | ✓ | | [ ^ x86_32-floats-return-ABI ]
314
314
[ ` i686-win7-windows-msvc ` ] ( platform-support/win7-windows-msvc.md ) | ✓ | | 32-bit Windows 7 support [ ^ x86_32-floats-return-ABI ]
315
315
[ ` i686-wrs-vxworks ` ] ( platform-support/vxworks.md ) | ✓ | | [ ^ x86_32-floats-return-ABI ]
316
+ [ ` loongarch64-unknown-linux-ohos ` ] ( platform-support/openharmony.md ) | ✓ | | LoongArch64 OpenHarmony
316
317
[ ` m68k-unknown-linux-gnu ` ] ( platform-support/m68k-unknown-linux-gnu.md ) | ? | | Motorola 680x0 Linux
317
318
` mips-unknown-linux-gnu ` | ✓ | ✓ | MIPS Linux (kernel 4.4, glibc 2.23)
318
319
` mips-unknown-linux-musl ` | ✓ | | MIPS Linux with musl 1.2.3
Original file line number Diff line number Diff line change 2
2
3
3
** Tier: 2**
4
4
5
+ * aarch64-unknown-linux-ohos
6
+ * armv7-unknown-linux-ohos
7
+ * x86_64-unknown-linux-ohos
8
+
9
+ ** Tier: 3**
10
+
11
+ * loongarch64-unknown-linux-ohos
12
+
5
13
Targets for the [ OpenHarmony] ( https://gitee.com/openharmony/docs/ ) operating
6
14
system.
7
15
Original file line number Diff line number Diff line change 249
249
//@ revisions: loongarch64_unknown_linux_musl
250
250
//@ [loongarch64_unknown_linux_musl] compile-flags: --target loongarch64-unknown-linux-musl
251
251
//@ [loongarch64_unknown_linux_musl] needs-llvm-components: loongarch
252
+ //@ revisions: loongarch64_unknown_linux_ohos
253
+ //@ [loongarch64_unknown_linux_ohos] compile-flags: --target loongarch64-unknown-linux-ohos
254
+ //@ [loongarch64_unknown_linux_ohos] needs-llvm-components: loongarch
252
255
//@ revisions: loongarch64_unknown_none
253
256
//@ [loongarch64_unknown_none] compile-flags: --target loongarch64-unknown-none
254
257
//@ [loongarch64_unknown_none] needs-llvm-components: loongarch
You can’t perform that action at this time.
0 commit comments