@@ -415,6 +415,7 @@ impl Command {
415
415
all( target_os = "linux" , target_env = "musl" ) ,
416
416
target_os = "nto" ,
417
417
target_vendor = "apple" ,
418
+ target_os = "cygwin" ,
418
419
) ) ) ]
419
420
fn posix_spawn (
420
421
& mut self ,
@@ -433,6 +434,7 @@ impl Command {
433
434
all( target_os = "linux" , target_env = "musl" ) ,
434
435
target_os = "nto" ,
435
436
target_vendor = "apple" ,
437
+ target_os = "cygwin" ,
436
438
) ) ]
437
439
// FIXME(#115199): Rust currently omits weak function definitions
438
440
// and its metadata from LLVM IR.
@@ -587,7 +589,7 @@ impl Command {
587
589
/// Some platforms can set a new working directory for a spawned process in the
588
590
/// `posix_spawn` path. This function looks up the function pointer for adding
589
591
/// such an action to a `posix_spawn_file_actions_t` struct.
590
- #[ cfg( not( all( target_os = "linux" , target_env = "musl" ) ) ) ]
592
+ #[ cfg( not( any ( all( target_os = "linux" , target_env = "musl" ) , target_os = "cygwin ") ) ) ]
591
593
fn get_posix_spawn_addchdir ( ) -> Option < PosixSpawnAddChdirFn > {
592
594
use crate :: sys:: weak:: weak;
593
595
@@ -621,7 +623,9 @@ impl Command {
621
623
/// Weak symbol lookup doesn't work with statically linked libcs, so in cases
622
624
/// where static linking is possible we need to either check for the presence
623
625
/// of the symbol at compile time or know about it upfront.
624
- #[ cfg( all( target_os = "linux" , target_env = "musl" ) ) ]
626
+ ///
627
+ /// Cygwin doesn't support weak symbol, so just link it.
628
+ #[ cfg( any( all( target_os = "linux" , target_env = "musl" ) , target_os = "cygwin" ) ) ]
625
629
fn get_posix_spawn_addchdir ( ) -> Option < PosixSpawnAddChdirFn > {
626
630
// Our minimum required musl supports this function, so we can just use it.
627
631
Some ( libc:: posix_spawn_file_actions_addchdir_np)
0 commit comments