diff mbox series

[testsuite] Robustify target_tls_runtime check

Message ID 1699000.C0UgOl6vzR@polaris
State New
Headers show
Series [testsuite] Robustify target_tls_runtime check | expand

Commit Message

Eric Botcazou July 13, 2018, 8:54 a.m. UTC
As witnessed by the kludge added for MSP430 and Visium, the check doesn't 
really work (that's also visible for arm-eabi).

Tested on x86_64-suse-linux, visium-elf and arm-eabi, OK for mainline?


2018-07-13  Eric Botcazou  <ebotcazou@adacore.com>

	* lib/target-supports.exp (check_effective_target_tls_runtime): Force
	global-dynamic model for thread variable and remove kludge.
diff mbox series

Patch

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 262551)
+++ lib/target-supports.exp	(working copy)
@@ -878,13 +878,8 @@  proc check_effective_target_tls_emulated
 # Return 1 if TLS executables can run correctly, 0 otherwise.
 
 proc check_effective_target_tls_runtime {} {
-    # The runtime does not have TLS support, but just
-    # running the test below is insufficient to show this.
-    if { [istarget msp430-*-*] || [istarget visium-*-*] } {
-	return 0
-    }
     return [check_runtime tls_runtime {
-	__thread int thr = 0;
+	__thread int thr __attribute__((tls_model("global-dynamic"))) = 0;
 	int main (void) { return thr; }
     } [add_options_for_tls ""]]
 }