From 3f38d952361bac197787c9160b6a532cff6a6bc5 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Wed, 27 Jul 2016 14:12:20 +0000 Subject: [PATCH] [ARM] Pass thumb as architecture to the underlying tools, when targeting windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This makes sure that the thumb section flag gets set by the assembler. Patch by Martin Storsjö. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276869 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChain.cpp | 4 +++- test/Driver/windows-thumb.s | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test/Driver/windows-thumb.s diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index 91b364128c..e5e17a5659 100644 --- a/lib/Driver/ToolChain.cpp +++ b/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/test/Driver/windows-thumb.s b/test/Driver/windows-thumb.s new file mode 100644 index 0000000000..afe5b2d4bc --- /dev/null +++ b/test/Driver/windows-thumb.s @@ -0,0 +1,2 @@ +; RUN: %clang -target armv7-windows -c -### %s 2>&1 | FileCheck %s +; CHECK: "-triple" "thumbv7- -- 2.40.0