[cfe-commits] r110025 - in /cfe/trunk/lib/Driver: HostInfo.cpp ToolChains.cpp ToolChains.h
Daniel Dunbar
daniel at zuster.org
Sun Aug 1 22:43:59 PDT 2010
Author: ddunbar
Date: Mon Aug 2 00:43:59 2010
New Revision: 110025
URL: http://llvm.org/viewvc/llvm-project?rev=110025&view=rev
Log:
Driver/FreeBSD: Change how FreeBSD derives the Lib32 variable, to normalize tool
chain construction.
Modified:
cfe/trunk/lib/Driver/HostInfo.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
Modified: cfe/trunk/lib/Driver/HostInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/HostInfo.cpp?rev=110025&r1=110024&r2=110025&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/HostInfo.cpp (original)
+++ cfe/trunk/lib/Driver/HostInfo.cpp Mon Aug 2 00:43:59 2010
@@ -363,27 +363,18 @@
ToolChain *FreeBSDHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
- bool Lib32 = false;
-
assert(!ArchName &&
"Unexpected arch name on platform without driver driver support.");
- // On x86_64 we need to be able to compile 32-bits binaries as well.
- // Compiling 64-bit binaries on i386 is not supported. We don't have a
- // lib64.
std::string Arch = getArchName();
ArchName = Arch.c_str();
- if (Args.hasArg(options::OPT_m32) && getArchName() == "x86_64") {
- ArchName = "i386";
- Lib32 = true;
- }
ToolChain *&TC = ToolChains[ArchName];
if (!TC) {
llvm::Triple TCTriple(getTriple());
TCTriple.setArchName(ArchName);
- TC = new toolchains::FreeBSD(*this, TCTriple, Lib32);
+ TC = new toolchains::FreeBSD(*this, TCTriple);
}
return TC;
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=110025&r1=110024&r2=110025&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Mon Aug 2 00:43:59 2010
@@ -889,8 +889,16 @@
/// FreeBSD - FreeBSD tool chain which can call as(1) and ld(1) directly.
-FreeBSD::FreeBSD(const HostInfo &Host, const llvm::Triple& Triple, bool Lib32)
+FreeBSD::FreeBSD(const HostInfo &Host, const llvm::Triple& Triple)
: Generic_GCC(Host, Triple) {
+
+ // Determine if we are compiling 32-bit code on an x86_64 platform.
+ bool Lib32 = false;
+ if (Triple.getArch() == llvm::Triple::x86 &&
+ llvm::Triple(getDriver().DefaultHostTriple).getArch() ==
+ llvm::Triple::x86_64)
+ Lib32 = true;
+
getProgramPaths().push_back(getDriver().Dir + "/../libexec");
getProgramPaths().push_back("/usr/libexec");
if (Lib32) {
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=110025&r1=110024&r2=110025&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Mon Aug 2 00:43:59 2010
@@ -269,7 +269,7 @@
class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_GCC {
public:
- FreeBSD(const HostInfo &Host, const llvm::Triple& Triple, bool Lib32);
+ FreeBSD(const HostInfo &Host, const llvm::Triple& Triple);
virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const;
};
More information about the cfe-commits
mailing list