File tree Expand file tree Collapse file tree 5 files changed +11
-15
lines changed
library/std/src/sys/vxworks Expand file tree Collapse file tree 5 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ impl FileDesc {
5353 }
5454
5555 #[ inline]
56- fn is_read_vectored ( & self ) -> bool {
56+ pub fn is_read_vectored ( & self ) -> bool {
5757 true
5858 }
5959
Original file line number Diff line number Diff line change @@ -351,28 +351,19 @@ impl ExitStatus {
351351 }
352352
353353 fn exited ( & self ) -> bool {
354- /*unsafe*/
355- { libc:: WIFEXITED ( self . 0 ) }
354+ libc:: WIFEXITED ( self . 0 )
356355 }
357356
358357 pub fn success ( & self ) -> bool {
359358 self . code ( ) == Some ( 0 )
360359 }
361360
362361 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 }
368363 }
369364
370365 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 }
376367 }
377368}
378369
Original file line number Diff line number Diff line change 22#![ unstable( feature = "thread_local_internals" , issue = "none" ) ]
33
44pub 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;
66 register_dtor_fallback ( t, dtor) ;
77}
Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ pub fn find(build: &mut Build) {
132132 false
133133 } ;
134134
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" ) {
136137 let compiler = cfg. get_compiler ( ) ;
137138 build. cxx . insert ( target, compiler) ;
138139 }
Original file line number Diff line number Diff line change @@ -854,6 +854,10 @@ impl Build {
854854 if let Some ( linker) = self . config . target_config . get ( & target) . and_then ( |c| c. linker . as_ref ( ) )
855855 {
856856 Some ( linker)
857+ } else if target. contains ( "vxworks" ) {
858+ // need to use CXX compiler as linker to resolve the exception functions
859+ // that are only existed in CXX libraries
860+ Some ( self . cxx [ & target] . path ( ) )
857861 } else if target != self . config . build
858862 && util:: use_host_linker ( target)
859863 && !target. contains ( "msvc" )
You can’t perform that action at this time.
0 commit comments