File tree Expand file tree Collapse file tree 5 files changed +33
-22
lines changed Expand file tree Collapse file tree 5 files changed +33
-22
lines changed Original file line number Diff line number Diff line change @@ -1095,6 +1095,7 @@ pub mod types {
10951095 pub type sighandler_t = size_t ;
10961096 }
10971097 pub mod bsd44 {
1098+ use types:: common:: c95:: { c_void} ;
10981099 use types:: os:: arch:: c95:: { c_char, c_int, c_uint} ;
10991100
11001101 pub type socklen_t = u32 ;
@@ -1167,6 +1168,17 @@ pub mod types {
11671168 pub sun_family : sa_family_t ,
11681169 pub sun_path : [ c_char , ..104 ]
11691170 }
1171+ #[ repr( C ) ]
1172+ #[ deriving( Copy ) ] pub struct ifaddrs {
1173+ pub ifa_next : * mut ifaddrs ,
1174+ pub ifa_name : * mut c_char ,
1175+ pub ifa_flags : c_uint ,
1176+ pub ifa_addr : * mut sockaddr ,
1177+ pub ifa_netmask : * mut sockaddr ,
1178+ pub ifa_dstaddr : * mut sockaddr ,
1179+ pub ifa_data : * mut c_void
1180+ }
1181+
11701182 }
11711183 }
11721184
Original file line number Diff line number Diff line change @@ -215,22 +215,7 @@ mod test {
215215 }
216216
217217 #[ test]
218- #[ cfg( target_os = "freebsd" ) ]
219- fn test_rpath_relative ( ) {
220- let config = & mut RPathConfig {
221- used_crates : Vec :: new ( ) ,
222- has_rpath : true ,
223- is_like_osx : false ,
224- out_filename : Path :: new ( "bin/rustc" ) ,
225- get_install_prefix_lib_path : || panic ! ( ) ,
226- realpath : |p| Ok ( p. clone ( ) )
227- } ;
228- let res = get_rpath_relative_to_output ( config, & Path :: new ( "lib/libstd.so" ) ) ;
229- assert_eq ! ( res, "$ORIGIN/../lib" ) ;
230- }
231-
232- #[ test]
233- #[ cfg( target_os = "dragonfly" ) ]
218+ #[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
234219 fn test_rpath_relative ( ) {
235220 let config = & mut RPathConfig {
236221 used_crates : Vec :: new ( ) ,
Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ pub fn opts() -> TargetOptions {
2020 has_rpath : true ,
2121 pre_link_args : vec ! (
2222 "-L/usr/local/lib" . to_string( ) ,
23- "-L/usr/local/lib/gcc47" . to_string( ) ,
24- "-L/usr/local/lib/gcc44" . to_string( ) ,
23+ "-L/usr/local/lib/gcc48" . to_string( ) ,
2524 ) ,
2625
2726 .. Default :: default ( )
Original file line number Diff line number Diff line change 1111use target:: Target ;
1212
1313pub fn target ( ) -> Target {
14+ let mut base = super :: dragonfly_base:: opts ( ) ;
15+ base. pre_link_args . push ( "-m64" . to_string ( ) ) ;
16+
1417 Target {
15- data_layout : "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" . to_string ( ) ,
18+ data_layout : "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
19+ f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-\
20+ s0:64:64-f80:128:128-n8:16:32:64-S128". to_string ( ) ,
1621 llvm_target : "x86_64-unknown-dragonfly" . to_string ( ) ,
1722 target_endian : "little" . to_string ( ) ,
18- target_word_size : "32 " . to_string ( ) ,
23+ target_word_size : "64 " . to_string ( ) ,
1924 arch : "x86_64" . to_string ( ) ,
2025 target_os : "dragonfly" . to_string ( ) ,
21- options : super :: dragonfly_base :: opts ( )
26+ options : base ,
2227 }
2328}
Original file line number Diff line number Diff line change @@ -665,7 +665,7 @@ pub fn dll_filename(base: &str) -> String {
665665/// ```
666666pub fn self_exe_name ( ) -> Option < Path > {
667667
668- #[ cfg( any ( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
668+ #[ cfg( target_os = "freebsd" ) ]
669669 fn load_self ( ) -> Option < Vec < u8 > > {
670670 unsafe {
671671 use libc:: funcs:: bsd44:: * ;
@@ -691,6 +691,16 @@ pub fn self_exe_name() -> Option<Path> {
691691 }
692692 }
693693
694+ #[ cfg( target_os = "dragonfly" ) ]
695+ fn load_self ( ) -> Option < Vec < u8 > > {
696+ use std:: io;
697+
698+ match io:: fs:: readlink ( & Path :: new ( "/proc/curproc/file" ) ) {
699+ Ok ( path) => Some ( path. into_vec ( ) ) ,
700+ Err ( ..) => None
701+ }
702+ }
703+
694704 #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
695705 fn load_self ( ) -> Option < Vec < u8 > > {
696706 use std:: io;
You can’t perform that action at this time.
0 commit comments