File tree 5 files changed +11
-15
lines changed
library/std/src/sys/vxworks
5 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ impl FileDesc {
53
53
}
54
54
55
55
#[ inline]
56
- fn is_read_vectored ( & self ) -> bool {
56
+ pub fn is_read_vectored ( & self ) -> bool {
57
57
true
58
58
}
59
59
Original file line number Diff line number Diff line change @@ -351,28 +351,19 @@ impl ExitStatus {
351
351
}
352
352
353
353
fn exited ( & self ) -> bool {
354
- /*unsafe*/
355
- { libc:: WIFEXITED ( self . 0 ) }
354
+ libc:: WIFEXITED ( self . 0 )
356
355
}
357
356
358
357
pub fn success ( & self ) -> bool {
359
358
self . code ( ) == Some ( 0 )
360
359
}
361
360
362
361
pub fn code ( & self ) -> Option < i32 > {
363
- if self . exited ( ) {
364
- Some ( /*unsafe*/ { libc:: WEXITSTATUS ( self . 0 ) } )
365
- } else {
366
- None
367
- }
362
+ if self . exited ( ) { Some ( libc:: WEXITSTATUS ( self . 0 ) ) } else { None }
368
363
}
369
364
370
365
pub fn signal ( & self ) -> Option < i32 > {
371
- if !self . exited ( ) {
372
- Some ( /*unsafe*/ { libc:: WTERMSIG ( self . 0 ) } )
373
- } else {
374
- None
375
- }
366
+ if !self . exited ( ) { Some ( libc:: WTERMSIG ( self . 0 ) ) } else { None }
376
367
}
377
368
}
378
369
Original file line number Diff line number Diff line change 2
2
#![ unstable( feature = "thread_local_internals" , issue = "none" ) ]
3
3
4
4
pub unsafe fn register_dtor ( t : * mut u8 , dtor : unsafe extern "C" fn ( * mut u8 ) ) {
5
- use crate :: sys_common:: thread_local :: register_dtor_fallback;
5
+ use crate :: sys_common:: thread_local_dtor :: register_dtor_fallback;
6
6
register_dtor_fallback ( t, dtor) ;
7
7
}
Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ pub fn find(build: &mut Build) {
132
132
false
133
133
} ;
134
134
135
- if cxx_configured {
135
+ // for VxWorks, record CXX compiler which will be used in lib.rs:linker()
136
+ if cxx_configured || target. contains ( "vxworks" ) {
136
137
let compiler = cfg. get_compiler ( ) ;
137
138
build. cxx . insert ( target, compiler) ;
138
139
}
Original file line number Diff line number Diff line change @@ -857,6 +857,10 @@ impl Build {
857
857
if let Some ( linker) = self . config . target_config . get ( & target) . and_then ( |c| c. linker . as_ref ( ) )
858
858
{
859
859
Some ( linker)
860
+ } else if target. contains ( "vxworks" ) {
861
+ // need to use CXX compiler as linker to resolve the exception functions
862
+ // that are only existed in CXX libraries
863
+ Some ( self . cxx [ & target] . path ( ) )
860
864
} else if target != self . config . build
861
865
&& util:: use_host_linker ( target)
862
866
&& !target. contains ( "msvc" )
You can’t perform that action at this time.
0 commit comments