@@ -311,6 +311,9 @@ pub struct TargetOptions {
311311 pub relocation_model : String ,
312312 /// Code model to use. Corresponds to `llc -code-model=$code_model`. Defaults to "default".
313313 pub code_model : String ,
314+ /// TLS model to use. Options are "global-dynamic" (default), "local-dynamic", "initial-exec"
315+ /// and "local-exec". This is similar to the -ftls-model option in GCC/Clang.
316+ pub tls_model : String ,
314317 /// Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
315318 pub disable_redzone : bool ,
316319 /// Eliminate frame pointers from stack frames if possible. Defaults to true.
@@ -450,6 +453,7 @@ impl Default for TargetOptions {
450453 executables : false ,
451454 relocation_model : "pic" . to_string ( ) ,
452455 code_model : "default" . to_string ( ) ,
456+ tls_model : "global-dynamic" . to_string ( ) ,
453457 disable_redzone : false ,
454458 eliminate_frame_pointer : true ,
455459 function_sections : true ,
@@ -696,6 +700,7 @@ impl Target {
696700 key ! ( executables, bool ) ;
697701 key ! ( relocation_model) ;
698702 key ! ( code_model) ;
703+ key ! ( tls_model) ;
699704 key ! ( disable_redzone, bool ) ;
700705 key ! ( eliminate_frame_pointer, bool ) ;
701706 key ! ( function_sections, bool ) ;
@@ -888,6 +893,7 @@ impl ToJson for Target {
888893 target_option_val ! ( executables) ;
889894 target_option_val ! ( relocation_model) ;
890895 target_option_val ! ( code_model) ;
896+ target_option_val ! ( tls_model) ;
891897 target_option_val ! ( disable_redzone) ;
892898 target_option_val ! ( eliminate_frame_pointer) ;
893899 target_option_val ! ( function_sections) ;
0 commit comments