[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
This commit is contained in:
Renato Golin 2016-07-27 14:12:20 +00:00
parent 0b113671c5
commit 6b5596aaec
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1,2 @@
; RUN: %clang -target armv7-windows -c -### %s 2>&1 | FileCheck %s
; CHECK: "-triple" "thumbv7-