@@ -1885,6 +1885,8 @@ pub struct TargetOptions {
18851885 /// passed, and cannot be disabled even via `-C`. Corresponds to `llc
18861886 /// -mattr=$features`.
18871887 pub features : StaticCow < str > ,
1888+ /// Direct or use GOT indirect to reference external data symbols
1889+ pub direct_access_external_data : Option < bool > ,
18881890 /// Whether dynamic linking is available on this target. Defaults to false.
18891891 pub dynamic_linking : bool ,
18901892 /// Whether dynamic linking can export TLS globals. Defaults to true.
@@ -2279,6 +2281,7 @@ impl Default for TargetOptions {
22792281 asm_args : cvs ! [ ] ,
22802282 cpu : "generic" . into ( ) ,
22812283 features : "" . into ( ) ,
2284+ direct_access_external_data : None ,
22822285 dynamic_linking : false ,
22832286 dll_tls_export : true ,
22842287 only_cdylib : false ,
@@ -2575,6 +2578,12 @@ impl Target {
25752578 base. $key_name = s as u32 ;
25762579 }
25772580 } ) ;
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+ } ) ;
25782587 ( $key_name: ident, Option <u64 >) => ( {
25792588 let name = ( stringify!( $key_name) ) . replace( "_" , "-" ) ;
25802589 if let Some ( s) = obj. remove( & name) . and_then( |b| b. as_u64( ) ) {
@@ -3003,6 +3012,7 @@ impl Target {
30033012 key ! ( cpu) ;
30043013 key ! ( features) ;
30053014 key ! ( dynamic_linking, bool ) ;
3015+ key ! ( direct_access_external_data, Option <bool >) ;
30063016 key ! ( dll_tls_export, bool ) ;
30073017 key ! ( only_cdylib, bool ) ;
30083018 key ! ( executables, bool ) ;
@@ -3257,6 +3267,7 @@ impl ToJson for Target {
32573267 target_option_val ! ( cpu) ;
32583268 target_option_val ! ( features) ;
32593269 target_option_val ! ( dynamic_linking) ;
3270+ target_option_val ! ( direct_access_external_data) ;
32603271 target_option_val ! ( dll_tls_export) ;
32613272 target_option_val ! ( only_cdylib) ;
32623273 target_option_val ! ( executables) ;
0 commit comments