@@ -1885,6 +1885,8 @@ pub struct TargetOptions {
1885
1885
/// passed, and cannot be disabled even via `-C`. Corresponds to `llc
1886
1886
/// -mattr=$features`.
1887
1887
pub features : StaticCow < str > ,
1888
+ /// Direct or use GOT indirect to reference external data symbols
1889
+ pub direct_access_external_data : Option < bool > ,
1888
1890
/// Whether dynamic linking is available on this target. Defaults to false.
1889
1891
pub dynamic_linking : bool ,
1890
1892
/// Whether dynamic linking can export TLS globals. Defaults to true.
@@ -2279,6 +2281,7 @@ impl Default for TargetOptions {
2279
2281
asm_args : cvs ! [ ] ,
2280
2282
cpu : "generic" . into ( ) ,
2281
2283
features : "" . into ( ) ,
2284
+ direct_access_external_data : None ,
2282
2285
dynamic_linking : false ,
2283
2286
dll_tls_export : true ,
2284
2287
only_cdylib : false ,
@@ -2575,6 +2578,12 @@ impl Target {
2575
2578
base. $key_name = s as u32 ;
2576
2579
}
2577
2580
} ) ;
2581
+ ( $key_name: ident, Option <bool >) => ( {
2582
+ let name = ( stringify!( $key_name) ) . replace( "_" , "-" ) ;
2583
+ if let Some ( s) = obj. remove( & name) . and_then( |b| b. as_bool( ) ) {
2584
+ base. $key_name = Some ( s) ;
2585
+ }
2586
+ } ) ;
2578
2587
( $key_name: ident, Option <u64 >) => ( {
2579
2588
let name = ( stringify!( $key_name) ) . replace( "_" , "-" ) ;
2580
2589
if let Some ( s) = obj. remove( & name) . and_then( |b| b. as_u64( ) ) {
@@ -3003,6 +3012,7 @@ impl Target {
3003
3012
key ! ( cpu) ;
3004
3013
key ! ( features) ;
3005
3014
key ! ( dynamic_linking, bool ) ;
3015
+ key ! ( direct_access_external_data, Option <bool >) ;
3006
3016
key ! ( dll_tls_export, bool ) ;
3007
3017
key ! ( only_cdylib, bool ) ;
3008
3018
key ! ( executables, bool ) ;
@@ -3257,6 +3267,7 @@ impl ToJson for Target {
3257
3267
target_option_val ! ( cpu) ;
3258
3268
target_option_val ! ( features) ;
3259
3269
target_option_val ! ( dynamic_linking) ;
3270
+ target_option_val ! ( direct_access_external_data) ;
3260
3271
target_option_val ! ( dll_tls_export) ;
3261
3272
target_option_val ! ( only_cdylib) ;
3262
3273
target_option_val ! ( executables) ;
0 commit comments