File tree Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -250,8 +250,11 @@ fn main() {
250250 let llvm_use_libcxx = env:: var_os ( "LLVM_USE_LIBCXX" ) ;
251251
252252 let stdcppname = if target. contains ( "openbsd" ) {
253- // llvm-config on OpenBSD doesn't mention stdlib=libc++
254- "c++"
253+ if target. contains ( "sparc64" ) {
254+ "estdc++"
255+ } else {
256+ "c++"
257+ }
255258 } else if target. contains ( "freebsd" ) {
256259 "c++"
257260 } else if target. contains ( "darwin" ) {
Original file line number Diff line number Diff line change @@ -395,6 +395,7 @@ supported_targets! {
395395
396396 ( "aarch64-unknown-openbsd" , aarch64_unknown_openbsd) ,
397397 ( "i686-unknown-openbsd" , i686_unknown_openbsd) ,
398+ ( "sparc64-unknown-openbsd" , sparc64_unknown_openbsd) ,
398399 ( "x86_64-unknown-openbsd" , x86_64_unknown_openbsd) ,
399400
400401 ( "aarch64-unknown-netbsd" , aarch64_unknown_netbsd) ,
Original file line number Diff line number Diff line change 1+ use crate :: spec:: { LinkerFlavor , Target , TargetResult } ;
2+
3+ pub fn target ( ) -> TargetResult {
4+ let mut base = super :: openbsd_base:: opts ( ) ;
5+ base. cpu = "v9" . to_string ( ) ;
6+ base. pre_link_args . get_mut ( & LinkerFlavor :: Gcc ) . unwrap ( ) . push ( "-m64" . to_string ( ) ) ;
7+ base. max_atomic_width = Some ( 64 ) ;
8+
9+ Ok ( Target {
10+ llvm_target : "sparc64-unknown-openbsd" . to_string ( ) ,
11+ target_endian : "big" . to_string ( ) ,
12+ target_pointer_width : "64" . to_string ( ) ,
13+ target_c_int_width : "32" . to_string ( ) ,
14+ data_layout : "E-m:e-i64:64-n32:64-S128" . to_string ( ) ,
15+ arch : "sparc64" . to_string ( ) ,
16+ target_os : "openbsd" . to_string ( ) ,
17+ target_env : String :: new ( ) ,
18+ target_vendor : "unknown" . to_string ( ) ,
19+ linker_flavor : LinkerFlavor :: Gcc ,
20+ options : base,
21+ } )
22+ }
Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ fn main() {
2323 } else if target. contains ( "netbsd" ) {
2424 println ! ( "cargo:rustc-link-lib=gcc_s" ) ;
2525 } else if target. contains ( "openbsd" ) {
26- println ! ( "cargo:rustc-link-lib=c++abi" ) ;
26+ if target. contains ( "sparc64" ) {
27+ println ! ( "cargo:rustc-link-lib=gcc" ) ;
28+ } else {
29+ println ! ( "cargo:rustc-link-lib=c++abi" ) ;
30+ }
2731 } else if target. contains ( "solaris" ) {
2832 println ! ( "cargo:rustc-link-lib=gcc_s" ) ;
2933 } else if target. contains ( "dragonfly" ) {
You can’t perform that action at this time.
0 commit comments