@@ -581,8 +581,10 @@ pub struct TargetOptions {
581
581
/// user-defined libraries.
582
582
pub post_link_args : LinkArgs ,
583
583
584
- /// Environment variables to be set before invoking the linker.
584
+ /// Environment variables to be set for the linker invocation .
585
585
pub link_env : Vec < ( String , String ) > ,
586
+ /// Environment variables to be removed for the linker invocation.
587
+ pub link_env_remove : Vec < String > ,
586
588
587
589
/// Extra arguments to pass to the external assembler (when used)
588
590
pub asm_args : Vec < String > ,
@@ -844,6 +846,7 @@ impl Default for TargetOptions {
844
846
post_link_objects_crt : Vec :: new ( ) ,
845
847
late_link_args : LinkArgs :: new ( ) ,
846
848
link_env : Vec :: new ( ) ,
849
+ link_env_remove : Vec :: new ( ) ,
847
850
archive_format : "gnu" . to_string ( ) ,
848
851
custom_unwind_resume : false ,
849
852
allow_asm : true ,
@@ -1119,6 +1122,7 @@ impl Target {
1119
1122
key ! ( post_link_objects_crt, list) ;
1120
1123
key ! ( post_link_args, link_args) ;
1121
1124
key ! ( link_env, env) ;
1125
+ key ! ( link_env_remove, list) ;
1122
1126
key ! ( asm_args, list) ;
1123
1127
key ! ( cpu) ;
1124
1128
key ! ( features) ;
@@ -1335,6 +1339,7 @@ impl ToJson for Target {
1335
1339
target_option_val ! ( post_link_objects_crt) ;
1336
1340
target_option_val ! ( link_args - post_link_args) ;
1337
1341
target_option_val ! ( env - link_env) ;
1342
+ target_option_val ! ( link_env_remove) ;
1338
1343
target_option_val ! ( asm_args) ;
1339
1344
target_option_val ! ( cpu) ;
1340
1345
target_option_val ! ( features) ;
0 commit comments