]> granicus.if.org Git - clang/commitdiff
[Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 16 Jan 2016 03:44:52 +0000 (03:44 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 16 Jan 2016 03:44:52 +0000 (03:44 +0000)
FIXME: Add more targets to use emutls into clang/test/Driver/emulated-tls.cpp.
FIXME: Add cygwin tests into llvm/test/CodeGen/X86. Working in progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257984 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ReleaseNotes.rst
lib/Driver/Tools.cpp
test/Driver/emulated-tls.cpp [new file with mode: 0644]

index 5a25e0b0632fdfe502c944c0fcb8decae4fdfdc0..ea3dcf28357ee839a0f496395e21ae6849167eb4 100644 (file)
@@ -74,6 +74,8 @@ Windows Support
 
 Clang's support for building native Windows programs ...
 
+TLS is enabled for Cygwin defaults to -femulated-tls.
+
 
 C Language Changes in Clang
 ---------------------------
index 90c25726df213576e5957d2777dcdbcb2b0741c8..080fef8d9e903a499ed1dcb246c27afeeff2050f 100644 (file)
@@ -4597,7 +4597,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
   // Emulated TLS is enabled by default on Android, and can be enabled manually
   // with -femulated-tls.
-  bool EmulatedTLSDefault = Triple.isAndroid();
+  bool EmulatedTLSDefault = Triple.isAndroid() || Triple.isWindowsCygwinEnvironment();
   if (Args.hasFlag(options::OPT_femulated_tls, options::OPT_fno_emulated_tls,
                    EmulatedTLSDefault))
     CmdArgs.push_back("-femulated-tls");
diff --git a/test/Driver/emulated-tls.cpp b/test/Driver/emulated-tls.cpp
new file mode 100644 (file)
index 0000000..a18c2e2
--- /dev/null
@@ -0,0 +1,5 @@
+// Cygwin uses emutls. Clang should pass -femulated-tls to cc1 and cc1 should pass EmulatedTLS to LLVM CodeGen.
+// FIXME: Add more targets here to use emutls.
+// RUN: %clang -### -std=c++11 -target i686-pc-cygwin %s 2>&1 | FileCheck %s
+
+// CHECK: "-cc1" {{.*}}"-femulated-tls"