@@ -423,19 +423,23 @@ pub struct TargetOptions {
423423 /// Linker arguments that are passed *before* any user-defined libraries.
424424 pub pre_link_args : LinkArgs , // ... unconditionally
425425 pub pre_link_args_crt : LinkArgs , // ... when linking with a bundled crt
426- /// Objects to link before all others, always found within the
426+ /// Objects to link before all others, all except *_sys found within the
427427 /// sysroot folder.
428428 pub pre_link_objects_exe : Vec < String > , // ... when linking an executable, unconditionally
429429 pub pre_link_objects_exe_crt : Vec < String > , // ... when linking an executable with a bundled crt
430+ pub pre_link_objects_exe_crt_sys : Vec < String > , // ... when linking an executable with a bundled
431+ // crt, from the system library search path
430432 pub pre_link_objects_dll : Vec < String > , // ... when linking a dylib
431433 /// Linker arguments that are unconditionally passed after any
432434 /// user-defined but before post_link_objects. Standard platform
433435 /// libraries that should be always be linked to, usually go here.
434436 pub late_link_args : LinkArgs ,
435- /// Objects to link after all others, always found within the
437+ /// Objects to link after all others, all except *_sys found within the
436438 /// sysroot folder.
437439 pub post_link_objects : Vec < String > , // ... unconditionally
438440 pub post_link_objects_crt : Vec < String > , // ... when linking with a bundled crt
441+ pub post_link_objects_crt_sys : Vec < String > , // ... when linking with a bundled crt, from the
442+ // system library search path
439443 /// Linker arguments that are unconditionally passed *after* any
440444 /// user-defined libraries.
441445 pub post_link_args : LinkArgs ,
@@ -670,9 +674,11 @@ impl Default for TargetOptions {
670674 relro_level : RelroLevel :: None ,
671675 pre_link_objects_exe : Vec :: new ( ) ,
672676 pre_link_objects_exe_crt : Vec :: new ( ) ,
677+ pre_link_objects_exe_crt_sys : Vec :: new ( ) ,
673678 pre_link_objects_dll : Vec :: new ( ) ,
674679 post_link_objects : Vec :: new ( ) ,
675680 post_link_objects_crt : Vec :: new ( ) ,
681+ post_link_objects_crt_sys : Vec :: new ( ) ,
676682 late_link_args : LinkArgs :: new ( ) ,
677683 link_env : Vec :: new ( ) ,
678684 archive_format : "gnu" . to_string ( ) ,
@@ -894,10 +900,12 @@ impl Target {
894900 key ! ( pre_link_args_crt, link_args) ;
895901 key ! ( pre_link_objects_exe, list) ;
896902 key ! ( pre_link_objects_exe_crt, list) ;
903+ key ! ( pre_link_objects_exe_crt_sys, list) ;
897904 key ! ( pre_link_objects_dll, list) ;
898905 key ! ( late_link_args, link_args) ;
899906 key ! ( post_link_objects, list) ;
900907 key ! ( post_link_objects_crt, list) ;
908+ key ! ( post_link_objects_crt_sys, list) ;
901909 key ! ( post_link_args, link_args) ;
902910 key ! ( link_env, env) ;
903911 key ! ( asm_args, list) ;
@@ -1102,10 +1110,12 @@ impl ToJson for Target {
11021110 target_option_val ! ( link_args - pre_link_args_crt) ;
11031111 target_option_val ! ( pre_link_objects_exe) ;
11041112 target_option_val ! ( pre_link_objects_exe_crt) ;
1113+ target_option_val ! ( pre_link_objects_exe_crt_sys) ;
11051114 target_option_val ! ( pre_link_objects_dll) ;
11061115 target_option_val ! ( link_args - late_link_args) ;
11071116 target_option_val ! ( post_link_objects) ;
11081117 target_option_val ! ( post_link_objects_crt) ;
1118+ target_option_val ! ( post_link_objects_crt_sys) ;
11091119 target_option_val ! ( link_args - post_link_args) ;
11101120 target_option_val ! ( env - link_env) ;
11111121 target_option_val ! ( asm_args) ;
0 commit comments