diff options
| author | Renato Golin <renato.golin@linaro.org> | 2016-07-27 14:12:20 +0000 |
|---|---|---|
| committer | Renato Golin <renato.golin@linaro.org> | 2016-07-27 14:12:20 +0000 |
| commit | 6b5596aaece9e856702bf7f70dbf32fe581fbdaf (patch) | |
| tree | 8ee09eb85249cdea3415536545483d25c1ee0f61 | |
| parent | 0b113671c5ca6425193fe7e65c5538aa9fc5c3d2 (diff) | |
| download | bcm5719-llvm-6b5596aaece9e856702bf7f70dbf32fe581fbdaf.tar.gz bcm5719-llvm-6b5596aaece9e856702bf7f70dbf32fe581fbdaf.zip | |
[ARM] Pass thumb as architecture to the underlying tools, when targeting windows
This makes sure that the thumb section flag gets set by the assembler.
Patch by Martin Storsjö.
llvm-svn: 276869
| -rw-r--r-- | clang/lib/Driver/ToolChain.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Driver/windows-thumb.s | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 91b364128c9..e5e17a5659c 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -493,8 +493,10 @@ std::string ToolChain::ComputeLLVMTriple(const ArgList &Args, ArchName = "arm"; // Assembly files should start in ARM mode, unless arch is M-profile. + // Windows is always thumb. if ((InputType != types::TY_PP_Asm && Args.hasFlag(options::OPT_mthumb, - options::OPT_mno_thumb, ThumbDefault)) || IsMProfile) { + options::OPT_mno_thumb, ThumbDefault)) || IsMProfile || + getTriple().isOSWindows()) { if (IsBigEndian) ArchName = "thumbeb"; else diff --git a/clang/test/Driver/windows-thumb.s b/clang/test/Driver/windows-thumb.s new file mode 100644 index 00000000000..afe5b2d4bca --- /dev/null +++ b/clang/test/Driver/windows-thumb.s @@ -0,0 +1,2 @@ +; RUN: %clang -target armv7-windows -c -### %s 2>&1 | FileCheck %s +; CHECK: "-triple" "thumbv7- |

