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