diff options
author | brooks <brooks@FreeBSD.org> | 2012-08-24 05:04:16 +0800 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2012-08-24 05:04:16 +0800 |
commit | 705f6e2be770a0c46ef255b2bde6b6a4b5378e4c (patch) | |
tree | 7df2d78dd5cce11b656c34c4f47edf838f4c4a0a /lang | |
parent | 5fe63ebf83f1dc599d7ec3fb1b45542eb181ee02 (diff) | |
download | freebsd-ports-graphics-705f6e2be770a0c46ef255b2bde6b6a4b5378e4c.tar.gz freebsd-ports-graphics-705f6e2be770a0c46ef255b2bde6b6a4b5378e4c.tar.zst freebsd-ports-graphics-705f6e2be770a0c46ef255b2bde6b6a4b5378e4c.zip |
Update LLVM and Clang to r162438 plus a couple patchs to make it possible
to target MIPS with FreeBSD's base binutils.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/clang-devel/Makefile | 9 | ||||
-rw-r--r-- | lang/clang-devel/distinfo | 8 | ||||
-rw-r--r-- | lang/clang-devel/files/mips-long-double-hack.diff | 15 | ||||
-rw-r--r-- | lang/clang-devel/files/patch-tools_clang_lib_Driver_Tools.cpp | 62 | ||||
-rw-r--r-- | lang/clang-devel/files/patch-tools_clang_lib_Sema_SemaChecking.cpp | 6 | ||||
-rw-r--r-- | lang/clang-devel/pkg-plist | 12 |
6 files changed, 97 insertions, 15 deletions
diff --git a/lang/clang-devel/Makefile b/lang/clang-devel/Makefile index ab578943400..a23a5be7565 100644 --- a/lang/clang-devel/Makefile +++ b/lang/clang-devel/Makefile @@ -7,7 +7,6 @@ PORTNAME= clang PORTVERSION= 3.2.r${SVN_REV} -PORTREVISION= 2 CATEGORIES= lang devel MASTER_SITES= ${MASTER_SITE_LOCAL} MASTER_SITE_SUBDIR= brooks @@ -54,9 +53,10 @@ MAKE_ARGS= CLANG_TBLGEN=${WRKSRC}/${RELTYPE}/bin/clang-tblgen \ LLVMToolDir=${LOCALBASE}/bin \ LLVMLibDir=${LOCALBASE}/lib -OPTIONS_DEFINE= ASSERTS DOCS +OPTIONS_DEFINE= ASSERTS DOCS MIPS_FPHACK ASSERTS_DESC= Enable assertions (thread unsafe) +MIPS_FPHACK_DESC= MIPS long double hack (breaks ABI) MAN1= clang.1 @@ -84,6 +84,10 @@ CONFIGURE_ARGS+= --disable-assertions RELTYPE= Release .endif +.if ${PORT_OPTIONS:MMIPS_FPHACK} +EXTRA_PATCHES= ${FILESDIR}/mips-long-double-hack.diff +.endif + .include <bsd.port.pre.mk> .include "${.CURDIR}/../../devel/llvm-devel/Makefile.svn_rev" @@ -170,7 +174,6 @@ PLIST_FILE_LIST= bin/ccc-analyzer \ bin/clang \ bin/clang++ \ bin/clang-tblgen \ - bin/c-index-test \ bin/scan-build \ bin/scan-view \ lib/libclang* diff --git a/lang/clang-devel/distinfo b/lang/clang-devel/distinfo index f4e65a4f516..f88af1eda5b 100644 --- a/lang/clang-devel/distinfo +++ b/lang/clang-devel/distinfo @@ -1,4 +1,4 @@ -SHA256 (clang-3.2.r160283.tar.bz2) = 953054836d50c2621e8e3268f8348c787e1b4f37377cb7808cd985e5e1be09dd -SIZE (clang-3.2.r160283.tar.bz2) = 7027147 -SHA256 (llvm-3.2.r160283.tar.bz2) = 3dfae804e7765bfacfb4347ada59e174fa9f4a272ee86b17ae6882e5f3e56ca7 -SIZE (llvm-3.2.r160283.tar.bz2) = 8961712 +SHA256 (clang-3.2.r162438.tar.bz2) = 477e78674c428218ddd717e3faa798daf040ba43e26c538ef0f733dab1d4fbe1 +SIZE (clang-3.2.r162438.tar.bz2) = 7193019 +SHA256 (llvm-3.2.r162438.tar.bz2) = 6e5bd1121b6af1e89ace5f799febeec8278fa2e24fce6f69f5d840a42ac75617 +SIZE (llvm-3.2.r162438.tar.bz2) = 8851337 diff --git a/lang/clang-devel/files/mips-long-double-hack.diff b/lang/clang-devel/files/mips-long-double-hack.diff new file mode 100644 index 00000000000..dbc45f6f85e --- /dev/null +++ b/lang/clang-devel/files/mips-long-double-hack.diff @@ -0,0 +1,15 @@ + +$FreeBSD$ + +--- tools/clang/lib/Basic/Targets.cpp.orig ++++ tools/clang/lib/Basic/Targets.cpp +@@ -3957,6 +3957,9 @@ + PointerWidth = PointerAlign = 64; + LongDoubleWidth = LongDoubleAlign = 128; + LongDoubleFormat = &llvm::APFloat::IEEEquad; ++ // FIXME: Ugly ABI-Breaking hack until the back end supports 128-bit floats ++ LongDoubleWidth = LongDoubleAlign = 64; ++ LongDoubleFormat = &llvm::APFloat::IEEEdouble; + SuitableAlign = 128; + } + virtual bool setABI(const std::string &Name) { diff --git a/lang/clang-devel/files/patch-tools_clang_lib_Driver_Tools.cpp b/lang/clang-devel/files/patch-tools_clang_lib_Driver_Tools.cpp new file mode 100644 index 00000000000..d00e291a037 --- /dev/null +++ b/lang/clang-devel/files/patch-tools_clang_lib_Driver_Tools.cpp @@ -0,0 +1,62 @@ + +$FreeBSD$ + +--- tools/clang/lib/Driver/Tools.cpp.orig ++++ tools/clang/lib/Driver/Tools.cpp +@@ -5119,17 +5119,48 @@ + + // When building 32-bit code on FreeBSD/amd64, we have to explicitly + // instruct as in the base system to assemble 32-bit code. +- if (getToolChain().getArchName() == "i386") ++ if (getToolChain().getArch() == llvm::Triple::x86) + CmdArgs.push_back("--32"); +- +- if (getToolChain().getArchName() == "powerpc") ++ else if (getToolChain().getArch() == llvm::Triple::ppc) + CmdArgs.push_back("-a32"); ++ else if (getToolChain().getArch() == llvm::Triple::mips || ++ getToolChain().getArch() == llvm::Triple::mipsel || ++ getToolChain().getArch() == llvm::Triple::mips64 || ++ getToolChain().getArch() == llvm::Triple::mips64el) { ++ StringRef CPUName; ++ StringRef ABIName; ++ getMipsCPUAndABI(Args, getToolChain(), CPUName, ABIName); + +- // Set byte order explicitly +- if (getToolChain().getArchName() == "mips") +- CmdArgs.push_back("-EB"); +- else if (getToolChain().getArchName() == "mipsel") +- CmdArgs.push_back("-EL"); ++ CmdArgs.push_back("-march"); ++ CmdArgs.push_back(CPUName.data()); ++ ++ // Convert ABI name to the GNU tools acceptable variant. ++ if (ABIName == "o32") ++ ABIName = "32"; ++ else if (ABIName == "n64") ++ ABIName = "64"; ++ ++ CmdArgs.push_back("-mabi"); ++ CmdArgs.push_back(ABIName.data()); ++ ++ if (getToolChain().getArch() == llvm::Triple::mips || ++ getToolChain().getArch() == llvm::Triple::mips64) ++ CmdArgs.push_back("-EB"); ++ else ++ CmdArgs.push_back("-EL"); ++ ++ Arg *LastPICArg = Args.getLastArg(options::OPT_fPIC, options::OPT_fno_PIC, ++ options::OPT_fpic, options::OPT_fno_pic, ++ options::OPT_fPIE, options::OPT_fno_PIE, ++ options::OPT_fpie, options::OPT_fno_pie); ++ if (LastPICArg && ++ (LastPICArg->getOption().matches(options::OPT_fPIC) || ++ LastPICArg->getOption().matches(options::OPT_fpic) || ++ LastPICArg->getOption().matches(options::OPT_fPIE) || ++ LastPICArg->getOption().matches(options::OPT_fpie))) { ++ CmdArgs.push_back("-KPIC"); ++ } ++ } + + Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, + options::OPT_Xassembler); diff --git a/lang/clang-devel/files/patch-tools_clang_lib_Sema_SemaChecking.cpp b/lang/clang-devel/files/patch-tools_clang_lib_Sema_SemaChecking.cpp index db618b150ef..bad27d61059 100644 --- a/lang/clang-devel/files/patch-tools_clang_lib_Sema_SemaChecking.cpp +++ b/lang/clang-devel/files/patch-tools_clang_lib_Sema_SemaChecking.cpp @@ -16,8 +16,8 @@ $FreeBSD: /tmp/pcvs/ports/lang/clang-devel/files/patch-tools_clang_lib_Sema_Sema + // format specifier. + const Expr *Ex = getDataArg(argIndex); + QualType type = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(S.Context.UnsignedCharTy); -+ //const analyze_printf::ArgTypeResult &ATR = S.Context.IntTy; -+ const analyze_printf::ArgTypeResult &ATR = type; ++ //const analyze_printf::ArgType &ATR = S.Context.IntTy; ++ const analyze_printf::ArgType &ATR = type; + if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType())) + S.Diag(getLocationOfByte(CS.getStart()), + diag::warn_printf_conversion_argument_type_mismatch) @@ -28,7 +28,7 @@ $FreeBSD: /tmp/pcvs/ports/lang/clang-devel/files/patch-tools_clang_lib_Sema_Sema + // Now type check the data expression that matches the + // format specifier. + Ex = getDataArg(argIndex + 1); -+ const analyze_printf::ArgTypeResult &ATR2 = ArgTypeResult::CStrTy; ++ const analyze_printf::ArgType &ATR2 = ArgType::CStrTy; + if (ATR2.isValid() && !ATR2.matchesType(S.Context, Ex->getType())) + S.Diag(getLocationOfByte(CS.getStart()), + diag::warn_printf_conversion_argument_type_mismatch) diff --git a/lang/clang-devel/pkg-plist b/lang/clang-devel/pkg-plist index 0ac880cfbdd..83c71f4eca9 100644 --- a/lang/clang-devel/pkg-plist +++ b/lang/clang-devel/pkg-plist @@ -1,5 +1,4 @@ bin/c++-analyzer -bin/c-index-test bin/ccc-analyzer bin/clang bin/clang++ @@ -31,6 +30,7 @@ include/clang/AST/CanonicalType.h include/clang/AST/CharUnits.h include/clang/AST/Comment.h include/clang/AST/CommentBriefParser.h +include/clang/AST/CommentCommandTraits.h include/clang/AST/CommentDiagnostic.h include/clang/AST/CommentLexer.h include/clang/AST/CommentNodes.inc @@ -92,7 +92,6 @@ include/clang/ASTMatchers/ASTMatchFinder.h include/clang/ASTMatchers/ASTMatchers.h include/clang/ASTMatchers/ASTMatchersInternal.h include/clang/ASTMatchers/ASTMatchersMacros.h -include/clang/ASTMatchers/RefactoringCallbacks.h include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h include/clang/Analysis/Analyses/Dominators.h include/clang/Analysis/Analyses/FormatString.h @@ -327,7 +326,6 @@ include/clang/Serialization/ModuleManager.h include/clang/Serialization/SerializationDiagnostic.h include/clang/StaticAnalyzer/Checkers/ClangCheckers.h include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h -include/clang/StaticAnalyzer/Checkers/DereferenceChecker.h include/clang/StaticAnalyzer/Checkers/LocalCheckers.h include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h @@ -342,7 +340,7 @@ include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h -include/clang/StaticAnalyzer/Core/PathSensitive/Calls.h +include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h @@ -368,9 +366,10 @@ include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h include/clang/StaticAnalyzer/Frontend/FrontendActions.h include/clang/Tooling/ArgumentsAdjusters.h -include/clang/Tooling/CommandLineClangTool.h +include/clang/Tooling/CommonOptionsParser.h include/clang/Tooling/CompilationDatabase.h include/clang/Tooling/Refactoring.h +include/clang/Tooling/RefactoringCallbacks.h include/clang/Tooling/Tooling.h lib/clang/%%CLANG_RELEASE%%/include/ammintrin.h lib/clang/%%CLANG_RELEASE%%/include/arm_neon.h @@ -414,11 +413,14 @@ lib/libclangTooling.a %%PORTDOCS%%%%DOCSDIR%%/html/AnalyzerRegions.html %%PORTDOCS%%%%DOCSDIR%%/html/AutomaticReferenceCounting.html %%PORTDOCS%%%%DOCSDIR%%/html/ClangPlugins.html +%%PORTDOCS%%%%DOCSDIR%%/html/ClangTools.html %%PORTDOCS%%%%DOCSDIR%%/html/DriverInternals.html %%PORTDOCS%%%%DOCSDIR%%/html/HowToSetupToolingForLLVM.html %%PORTDOCS%%%%DOCSDIR%%/html/InternalsManual.html +%%PORTDOCS%%%%DOCSDIR%%/html/IntroductionToTheClangAST.html %%PORTDOCS%%%%DOCSDIR%%/html/JSONCompilationDatabase.html %%PORTDOCS%%%%DOCSDIR%%/html/LanguageExtensions.html +%%PORTDOCS%%%%DOCSDIR%%/html/LibASTMatchersReference.html %%PORTDOCS%%%%DOCSDIR%%/html/LibTooling.html %%PORTDOCS%%%%DOCSDIR%%/html/ObjectiveCLiterals.html %%PORTDOCS%%%%DOCSDIR%%/html/PCHInternals.html |