clang-3.0
This required moving to the cmake build for llvm in order to build clang separately from llvm. svn path=/nixpkgs/trunk/; revision=30956
This commit is contained in:
parent
8116b29c33
commit
006d8dcdc1
|
@ -1,39 +1,49 @@
|
|||
diff -ru -x '*~' a/tools/clang/lib/Frontend/InitHeaderSearch.cpp b/tools/clang/lib/Frontend/InitHeaderSearch.cpp
|
||||
--- a/tools/clang/lib/Frontend/InitHeaderSearch.cpp 2011-03-21 20:24:04.000000000 -0400
|
||||
+++ b/tools/clang/lib/Frontend/InitHeaderSearch.cpp 2011-10-18 12:09:50.624355551 -0400
|
||||
@@ -438,6 +438,7 @@
|
||||
|
||||
void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
|
||||
const HeaderSearchOptions &HSOpts) {
|
||||
+#if 0
|
||||
llvm::Triple::OSType os = triple.getOS();
|
||||
|
||||
switch (os) {
|
||||
@@ -559,6 +560,8 @@
|
||||
}
|
||||
|
||||
AddPath("/usr/include", System, false, false, false);
|
||||
+#endif
|
||||
+ AddPath(C_INCLUDE_PATH, System, false, false, false);
|
||||
}
|
||||
|
||||
void InitHeaderSearch::
|
||||
@@ -577,6 +580,7 @@
|
||||
triple);
|
||||
diff -Naur clang-3.0.src-orig/lib/Driver/ToolChains.cpp clang-3.0.src/lib/Driver/ToolChains.cpp
|
||||
--- clang-3.0.src-orig/lib/Driver/ToolChains.cpp 2011-11-17 02:40:32.000000000 -0500
|
||||
+++ clang-3.0.src/lib/Driver/ToolChains.cpp 2011-12-19 06:29:27.562428830 -0500
|
||||
@@ -1926,14 +1926,17 @@
|
||||
if (DriverArgs.hasArg(options::OPT_nostdinc))
|
||||
return;
|
||||
}
|
||||
+#if 0
|
||||
// FIXME: temporary hack: hard-coded paths.
|
||||
switch (os) {
|
||||
case llvm::Triple::Cygwin:
|
||||
@@ -847,6 +851,10 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
|
||||
addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
|
||||
|
||||
+#endif
|
||||
+ AddGnuCPlusPlusIncludePaths(
|
||||
+ CPP_INCLUDE_PATH,
|
||||
+ CPP_HOST, "", "", triple);
|
||||
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
|
||||
llvm::sys::Path P(D.ResourceDir);
|
||||
P.appendComponent("include");
|
||||
addSystemInclude(DriverArgs, CC1Args, P.str());
|
||||
}
|
||||
+#if 0
|
||||
|
||||
if (DriverArgs.hasArg(options::OPT_nostdlibinc))
|
||||
return;
|
||||
@@ -1998,6 +2001,8 @@
|
||||
return;
|
||||
|
||||
addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
|
||||
+#endif
|
||||
+ addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + C_INCLUDE_PATH);
|
||||
}
|
||||
|
||||
void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang,
|
||||
static bool addLibStdCXXIncludePaths(Twine Base, Twine TargetArchDir,
|
||||
@@ -2030,6 +2035,7 @@
|
||||
bool IsTarget64Bit = (TargetArch == llvm::Triple::x86_64 ||
|
||||
TargetArch == llvm::Triple::ppc64);
|
||||
|
||||
+#if 0
|
||||
StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT);
|
||||
if (!CxxIncludeRoot.empty()) {
|
||||
StringRef CxxIncludeArch(CXX_INCLUDE_ARCH);
|
||||
@@ -2072,6 +2078,10 @@
|
||||
GCCInstallation.getTriple() + Suffix,
|
||||
DriverArgs, CC1Args);
|
||||
}
|
||||
+#endif
|
||||
+ addLibStdCXXIncludePaths(CPP_INCLUDE_PATH,
|
||||
+ CPP_HOST,
|
||||
+ DriverArgs, CC1Args);
|
||||
}
|
||||
|
||||
/// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.
|
||||
|
|
|
@ -1,33 +1,26 @@
|
|||
diff -Naur a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
|
||||
--- a/tools/clang/lib/Driver/ToolChains.cpp 2011-03-21 17:29:27.000000000 -0400
|
||||
+++ b/tools/clang/lib/Driver/ToolChains.cpp 2011-10-18 19:43:48.999590771 -0400
|
||||
@@ -1482,12 +1482,9 @@
|
||||
Lib = Lib64;
|
||||
}
|
||||
diff -Naur clang-3.0.src-orig/lib/Driver/ToolChains.cpp clang-3.0.src/lib/Driver/ToolChains.cpp
|
||||
--- clang-3.0.src-orig/lib/Driver/ToolChains.cpp 2011-11-17 02:40:32.000000000 -0500
|
||||
+++ clang-3.0.src/lib/Driver/ToolChains.cpp 2011-12-19 05:32:38.695513475 -0500
|
||||
@@ -1800,6 +1800,7 @@
|
||||
|
||||
- llvm::sys::Path LinkerPath(Base + "/../../../../" + GccTriple + "/bin/ld");
|
||||
- if (!llvm::sys::fs::exists(LinkerPath.str(), Exists) && Exists)
|
||||
- Linker = LinkerPath.str();
|
||||
- else
|
||||
- Linker = GetProgramPath("ld");
|
||||
+ Linker = GetProgramPath("ld");
|
||||
Linker = GetProgramPath("ld");
|
||||
|
||||
+#if 0
|
||||
LinuxDistro Distro = DetectLinuxDistro(Arch);
|
||||
|
||||
if (IsUbuntu(Distro)) {
|
||||
@@ -1531,6 +1528,7 @@
|
||||
Paths.push_back(Base + "/../../..");
|
||||
if (Arch == getArch() && IsUbuntu(Distro))
|
||||
Paths.push_back("/usr/lib/" + GccTriple);
|
||||
if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
|
||||
@@ -1882,6 +1883,7 @@
|
||||
addPathIfExists(SysRoot + "/lib", Paths);
|
||||
addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
|
||||
addPathIfExists(SysRoot + "/usr/lib", Paths);
|
||||
+#endif
|
||||
}
|
||||
|
||||
bool Linux::HasNativeLLVMSupport() const {
|
||||
diff -Naur a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
|
||||
--- a/tools/clang/lib/Driver/Tools.cpp 2011-03-06 18:31:01.000000000 -0500
|
||||
+++ b/tools/clang/lib/Driver/Tools.cpp 2011-10-18 18:44:00.799604267 -0400
|
||||
@@ -3619,6 +3619,7 @@
|
||||
diff -Naur clang-3.0.src-orig/lib/Driver/Tools.cpp clang-3.0.src/lib/Driver/Tools.cpp
|
||||
--- clang-3.0.src-orig/lib/Driver/Tools.cpp 2011-11-07 05:27:39.000000000 -0500
|
||||
+++ clang-3.0.src/lib/Driver/Tools.cpp 2011-12-19 05:34:44.075325534 -0500
|
||||
@@ -4306,6 +4306,7 @@
|
||||
ToolChain.getArch() == llvm::Triple::thumb ||
|
||||
(!Args.hasArg(options::OPT_static) &&
|
||||
!Args.hasArg(options::OPT_shared))) {
|
||||
|
@ -35,8 +28,8 @@ diff -Naur a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
|
|||
CmdArgs.push_back("-dynamic-linker");
|
||||
if (ToolChain.getArch() == llvm::Triple::x86)
|
||||
CmdArgs.push_back("/lib/ld-linux.so.2");
|
||||
@@ -3627,6 +3628,7 @@
|
||||
CmdArgs.push_back("/lib/ld-linux.so.3");
|
||||
@@ -4318,6 +4319,7 @@
|
||||
CmdArgs.push_back("/lib64/ld64.so.1");
|
||||
else
|
||||
CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
|
||||
+#endif
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
diff -Naur llvm-2.9-orig/Makefile.rules llvm-2.9/Makefile.rules
|
||||
--- llvm-2.9-orig/Makefile.rules 2011-03-25 02:26:58.000000000 -0400
|
||||
+++ llvm-2.9/Makefile.rules 2011-10-19 15:31:38.538674143 -0400
|
||||
@@ -941,7 +941,7 @@
|
||||
@echo "*** llvm-config doesn't exist - rebuilding it."
|
||||
@$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
|
||||
|
||||
-$(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
|
||||
+$(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT):
|
||||
|
||||
ifeq ($(ENABLE_SHARED), 1)
|
||||
# We can take the "auto-import" feature to get rid of using dllimport.
|
||||
@@ -1137,7 +1137,7 @@
|
||||
else
|
||||
SharedLibKindMessage := "Shared Library"
|
||||
endif
|
||||
-$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
|
||||
+$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(SharedLibDir)/.dir
|
||||
$(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
|
||||
$(notdir $@)
|
||||
$(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
|
||||
@@ -1411,7 +1411,7 @@
|
||||
$(ToolBuildPath): $(ToolDir)/.dir
|
||||
endif
|
||||
|
||||
-$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
|
||||
+$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths)
|
||||
$(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
|
||||
$(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
|
||||
$(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
|
||||
diff -Naur llvm-2.9-orig/unittests/Makefile.unittest llvm-2.9/unittests/Makefile.unittest
|
||||
--- llvm-2.9-orig/unittests/Makefile.unittest 2011-02-04 12:12:18.000000000 -0500
|
||||
+++ llvm-2.9/unittests/Makefile.unittest 2011-10-19 15:47:27.100035616 -0400
|
||||
@@ -47,7 +47,7 @@
|
||||
Run.Shared := $(SHLIBPATH_VAR)="$(SharedLibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)"
|
||||
endif
|
||||
|
||||
-$(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
|
||||
+$(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths)
|
||||
$(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg)
|
||||
$(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
|
||||
$(TESTLIBS) $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
|
|
@ -1,134 +0,0 @@
|
|||
diff -Naur a/tools/clang/include/clang/AST/Makefile b/tools/clang/include/clang/AST/Makefile
|
||||
--- a/tools/clang/include/clang/AST/Makefile 2010-08-18 19:23:40.000000000 -0400
|
||||
+++ b/tools/clang/include/clang/AST/Makefile 2011-10-19 14:19:21.420750346 -0400
|
||||
@@ -6,24 +6,24 @@
|
||||
|
||||
include $(CLANG_LEVEL)/Makefile
|
||||
|
||||
-$(ObjDir)/Attrs.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
|
||||
+$(ObjDir)/Attrs.inc.tmp : $(TD_SRC_DIR)/Attr.td \
|
||||
$(ObjDir)/.dir
|
||||
$(Echo) "Building Clang attribute classes with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-attr-classes -o $(call SYSPATH, $@) \
|
||||
-I $(PROJ_SRC_DIR)/../../ $<
|
||||
|
||||
-$(ObjDir)/AttrImpl.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
|
||||
+$(ObjDir)/AttrImpl.inc.tmp : $(TD_SRC_DIR)/Attr.td \
|
||||
$(ObjDir)/.dir
|
||||
$(Echo) "Building Clang attribute implementations with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-attr-impl -o $(call SYSPATH, $@) \
|
||||
-I $(PROJ_SRC_DIR)/../../ $<
|
||||
|
||||
-$(ObjDir)/StmtNodes.inc.tmp : $(TD_SRC_DIR)/StmtNodes.td $(TBLGEN) \
|
||||
+$(ObjDir)/StmtNodes.inc.tmp : $(TD_SRC_DIR)/StmtNodes.td \
|
||||
$(ObjDir)/.dir
|
||||
$(Echo) "Building Clang statement node tables with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-stmt-nodes -o $(call SYSPATH, $@) $<
|
||||
|
||||
-$(ObjDir)/DeclNodes.inc.tmp : $(TD_SRC_DIR)/DeclNodes.td $(TBLGEN) \
|
||||
+$(ObjDir)/DeclNodes.inc.tmp : $(TD_SRC_DIR)/DeclNodes.td \
|
||||
$(ObjDir)/.dir
|
||||
$(Echo) "Building Clang declaration node tables with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-decl-nodes -o $(call SYSPATH, $@) $<
|
||||
diff -Naur a/tools/clang/include/clang/Basic/Makefile b/tools/clang/include/clang/Basic/Makefile
|
||||
--- a/tools/clang/include/clang/Basic/Makefile 2010-09-09 16:27:36.000000000 -0400
|
||||
+++ b/tools/clang/include/clang/Basic/Makefile 2011-10-19 14:17:54.950837324 -0400
|
||||
@@ -29,20 +29,20 @@
|
||||
CLANG_HAS_VERSION_PATCHLEVEL := 1
|
||||
endif
|
||||
|
||||
-$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang $(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) diagnostic tables with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $<
|
||||
|
||||
-$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang diagnostic groups with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $<
|
||||
|
||||
-$(ObjDir)/AttrList.inc.tmp : Attr.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/AttrList.inc.tmp : Attr.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang attribute list with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-attr-list -o $(call SYSPATH, $@) \
|
||||
-I $(PROJ_SRC_DIR)/../.. $<
|
||||
|
||||
-$(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang arm_neon.inc with tblgen"
|
||||
$(Verb) $(TableGen) -gen-arm-neon-sema -o $(call SYSPATH, $@) $<
|
||||
|
||||
diff -Naur a/tools/clang/include/clang/Driver/Makefile b/tools/clang/include/clang/Driver/Makefile
|
||||
--- a/tools/clang/include/clang/Driver/Makefile 2010-06-08 16:34:18.000000000 -0400
|
||||
+++ b/tools/clang/include/clang/Driver/Makefile 2011-10-19 14:25:33.739369159 -0400
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
include $(CLANG_LEVEL)/Makefile
|
||||
|
||||
-$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang Driver Option tables with tblgen"
|
||||
$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
|
||||
|
||||
-$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang CC1 Option tables with tblgen"
|
||||
$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
|
||||
|
||||
-$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang CC1 Assembler Option tables with tblgen"
|
||||
$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
|
||||
diff -Naur a/tools/clang/include/clang/Lex/Makefile b/tools/clang/include/clang/Lex/Makefile
|
||||
--- a/tools/clang/include/clang/Lex/Makefile 2010-10-19 22:31:43.000000000 -0400
|
||||
+++ b/tools/clang/include/clang/Lex/Makefile 2011-10-19 14:18:25.082807086 -0400
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
include $(CLANG_LEVEL)/Makefile
|
||||
|
||||
-$(ObjDir)/AttrSpellings.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
|
||||
+$(ObjDir)/AttrSpellings.inc.tmp : $(TD_SRC_DIR)/Attr.td \
|
||||
$(ObjDir)/.dir
|
||||
$(Echo) "Building Clang attribute spellings with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-attr-spelling-list -o $(call SYSPATH, $@) \
|
||||
diff -Naur a/tools/clang/include/clang/Serialization/Makefile b/tools/clang/include/clang/Serialization/Makefile
|
||||
--- a/tools/clang/include/clang/Serialization/Makefile 2010-08-18 19:23:40.000000000 -0400
|
||||
+++ b/tools/clang/include/clang/Serialization/Makefile 2011-10-19 14:25:05.764398164 -0400
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
include $(CLANG_LEVEL)/Makefile
|
||||
|
||||
-$(ObjDir)/AttrPCHRead.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
|
||||
+$(ObjDir)/AttrPCHRead.inc.tmp : $(TD_SRC_DIR)/Attr.td \
|
||||
$(ObjDir)/.dir
|
||||
$(Echo) "Building Clang PCH reader with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-attr-pch-read -o $(call SYSPATH, $@) \
|
||||
-I $(PROJ_SRC_DIR)/../../ $<
|
||||
|
||||
-$(ObjDir)/AttrPCHWrite.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \
|
||||
+$(ObjDir)/AttrPCHWrite.inc.tmp : $(TD_SRC_DIR)/Attr.td \
|
||||
$(ObjDir)/.dir
|
||||
$(Echo) "Building Clang PCH writer with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-attr-pch-write -o $(call SYSPATH, $@) \
|
||||
diff -Naur a/tools/clang/lib/Headers/Makefile b/tools/clang/lib/Headers/Makefile
|
||||
--- a/tools/clang/lib/Headers/Makefile 2010-07-21 21:19:36.000000000 -0400
|
||||
+++ b/tools/clang/lib/Headers/Makefile 2011-10-19 14:15:18.520993127 -0400
|
||||
@@ -49,6 +49,6 @@
|
||||
|
||||
install-local:: $(INSTHEADERS)
|
||||
|
||||
-$(ObjDir)/arm_neon.h.inc.tmp : $(CLANG_LEVEL)/include/clang/Basic/arm_neon.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/arm_neon.h.inc.tmp : $(CLANG_LEVEL)/include/clang/Basic/arm_neon.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang arm_neon.h.inc with tblgen"
|
||||
$(Verb) $(TableGen) -gen-arm-neon -o $(call SYSPATH, $@) $<
|
||||
diff -Naur a/tools/clang/lib/StaticAnalyzer/Checkers/Makefile b/tools/clang/lib/StaticAnalyzer/Checkers/Makefile
|
||||
--- a/tools/clang/lib/StaticAnalyzer/Checkers/Makefile 2011-02-15 02:42:38.000000000 -0500
|
||||
+++ b/tools/clang/lib/StaticAnalyzer/Checkers/Makefile 2011-10-19 14:15:58.240953760 -0400
|
||||
@@ -19,6 +19,6 @@
|
||||
|
||||
include $(CLANG_LEVEL)/Makefile
|
||||
|
||||
-$(ObjDir)/Checkers.inc.tmp : Checkers.td $(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td $(TBLGEN) $(ObjDir)/.dir
|
||||
+$(ObjDir)/Checkers.inc.tmp : Checkers.td $(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td $(ObjDir)/.dir
|
||||
$(Echo) "Building Clang SA Checkers tables with tblgen"
|
||||
$(Verb) $(TableGen) -gen-clang-sa-checkers -I $(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -o $(call SYSPATH, $@) $<
|
|
@ -1,51 +1,31 @@
|
|||
{ stdenv, fetchurl, perl, groff, llvm }:
|
||||
{ stdenv, fetchurl, perl, groff, llvm, cmake }:
|
||||
|
||||
assert stdenv.isLinux && stdenv.gcc.gcc != null;
|
||||
|
||||
let version = "2.9"; in
|
||||
let version = "3.0"; in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "clang-${version}";
|
||||
|
||||
src = llvm.src;
|
||||
buildInputs = [ perl llvm groff cmake ];
|
||||
|
||||
buildInputs = [ perl llvm groff ];
|
||||
patches = stdenv.lib.optionals stdenv.isLinux
|
||||
[ ./clang-include-paths.patch ./clang-ld-flags.patch ];
|
||||
|
||||
configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" ]
|
||||
++ stdenv.lib.optionals (stdenv.gcc ? clang) [
|
||||
"--with-built-clang=yes"
|
||||
"CXX=clang++"
|
||||
];
|
||||
|
||||
srcClang = fetchurl {
|
||||
url = "http://llvm.org/releases/${version}/clang-${version}.tgz";
|
||||
sha256 = "1pq9g7qxw761dp6gx3amx39kl9p4zhlymmn8gfmcnw9ag0zizi3h";
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
pushd tools
|
||||
unpackFile $srcClang
|
||||
mv clang-${version} clang
|
||||
popd
|
||||
find
|
||||
'';
|
||||
|
||||
patches = [ ./clang-include-paths.patch ./clang-ld-flags.patch ./clang-tblgen.patch ./clang-system-llvm-libs.patch ];
|
||||
|
||||
buildFlags = [ "TableGen=tblgen" "LLVM_CONFIG=llvm-config" ];
|
||||
|
||||
preBuild = ''
|
||||
postPatch = stdenv.lib.optionalString stdenv.isLinux ''
|
||||
sed -i -e 's,C_INCLUDE_PATH,"${stdenv.gcc.libc}/include/",' \
|
||||
-e 's,CPP_HOST,"'$(${stdenv.gcc.gcc}/bin/gcc -dumpmachine)'",' \
|
||||
-e 's,CPP_HOST,"'$(${stdenv.gcc}/bin/cc -dumpmachine)'",' \
|
||||
-e 's,CPP_INCLUDE_PATH,"${stdenv.gcc.gcc}/include/c++/${stdenv.gcc.gcc.version}",' \
|
||||
tools/clang/lib/Frontend/InitHeaderSearch.cpp
|
||||
|
||||
pushd utils/unittest
|
||||
make
|
||||
popd
|
||||
cd tools/clang
|
||||
lib/Driver/ToolChains.cpp
|
||||
'';
|
||||
|
||||
cmakeFlags = [ "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}" "-DCMAKE_BUILD_TYPE=Release" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://llvm.org/releases/${version}/clang-${version}.tar.gz";
|
||||
sha256 = "0v8j9rgmb7w74ihc44zfxa22q17c946n5b6prwl38z3d6pd74kmn";
|
||||
};
|
||||
|
||||
passthru = { gcc = stdenv.gcc.gcc; };
|
||||
|
||||
meta = {
|
||||
|
@ -53,6 +33,7 @@ stdenv.mkDerivation {
|
|||
description = "A C language family frontend for LLVM";
|
||||
license = "BSD";
|
||||
maintainers = with stdenv.lib.maintainers; [viric shlevy];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
platforms = with stdenv.lib.platforms; all;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchurl, perl, groff, darwinSwVersUtility }:
|
||||
{ stdenv, fetchurl, perl, groff, darwinSwVersUtility, cmake }:
|
||||
|
||||
let version = "3.0"; in
|
||||
|
||||
|
@ -10,14 +10,10 @@ stdenv.mkDerivation {
|
|||
sha256 = "0xq4gi7lflv8ilfckslhfvnja5693xjii1yvzz39kklr6hfv37ji";
|
||||
};
|
||||
|
||||
buildInputs = [ perl groff ] ++
|
||||
buildInputs = [ perl groff cmake ] ++
|
||||
stdenv.lib.optional stdenv.isDarwin darwinSwVersUtility;
|
||||
|
||||
configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" ]
|
||||
++ stdenv.lib.optionals (stdenv.gcc ? clang) [
|
||||
"--with-built-clang=yes"
|
||||
"CXX=clang++"
|
||||
];
|
||||
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
|
|
|
@ -1665,7 +1665,11 @@ let
|
|||
|
||||
ccl = builderDefsPackage ../development/compilers/ccl {};
|
||||
|
||||
clangBootUnwrapped = callPackage ../development/compilers/llvm/clang.nix { };
|
||||
clangBootUnwrapped = callPackage ../development/compilers/llvm/clang.nix {
|
||||
# There is a bug in gcc-4.5 that prevents building a release build of
|
||||
# clang-3.0
|
||||
stdenv = stdenvAdapters.overrideGCC stdenv gcc46;
|
||||
};
|
||||
|
||||
clangBoot = wrapClang clangBootUnwrapped;
|
||||
|
||||
|
|
Loading…
Reference in New Issue