r257984 - [Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.
NAKAMURA Takumi via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 15 19:44:53 PST 2016
Author: chapuni
Date: Fri Jan 15 21:44:52 2016
New Revision: 257984
URL: http://llvm.org/viewvc/llvm-project?rev=257984&view=rev
Log:
[Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.
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.
Added:
cfe/trunk/test/Driver/emulated-tls.cpp
Modified:
cfe/trunk/docs/ReleaseNotes.rst
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=257984&r1=257983&r2=257984&view=diff
==============================================================================
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Fri Jan 15 21:44:52 2016
@@ -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
---------------------------
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=257984&r1=257983&r2=257984&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Jan 15 21:44:52 2016
@@ -4597,7 +4597,7 @@ void Clang::ConstructJob(Compilation &C,
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");
Added: cfe/trunk/test/Driver/emulated-tls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/emulated-tls.cpp?rev=257984&view=auto
==============================================================================
--- cfe/trunk/test/Driver/emulated-tls.cpp (added)
+++ cfe/trunk/test/Driver/emulated-tls.cpp Fri Jan 15 21:44:52 2016
@@ -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"
More information about the cfe-commits
mailing list