summaryrefslogtreecommitdiff
path: root/lang/clang
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2018-12-09 20:04:38 +0000
committeradam <adam@pkgsrc.org>2018-12-09 20:04:38 +0000
commitc859e7b19dcd558c211972c47c585a4ef506a382 (patch)
treef09be1286874d3087abd9a0a3fa3a325eac17b34 /lang/clang
parentefb1fd4565223c20630b5ebe741a1315bda7dd9e (diff)
downloadpkgsrc-c859e7b19dcd558c211972c47c585a4ef506a382.tar.gz
llvm: updated to 7.0.0
LLVM 7.0.0 Release The release contains the work on trunk up to SVN revision 338536 plus work on the release branch. It is the result of the community's work over the past six months, including: function multiversioning in Clang with the 'target' attribute for ELF-based x86/x86_64 targets, improved PCH support in clang-cl, preliminary DWARF v5 support, basic support for OpenMP 4.5 offloading to NVPTX, OpenCL C++ support, MSan, X-Ray and libFuzzer support for FreeBSD, early UBSan, X-Ray and libFuzzer support for OpenBSD, UBSan checks for implicit conversions, many long-tail compatibility issues fixed in lld which is now production ready for ELF, COFF and MinGW, new tools llvm-exegesis, llvm-mca and diagtool. And as usual, many optimizations, improved diagnostics, and bug fixes. For more details, see the release notes: https://llvm.org/releases/7.0.0/docs/ReleaseNotes.html https://llvm.org/releases/7.0.0/tools/clang/docs/ReleaseNotes.html https://llvm.org/releases/7.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html https://llvm.org/releases/7.0.0/tools/lld/docs/ReleaseNotes.html
Diffstat (limited to 'lang/clang')
-rw-r--r--lang/clang/Makefile3
-rw-r--r--lang/clang/Makefile.common7
-rw-r--r--lang/clang/PLIST45
-rw-r--r--lang/clang/buildlink3.mk4
-rw-r--r--lang/clang/distinfo18
-rw-r--r--lang/clang/patches/patch-lib_Basic_Targets_OSTargets.h19
-rw-r--r--lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp120
-rw-r--r--lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.h18
-rw-r--r--lang/clang/patches/patch-lib_Frontend_InitHeaderSearch.cpp8
9 files changed, 120 insertions, 122 deletions
diff --git a/lang/clang/Makefile b/lang/clang/Makefile
index 9e927b8baeb..c51df51876e 100644
--- a/lang/clang/Makefile
+++ b/lang/clang/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.45 2018/10/24 21:12:59 maya Exp $
+# $NetBSD: Makefile,v 1.46 2018/12/09 20:04:38 adam Exp $
PKGNAME= ${DISTNAME:S/.src//:S/cfe/clang/}
-PKGREVISION= 1
PYTHON_FOR_BUILD_ONLY= yes
CMAKE_ARGS+= -DCLANG_ENABLE_STATIC_ANALYZER=OFF
diff --git a/lang/clang/Makefile.common b/lang/clang/Makefile.common
index 0cdba109227..2f6b255d673 100644
--- a/lang/clang/Makefile.common
+++ b/lang/clang/Makefile.common
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile.common,v 1.28 2018/08/09 14:56:41 jperkin Exp $
+# $NetBSD: Makefile.common,v 1.29 2018/12/09 20:04:38 adam Exp $
# used by lang/clang/Makefile
# used by lang/clang-static-analyzer/Makefile
-DISTNAME= cfe-6.0.1.src
+DISTNAME= cfe-7.0.0.src
CATEGORIES= lang devel
MASTER_SITES= http://llvm.org/releases/${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tar.xz
@@ -65,6 +65,7 @@ REPLACE_PYTHON+= utils/analyzer/ubiviz
REPLACE_PYTHON+= utils/check_cfc/check_cfc.py
REPLACE_PYTHON+= utils/check_cfc/obj_diff.py
REPLACE_PYTHON+= utils/check_cfc/test_check_cfc.py
+REPLACE_PYTHON+= utils/hmaptool/hmaptool
REPLACE_PYTHON+= utils/token-delta.py
REPLACE_PYTHON+= www/builtins.py
@@ -129,7 +130,7 @@ CMAKE_ARGS+= -DCLANG_INCLUDE_TESTS=OFF
.endif
post-extract:
- ${RUN} mkdir -p ${WRKDIR}/build
+ ${MKDIR} ${WRKDIR}/build
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
diff --git a/lang/clang/PLIST b/lang/clang/PLIST
index c42da70587d..647fcefcb6b 100644
--- a/lang/clang/PLIST
+++ b/lang/clang/PLIST
@@ -1,8 +1,8 @@
-@comment $NetBSD: PLIST,v 1.24 2018/08/07 10:44:50 adam Exp $
+@comment $NetBSD: PLIST,v 1.25 2018/12/09 20:04:38 adam Exp $
bin/c-index-test
bin/clang
bin/clang++
-bin/clang-6.0
+bin/clang-7
bin/clang-cl
bin/clang-cpp
bin/clang-format
@@ -10,7 +10,9 @@ bin/clang-import-test
bin/clang-offload-bundler
bin/clang-refactor
bin/clang-rename
+bin/diagtool
bin/git-clang-format
+bin/hmaptool
include/clang-c/BuildSystem.h
include/clang-c/CXCompilationDatabase.h
include/clang-c/CXErrorCode.h
@@ -60,6 +62,7 @@ include/clang/AST/CommentNodes.inc
include/clang/AST/CommentParser.h
include/clang/AST/CommentSema.h
include/clang/AST/CommentVisitor.h
+include/clang/AST/ComparisonCategories.h
include/clang/AST/DataCollection.h
include/clang/AST/Decl.h
include/clang/AST/DeclAccessPair.h
@@ -91,11 +94,13 @@ include/clang/AST/Mangle.h
include/clang/AST/MangleNumberingContext.h
include/clang/AST/NSAPI.h
include/clang/AST/NestedNameSpecifier.h
+include/clang/AST/NonTrivialTypeVisitor.h
include/clang/AST/ODRHash.h
include/clang/AST/OpenMPClause.h
include/clang/AST/OperationKinds.def
include/clang/AST/OperationKinds.h
include/clang/AST/ParentMap.h
+include/clang/AST/PrettyDeclStackTrace.h
include/clang/AST/PrettyPrinter.h
include/clang/AST/QualTypeNames.h
include/clang/AST/RawCommentList.h
@@ -157,6 +162,7 @@ include/clang/Analysis/CFGStmtMap.h
include/clang/Analysis/CallGraph.h
include/clang/Analysis/CloneDetection.h
include/clang/Analysis/CodeInjector.h
+include/clang/Analysis/ConstructionContext.h
include/clang/Analysis/DomainSpecific/CocoaConventions.h
include/clang/Analysis/DomainSpecific/ObjCNoReturn.h
include/clang/Analysis/FlowSensitive/DataflowValues.h
@@ -172,6 +178,7 @@ include/clang/Basic/AttrList.inc
include/clang/Basic/AttrSubMatchRulesList.inc
include/clang/Basic/AttrSubjectMatchRules.h
include/clang/Basic/Attributes.h
+include/clang/Basic/BitmaskEnum.h
include/clang/Basic/Builtins.def
include/clang/Basic/Builtins.h
include/clang/Basic/BuiltinsAArch64.def
@@ -216,6 +223,7 @@ include/clang/Basic/DiagnosticSemaKinds.inc
include/clang/Basic/DiagnosticSerializationKinds.inc
include/clang/Basic/ExceptionSpecificationType.h
include/clang/Basic/ExpressionTraits.h
+include/clang/Basic/Features.def
include/clang/Basic/FileManager.h
include/clang/Basic/FileSystemOptions.h
include/clang/Basic/FileSystemStatCache.h
@@ -249,6 +257,7 @@ include/clang/Basic/SourceLocation.h
include/clang/Basic/SourceManager.h
include/clang/Basic/SourceManagerInternals.h
include/clang/Basic/Specifiers.h
+include/clang/Basic/Stack.h
include/clang/Basic/SyncScope.h
include/clang/Basic/TargetBuiltins.h
include/clang/Basic/TargetCXXABI.h
@@ -260,11 +269,12 @@ include/clang/Basic/TokenKinds.h
include/clang/Basic/TypeTraits.h
include/clang/Basic/Version.h
include/clang/Basic/Version.inc
-include/clang/Basic/VersionTuple.h
include/clang/Basic/VirtualFileSystem.h
include/clang/Basic/Visibility.h
include/clang/Basic/X86Target.def
+include/clang/Basic/XRayInstr.h
include/clang/Basic/XRayLists.h
+include/clang/Basic/arm_fp16.inc
include/clang/Basic/arm_neon.inc
include/clang/CodeGen/BackendUtil.h
include/clang/CodeGen/CGFunctionInfo.h
@@ -391,7 +401,6 @@ include/clang/Sema/AttrParsedAttrKinds.inc
include/clang/Sema/AttrParsedAttrList.inc
include/clang/Sema/AttrSpellingListIndex.inc
include/clang/Sema/AttrTemplateInstantiate.inc
-include/clang/Sema/AttributeList.h
include/clang/Sema/CXXFieldCollector.h
include/clang/Sema/CleanupInfo.h
include/clang/Sema/CodeCompleteConsumer.h
@@ -408,8 +417,8 @@ include/clang/Sema/MultiplexExternalSemaSource.h
include/clang/Sema/ObjCMethodList.h
include/clang/Sema/Overload.h
include/clang/Sema/Ownership.h
+include/clang/Sema/ParsedAttr.h
include/clang/Sema/ParsedTemplate.h
-include/clang/Sema/PrettyDeclStackTrace.h
include/clang/Sema/Scope.h
include/clang/Sema/ScopeInfo.h
include/clang/Sema/Sema.h
@@ -420,6 +429,7 @@ include/clang/Sema/SemaInternal.h
include/clang/Sema/SemaLambda.h
include/clang/Sema/Template.h
include/clang/Sema/TemplateDeduction.h
+include/clang/Sema/TemplateInstCallback.h
include/clang/Sema/TypoCorrection.h
include/clang/Sema/Weak.h
include/clang/Serialization/ASTBitCodes.h
@@ -474,7 +484,13 @@ include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState_Fwd.h
+include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTContext.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTExpr.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTSolver.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTSort.h
include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
include/clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h
include/clang/StaticAnalyzer/Core/PathSensitive/SVals.def
@@ -496,6 +512,7 @@ include/clang/StaticAnalyzer/Frontend/FrontendActions.h
include/clang/StaticAnalyzer/Frontend/ModelConsumer.h
include/clang/Tooling/ASTDiff/ASTDiff.h
include/clang/Tooling/ASTDiff/ASTDiffInternal.h
+include/clang/Tooling/AllTUsExecution.h
include/clang/Tooling/ArgumentsAdjusters.h
include/clang/Tooling/CommonOptionsParser.h
include/clang/Tooling/CompilationDatabase.h
@@ -507,6 +524,8 @@ include/clang/Tooling/DiagnosticsYaml.h
include/clang/Tooling/Execution.h
include/clang/Tooling/FileMatchTrie.h
include/clang/Tooling/FixIt.h
+include/clang/Tooling/Inclusions/HeaderIncludes.h
+include/clang/Tooling/Inclusions/IncludeStyle.h
include/clang/Tooling/JSONCompilationDatabase.h
include/clang/Tooling/Refactoring.h
include/clang/Tooling/Refactoring/ASTSelection.h
@@ -538,7 +557,9 @@ include/clang/Tooling/Tooling.h
lib/clang/${PKGVERSION}/include/__clang_cuda_builtin_vars.h
lib/clang/${PKGVERSION}/include/__clang_cuda_cmath.h
lib/clang/${PKGVERSION}/include/__clang_cuda_complex_builtins.h
+lib/clang/${PKGVERSION}/include/__clang_cuda_device_functions.h
lib/clang/${PKGVERSION}/include/__clang_cuda_intrinsics.h
+lib/clang/${PKGVERSION}/include/__clang_cuda_libdevice_declares.h
lib/clang/${PKGVERSION}/include/__clang_cuda_math_forward_declares.h
lib/clang/${PKGVERSION}/include/__clang_cuda_runtime_wrapper.h
lib/clang/${PKGVERSION}/include/__stddef_max_align_t.h
@@ -549,6 +570,7 @@ lib/clang/${PKGVERSION}/include/altivec.h
lib/clang/${PKGVERSION}/include/ammintrin.h
lib/clang/${PKGVERSION}/include/arm64intr.h
lib/clang/${PKGVERSION}/include/arm_acle.h
+lib/clang/${PKGVERSION}/include/arm_fp16.h
lib/clang/${PKGVERSION}/include/arm_neon.h
lib/clang/${PKGVERSION}/include/armintr.h
lib/clang/${PKGVERSION}/include/avx2intrin.h
@@ -578,6 +600,7 @@ lib/clang/${PKGVERSION}/include/avxintrin.h
lib/clang/${PKGVERSION}/include/bmi2intrin.h
lib/clang/${PKGVERSION}/include/bmiintrin.h
lib/clang/${PKGVERSION}/include/cetintrin.h
+lib/clang/${PKGVERSION}/include/cldemoteintrin.h
lib/clang/${PKGVERSION}/include/clflushoptintrin.h
lib/clang/${PKGVERSION}/include/clwbintrin.h
lib/clang/${PKGVERSION}/include/clzerointrin.h
@@ -598,6 +621,7 @@ lib/clang/${PKGVERSION}/include/ia32intrin.h
lib/clang/${PKGVERSION}/include/immintrin.h
lib/clang/${PKGVERSION}/include/intrin.h
lib/clang/${PKGVERSION}/include/inttypes.h
+lib/clang/${PKGVERSION}/include/invpcidintrin.h
lib/clang/${PKGVERSION}/include/iso646.h
lib/clang/${PKGVERSION}/include/limits.h
lib/clang/${PKGVERSION}/include/lwpintrin.h
@@ -606,17 +630,21 @@ lib/clang/${PKGVERSION}/include/mm3dnow.h
lib/clang/${PKGVERSION}/include/mm_malloc.h
lib/clang/${PKGVERSION}/include/mmintrin.h
lib/clang/${PKGVERSION}/include/module.modulemap
+lib/clang/${PKGVERSION}/include/movdirintrin.h
lib/clang/${PKGVERSION}/include/msa.h
lib/clang/${PKGVERSION}/include/mwaitxintrin.h
lib/clang/${PKGVERSION}/include/nmmintrin.h
lib/clang/${PKGVERSION}/include/opencl-c.h
+lib/clang/${PKGVERSION}/include/pconfigintrin.h
lib/clang/${PKGVERSION}/include/pkuintrin.h
lib/clang/${PKGVERSION}/include/pmmintrin.h
lib/clang/${PKGVERSION}/include/popcntintrin.h
lib/clang/${PKGVERSION}/include/prfchwintrin.h
+lib/clang/${PKGVERSION}/include/ptwriteintrin.h
lib/clang/${PKGVERSION}/include/rdseedintrin.h
lib/clang/${PKGVERSION}/include/rtmintrin.h
lib/clang/${PKGVERSION}/include/s390intrin.h
+lib/clang/${PKGVERSION}/include/sgxintrin.h
lib/clang/${PKGVERSION}/include/shaintrin.h
lib/clang/${PKGVERSION}/include/smmintrin.h
lib/clang/${PKGVERSION}/include/stdalign.h
@@ -635,6 +663,8 @@ lib/clang/${PKGVERSION}/include/vaesintrin.h
lib/clang/${PKGVERSION}/include/varargs.h
lib/clang/${PKGVERSION}/include/vecintrin.h
lib/clang/${PKGVERSION}/include/vpclmulqdqintrin.h
+lib/clang/${PKGVERSION}/include/waitpkgintrin.h
+lib/clang/${PKGVERSION}/include/wbnoinvdintrin.h
lib/clang/${PKGVERSION}/include/wmmintrin.h
lib/clang/${PKGVERSION}/include/x86intrin.h
lib/clang/${PKGVERSION}/include/xmmintrin.h
@@ -648,8 +678,7 @@ lib/cmake/clang/ClangConfig.cmake
lib/cmake/clang/ClangTargets-release.cmake
lib/cmake/clang/ClangTargets.cmake
lib/libclang.${SOEXT}
-${PLIST.notdylib}lib/libclang.${SOEXT}.${LLVM_MAJOR}
-${PLIST.notdylib}lib/libclang.${SOEXT}.6
+${PLIST.notdylib}lib/libclang.${SOEXT}.7
lib/libclangAST.a
lib/libclangASTMatchers.a
lib/libclangAnalysis.a
@@ -663,6 +692,7 @@ lib/libclangFormat.a
lib/libclangFrontend.a
lib/libclangFrontendTool.a
lib/libclangHandleCXX.a
+lib/libclangHandleLLVM.a
lib/libclangIndex.a
lib/libclangLex.a
lib/libclangParse.a
@@ -673,6 +703,7 @@ lib/libclangSerialization.a
lib/libclangTooling.a
lib/libclangToolingASTDiff.a
lib/libclangToolingCore.a
+lib/libclangToolingInclusions.a
lib/libclangToolingRefactor.a
share/clang/bash-autocomplete.sh
share/clang/clang-format-bbedit.applescript
diff --git a/lang/clang/buildlink3.mk b/lang/clang/buildlink3.mk
index 42ef78844ac..a22c1eec522 100644
--- a/lang/clang/buildlink3.mk
+++ b/lang/clang/buildlink3.mk
@@ -1,11 +1,11 @@
-# $NetBSD: buildlink3.mk,v 1.8 2018/02/07 12:10:21 joerg Exp $
+# $NetBSD: buildlink3.mk,v 1.9 2018/12/09 20:04:38 adam Exp $
BUILDLINK_TREE+= clang
.if !defined(CLANG_BUILDLINK3_MK)
CLANG_BUILDLINK3_MK:=
-BUILDLINK_API_DEPENDS.clang+= clang>=5.0
+BUILDLINK_API_DEPENDS.clang+= clang>=7.0.0
BUILDLINK_PKGSRCDIR.clang?= ../../lang/clang
.include "../../textproc/libxml2/buildlink3.mk"
diff --git a/lang/clang/distinfo b/lang/clang/distinfo
index 64c3528e24f..c3d5b5eed40 100644
--- a/lang/clang/distinfo
+++ b/lang/clang/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.54 2018/10/24 21:12:59 maya Exp $
+$NetBSD: distinfo,v 1.55 2018/12/09 20:04:38 adam Exp $
-SHA1 (cfe-6.0.1.src.tar.xz) = d93d8f3e3d7eb549ac58507383f7fcbdd78804d7
-RMD160 (cfe-6.0.1.src.tar.xz) = c280cd2037b19f9bd733944b765f9ca23b35e0a4
-SHA512 (cfe-6.0.1.src.tar.xz) = f64ba9290059f6e36fee41c8f32bf483609d31c291fcd2f77d41fecfdf3c8233a5e23b93a1c73fed03683823bd6e72757ed993dd32527de3d5f2b7a64bb031b9
-Size (cfe-6.0.1.src.tar.xz) = 11905772 bytes
-SHA1 (patch-lib_Basic_Targets_OSTargets.h) = a8a710720e67c778cf5d4e30e3bb41d9aaf7c9d4
-SHA1 (patch-lib_Driver_ToolChains_Solaris.cpp) = 7cf1d43b50e7a0bf0842f2265b0449b0fea44007
-SHA1 (patch-lib_Driver_ToolChains_Solaris.h) = 13849df72a4b719bbb6109ab1d1abf2e7b97014f
-SHA1 (patch-lib_Frontend_InitHeaderSearch.cpp) = 924cb81bd8e2eb07c3577e25c1b1d4f405e9360f
+SHA1 (cfe-7.0.0.src.tar.xz) = a4eb0b33f6a201e97ac62eb1b519e2476e56c794
+RMD160 (cfe-7.0.0.src.tar.xz) = 10e3071762617f0623ae05500ce6176b625c680c
+SHA512 (cfe-7.0.0.src.tar.xz) = 17a658032a0160c57d4dc23cb45a1516a897e0e2ba4ebff29472e471feca04c5b68cff351cdf231b42aab0cff587b84fe11b921d1ca7194a90e6485913d62cb7
+Size (cfe-7.0.0.src.tar.xz) = 12541904 bytes
+SHA1 (patch-lib_Basic_Targets_OSTargets.h) = 2a00f6de42c67d8c8aca0153339aba1adc455280
+SHA1 (patch-lib_Driver_ToolChains_Solaris.cpp) = 17b6b748135fb051101e926f86910fd3bb55f312
+SHA1 (patch-lib_Driver_ToolChains_Solaris.h) = 07dacb5c341360bdce229f512bdfa95e5d6ef81c
+SHA1 (patch-lib_Frontend_InitHeaderSearch.cpp) = 497ddbe1eac8726d736bed58557a795dce207d1a
diff --git a/lang/clang/patches/patch-lib_Basic_Targets_OSTargets.h b/lang/clang/patches/patch-lib_Basic_Targets_OSTargets.h
index 92da98b7d32..648416f8306 100644
--- a/lang/clang/patches/patch-lib_Basic_Targets_OSTargets.h
+++ b/lang/clang/patches/patch-lib_Basic_Targets_OSTargets.h
@@ -1,12 +1,12 @@
-$NetBSD: patch-lib_Basic_Targets_OSTargets.h,v 1.2 2018/10/24 21:12:59 maya Exp $
+$NetBSD: patch-lib_Basic_Targets_OSTargets.h,v 1.3 2018/12/09 20:04:38 adam Exp $
Sync SunOS default defines with a working reality.
NetBSD __float128, needed to build anything with base libstdc++
which assumes __float128.
---- lib/Basic/Targets/OSTargets.h.orig 2018-01-04 07:43:41.000000000 +0000
+--- lib/Basic/Targets/OSTargets.h.orig 2018-07-23 17:44:00.000000000 +0000
+++ lib/Basic/Targets/OSTargets.h
-@@ -358,12 +358,22 @@ protected:
+@@ -364,12 +364,22 @@ protected:
Builder.defineMacro("__ELF__");
if (Opts.POSIXThreads)
Builder.defineMacro("_REENTRANT");
@@ -17,7 +17,7 @@ which assumes __float128.
public:
NetBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: OSTargetInfo<Target>(Triple, Opts) {
- this->MCountName = "_mcount";
+ this->MCountName = "__mcount";
+ switch (Triple.getArch()) {
+ default:
+ break;
@@ -29,7 +29,7 @@ which assumes __float128.
}
};
-@@ -531,20 +541,16 @@ protected:
+@@ -538,19 +548,14 @@ protected:
Builder.defineMacro("__ELF__");
Builder.defineMacro("__svr4__");
Builder.defineMacro("__SVR4");
@@ -49,13 +49,10 @@ which assumes __float128.
- Builder.defineMacro("_LARGEFILE_SOURCE");
- Builder.defineMacro("_LARGEFILE64_SOURCE");
- Builder.defineMacro("__EXTENSIONS__");
-- Builder.defineMacro("_REENTRANT");
+ Builder.defineMacro("_LARGEFILE_SOURCE");
+ Builder.defineMacro("_LARGEFILE64_SOURCE");
+ Builder.defineMacro("__EXTENSIONS__");
+ }
-+ if (Opts.POSIXThreads)
-+ Builder.defineMacro("_REENTRANT");
- }
-
- public:
+ if (Opts.POSIXThreads)
+ Builder.defineMacro("_REENTRANT");
+ if (this->HasFloat128)
diff --git a/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp b/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp
index e854bcdef59..83feb6155d3 100644
--- a/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp
+++ b/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.cpp
@@ -1,4 +1,4 @@
-$NetBSD: patch-lib_Driver_ToolChains_Solaris.cpp,v 1.1 2018/08/09 14:56:41 jperkin Exp $
+$NetBSD: patch-lib_Driver_ToolChains_Solaris.cpp,v 1.2 2018/12/09 20:04:38 adam Exp $
Use compiler-rt instead of libgcc.
Pull in libcxx correctly.
@@ -7,7 +7,7 @@ Don't specify --dynamic-linker, makes it impossible for the user to use -Wl,-r
Ensure we reset to -zdefaultextract prior to adding compiler-rt.
Test removing -Bdynamic for golang.
---- lib/Driver/ToolChains/Solaris.cpp.orig 2018-01-04 07:43:41.000000000 +0000
+--- lib/Driver/ToolChains/Solaris.cpp.orig 2018-02-06 13:21:12.000000000 +0000
+++ lib/Driver/ToolChains/Solaris.cpp
@@ -49,8 +49,29 @@ void solaris::Linker::ConstructJob(Compi
const InputInfoList &Inputs,
@@ -39,25 +39,21 @@ Test removing -Bdynamic for golang.
// Demangle C++ names in errors
CmdArgs.push_back("-C");
-@@ -62,15 +83,8 @@ void solaris::Linker::ConstructJob(Compi
- if (Args.hasArg(options::OPT_static)) {
+@@ -63,13 +84,8 @@ void solaris::Linker::ConstructJob(Compi
CmdArgs.push_back("-Bstatic");
CmdArgs.push_back("-dn");
-- } else {
+ } else {
- CmdArgs.push_back("-Bdynamic");
-- if (Args.hasArg(options::OPT_shared)) {
-- CmdArgs.push_back("-shared");
+ if (Args.hasArg(options::OPT_shared)) {
+ CmdArgs.push_back("-shared");
- } else {
- CmdArgs.push_back("--dynamic-linker");
- CmdArgs.push_back(
- Args.MakeArgString(getToolChain().GetFilePath("ld.so.1")));
-- }
-+ } else if (Args.hasArg(options::OPT_shared)) {
-+ CmdArgs.push_back("-shared");
- }
+ }
- if (Output.isFilename()) {
-@@ -83,13 +97,11 @@ void solaris::Linker::ConstructJob(Compi
+ // libpthread has been folded into libc since Solaris 10, no need to do
+@@ -88,13 +104,11 @@ void solaris::Linker::ConstructJob(Compi
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
if (!Args.hasArg(options::OPT_shared))
CmdArgs.push_back(
@@ -73,13 +69,20 @@ Test removing -Bdynamic for golang.
+ Args.MakeArgString(SysPath + "values-Xa.o"));
}
- getToolChain().AddFilePathLibArgs(Args, CmdArgs);
-@@ -100,21 +112,21 @@ void solaris::Linker::ConstructJob(Compi
+ // Provide __start___sancov_guards. Solaris ld doesn't automatically create
+@@ -113,21 +127,18 @@ void solaris::Linker::ConstructJob(Compi
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
- if (getToolChain().ShouldLinkCXXStdlib(Args))
- getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
+- if (Args.hasArg(options::OPT_fstack_protector) ||
+- Args.hasArg(options::OPT_fstack_protector_strong) ||
+- Args.hasArg(options::OPT_fstack_protector_all)) {
+- // Explicitly link ssp libraries, not folded into Solaris libc.
+- CmdArgs.push_back("-lssp_nonshared");
+- CmdArgs.push_back("-lssp");
+- }
- CmdArgs.push_back("-lgcc_s");
- CmdArgs.push_back("-lc");
- if (!Args.hasArg(options::OPT_shared)) {
@@ -96,7 +99,12 @@ Test removing -Bdynamic for golang.
CmdArgs.push_back("-lm");
}
+ CmdArgs.push_back("-lc");
+ if (NeedsSanitizerDeps)
+ linkSanitizerRuntimeDeps(getToolChain(), CmdArgs);
}
+@@ -139,11 +150,7 @@ void solaris::Linker::ConstructJob(Compi
+ getToolChain().getCompilerRTArgString(Args, "sancov_end", false));
+ CmdArgs.push_back("--no-whole-archive");
- if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
- CmdArgs.push_back(
@@ -107,46 +115,37 @@ Test removing -Bdynamic for golang.
getToolChain().addProfileRTLibs(Args, CmdArgs);
-@@ -127,35 +139,9 @@ void solaris::Linker::ConstructJob(Compi
- Solaris::Solaris(const Driver &D, const llvm::Triple &Triple,
+@@ -172,26 +179,9 @@ Solaris::Solaris(const Driver &D, const
const ArgList &Args)
: Generic_ELF(D, Triple, Args) {
--
+
- GCCInstallation.init(Triple, Args);
-
+- StringRef LibSuffix = getSolarisLibSuffix(Triple);
- path_list &Paths = getFilePaths();
-- if (GCCInstallation.isValid())
-- addPathIfExists(D, GCCInstallation.getInstallPath(), Paths);
--
-- addPathIfExists(D, getDriver().getInstalledDir(), Paths);
-- if (getDriver().getInstalledDir() != getDriver().Dir)
-- addPathIfExists(D, getDriver().Dir, Paths);
--
-- addPathIfExists(D, getDriver().SysRoot + getDriver().Dir + "/../lib", Paths);
--
-- std::string LibPath = "/usr/lib/";
-- switch (Triple.getArch()) {
-- case llvm::Triple::x86:
-- case llvm::Triple::sparc:
-- break;
-- case llvm::Triple::x86_64:
-- LibPath += "amd64/";
-- break;
-- case llvm::Triple::sparcv9:
-- LibPath += "sparcv9/";
-- break;
-- default:
-- llvm_unreachable("Unsupported architecture");
+- if (GCCInstallation.isValid()) {
+- // On Solaris gcc uses both an architecture-specific path with triple in it
+- // as well as a more generic lib path (+arch suffix).
+- addPathIfExists(D,
+- GCCInstallation.getInstallPath() +
+- GCCInstallation.getMultilib().gccSuffix(),
+- Paths);
+- addPathIfExists(D, GCCInstallation.getParentLibPath() + LibSuffix, Paths);
- }
-
-- addPathIfExists(D, getDriver().SysRoot + LibPath, Paths);
+- // If we are currently running Clang inside of the requested system root,
+- // add its parent library path to those searched.
+- if (StringRef(D.Dir).startswith(D.SysRoot))
+- addPathIfExists(D, D.Dir + "/../lib", Paths);
+-
+- addPathIfExists(D, D.SysRoot + "/usr/lib" + LibSuffix, Paths);
+ // No special handling, the C runtime files are found directly above
+ // and crle handles adding the default system library paths if they
+ // are necessary.
}
- Tool *Solaris::buildAssembler() const {
-@@ -164,30 +150,41 @@ Tool *Solaris::buildAssembler() const {
+ SanitizerMask Solaris::getSupportedSanitizers() const {
+@@ -211,6 +201,32 @@ Tool *Solaris::buildAssembler() const {
Tool *Solaris::buildLinker() const { return new tools::solaris::Linker(*this); }
@@ -176,35 +175,6 @@ Test removing -Bdynamic for golang.
+ }
+}
+
- void Solaris::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
- ArgStringList &CC1Args) const {
- if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
- DriverArgs.hasArg(options::OPT_nostdincxx))
- return;
-
-- // Include the support directory for things like xlocale and fudged system
-- // headers.
-- // FIXME: This is a weird mix of libc++ and libstdc++. We should also be
-- // checking the value of -stdlib= here and adding the includes for libc++
-- // rather than libstdc++ if it's requested.
-- addSystemInclude(DriverArgs, CC1Args, "/usr/include/c++/v1/support/solaris");
--
-- if (GCCInstallation.isValid()) {
-- GCCVersion Version = GCCInstallation.getVersion();
-- addSystemInclude(DriverArgs, CC1Args,
-- getDriver().SysRoot + "/usr/gcc/" +
-- Version.MajorStr + "." +
-- Version.MinorStr +
-- "/include/c++/" + Version.Text);
-- addSystemInclude(DriverArgs, CC1Args,
-- getDriver().SysRoot + "/usr/gcc/" + Version.MajorStr +
-- "." + Version.MinorStr + "/include/c++/" +
-- Version.Text + "/" +
-- GCCInstallation.getTriple().str());
-- }
-+ // Currently assumes pkgsrc layout.
-+ addSystemInclude(DriverArgs, CC1Args,
-+ llvm::sys::path::parent_path(getDriver().getInstalledDir())
-+ + "/include/c++/v1");
-+ return;
- }
+ void Solaris::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
+ ArgStringList &CC1Args) const {
+ const Driver &D = getDriver();
diff --git a/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.h b/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.h
index 42b60d1e471..7919ed4d68f 100644
--- a/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.h
+++ b/lang/clang/patches/patch-lib_Driver_ToolChains_Solaris.h
@@ -1,16 +1,16 @@
-$NetBSD: patch-lib_Driver_ToolChains_Solaris.h,v 1.1 2018/08/09 14:56:41 jperkin Exp $
+$NetBSD: patch-lib_Driver_ToolChains_Solaris.h,v 1.2 2018/12/09 20:04:38 adam Exp $
Override AddCXXStdlibLibArgs().
---- lib/Driver/ToolChains/Solaris.h.orig 2018-01-04 07:43:41.000000000 +0000
+--- lib/Driver/ToolChains/Solaris.h.orig 2018-02-05 23:59:13.000000000 +0000
+++ lib/Driver/ToolChains/Solaris.h
-@@ -60,6 +60,9 @@ public:
- void AddClangCXXStdlibIncludeArgs(
- const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const override;
-+ void AddCXXStdlibLibArgs(
-+ const llvm::opt::ArgList &Args,
-+ llvm::opt::ArgStringList &CmdArgs) const override;
+@@ -67,6 +67,9 @@ public:
+ SanitizerMask getSupportedSanitizers() const override;
unsigned GetDefaultDwarfVersion() const override { return 2; }
++ void AddCXXStdlibLibArgs(
++ const llvm::opt::ArgList &Args,
++ llvm::opt::ArgStringList &CmdArgs) const override;
+ protected:
+ Tool *buildAssembler() const override;
diff --git a/lang/clang/patches/patch-lib_Frontend_InitHeaderSearch.cpp b/lang/clang/patches/patch-lib_Frontend_InitHeaderSearch.cpp
index bf4e09dc0d4..c903139aa8c 100644
--- a/lang/clang/patches/patch-lib_Frontend_InitHeaderSearch.cpp
+++ b/lang/clang/patches/patch-lib_Frontend_InitHeaderSearch.cpp
@@ -1,13 +1,13 @@
-$NetBSD: patch-lib_Frontend_InitHeaderSearch.cpp,v 1.1 2018/08/09 14:56:41 jperkin Exp $
+$NetBSD: patch-lib_Frontend_InitHeaderSearch.cpp,v 1.2 2018/12/09 20:04:38 adam Exp $
Don't add /usr/local/include by default on Solaris.
---- lib/Frontend/InitHeaderSearch.cpp.orig 2018-01-04 07:43:41.000000000 +0000
+--- lib/Frontend/InitHeaderSearch.cpp.orig 2018-06-28 23:23:45.000000000 +0000
+++ lib/Frontend/InitHeaderSearch.cpp
-@@ -216,6 +216,7 @@ void InitHeaderSearch::AddDefaultCInclud
- case llvm::Triple::NaCl:
+@@ -221,6 +221,7 @@ void InitHeaderSearch::AddDefaultCInclud
case llvm::Triple::PS4:
case llvm::Triple::ELFIAMCU:
+ case llvm::Triple::Fuchsia:
+ case llvm::Triple::Solaris:
break;
case llvm::Triple::Win32: