diff options
-rw-r--r-- | lib/Driver/HostInfo.cpp | 8 | ||||
-rw-r--r-- | lib/Driver/Makefile | 4 | ||||
-rw-r--r-- | lib/Driver/ToolChains.cpp | 5 | ||||
-rw-r--r-- | lib/Driver/ToolChains.h | 4 |
4 files changed, 14 insertions, 7 deletions
diff --git a/lib/Driver/HostInfo.cpp b/lib/Driver/HostInfo.cpp index 08c4ef4900..22fe11d661 100644 --- a/lib/Driver/HostInfo.cpp +++ b/lib/Driver/HostInfo.cpp @@ -42,7 +42,7 @@ class DarwinHostInfo : public HostInfo { unsigned DarwinVersion[3]; /// GCC version to use on this host. - unsigned GCCVersion[3]; + unsigned GCCVersion[4]; /// Cache of tool chains we have created. mutable llvm::DenseMap<unsigned, ToolChain*> ToolChains; @@ -84,6 +84,12 @@ DarwinHostInfo::DarwinHostInfo(const Driver &D, const llvm::Triple& Triple) GCCVersion[0] = 4; GCCVersion[1] = 2; GCCVersion[2] = 1; + // And we need to select the OS gcc was configured for, darwin10 +#ifdef OS_MAJOR + GCCVersion[3] = OS_MAJOR; +#else + GCCVersion[3] = 10; +#endif } DarwinHostInfo::~DarwinHostInfo() { diff --git a/lib/Driver/Makefile b/lib/Driver/Makefile index 6a31e5fb88..ef7bc60aeb 100644 --- a/lib/Driver/Makefile +++ b/lib/Driver/Makefile @@ -11,10 +11,10 @@ LEVEL = ../../../.. LIBRARYNAME := clangDriver BUILD_ARCHIVE = 1 CXXFLAGS = -fno-rtti - +OS_MAJOR := -DOS_MAJOR=$(shell uname -r | sed 's/\..*//') # Don't install Clang libraries NO_INSTALL = 1 -CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include +CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include $(OS_MAJOR) include $(LEVEL)/Makefile.common diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index a5a48adcf0..443ce80ae8 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -46,17 +46,18 @@ Darwin::Darwin(const HostInfo &Host, const llvm::Triple& Triple, DarwinGCC::DarwinGCC(const HostInfo &Host, const llvm::Triple& Triple, const unsigned (&DarwinVersion)[3], - const unsigned (&_GCCVersion)[3], bool IsIPhoneOS) + const unsigned (&_GCCVersion)[4], bool IsIPhoneOS) : Darwin(Host, Triple, DarwinVersion, IsIPhoneOS) { GCCVersion[0] = _GCCVersion[0]; GCCVersion[1] = _GCCVersion[1]; GCCVersion[2] = _GCCVersion[2]; + GCCVersion[3] = _GCCVersion[3]; // Set up the tool chain paths to match gcc. ToolChainDir = "i686-apple-darwin"; - ToolChainDir += llvm::utostr(DarwinVersion[0]); + ToolChainDir += llvm::utostr(GCCVersion[3]); ToolChainDir += "/"; ToolChainDir += llvm::utostr(GCCVersion[0]); ToolChainDir += '.'; diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 6088d9617c..5934be4788 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -165,14 +165,14 @@ public: /// DarwinGCC - The Darwin toolchain used by GCC. class VISIBILITY_HIDDEN DarwinGCC : public Darwin { /// GCC version to use. - unsigned GCCVersion[3]; + unsigned GCCVersion[4]; /// The directory suffix for this tool chain. std::string ToolChainDir; public: DarwinGCC(const HostInfo &Host, const llvm::Triple& Triple, - const unsigned (&DarwinVersion)[3], const unsigned (&GCCVersion)[3], + const unsigned (&DarwinVersion)[3], const unsigned (&GCCVersion)[4], bool IsIPhoneOS); /// @name Darwin ToolChain Implementation |