diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-02 21:41:52 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-02 21:41:52 +0000 |
commit | 5716d87ed11f26d72d248c0b87676ae28780195e (patch) | |
tree | 067a5fc5d8977fdf7ebf22de5aa65aa6b2a36ca5 /clang/lib/Driver/Tools.cpp | |
parent | afd2c44e72c690e3018503d4907edd3072470d52 (diff) | |
download | bcm5719-llvm-5716d87ed11f26d72d248c0b87676ae28780195e.tar.gz bcm5719-llvm-5716d87ed11f26d72d248c0b87676ae28780195e.zip |
Driver: When using the generic gcc tool, pass -m32 or -m64 if we
recognize the architecture.
- This is an attempt to force gcc to the write target.
- PR4094.
llvm-svn: 70647
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index d79f850f072..a714be81c33 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -617,7 +617,8 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA, if (A->getOption().hasForwardToGCC()) { // It is unfortunate that we have to claim here, as this means // we will basically never report anything interesting for - // platforms using a generic gcc. + // platforms using a generic gcc, even if we are just using gcc + // to get to the assembler. A->claim(); A->render(Args, CmdArgs); } @@ -638,6 +639,14 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Str); } + // Try to force gcc to match the tool chain we want, if we recognize + // the arch. + const char *Str = getToolChain().getArchName().c_str(); + if (strcmp(Str, "i386") == 0 || strcmp(Str, "powerpc") == 0) + CmdArgs.push_back("-m32"); + else if (strcmp(Str, "x86_64") == 0 || strcmp(Str, "powerpc64") == 0) + CmdArgs.push_back("-m64"); + if (Output.isPipe()) { CmdArgs.push_back("-o"); CmdArgs.push_back("-"); |