This repository was archived by the owner on May 28, 2025. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 5 files changed +37
-0
lines changed 
compiler/rustc_target/src/spec Expand file tree Collapse file tree 5 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -1882,6 +1882,7 @@ supported_targets! {
18821882
18831883    ( "aarch64-unknown-linux-ohos" ,  aarch64_unknown_linux_ohos) , 
18841884    ( "armv7-unknown-linux-ohos" ,  armv7_unknown_linux_ohos) , 
1885+     ( "loongarch64-unknown-linux-ohos" ,  loongarch64_unknown_linux_ohos) , 
18851886    ( "x86_64-unknown-linux-ohos" ,  x86_64_unknown_linux_ohos) , 
18861887
18871888    ( "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
313313` i686-uwp-windows-msvc `  | ✓ |  | [ ^ x86_32-floats-return-ABI ] 
314314[ ` i686-win7-windows-msvc ` ] ( platform-support/win7-windows-msvc.md )  | ✓ |   | 32-bit Windows 7 support [ ^ x86_32-floats-return-ABI ] 
315315[ ` i686-wrs-vxworks ` ] ( platform-support/vxworks.md )  | ✓ |  | [ ^ x86_32-floats-return-ABI ] 
316+ [ ` loongarch64-unknown-linux-ohos ` ] ( platform-support/openharmony.md )  | ✓ |   | LoongArch64 OpenHarmony
316317[ ` m68k-unknown-linux-gnu ` ] ( platform-support/m68k-unknown-linux-gnu.md )  | ? |  | Motorola 680x0 Linux
317318` mips-unknown-linux-gnu `  | ✓ | ✓ | MIPS Linux (kernel 4.4, glibc 2.23)
318319` mips-unknown-linux-musl `  | ✓ |  | MIPS Linux with musl 1.2.3
Original file line number Diff line number Diff line change 22
33** Tier: 2** 
44
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+ 
513Targets for the [ OpenHarmony] ( https://gitee.com/openharmony/docs/ )  operating
614system.
715
Original file line number Diff line number Diff line change 249249//@ revisions: loongarch64_unknown_linux_musl 
250250//@ [loongarch64_unknown_linux_musl] compile-flags: --target loongarch64-unknown-linux-musl 
251251//@ [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 
252255//@ revisions: loongarch64_unknown_none 
253256//@ [loongarch64_unknown_none] compile-flags: --target loongarch64-unknown-none 
254257//@ [loongarch64_unknown_none] needs-llvm-components: loongarch 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments