<div dir="ltr">On Fri, Oct 24, 2014 at 11:25 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">This test is fairly unhermetic, it's picking up the ld executable from<br>
the user's system, which may not exist. I would recommend using a fake<br>
sysroot in test/Driver/Inputs, as all the other tests do. It should be<br>
enough to add an empty executable file at<br>
test/Driver/Inputs/windows_cross/usr/bin/ld.</blockquote><div><br></div><div>Thats a good point. It would be better if the test were hermetic. I've updated the test to do this in SVN r220625.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">
On Thu, Oct 23, 2014 at 8:13 PM, Saleem Abdulrasool<br>
<<a href="mailto:compnerd@compnerd.org">compnerd@compnerd.org</a>> wrote:<br>
> Author: compnerd<br>
> Date: Thu Oct 23 22:13:37 2014<br>
> New Revision: 220546<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=220546&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=220546&view=rev</a><br>
> Log:<br>
> Driver: add CrossWindowsToolChain<br>
><br>
> This is a very basic toolchain. It supports cross-compiling Windows (primarily<br>
> inspired by the WoA target). It is meant to use clang with the LLVM IAS and a<br>
> binutils ld-compatible interface for the linker (eventually to be lld). It does<br>
> not perform any "standard" GCC lookup, nor does it perform any special<br>
> adjustments given that it is expected to be used in an environment where the<br>
> user is using MSVCRT (and as such Visual Studio headers) and the Windows SDK.<br>
> The primary runtime library is expected to be compiler-rt and the C++<br>
> implementation to be libc++.<br>
><br>
> It also expects that a sysroot has been setup given the usual Unix semantics<br>
> (standard C headers in /usr/include, all the import libraries available in<br>
> /usr/lib). It also expects that an entry point stub is present in /usr/lib<br>
> (crtbegin.obj for executables, crtbeginS.obj for shared libraries).<br>
><br>
> The entry point stub is responsible for running any GNU constructors.<br>
><br>
> Added:<br>
> cfe/trunk/test/Driver/windows-cross.c<br>
> Modified:<br>
> cfe/trunk/lib/Driver/CMakeLists.txt<br>
> cfe/trunk/lib/Driver/Driver.cpp<br>
> cfe/trunk/lib/Driver/ToolChains.h<br>
> cfe/trunk/lib/Driver/Tools.cpp<br>
> cfe/trunk/lib/Driver/Tools.h<br>
><br>
> Modified: cfe/trunk/lib/Driver/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CMakeLists.txt?rev=220546&r1=220545&r2=220546&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CMakeLists.txt?rev=220546&r1=220545&r2=220546&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/CMakeLists.txt (original)<br>
> +++ cfe/trunk/lib/Driver/CMakeLists.txt Thu Oct 23 22:13:37 2014<br>
> @@ -6,6 +6,7 @@ set(LLVM_LINK_COMPONENTS<br>
> add_clang_library(clangDriver<br>
> Action.cpp<br>
> Compilation.cpp<br>
> + CrossWindowsToolChain.cpp<br>
> Driver.cpp<br>
> DriverOptions.cpp<br>
> Job.cpp<br>
><br>
> Modified: cfe/trunk/lib/Driver/Driver.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=220546&r1=220545&r2=220546&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=220546&r1=220545&r2=220546&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/Driver.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/Driver.cpp Thu Oct 23 22:13:37 2014<br>
> @@ -2039,6 +2039,9 @@ const ToolChain &Driver::getToolChain(co<br>
> else<br>
> TC = new toolchains::Generic_GCC(*this, Target, Args);<br>
> break;<br>
> + case llvm::Triple::Itanium:<br>
> + TC = new toolchains::CrossWindowsToolChain(*this, Target, Args);<br>
> + break;<br>
> case llvm::Triple::MSVC:<br>
> case llvm::Triple::UnknownEnvironment:<br>
> TC = new toolchains::MSVCToolChain(*this, Target, Args);<br>
><br>
> Modified: cfe/trunk/lib/Driver/ToolChains.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=220546&r1=220545&r2=220546&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=220546&r1=220545&r2=220546&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/ToolChains.h (original)<br>
> +++ cfe/trunk/lib/Driver/ToolChains.h Thu Oct 23 22:13:37 2014<br>
> @@ -761,6 +761,34 @@ protected:<br>
> Tool *buildAssembler() const override;<br>
> };<br>
><br>
> +class LLVM_LIBRARY_VISIBILITY CrossWindowsToolChain : public Generic_GCC {<br>
> +public:<br>
> + CrossWindowsToolChain(const Driver &D, const llvm::Triple &T,<br>
> + const llvm::opt::ArgList &Args);<br>
> +<br>
> + bool IsIntegratedAssemblerDefault() const override { return true; }<br>
> + bool IsUnwindTablesDefault() const override;<br>
> + bool isPICDefault() const override;<br>
> + bool isPIEDefault() const override;<br>
> + bool isPICDefaultForced() const override;<br>
> +<br>
> + unsigned int GetDefaultStackProtectorLevel(bool KernelOrKext) const override {<br>
> + return 0;<br>
> + }<br>
> +<br>
> + void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,<br>
> + llvm::opt::ArgStringList &CC1Args)<br>
> + const override;<br>
> + void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,<br>
> + llvm::opt::ArgStringList &CC1Args)<br>
> + const override;<br>
> + void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,<br>
> + llvm::opt::ArgStringList &CmdArgs) const override;<br>
> +<br>
> +protected:<br>
> + Tool *buildLinker() const override;<br>
> + Tool *buildAssembler() const override;<br>
> +};<br>
><br>
> class LLVM_LIBRARY_VISIBILITY XCore : public ToolChain {<br>
> public:<br>
><br>
> Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=220546&r1=220545&r2=220546&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=220546&r1=220545&r2=220546&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/Tools.cpp Thu Oct 23 22:13:37 2014<br>
> @@ -2138,6 +2138,14 @@ static void addClangRTLinux(<br>
> CmdArgs.push_back("-lgcc_eh");<br>
> }<br>
><br>
> +static void addClangRTWindows(const ToolChain &TC, const ArgList &Args,<br>
> + ArgStringList &CmdArgs) {<br>
> + SmallString<128> LibClangRT = getCompilerRTLibDir(TC);<br>
> + llvm::sys::path::append(LibClangRT, Twine("libclang_rt.builtins-") +<br>
> + getArchNameForCompilerRTLib(TC) + ".lib");<br>
> + CmdArgs.push_back(Args.MakeArgString(LibClangRT));<br>
> +}<br>
> +<br>
> static void addProfileRT(<br>
> const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) {<br>
> if (!(Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,<br>
> @@ -7288,7 +7296,15 @@ static void AddRunTimeLibs(const ToolCha<br>
><br>
> switch(RLT) {<br>
> case ToolChain::RLT_CompilerRT:<br>
> - addClangRTLinux(TC, Args, CmdArgs);<br>
> + switch (TC.getTriple().getOS()) {<br>
> + default: llvm_unreachable("unsupported OS");<br>
> + case llvm::Triple::Win32:<br>
> + addClangRTWindows(TC, Args, CmdArgs);<br>
> + break;<br>
> + case llvm::Triple::Linux:<br>
> + addClangRTLinux(TC, Args, CmdArgs);<br>
> + break;<br>
> + }<br>
> break;<br>
> case ToolChain::RLT_Libgcc:<br>
> AddLibgcc(TC.getTriple(), D, CmdArgs, Args);<br>
> @@ -8114,3 +8130,181 @@ void XCore::Link::ConstructJob(Compilati<br>
> const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("xcc"));<br>
> C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));<br>
> }<br>
> +<br>
> +void CrossWindows::Assemble::ConstructJob(Compilation &C, const JobAction &JA,<br>
> + const InputInfo &Output,<br>
> + const InputInfoList &Inputs,<br>
> + const ArgList &Args,<br>
> + const char *LinkingOutput) const {<br>
> + const auto &TC =<br>
> + static_cast<const toolchains::CrossWindowsToolChain &>(getToolChain());<br>
> + ArgStringList CmdArgs;<br>
> + const char *Exec;<br>
> +<br>
> + switch (TC.getArch()) {<br>
> + default: llvm_unreachable("unsupported architecture");<br>
> + case llvm::Triple::arm:<br>
> + case llvm::Triple::thumb:<br>
> + break;<br>
> + case llvm::Triple::x86:<br>
> + CmdArgs.push_back("--32");<br>
> + break;<br>
> + case llvm::Triple::x86_64:<br>
> + CmdArgs.push_back("--64");<br>
> + break;<br>
> + }<br>
> +<br>
> + Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);<br>
> +<br>
> + CmdArgs.push_back("-o");<br>
> + CmdArgs.push_back(Output.getFilename());<br>
> +<br>
> + for (const auto &Input : Inputs)<br>
> + CmdArgs.push_back(Input.getFilename());<br>
> +<br>
> + const std::string Assembler = TC.GetProgramPath("as");<br>
> + Exec = Args.MakeArgString(Assembler);<br>
> +<br>
> + C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));<br>
> +}<br>
> +<br>
> +void CrossWindows::Link::ConstructJob(Compilation &C, const JobAction &JA,<br>
> + const InputInfo &Output,<br>
> + const InputInfoList &Inputs,<br>
> + const ArgList &Args,<br>
> + const char *LinkingOutput) const {<br>
> + const auto &TC =<br>
> + static_cast<const toolchains::CrossWindowsToolChain &>(getToolChain());<br>
> + const llvm::Triple &T = TC.getTriple();<br>
> + const Driver &D = TC.getDriver();<br>
> + SmallString<128> EntryPoint;<br>
> + ArgStringList CmdArgs;<br>
> + const char *Exec;<br>
> +<br>
> + // Silence warning for "clang -g foo.o -o foo"<br>
> + Args.ClaimAllArgs(options::OPT_g_Group);<br>
> + // and "clang -emit-llvm foo.o -o foo"<br>
> + Args.ClaimAllArgs(options::OPT_emit_llvm);<br>
> + // and for "clang -w foo.o -o foo"<br>
> + Args.ClaimAllArgs(options::OPT_w);<br>
> + // Other warning options are already handled somewhere else.<br>
> +<br>
> + if (!D.SysRoot.empty())<br>
> + CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));<br>
> +<br>
> + if (Args.hasArg(options::OPT_pie))<br>
> + CmdArgs.push_back("-pie");<br>
> + if (Args.hasArg(options::OPT_rdynamic))<br>
> + CmdArgs.push_back("-export-dynamic");<br>
> + if (Args.hasArg(options::OPT_s))<br>
> + CmdArgs.push_back("--strip-all");<br>
> +<br>
> + CmdArgs.push_back("-m");<br>
> + switch (TC.getArch()) {<br>
> + default: llvm_unreachable("unsupported architecture");<br>
> + case llvm::Triple::arm:<br>
> + case llvm::Triple::thumb:<br>
> + // FIXME: this is incorrect for WinCE<br>
> + CmdArgs.push_back("thumb2pe");<br>
> + break;<br>
> + case llvm::Triple::x86:<br>
> + CmdArgs.push_back("i386pe");<br>
> + EntryPoint.append("_");<br>
> + break;<br>
> + case llvm::Triple::x86_64:<br>
> + CmdArgs.push_back("i386pep");<br>
> + break;<br>
> + }<br>
> +<br>
> + if (Args.hasArg(options::OPT_shared)) {<br>
> + switch (T.getArch()) {<br>
> + default: llvm_unreachable("unsupported architecture");<br>
> + case llvm::Triple::arm:<br>
> + case llvm::Triple::thumb:<br>
> + case llvm::Triple::x86_64:<br>
> + EntryPoint.append("_DllMainCRTStartup");<br>
> + break;<br>
> + case llvm::Triple::x86:<br>
> + EntryPoint.append("_DllMainCRTStartup@12");<br>
> + break;<br>
> + }<br>
> +<br>
> + CmdArgs.push_back("-shared");<br>
> + CmdArgs.push_back("-Bdynamic");<br>
> +<br>
> + CmdArgs.push_back("--enable-auto-image-base");<br>
> +<br>
> + CmdArgs.push_back("--entry");<br>
> + CmdArgs.push_back(Args.MakeArgString(EntryPoint));<br>
> + } else {<br>
> + EntryPoint.append("mainCRTStartup");<br>
> +<br>
> + CmdArgs.push_back(Args.hasArg(options::OPT_static) ? "-Bstatic"<br>
> + : "-Bdynamic");<br>
> +<br>
> + if (!Args.hasArg(options::OPT_nostdlib) &&<br>
> + !Args.hasArg(options::OPT_nostartfiles)) {<br>
> + CmdArgs.push_back("--entry");<br>
> + CmdArgs.push_back(Args.MakeArgString(EntryPoint));<br>
> + }<br>
> +<br>
> + // FIXME: handle subsystem<br>
> + }<br>
> +<br>
> + // NOTE: deal with multiple definitions on Windows (e.g. COMDAT)<br>
> + CmdArgs.push_back("--allow-multiple-definitions");<br>
> +<br>
> + CmdArgs.push_back("-o");<br>
> + CmdArgs.push_back(Output.getFilename());<br>
> +<br>
> + if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_rdynamic)) {<br>
> + SmallString<261> ImpLib(Output.getFilename());<br>
> + llvm::sys::path::replace_extension(ImpLib, ".lib");<br>
> +<br>
> + CmdArgs.push_back("--out-implib");<br>
> + CmdArgs.push_back(Args.MakeArgString(ImpLib));<br>
> + }<br>
> +<br>
> + if (!Args.hasArg(options::OPT_nostdlib) &&<br>
> + !Args.hasArg(options::OPT_nostartfiles)) {<br>
> + const std::string CRTPath(D.SysRoot + "/usr/lib/");<br>
> + const char *CRTBegin;<br>
> +<br>
> + CRTBegin =<br>
> + Args.hasArg(options::OPT_shared) ? "crtbeginS.obj" : "crtbegin.obj";<br>
> + CmdArgs.push_back(Args.MakeArgString(CRTPath + CRTBegin));<br>
> + }<br>
> +<br>
> + Args.AddAllArgs(CmdArgs, options::OPT_L);<br>
> +<br>
> + const auto &Paths = TC.getFilePaths();<br>
> + for (const auto &Path : Paths)<br>
> + CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + Path));<br>
> +<br>
> + AddLinkerInputs(TC, Inputs, Args, CmdArgs);<br>
> +<br>
> + if (D.CCCIsCXX() && !Args.hasArg(options::OPT_nostdlib) &&<br>
> + !Args.hasArg(options::OPT_nodefaultlibs)) {<br>
> + bool StaticCXX = Args.hasArg(options::OPT_static_libstdcxx) &&<br>
> + !Args.hasArg(options::OPT_static);<br>
> + if (StaticCXX)<br>
> + CmdArgs.push_back("-Bstatic");<br>
> + TC.AddCXXStdlibLibArgs(Args, CmdArgs);<br>
> + if (StaticCXX)<br>
> + CmdArgs.push_back("-Bdynamic");<br>
> + }<br>
> +<br>
> + if (!Args.hasArg(options::OPT_nostdlib)) {<br>
> + if (!Args.hasArg(options::OPT_nodefaultlibs)) {<br>
> + // TODO handle /MT[d] /MD[d]<br>
> + CmdArgs.push_back("-lmsvcrt");<br>
> + AddRunTimeLibs(TC, D, CmdArgs, Args);<br>
> + }<br>
> + }<br>
> +<br>
> + const std::string Linker = TC.GetProgramPath("ld");<br>
> + Exec = Args.MakeArgString(Linker);<br>
> +<br>
> + C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));<br>
> +}<br>
> +<br>
><br>
> Modified: cfe/trunk/lib/Driver/Tools.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=220546&r1=220545&r2=220546&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=220546&r1=220545&r2=220546&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/Tools.h (original)<br>
> +++ cfe/trunk/lib/Driver/Tools.h Thu Oct 23 22:13:37 2014<br>
> @@ -645,6 +645,32 @@ namespace XCore {<br>
> };<br>
> } // end namespace XCore.<br>
><br>
> +namespace CrossWindows {<br>
> +class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {<br>
> +public:<br>
> + Assemble(const ToolChain &TC) : Tool("CrossWindows::Assemble", "as", TC) { }<br>
> +<br>
> + bool hasIntegratedCPP() const override { return false; }<br>
> +<br>
> + void ConstructJob(Compilation &C, const JobAction &JA,<br>
> + const InputInfo &Output, const InputInfoList &Inputs,<br>
> + const llvm::opt::ArgList &TCArgs,<br>
> + const char *LinkingOutput) const override;<br>
> +};<br>
> +<br>
> +class LLVM_LIBRARY_VISIBILITY Link : public Tool {<br>
> +public:<br>
> + Link(const ToolChain &TC) : Tool("CrossWindows::Link", "ld", TC, RF_Full) {}<br>
> +<br>
> + bool hasIntegratedCPP() const override { return false; }<br>
> + bool isLinkJob() const override { return true; }<br>
> +<br>
> + void ConstructJob(Compilation &C, const JobAction &JA,<br>
> + const InputInfo &Output, const InputInfoList &Inputs,<br>
> + const llvm::opt::ArgList &TCArgs,<br>
> + const char *LinkingOutput) const override;<br>
> +};<br>
> +}<br>
><br>
> } // end namespace toolchains<br>
> } // end namespace driver<br>
><br>
> Added: cfe/trunk/test/Driver/windows-cross.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/windows-cross.c?rev=220546&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/windows-cross.c?rev=220546&view=auto</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/Driver/windows-cross.c (added)<br>
> +++ cfe/trunk/test/Driver/windows-cross.c Thu Oct 23 22:13:37 2014<br>
> @@ -0,0 +1,40 @@<br>
> +// RUN: %clang -### -target armv7-windows-itanium -o /dev/null %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-BASIC<br>
> +<br>
> +// CHECK-BASIC: ld" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definitions" "-o" "/dev/null" "/usr/lib/crtbegin.obj" "-L/usr/lib" "-L/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"<br>
> +<br>
> +// RUN: %clang -### -target armv7-windows-itanium -rtlib=compiler-rt -o /dev/null %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-RTLIB<br>
> +<br>
> +// CHECK-RTLIB: ld" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definitions" "-o" "/dev/null" "/usr/lib/crtbegin.obj" "-L/usr/lib" "-L/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "{{.*}}/libclang_rt.builtins-arm.lib"<br>
> +<br>
> +// RUN: %clang -### -target armv7-windows-itanium --sysroot /sysroot/Windows/ARM/8.1 -rtlib=compiler-rt -o /dev/null %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-SYSROOT<br>
> +<br>
> +// CHECK-SYSROOT: ld" "--sysroot=/sysroot/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definitions" "-o" "/dev/null" "/sysroot/Windows/ARM/8.1/usr/lib/crtbegin.obj" "-L/sysroot/Windows/ARM/8.1/usr/lib" "-L/sysroot/Windows/ARM/8.1/usr/lib/gcc" "{{.*}}.o" "-lmsvcrt" "{{.*}}/libclang_rt.builtins-arm.lib"<br>
> +<br>
> +// RUN: %clang -### -target armv7-windows-itanium --sysroot /sysroot/Windows/ARM/8.1 -rtlib=compiler-rt -stdlib=libc++ -o /dev/null %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-C-LIBCXX<br>
> +<br>
> +// CHECK-C-LIBCXX: ld" "--sysroot=/sysroot/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definitions" "-o" "/dev/null" "/sysroot/Windows/ARM/8.1/usr/lib/crtbegin.obj" "{{.*}}.o" "-lmsvcrt" "{{.*}}/libclang_rt.builtins-arm.lib"<br>
> +<br>
> +// RUN: %clangxx -### -target armv7-windows-itanium --sysroot /sysroot/Windows/ARM/8.1 -rtlib=compiler-rt -stdlib=libc++ -o /dev/null %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-LIBCXX<br>
> +<br>
> +// CHECK-LIBCXX: ld" "--sysroot=/sysroot/Windows/ARM/8.1" "-m" "thumb2pe" "-Bdynamic" "--entry" "mainCRTStartup" "--allow-multiple-definitions" "-o" "/dev/null" "/sysroot/Windows/ARM/8.1/usr/lib/crtbegin.obj" "{{.*}}.o" "-lc++" "-lmsvcrt" "{{.*}}/libclang_rt.builtins-arm.lib"<br>
> +<br>
> +// RUN: %clang -### -target armv7-windows-itanium --sysroot /sysroot/Windows/ARM/8.1 -shared -rtlib=compiler-rt -stdlib=libc++ -o shared.dll %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-SHARED<br>
> +<br>
> +// CHECK-SHARED: ld" "--sysroot=/sysroot/Windows/ARM/8.1" "-m" "thumb2pe" "-shared" "-Bdynamic" "--enable-auto-image-base" "--entry" "_DllMainCRTStartup" "--allow-multiple-definitions" "-o" "shared.dll" "--out-implib" "shared.lib" "/sysroot/Windows/ARM/8.1/usr/lib/crtbeginS.obj" "{{.*}}.o" "-lmsvcrt" "{{.*}}/libclang_rt.builtins-arm.lib"<br>
> +<br>
> +// RUN: %clang -### -target armv7-windows-itanium --sysroot /sysroot/Windows/ARM/8.1 -shared -rtlib=compiler-rt -stdlib=libc++ -nostartfiles -o shared.dll %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-NOSTARTFILES<br>
> +<br>
> +// CHECK-NOSTARTFILES: ld" "--sysroot=/sysroot/Windows/ARM/8.1" "-m" "thumb2pe" "-shared" "-Bdynamic" "--enable-auto-image-base" "--entry" "_DllMainCRTStartup" "--allow-multiple-definitions" "-o" "shared.dll" "--out-implib" "shared.lib" "{{.*}}.o" "-lmsvcrt" "{{.*}}/libclang_rt.builtins-arm.lib"<br>
> +<br>
> +// RUN: %clang -### -target armv7-windows-itanium --sysroot /sysroot/Windows/ARM/8.1 -shared -rtlib=compiler-rt -stdlib=libc++ -nostartfiles -nodefaultlibs -o shared.dll %s 2>&1 \<br>
> +// RUN: | FileCheck %s --check-prefix CHECK-STANDALONE<br>
> +<br>
> +// CHECK-STANDALONE: ld" "--sysroot=/sysroot/Windows/ARM/8.1" "-m" "thumb2pe" "-shared" "-Bdynamic" "--enable-auto-image-base" "--entry" "_DllMainCRTStartup" "--allow-multiple-definitions" "-o" "shared.dll" "--out-implib" "shared.lib" "{{.*}}.o"<br>
> +<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>