From owner-svn-src-projects@freebsd.org Sun Jan 26 00:21:31 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25ECB228C5F for ; Sun, 26 Jan 2020 00:21:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484tpg0wppz4KBy; Sun, 26 Jan 2020 00:21:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AEA518A70; Sun, 26 Jan 2020 00:21:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00Q0LVLr092153; Sun, 26 Jan 2020 00:21:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00Q0LUT5092148; Sun, 26 Jan 2020 00:21:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001260021.00Q0LUT5092148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 26 Jan 2020 00:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357127 - in projects/clang1000-import/lib/clang: headers include/llvm/Support libclang libllvm X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import/lib/clang: headers include/llvm/Support libclang libllvm X-SVN-Commit-Revision: 357127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 00:21:31 -0000 Author: dim Date: Sun Jan 26 00:21:30 2020 New Revision: 357127 URL: https://svnweb.freebsd.org/changeset/base/357127 Log: Update build glue for a minimal build of the clang executable. Added: projects/clang1000-import/lib/clang/include/llvm/Support/Extension.def (contents, props changed) Modified: projects/clang1000-import/lib/clang/headers/Makefile projects/clang1000-import/lib/clang/libclang/Makefile projects/clang1000-import/lib/clang/libllvm/Makefile Modified: projects/clang1000-import/lib/clang/headers/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/headers/Makefile Sat Jan 25 23:22:08 2020 (r357126) +++ projects/clang1000-import/lib/clang/headers/Makefile Sun Jan 26 00:21:30 2020 (r357127) @@ -5,14 +5,11 @@ .PATH: ${CLANG_SRCS}/lib/Headers -INCSGROUPS= INCS CUDA FUZZ OMP PPC PROF SAN +INCSGROUPS= INCS CUDA OMP PPC INCSDIR= ${LIBDIR}/clang/10.0.0/include CUDADIR= ${INCSDIR}/cuda_wrappers -FUZZDIR= ${INCSDIR}/fuzzer OMPDIR= ${INCSDIR}/openmp_wrappers PPCDIR= ${INCSDIR}/ppc_wrappers -PROFDIR= ${INCSDIR}/profile -SANDIR= ${INCSDIR}/sanitizer GENINCS+= arm_fp16.h GENINCS+= arm_mve.h @@ -149,8 +146,6 @@ CUDA+= cuda_wrappers/algorithm CUDA+= cuda_wrappers/complex CUDA+= cuda_wrappers/new -FUZZ+= fuzzer/FuzzedDataProvider.h - OMP+= openmp_wrappers/__clang_openmp_math.h OMP+= openmp_wrappers/__clang_openmp_math_declares.h OMP+= openmp_wrappers/cmath @@ -163,27 +158,6 @@ PPC+= ppc_wrappers/pmmintrin.h PPC+= ppc_wrappers/smmintrin.h PPC+= ppc_wrappers/tmmintrin.h PPC+= ppc_wrappers/xmmintrin.h - -PROF+= profile/InstrProfData.inc - -SAN+= sanitizer/allocator_interface.h -SAN+= sanitizer/asan_interface.h -SAN+= sanitizer/common_interface_defs.h -SAN+= sanitizer/coverage_interface.h -SAN+= sanitizer/dfsan_interface.h -SAN+= sanitizer/hwasan_interface.h -SAN+= sanitizer/linux_syscall_hooks.h -SAN+= sanitizer/lsan_interface.h -SAN+= sanitizer/msan_interface.h -SAN+= sanitizer/netbsd_syscall_hooks.h -SAN+= sanitizer/scudo_interface.h -SAN+= sanitizer/tsan_interface.h -SAN+= sanitizer/tsan_interface_atomic.h -SAN+= sanitizer/ubsan_interface.h - -XRAY+= xray/xray_interface.h -XRAY+= xray/xray_log_interface.h -XRAY+= xray/xray_records.h arm_fp16.h: ${CLANG_SRCS}/include/clang/Basic/arm_fp16.td ${CLANG_TBLGEN} -gen-arm-fp16 \ Added: projects/clang1000-import/lib/clang/include/llvm/Support/Extension.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang1000-import/lib/clang/include/llvm/Support/Extension.def Sun Jan 26 00:21:30 2020 (r357127) @@ -0,0 +1,3 @@ +// $FreeBSD$ +//extension handlers +#undef HANDLE_EXTENSION Modified: projects/clang1000-import/lib/clang/libclang/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/libclang/Makefile Sat Jan 25 23:22:08 2020 (r357126) +++ projects/clang1000-import/lib/clang/libclang/Makefile Sun Jan 26 00:21:30 2020 (r357127) @@ -47,6 +47,7 @@ SRCS_FUL+= ARCMigrate/TransZeroOutPropsInDealloc.cpp SRCS_FUL+= ARCMigrate/TransformActions.cpp SRCS_FUL+= ARCMigrate/Transforms.cpp SRCS_MIN+= AST/APValue.cpp +SRCS_MIN+= AST/ASTConcept.cpp SRCS_MIN+= AST/ASTConsumer.cpp SRCS_MIN+= AST/ASTContext.cpp SRCS_MIN+= AST/ASTDiagnostic.cpp @@ -78,12 +79,33 @@ SRCS_MIN+= AST/DeclarationName.cpp SRCS_MIN+= AST/Expr.cpp SRCS_MIN+= AST/ExprCXX.cpp SRCS_MIN+= AST/ExprClassification.cpp +SRCS_MIN+= AST/ExprConcepts.cpp SRCS_MIN+= AST/ExprConstant.cpp SRCS_MIN+= AST/ExprObjC.cpp SRCS_LDB+= AST/ExternalASTMerger.cpp SRCS_MIN+= AST/ExternalASTSource.cpp SRCS_MIN+= AST/FormatString.cpp SRCS_MIN+= AST/InheritViz.cpp +SRCS_MIN+= AST/Interp/Block.cpp +SRCS_MIN+= AST/Interp/ByteCodeEmitter.cpp +SRCS_MIN+= AST/Interp/ByteCodeExprGen.cpp +SRCS_MIN+= AST/Interp/ByteCodeGenError.cpp +SRCS_MIN+= AST/Interp/ByteCodeStmtGen.cpp +SRCS_MIN+= AST/Interp/Context.cpp +SRCS_MIN+= AST/Interp/Descriptor.cpp +SRCS_MIN+= AST/Interp/EvalEmitter.cpp +SRCS_MIN+= AST/Interp/Frame.cpp +SRCS_MIN+= AST/Interp/Function.cpp +SRCS_MIN+= AST/Interp/Interp.cpp +SRCS_MIN+= AST/Interp/InterpFrame.cpp +SRCS_MIN+= AST/Interp/InterpStack.cpp +SRCS_MIN+= AST/Interp/InterpState.cpp +SRCS_MIN+= AST/Interp/Pointer.cpp +SRCS_MIN+= AST/Interp/PrimType.cpp +SRCS_MIN+= AST/Interp/Program.cpp +SRCS_MIN+= AST/Interp/Record.cpp +SRCS_MIN+= AST/Interp/Source.cpp +SRCS_MIN+= AST/Interp/State.cpp SRCS_MIN+= AST/ItaniumCXXABI.cpp SRCS_MIN+= AST/ItaniumMangle.cpp SRCS_MIN+= AST/JSONNodeDumper.cpp @@ -159,6 +181,7 @@ SRCS_MIN+= Basic/FileSystemStatCache.cpp SRCS_MIN+= Basic/FixedPoint.cpp SRCS_MIN+= Basic/IdentifierTable.cpp SRCS_MIN+= Basic/LangOptions.cpp +SRCS_MIN+= Basic/LangStandards.cpp SRCS_MIN+= Basic/Module.cpp SRCS_MIN+= Basic/ObjCRuntime.cpp SRCS_MIN+= Basic/OpenMPKinds.cpp @@ -168,6 +191,7 @@ SRCS_MIN+= Basic/SanitizerSpecialCaseList.cpp SRCS_MIN+= Basic/Sanitizers.cpp SRCS_MIN+= Basic/SourceLocation.cpp SRCS_MIN+= Basic/SourceManager.cpp +SRCS_MIN+= Basic/Stack.cpp SRCS_MIN+= Basic/TargetInfo.cpp SRCS_MIN+= Basic/Targets.cpp SRCS_MIN+= Basic/Targets/AArch64.cpp @@ -262,10 +286,12 @@ SRCS_MIN+= Driver/Driver.cpp SRCS_MIN+= Driver/DriverOptions.cpp SRCS_MIN+= Driver/Job.cpp SRCS_MIN+= Driver/Multilib.cpp +SRCS_MIN+= Driver/OptionUtils.cpp SRCS_MIN+= Driver/Phases.cpp SRCS_MIN+= Driver/SanitizerArgs.cpp SRCS_MIN+= Driver/Tool.cpp SRCS_MIN+= Driver/ToolChain.cpp +SRCS_MIN+= Driver/ToolChains/AIX.cpp SRCS_MIN+= Driver/ToolChains/AMDGPU.cpp SRCS_MIN+= Driver/ToolChains/AVR.cpp SRCS_MIN+= Driver/ToolChains/Ananas.cpp @@ -286,6 +312,7 @@ SRCS_MIN+= Driver/ToolChains/CrossWindows.cpp SRCS_MIN+= Driver/ToolChains/Cuda.cpp SRCS_MIN+= Driver/ToolChains/Darwin.cpp SRCS_MIN+= Driver/ToolChains/DragonFly.cpp +SRCS_MIN+= Driver/ToolChains/Flang.cpp SRCS_MIN+= Driver/ToolChains/FreeBSD.cpp SRCS_MIN+= Driver/ToolChains/Fuchsia.cpp SRCS_MIN+= Driver/ToolChains/Gnu.cpp @@ -293,6 +320,7 @@ SRCS_MIN+= Driver/ToolChains/HIP.cpp SRCS_MIN+= Driver/ToolChains/Haiku.cpp SRCS_MIN+= Driver/ToolChains/Hexagon.cpp SRCS_MIN+= Driver/ToolChains/Hurd.cpp +SRCS_MIN+= Driver/ToolChains/InterfaceStubs.cpp SRCS_MIN+= Driver/ToolChains/Linux.cpp SRCS_MIN+= Driver/ToolChains/MSP430.cpp SRCS_MIN+= Driver/ToolChains/MSVC.cpp @@ -348,7 +376,6 @@ SRCS_MIN+= Frontend/HeaderIncludeGen.cpp SRCS_MIN+= Frontend/InitHeaderSearch.cpp SRCS_MIN+= Frontend/InitPreprocessor.cpp SRCS_MIN+= Frontend/InterfaceStubFunctionsConsumer.cpp -SRCS_MIN+= Frontend/LangStandards.cpp SRCS_MIN+= Frontend/LayoutOverrideSource.cpp SRCS_MIN+= Frontend/LogDiagnosticPrinter.cpp SRCS_MIN+= Frontend/ModuleDependencyCollector.cpp @@ -437,6 +464,7 @@ SRCS_MIN+= Sema/SemaCXXScopeSpec.cpp SRCS_MIN+= Sema/SemaCast.cpp SRCS_MIN+= Sema/SemaChecking.cpp SRCS_MIN+= Sema/SemaCodeComplete.cpp +SRCS_MIN+= Sema/SemaConcept.cpp SRCS_MIN+= Sema/SemaConsumer.cpp SRCS_MIN+= Sema/SemaCoroutine.cpp SRCS_MIN+= Sema/SemaDecl.cpp @@ -477,7 +505,7 @@ SRCS_MIN+= Serialization/ASTWriterStmt.cpp SRCS_MIN+= Serialization/GeneratePCH.cpp SRCS_MIN+= Serialization/GlobalModuleIndex.cpp SRCS_MIN+= Serialization/InMemoryModuleCache.cpp -SRCS_MIN+= Serialization/Module.cpp +SRCS_MIN+= Serialization/ModuleFile.cpp SRCS_MIN+= Serialization/ModuleFileExtension.cpp SRCS_MIN+= Serialization/ModuleManager.cpp SRCS_MIN+= Serialization/PCHContainerOperations.cpp @@ -519,7 +547,6 @@ SRCS_FUL+= StaticAnalyzer/Checkers/GTestChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/GenericTaintChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/IdenticalExprChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/InnerPointerChecker.cpp -SRCS_FUL+= StaticAnalyzer/Checkers/IteratorChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/LocalizationChecker.cpp @@ -601,7 +628,6 @@ SRCS_FUL+= StaticAnalyzer/Core/CheckerManager.cpp SRCS_FUL+= StaticAnalyzer/Core/CommonBugCategories.cpp SRCS_FUL+= StaticAnalyzer/Core/ConstraintManager.cpp SRCS_FUL+= StaticAnalyzer/Core/CoreEngine.cpp -SRCS_FUL+= StaticAnalyzer/Core/DynamicTypeMap.cpp SRCS_FUL+= StaticAnalyzer/Core/Environment.cpp SRCS_FUL+= StaticAnalyzer/Core/ExplodedGraph.cpp SRCS_FUL+= StaticAnalyzer/Core/ExprEngine.cpp @@ -615,7 +641,6 @@ SRCS_FUL+= StaticAnalyzer/Core/IssueHash.cpp SRCS_FUL+= StaticAnalyzer/Core/LoopUnrolling.cpp SRCS_FUL+= StaticAnalyzer/Core/LoopWidening.cpp SRCS_FUL+= StaticAnalyzer/Core/MemRegion.cpp -SRCS_FUL+= StaticAnalyzer/Core/PathDiagnostic.cpp SRCS_FUL+= StaticAnalyzer/Core/PlistDiagnostics.cpp SRCS_FUL+= StaticAnalyzer/Core/ProgramState.cpp SRCS_FUL+= StaticAnalyzer/Core/RangeConstraintManager.cpp @@ -662,6 +687,34 @@ SRCS_ALL+= ${SRCS_LDB} .endif SRCS+= ${SRCS_ALL:O} +clang/AST/AbstractBasicReader.inc: \ + ${CLANG_SRCS}/include/clang/AST/PropertiesBase.td + ${CLANG_TBLGEN} -gen-clang-basic-reader \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/PropertiesBase.td +TGHDRS+= clang/AST/AbstractBasicReader.inc + +clang/AST/AbstractBasicWriter.inc: \ + ${CLANG_SRCS}/include/clang/AST/PropertiesBase.td + ${CLANG_TBLGEN} -gen-clang-basic-writer \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/PropertiesBase.td +TGHDRS+= clang/AST/AbstractBasicWriter.inc + +clang/AST/AbstractTypeReader.inc: \ + ${CLANG_SRCS}/include/clang/AST/TypeProperties.td + ${CLANG_TBLGEN} -gen-clang-type-reader \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/TypeProperties.td +TGHDRS+= clang/AST/AbstractTypeReader.inc + +clang/AST/AbstractTypeWriter.inc: \ + ${CLANG_SRCS}/include/clang/AST/TypeProperties.td + ${CLANG_TBLGEN} -gen-clang-type-writer \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/TypeProperties.td +TGHDRS+= clang/AST/AbstractTypeWriter.inc + clang/AST/AttrImpl.inc: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ @@ -729,17 +782,18 @@ TGHDRS+= clang/AST/CommentHTMLTagsProperties.inc clang/AST/CommentNodes.inc: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td ${CLANG_TBLGEN} -gen-clang-comment-nodes \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td TGHDRS+= clang/AST/CommentNodes.inc clang/AST/DeclNodes.inc: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td ${CLANG_TBLGEN} -gen-clang-decl-nodes \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td TGHDRS+= clang/AST/DeclNodes.inc -clang/AST/StmtDataCollectors.inc: ${CLANG_SRCS}/include/clang/AST/StmtDataCollectors.td +clang/AST/StmtDataCollectors.inc: \ + ${CLANG_SRCS}/include/clang/AST/StmtDataCollectors.td ${CLANG_TBLGEN} -gen-clang-data-collectors \ -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/include/clang/AST/StmtDataCollectors.td @@ -747,10 +801,16 @@ TGHDRS+= clang/AST/StmtDataCollectors.inc clang/AST/StmtNodes.inc: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td ${CLANG_TBLGEN} -gen-clang-stmt-nodes \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td TGHDRS+= clang/AST/StmtNodes.inc +clang/AST/TypeNodes.inc: ${CLANG_SRCS}/include/clang/Basic/TypeNodes.td + ${CLANG_TBLGEN} -gen-clang-type-nodes \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/TypeNodes.td +TGHDRS+= clang/AST/TypeNodes.inc + clang/Basic/AttrHasAttributeImpl.inc: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-has-attribute-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ @@ -806,6 +866,32 @@ clang/Basic/arm_neon.inc: ${CLANG_SRCS}/include/clang/ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/arm_neon.td TGHDRS+= clang/Basic/arm_neon.inc +clang/Basic/arm_mve_builtins.inc: ${CLANG_SRCS}/include/clang/Basic/arm_mve.td + ${CLANG_TBLGEN} -gen-arm-mve-builtin-def \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/arm_mve.td +TGHDRS+= clang/Basic/arm_mve_builtins.inc + +clang/Basic/arm_mve_builtin_aliases.inc: \ + ${CLANG_SRCS}/include/clang/Basic/arm_mve.td + ${CLANG_TBLGEN} -gen-arm-mve-builtin-aliases \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/arm_mve.td +TGHDRS+= clang/Basic/arm_mve_builtin_aliases.inc + +clang/Basic/arm_mve_builtin_cg.inc: ${CLANG_SRCS}/include/clang/Basic/arm_mve.td + ${CLANG_TBLGEN} -gen-arm-mve-builtin-codegen \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/arm_mve.td +TGHDRS+= clang/Basic/arm_mve_builtin_cg.inc + +clang/Basic/arm_mve_builtin_sema.inc: \ + ${CLANG_SRCS}/include/clang/Basic/arm_mve.td + ${CLANG_TBLGEN} -gen-arm-mve-builtin-sema \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/arm_mve.td +TGHDRS+= clang/Basic/arm_mve_builtin_sema.inc + clang/Driver/Options.inc: ${CLANG_SRCS}/include/clang/Driver/Options.td ${LLVM_TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ @@ -877,6 +963,12 @@ clang/StaticAnalyzer/Checkers/Checkers.inc: \ -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/Checkers.td TGHDRS+= clang/StaticAnalyzer/Checkers/Checkers.inc + +Opcodes.inc: ${CLANG_SRCS}/lib/AST/Interp/Opcodes.td + ${CLANG_TBLGEN} -gen-clang-opcodes \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/lib/AST/Interp/Opcodes.td +TGHDRS+= Opcodes.inc OpenCLBuiltins.inc: ${CLANG_SRCS}/lib/Sema/OpenCLBuiltins.td ${CLANG_TBLGEN} -gen-clang-opencl-builtins \ Modified: projects/clang1000-import/lib/clang/libllvm/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/libllvm/Makefile Sat Jan 25 23:22:08 2020 (r357126) +++ projects/clang1000-import/lib/clang/libllvm/Makefile Sun Jan 26 00:21:30 2020 (r357127) @@ -60,9 +60,11 @@ SRCS_MIN+= Analysis/CmpInstAnalysis.cpp SRCS_MIN+= Analysis/CodeMetrics.cpp SRCS_MIN+= Analysis/ConstantFolding.cpp SRCS_MIN+= Analysis/CostModel.cpp +SRCS_MIN+= Analysis/DDG.cpp SRCS_MIN+= Analysis/Delinearization.cpp SRCS_MIN+= Analysis/DemandedBits.cpp SRCS_MIN+= Analysis/DependenceAnalysis.cpp +SRCS_MIN+= Analysis/DependenceGraphBuilder.cpp SRCS_MIN+= Analysis/DivergenceAnalysis.cpp SRCS_MIN+= Analysis/DomPrinter.cpp SRCS_MIN+= Analysis/DomTreeUpdater.cpp @@ -88,6 +90,7 @@ SRCS_MIN+= Analysis/Lint.cpp SRCS_MIN+= Analysis/Loads.cpp SRCS_MIN+= Analysis/LoopAccessAnalysis.cpp SRCS_MIN+= Analysis/LoopAnalysisManager.cpp +SRCS_MIN+= Analysis/LoopCacheAnalysis.cpp SRCS_MIN+= Analysis/LoopInfo.cpp SRCS_MIN+= Analysis/LoopPass.cpp SRCS_MIN+= Analysis/LoopUnrollAnalyzer.cpp @@ -127,6 +130,7 @@ SRCS_MIN+= Analysis/TargetLibraryInfo.cpp SRCS_MIN+= Analysis/TargetTransformInfo.cpp SRCS_MIN+= Analysis/TypeBasedAliasAnalysis.cpp SRCS_MIN+= Analysis/TypeMetadataUtils.cpp +SRCS_MIN+= Analysis/VFABIDemangling.cpp SRCS_MIN+= Analysis/ValueLattice.cpp SRCS_MIN+= Analysis/ValueLatticeUtils.cpp SRCS_MIN+= Analysis/ValueTracking.cpp @@ -137,6 +141,7 @@ SRCS_MIN+= AsmParser/Parser.cpp SRCS_MIN+= BinaryFormat/Dwarf.cpp SRCS_MIN+= BinaryFormat/Magic.cpp SRCS_MIN+= BinaryFormat/Wasm.cpp +SRCS_MIN+= BinaryFormat/XCOFF.cpp SRCS_MIN+= Bitcode/Reader/BitReader.cpp SRCS_EXT+= Bitcode/Reader/BitcodeAnalyzer.cpp SRCS_MIN+= Bitcode/Reader/BitcodeReader.cpp @@ -180,6 +185,7 @@ SRCS_MIN+= CodeGen/BranchFolding.cpp SRCS_MIN+= CodeGen/BranchRelaxation.cpp SRCS_MIN+= CodeGen/BreakFalseDeps.cpp SRCS_EXT+= CodeGen/BuiltinGCs.cpp +SRCS_MIN+= CodeGen/CFGuardLongjmp.cpp SRCS_MIN+= CodeGen/CFIInstrInserter.cpp SRCS_MIN+= CodeGen/CalcSpillWeights.cpp SRCS_MIN+= CodeGen/CallingConvLower.cpp @@ -210,6 +216,7 @@ SRCS_MIN+= CodeGen/GlobalISel/Combiner.cpp SRCS_MIN+= CodeGen/GlobalISel/CombinerHelper.cpp SRCS_MIN+= CodeGen/GlobalISel/CallLowering.cpp SRCS_MIN+= CodeGen/GlobalISel/GISelChangeObserver.cpp +SRCS_MIN+= CodeGen/GlobalISel/GISelKnownBits.cpp SRCS_MIN+= CodeGen/GlobalISel/GlobalISel.cpp SRCS_MIN+= CodeGen/GlobalISel/IRTranslator.cpp SRCS_MIN+= CodeGen/GlobalISel/InstructionSelect.cpp @@ -257,11 +264,13 @@ SRCS_MIN+= CodeGen/LoopTraversal.cpp SRCS_MIN+= CodeGen/LowLevelType.cpp SRCS_MIN+= CodeGen/LowerEmuTLS.cpp SRCS_MIN+= CodeGen/MIRCanonicalizerPass.cpp +SRCS_MIN+= CodeGen/MIRNamerPass.cpp SRCS_EXT+= CodeGen/MIRParser/MILexer.cpp SRCS_EXT+= CodeGen/MIRParser/MIParser.cpp SRCS_EXT+= CodeGen/MIRParser/MIRParser.cpp SRCS_MIN+= CodeGen/MIRPrinter.cpp SRCS_MIN+= CodeGen/MIRPrintingPass.cpp +SRCS_MIN+= CodeGen/MIRVRegNamerUtils.cpp SRCS_MIN+= CodeGen/MachineBasicBlock.cpp SRCS_MIN+= CodeGen/MachineBlockFrequencyInfo.cpp SRCS_MIN+= CodeGen/MachineBlockPlacement.cpp @@ -279,6 +288,7 @@ SRCS_MIN+= CodeGen/MachineInstr.cpp SRCS_MIN+= CodeGen/MachineInstrBundle.cpp SRCS_MIN+= CodeGen/MachineLICM.cpp SRCS_MIN+= CodeGen/MachineLoopInfo.cpp +SRCS_MIN+= CodeGen/MachineLoopUtils.cpp SRCS_MIN+= CodeGen/MachineModuleInfo.cpp SRCS_MIN+= CodeGen/MachineModuleInfoImpls.cpp SRCS_MIN+= CodeGen/MachineOperand.cpp @@ -291,9 +301,11 @@ SRCS_MIN+= CodeGen/MachineRegisterInfo.cpp SRCS_MIN+= CodeGen/MachineSSAUpdater.cpp SRCS_MIN+= CodeGen/MachineScheduler.cpp SRCS_MIN+= CodeGen/MachineSink.cpp +SRCS_MIN+= CodeGen/MachineSizeOpts.cpp SRCS_MIN+= CodeGen/MachineTraceMetrics.cpp SRCS_MIN+= CodeGen/MachineVerifier.cpp SRCS_MIN+= CodeGen/MacroFusion.cpp +SRCS_MIN+= CodeGen/ModuloSchedule.cpp SRCS_MIN+= CodeGen/OptimizePHIs.cpp SRCS_MIN+= CodeGen/PHIElimination.cpp SRCS_MIN+= CodeGen/PHIEliminationUtils.cpp @@ -379,6 +391,7 @@ SRCS_MIN+= CodeGen/TargetRegisterInfo.cpp SRCS_MIN+= CodeGen/TargetSchedule.cpp SRCS_MIN+= CodeGen/TargetSubtargetInfo.cpp SRCS_MIN+= CodeGen/TwoAddressInstructionPass.cpp +SRCS_MIN+= CodeGen/TypePromotion.cpp SRCS_MIN+= CodeGen/UnreachableBlockElim.cpp SRCS_MIN+= CodeGen/ValueTypes.cpp SRCS_MIN+= CodeGen/VirtRegMap.cpp @@ -567,9 +580,7 @@ SRCS_EXT+= ExecutionEngine/Orc/Legacy.cpp SRCS_EXT+= ExecutionEngine/Orc/NullResolver.cpp SRCS_EXT+= ExecutionEngine/Orc/OrcABISupport.cpp SRCS_EXT+= ExecutionEngine/Orc/OrcCBindings.cpp -SRCS_EXT+= ExecutionEngine/Orc/OrcError.cpp SRCS_EXT+= ExecutionEngine/Orc/OrcMCJITReplacement.cpp -SRCS_EXT+= ExecutionEngine/Orc/RPCUtils.cpp SRCS_EXT+= ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp SRCS_EXT+= ExecutionEngine/Orc/ThreadSafeModule.cpp SRCS_XDB+= ExecutionEngine/RuntimeDyld/JITSymbol.cpp @@ -582,6 +593,8 @@ SRCS_XDB+= ExecutionEngine/RuntimeDyld/RuntimeDyldMach SRCS_XDB+= ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.cpp SRCS_XDB+= ExecutionEngine/SectionMemoryManager.cpp SRCS_XDB+= ExecutionEngine/TargetSelect.cpp +SRCS_MIN+= Frontend/OpenMP/OMPConstants.cpp +SRCS_MIN+= Frontend/OpenMP/OMPIRBuilder.cpp SRCS_MIN+= IR/AbstractCallSite.cpp SRCS_MIN+= IR/AsmWriter.cpp SRCS_MIN+= IR/Attributes.cpp @@ -601,6 +614,7 @@ SRCS_MIN+= IR/DiagnosticHandler.cpp SRCS_MIN+= IR/DiagnosticInfo.cpp SRCS_MIN+= IR/DiagnosticPrinter.cpp SRCS_MIN+= IR/Dominators.cpp +SRCS_MIN+= IR/FPEnv.cpp SRCS_MIN+= IR/Function.cpp SRCS_MIN+= IR/GVMaterializer.cpp SRCS_MIN+= IR/Globals.cpp @@ -660,7 +674,6 @@ SRCS_MIN+= MC/MCAsmMacro.cpp SRCS_MIN+= MC/MCAsmStreamer.cpp SRCS_MIN+= MC/MCAssembler.cpp SRCS_MIN+= MC/MCCodeEmitter.cpp -SRCS_MIN+= MC/MCCodePadder.cpp SRCS_MIN+= MC/MCCodeView.cpp SRCS_MIN+= MC/MCContext.cpp SRCS_XDL+= MC/MCDisassembler/Disassembler.cpp @@ -779,7 +792,7 @@ SRCS_MIN+= Option/OptTable.cpp SRCS_MIN+= Option/Option.cpp SRCS_MIN+= Passes/PassBuilder.cpp SRCS_MIN+= Passes/PassPlugin.cpp -SRCS_EXT+= Passes/StandardInstrumentations.cpp +SRCS_MIN+= Passes/StandardInstrumentations.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMapping.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMappingReader.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMappingWriter.cpp @@ -791,7 +804,9 @@ SRCS_MIN+= ProfileData/ProfileSummaryBuilder.cpp SRCS_MIN+= ProfileData/SampleProf.cpp SRCS_MIN+= ProfileData/SampleProfReader.cpp SRCS_MIN+= ProfileData/SampleProfWriter.cpp +SRCS_MIN+= Remarks/BitstreamRemarkSerializer.cpp SRCS_MIN+= Remarks/RemarkFormat.cpp +SRCS_MIN+= Remarks/RemarkSerializer.cpp SRCS_MIN+= Remarks/RemarkStringTable.cpp SRCS_MIN+= Remarks/YAMLRemarkSerializer.cpp SRCS_MIN+= Support/AArch64TargetParser.cpp @@ -830,7 +845,7 @@ SRCS_MIN+= Support/Errno.cpp SRCS_MIN+= Support/Error.cpp SRCS_MIN+= Support/ErrorHandling.cpp SRCS_EXL+= Support/FileOutputBuffer.cpp -SRCS_EXT+= Support/FileUtilities.cpp +SRCS_MIN+= Support/FileUtilities.cpp SRCS_MIN+= Support/FoldingSet.cpp SRCS_MIN+= Support/FormatVariadic.cpp SRCS_MIN+= Support/FormattedStream.cpp @@ -843,7 +858,6 @@ SRCS_MIN+= Support/IntEqClasses.cpp SRCS_MIN+= Support/IntervalMap.cpp SRCS_MIN+= Support/ItaniumManglingCanonicalizer.cpp SRCS_MIN+= Support/JSON.cpp -SRCS_MIN+= Support/JamCRC.cpp SRCS_MIN+= Support/KnownBits.cpp SRCS_MIN+= Support/LEB128.cpp SRCS_MIN+= Support/LineIterator.cpp @@ -960,6 +974,7 @@ SRCS_MIN+= Target/AArch64/AArch64SIMDInstrOpt.cpp SRCS_MIN+= Target/AArch64/AArch64SelectionDAGInfo.cpp SRCS_MIN+= Target/AArch64/AArch64SpeculationHardening.cpp SRCS_MIN+= Target/AArch64/AArch64StackTagging.cpp +SRCS_MIN+= Target/AArch64/AArch64StackTaggingPreRA.cpp SRCS_MIN+= Target/AArch64/AArch64StorePairSuppress.cpp SRCS_MIN+= Target/AArch64/AArch64Subtarget.cpp SRCS_MIN+= Target/AArch64/AArch64TargetMachine.cpp @@ -991,7 +1006,6 @@ SRCS_MIN+= Target/ARM/ARMBaseRegisterInfo.cpp SRCS_MIN+= Target/ARM/ARMBasicBlockInfo.cpp SRCS_MIN+= Target/ARM/ARMCallLowering.cpp SRCS_MIN+= Target/ARM/ARMCallingConv.cpp -SRCS_MIN+= Target/ARM/ARMCodeGenPrepare.cpp SRCS_MIN+= Target/ARM/ARMConstantIslandPass.cpp SRCS_MIN+= Target/ARM/ARMConstantPoolValue.cpp SRCS_MIN+= Target/ARM/ARMExpandPseudoInsts.cpp @@ -1034,6 +1048,9 @@ SRCS_MIN+= Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp SRCS_MIN+= Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp SRCS_MIN+= Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp SRCS_MIN+= Target/ARM/MLxExpansionPass.cpp +SRCS_MIN+= Target/ARM/MVEGatherScatterLowering.cpp +SRCS_MIN+= Target/ARM/MVETailPredication.cpp +SRCS_MIN+= Target/ARM/MVEVPTBlockPass.cpp SRCS_MIN+= Target/ARM/TargetInfo/ARMTargetInfo.cpp SRCS_MIN+= Target/ARM/Thumb1FrameLowering.cpp SRCS_MIN+= Target/ARM/Thumb1InstrInfo.cpp @@ -1153,7 +1170,8 @@ SRCS_MIN+= Target/PowerPC/PPCHazardRecognizers.cpp SRCS_MIN+= Target/PowerPC/PPCISelDAGToDAG.cpp SRCS_MIN+= Target/PowerPC/PPCISelLowering.cpp SRCS_MIN+= Target/PowerPC/PPCInstrInfo.cpp -SRCS_MIN+= Target/PowerPC/PPCLoopPreIncPrep.cpp +SRCS_MIN+= Target/PowerPC/PPCLoopInstrFormPrep.cpp +SRCS_MIN+= Target/PowerPC/PPCLowerMASSVEntries.cpp SRCS_MIN+= Target/PowerPC/PPCMCInstLower.cpp SRCS_MIN+= Target/PowerPC/PPCMIPeephole.cpp SRCS_MIN+= Target/PowerPC/PPCMachineFunctionInfo.cpp @@ -1186,13 +1204,17 @@ SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp SRCS_MIN+= Target/RISCV/RISCVAsmPrinter.cpp +SRCS_MIN+= Target/RISCV/RISCVCallLowering.cpp SRCS_MIN+= Target/RISCV/RISCVExpandPseudoInsts.cpp SRCS_MIN+= Target/RISCV/RISCVFrameLowering.cpp SRCS_MIN+= Target/RISCV/RISCVInstrInfo.cpp +SRCS_MIN+= Target/RISCV/RISCVInstructionSelector.cpp SRCS_MIN+= Target/RISCV/RISCVISelDAGToDAG.cpp SRCS_MIN+= Target/RISCV/RISCVISelLowering.cpp +SRCS_MIN+= Target/RISCV/RISCVLegalizerInfo.cpp SRCS_MIN+= Target/RISCV/RISCVMCInstLower.cpp SRCS_MIN+= Target/RISCV/RISCVMergeBaseOffset.cpp +SRCS_MIN+= Target/RISCV/RISCVRegisterBankInfo.cpp SRCS_MIN+= Target/RISCV/RISCVRegisterInfo.cpp SRCS_MIN+= Target/RISCV/RISCVSubtarget.cpp SRCS_MIN+= Target/RISCV/RISCVTargetMachine.cpp @@ -1235,7 +1257,6 @@ SRCS_MIN+= Target/TargetMachineC.cpp .if ${MK_LLVM_TARGET_X86} != "no" SRCS_MIN+= Target/X86/AsmParser/X86AsmParser.cpp SRCS_XDW+= Target/X86/Disassembler/X86Disassembler.cpp -SRCS_XDW+= Target/X86/Disassembler/X86DisassemblerDecoder.cpp SRCS_MIN+= Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp SRCS_MIN+= Target/X86/MCTargetDesc/X86AsmBackend.cpp SRCS_MIN+= Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp @@ -1253,6 +1274,7 @@ SRCS_MIN+= Target/X86/TargetInfo/X86TargetInfo.cpp SRCS_MIN+= Target/X86/Utils/X86ShuffleDecode.cpp SRCS_MIN+= Target/X86/X86AsmPrinter.cpp SRCS_MIN+= Target/X86/X86AvoidStoreForwardingBlocks.cpp +SRCS_MIN+= Target/X86/X86AvoidTrailingCall.cpp SRCS_MIN+= Target/X86/X86CallFrameOptimization.cpp SRCS_MIN+= Target/X86/X86CallLowering.cpp SRCS_MIN+= Target/X86/X86CallingConv.cpp @@ -1302,6 +1324,7 @@ SRCS_MIN+= ToolDrivers/llvm-dlltool/DlltoolDriver.cpp SRCS_MIW+= ToolDrivers/llvm-lib/LibDriver.cpp SRCS_MIN+= Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp SRCS_MIN+= Transforms/AggressiveInstCombine/TruncInstCombine.cpp +SRCS_MIN+= Transforms/CFGuard/CFGuard.cpp SRCS_MIN+= Transforms/Coroutines/CoroCleanup.cpp SRCS_MIN+= Transforms/Coroutines/CoroEarly.cpp SRCS_MIN+= Transforms/Coroutines/CoroElide.cpp @@ -1376,6 +1399,7 @@ SRCS_MIN+= Transforms/Instrumentation/PGOMemOPSizeOpt. SRCS_MIN+= Transforms/Instrumentation/PoisonChecking.cpp SRCS_MIN+= Transforms/Instrumentation/SanitizerCoverage.cpp SRCS_MIN+= Transforms/Instrumentation/ThreadSanitizer.cpp +SRCS_MIN+= Transforms/Instrumentation/ValueProfileCollector.cpp SRCS_MIN+= Transforms/ObjCARC/DependencyAnalysis.cpp SRCS_EXT+= Transforms/ObjCARC/ObjCARC.cpp SRCS_MIN+= Transforms/ObjCARC/ObjCARCAPElim.cpp @@ -1430,8 +1454,10 @@ SRCS_MIN+= Transforms/Scalar/LoopUnrollAndJamPass.cpp SRCS_MIN+= Transforms/Scalar/LoopUnswitch.cpp SRCS_MIN+= Transforms/Scalar/LoopVersioningLICM.cpp SRCS_MIN+= Transforms/Scalar/LowerAtomic.cpp +SRCS_MIN+= Transforms/Scalar/LowerConstantIntrinsics.cpp SRCS_MIN+= Transforms/Scalar/LowerExpectIntrinsic.cpp SRCS_MIN+= Transforms/Scalar/LowerGuardIntrinsic.cpp +SRCS_MIN+= Transforms/Scalar/LowerMatrixIntrinsics.cpp SRCS_MIN+= Transforms/Scalar/LowerWidenableCondition.cpp SRCS_MIN+= Transforms/Scalar/MakeGuardsExplicit.cpp SRCS_MIN+= Transforms/Scalar/MemCpyOptimizer.cpp @@ -1469,6 +1495,7 @@ SRCS_MIN+= Transforms/Utils/CanonicalizeAliases.cpp SRCS_MIN+= Transforms/Utils/CloneFunction.cpp SRCS_MIN+= Transforms/Utils/CloneModule.cpp SRCS_MIN+= Transforms/Utils/CodeExtractor.cpp +SRCS_MIN+= Transforms/Utils/CodeMoverUtils.cpp SRCS_MIN+= Transforms/Utils/CtorUtils.cpp SRCS_MIN+= Transforms/Utils/DemoteRegToStack.cpp SRCS_MIN+= Transforms/Utils/EntryExitInstrumenter.cpp @@ -1480,6 +1507,7 @@ SRCS_MIN+= Transforms/Utils/FunctionImportUtils.cpp SRCS_MIN+= Transforms/Utils/GlobalStatus.cpp SRCS_MIN+= Transforms/Utils/GuardUtils.cpp SRCS_MIN+= Transforms/Utils/ImportedFunctionsInliningStatistics.cpp +SRCS_MIN+= Transforms/Utils/InjectTLIMappings.cpp SRCS_MIN+= Transforms/Utils/InlineFunction.cpp SRCS_MIN+= Transforms/Utils/InstructionNamer.cpp SRCS_MIN+= Transforms/Utils/IntegerDivision.cpp @@ -1498,6 +1526,7 @@ SRCS_MIN+= Transforms/Utils/LowerInvoke.cpp SRCS_MIN+= Transforms/Utils/LowerSwitch.cpp SRCS_MIN+= Transforms/Utils/Mem2Reg.cpp SRCS_MIN+= Transforms/Utils/MetaRenamer.cpp +SRCS_MIN+= Transforms/Utils/MisExpect.cpp SRCS_MIN+= Transforms/Utils/ModuleUtils.cpp SRCS_MIN+= Transforms/Utils/NameAnonGlobals.cpp SRCS_MIN+= Transforms/Utils/PredicateInfo.cpp @@ -1522,8 +1551,8 @@ SRCS_MIN+= Transforms/Vectorize/LoopVectorize.cpp SRCS_MIN+= Transforms/Vectorize/SLPVectorizer.cpp SRCS_MIN+= Transforms/Vectorize/VPlan.cpp SRCS_MIN+= Transforms/Vectorize/VPlanHCFGBuilder.cpp -SRCS_MIN+= Transforms/Vectorize/VPlanHCFGTransforms.cpp SRCS_MIN+= Transforms/Vectorize/VPlanPredicator.cpp +SRCS_MIN+= Transforms/Vectorize/VPlanTransforms.cpp SRCS_MIN+= Transforms/Vectorize/VPlanVerifier.cpp SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp SRCS_EXT+= XRay/BlockIndexer.cpp @@ -1585,6 +1614,17 @@ llvm/IR/IntrinsicImpl.inc: ${LLVM_SRCS}/include/llvm/I ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td TGHDRS+= llvm/IR/IntrinsicImpl.inc +.for arch in \ + AArch64/aarch64 AMDGPU/amdgcn ARM/arm BPF/bpf Hexagon/hexagon \ + Mips/mips NVPTX/nvvm PowerPC/ppc R600/r600 RISCV/riscv S390/s390 \ + WebAssembly/wasm X86/x86 XCore/xcore +llvm/IR/Intrinsics${arch:H}.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td + ${LLVM_TBLGEN} -gen-intrinsic-enums -intrinsic-prefix=${arch:T} \ + -I ${LLVM_SRCS}/include -d ${.TARGET}.d -o ${.TARGET} \ + ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td +TGHDRS+= llvm/IR/Intrinsics${arch:H}.h +.endfor + AttributesCompatFunc.inc: ${LLVM_SRCS}/lib/IR/AttributesCompatFunc.td ${LLVM_TBLGEN} -gen-attrs \ -I ${LLVM_SRCS}/include -d ${.TARGET}.d -o ${.TARGET} \ @@ -1636,6 +1676,7 @@ beforebuild: DisassemblerTables/-gen-disassembler \ EVEX2VEXTables/-gen-x86-EVEX2VEX-tables \ FastISel/-gen-fast-isel \ + GICombiner/-gen-global-isel-combiner,-combiners=${arch:H}PreLegalizerCombinerHelper \ GlobalISel/-gen-global-isel \ InstrInfo/-gen-instr-info \ MCCodeEmitter/-gen-emitter \ @@ -1660,6 +1701,7 @@ TGHDRS+= AArch64GenCallingConv.inc TGHDRS+= AArch64GenDAGISel.inc TGHDRS+= AArch64GenDisassemblerTables.inc TGHDRS+= AArch64GenFastISel.inc +TGHDRS+= AArch64GenGICombiner.inc TGHDRS+= AArch64GenGlobalISel.inc TGHDRS+= AArch64GenInstrInfo.inc TGHDRS+= AArch64GenMCCodeEmitter.inc @@ -1731,9 +1773,11 @@ TGHDRS+= RISCVGenCompressInstEmitter.inc TGHDRS+= RISCVGenDAGISel.inc TGHDRS+= RISCVGenDisassemblerTables.inc TGHDRS+= RISCVGenDAGISel.inc +TGHDRS+= RISCVGenGlobalISel.inc TGHDRS+= RISCVGenInstrInfo.inc TGHDRS+= RISCVGenMCCodeEmitter.inc TGHDRS+= RISCVGenMCPseudoLowering.inc +TGHDRS+= RISCVGenRegisterBank.inc TGHDRS+= RISCVGenRegisterInfo.inc TGHDRS+= RISCVGenSubtargetInfo.inc TGHDRS+= RISCVGenSystemOperands.inc From owner-svn-src-projects@freebsd.org Sun Jan 26 17:22:05 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DC711F4B73 for ; Sun, 26 Jan 2020 17:22:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485KSF3k8Kz4HZV; Sun, 26 Jan 2020 17:22:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AEFD246A4; Sun, 26 Jan 2020 17:22:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QHM5C1005179; Sun, 26 Jan 2020 17:22:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QHM5G9005178; Sun, 26 Jan 2020 17:22:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001261722.00QHM5G9005178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 26 Jan 2020 17:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357148 - projects/clang1000-import/lib/clang/libclang X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/lib/clang/libclang X-SVN-Commit-Revision: 357148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 17:22:05 -0000 Author: dim Date: Sun Jan 26 17:22:05 2020 New Revision: 357148 URL: https://svnweb.freebsd.org/changeset/base/357148 Log: Update build glue for a full build (MK_CLANG_FULL=yes) of the clang executable. Modified: projects/clang1000-import/lib/clang/libclang/Makefile Modified: projects/clang1000-import/lib/clang/libclang/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/libclang/Makefile Sun Jan 26 14:23:27 2020 (r357147) +++ projects/clang1000-import/lib/clang/libclang/Makefile Sun Jan 26 17:22:05 2020 (r357148) @@ -160,6 +160,7 @@ SRCS_FUL+= Analysis/Dominators.cpp SRCS_MIN+= Analysis/ExprMutationAnalyzer.cpp SRCS_MIN+= Analysis/LiveVariables.cpp SRCS_MIN+= Analysis/ObjCNoReturn.cpp +SRCS_FUL+= Analysis/PathDiagnostic.cpp SRCS_MIN+= Analysis/PostOrderCFGView.cpp SRCS_FUL+= Analysis/ProgramPoint.cpp SRCS_MIN+= Analysis/ReachableCode.cpp @@ -527,6 +528,7 @@ SRCS_FUL+= StaticAnalyzer/Checkers/CastToStructChecker SRCS_FUL+= StaticAnalyzer/Checkers/CastValueChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/CheckObjCDealloc.cpp SRCS_FUL+= StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/CheckPlacementNew.cpp SRCS_FUL+= StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp SRCS_FUL+= StaticAnalyzer/Checkers/CheckSizeofPointer.cpp SRCS_FUL+= StaticAnalyzer/Checkers/ChrootChecker.cpp @@ -534,6 +536,7 @@ SRCS_FUL+= StaticAnalyzer/Checkers/CloneChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/ConversionChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/DeadStoresChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/DebugCheckers.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/DebugIteratorModeling.cpp SRCS_FUL+= StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/DereferenceChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/DirectIvarAssignment.cpp @@ -543,10 +546,15 @@ SRCS_FUL+= StaticAnalyzer/Checkers/DynamicTypePropagat SRCS_FUL+= StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/ExprInspectionChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/FixedAddressChecker.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/GTestChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/GenericTaintChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/IdenticalExprChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/InnerPointerChecker.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/InvalidatedIteratorChecker.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/Iterator.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/IteratorModeling.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/IteratorRangeChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/LocalizationChecker.cpp @@ -559,6 +567,7 @@ SRCS_FUL+= StaticAnalyzer/Checkers/MacOSXAPIChecker.cp SRCS_FUL+= StaticAnalyzer/Checkers/MallocChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/MallocSizeofChecker.cpp +SRCS_FUL+= StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/MoveChecker.cpp SRCS_FUL+= StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp @@ -628,6 +637,7 @@ SRCS_FUL+= StaticAnalyzer/Core/CheckerManager.cpp SRCS_FUL+= StaticAnalyzer/Core/CommonBugCategories.cpp SRCS_FUL+= StaticAnalyzer/Core/ConstraintManager.cpp SRCS_FUL+= StaticAnalyzer/Core/CoreEngine.cpp +SRCS_FUL+= StaticAnalyzer/Core/DynamicType.cpp SRCS_FUL+= StaticAnalyzer/Core/Environment.cpp SRCS_FUL+= StaticAnalyzer/Core/ExplodedGraph.cpp SRCS_FUL+= StaticAnalyzer/Core/ExprEngine.cpp From owner-svn-src-projects@freebsd.org Sun Jan 26 18:04:09 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C4B61F6163 for ; Sun, 26 Jan 2020 18:04:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485LNn2h60z4Knf; Sun, 26 Jan 2020 18:04:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DB2924F43; Sun, 26 Jan 2020 18:04:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QI49m3037653; Sun, 26 Jan 2020 18:04:09 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QI49FF037652; Sun, 26 Jan 2020 18:04:09 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261804.00QI49FF037652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 18:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357150 - projects/nfs-over-tls X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfs-over-tls X-SVN-Commit-Revision: 357150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 18:04:09 -0000 Author: rmacklem Date: Sun Jan 26 18:04:08 2020 New Revision: 357150 URL: https://svnweb.freebsd.org/changeset/base/357150 Log: Set up a projects area for the NFS over TLS project. Added: projects/nfs-over-tls/ - copied from r357149, head/sys/ Directory Properties: projects/nfs-over-tls/sys/ (props changed) From owner-svn-src-projects@freebsd.org Sun Jan 26 18:05:46 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C43191F61DE for ; Sun, 26 Jan 2020 18:05:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485LQf4myFz4KtC; Sun, 26 Jan 2020 18:05:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8543A24F46; Sun, 26 Jan 2020 18:05:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QI5kNe037773; Sun, 26 Jan 2020 18:05:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QI5kwd037772; Sun, 26 Jan 2020 18:05:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261805.00QI5kwd037772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 18:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357151 - projects/nfs-over-tls/usr.sbin X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfs-over-tls/usr.sbin X-SVN-Commit-Revision: 357151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 18:05:46 -0000 Author: rmacklem Date: Sun Jan 26 18:05:46 2020 New Revision: 357151 URL: https://svnweb.freebsd.org/changeset/base/357151 Log: Add the usr.sbin subtree to projects/nfs-over-tls. Added: - copied from r357150, head/usr.sbin/ Directory Properties: projects/nfs-over-tls/usr.sbin/ (props changed) From owner-svn-src-projects@freebsd.org Sun Jan 26 18:43:33 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D40C1F76AC for ; Sun, 26 Jan 2020 18:43:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485MGF1nyRz4Mss; Sun, 26 Jan 2020 18:43:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38C4B256C9; Sun, 26 Jan 2020 18:43:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QIhX4u061832; Sun, 26 Jan 2020 18:43:33 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QIhV4l061824; Sun, 26 Jan 2020 18:43:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261843.00QIhV4l061824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 18:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357152 - projects/nfs-over-tls/sys/rpc X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfs-over-tls/sys/rpc X-SVN-Commit-Revision: 357152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 18:43:33 -0000 Author: rmacklem Date: Sun Jan 26 18:43:31 2020 New Revision: 357152 URL: https://svnweb.freebsd.org/changeset/base/357152 Log: Patch the kernel RPC files for handling RPC-over-TLS. Modified: projects/nfs-over-tls/sys/rpc/auth.h projects/nfs-over-tls/sys/rpc/clnt.h projects/nfs-over-tls/sys/rpc/clnt_rc.c projects/nfs-over-tls/sys/rpc/clnt_stat.h projects/nfs-over-tls/sys/rpc/clnt_vc.c projects/nfs-over-tls/sys/rpc/krpc.h projects/nfs-over-tls/sys/rpc/svc.h projects/nfs-over-tls/sys/rpc/svc_auth.c projects/nfs-over-tls/sys/rpc/svc_vc.c Modified: projects/nfs-over-tls/sys/rpc/auth.h ============================================================================== --- projects/nfs-over-tls/sys/rpc/auth.h Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/auth.h Sun Jan 26 18:43:31 2020 (r357152) @@ -150,6 +150,7 @@ enum auth_stat { */ RPCSEC_GSS_CREDPROBLEM = 13, RPCSEC_GSS_CTXPROBLEM = 14, + /* Also used by RPCSEC_TLS for the same purpose */ RPCSEC_GSS_NODISPATCH = 0x8000000 }; @@ -249,6 +250,7 @@ extern AUTH *authunix_create(char *, u_int, u_int, int extern AUTH *authunix_create_default(void); /* takes no parameters */ #endif extern AUTH *authnone_create(void); /* takes no parameters */ +extern AUTH *authtls_create(void); /* takes no parameters */ __END_DECLS /* * DES style authentication @@ -344,6 +346,7 @@ struct rpc_msg; enum auth_stat _svcauth_null (struct svc_req *, struct rpc_msg *); enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); +enum auth_stat _svcauth_rpcsec_tls (struct svc_req *, struct rpc_msg *); __END_DECLS #define AUTH_NONE 0 /* no authentication */ @@ -355,6 +358,7 @@ __END_DECLS #define AUTH_DES AUTH_DH /* for backward compatibility */ #define AUTH_KERB 4 /* kerberos style */ #define RPCSEC_GSS 6 /* RPCSEC_GSS */ +#define AUTH_TLS 7 /* Initiate RPC-over-TLS */ /* * Pseudo auth flavors for RPCSEC_GSS. Modified: projects/nfs-over-tls/sys/rpc/clnt.h ============================================================================== --- projects/nfs-over-tls/sys/rpc/clnt.h Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/clnt.h Sun Jan 26 18:43:31 2020 (r357152) @@ -357,6 +357,8 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_ #define CLSET_PRIVPORT 27 /* set privileged source port flag */ #define CLGET_PRIVPORT 28 /* get privileged source port flag */ #define CLSET_BACKCHANNEL 29 /* set backchannel for socket */ +#define CLSET_TLS 30 /* set TLS for socket */ +#define CLSET_BLOCKRCV 31 /* Temporarily block reception */ #endif Modified: projects/nfs-over-tls/sys/rpc/clnt_rc.c ============================================================================== --- projects/nfs-over-tls/sys/rpc/clnt_rc.c Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/clnt_rc.c Sun Jan 26 18:43:31 2020 (r357152) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static enum clnt_stat clnt_reconnect_call(CLIENT *, struct rpc_callextra *, rpcproc_t, struct mbuf *, struct mbuf **, struct timeval); @@ -193,6 +194,24 @@ clnt_reconnect_connect(CLIENT *cl) newclient = clnt_vc_create(so, (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers, rc->rc_sendsz, rc->rc_recvsz, rc->rc_intr); + if (rc->rc_tls != 0 && newclient != NULL) { +printf("at rpctls_connect\n"); + stat = rpctls_connect(newclient, so); +printf("aft rpctls_connect=%d\n", stat); + if (stat != RPC_SUCCESS) { + if (stat != RPC_SYSTEMERROR) + stat = rpc_createerr.cf_stat = + RPC_TLSCONNECT; + else + stat = rpc_createerr.cf_stat = stat; + rpc_createerr.cf_error.re_errno = 0; + CLNT_CLOSE(newclient); + CLNT_RELEASE(newclient); + newclient = NULL; + td->td_ucred = oldcred; + goto out; + } + } } td->td_ucred = oldcred; @@ -470,6 +489,10 @@ clnt_reconnect_control(CLIENT *cl, u_int request, void xprt = (SVCXPRT *)info; xprt_register(xprt); rc->rc_backchannel = info; + break; + + case CLSET_TLS: + rc->rc_tls = 1; break; default: Modified: projects/nfs-over-tls/sys/rpc/clnt_stat.h ============================================================================== --- projects/nfs-over-tls/sys/rpc/clnt_stat.h Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/clnt_stat.h Sun Jan 26 18:43:31 2020 (r357152) @@ -73,7 +73,11 @@ enum clnt_stat { RPC_STALERACHANDLE = 25, RPC_CANTCONNECT = 26, /* couldn't make connection (cots) */ RPC_XPRTFAILED = 27, /* received discon from remote (cots) */ - RPC_CANTCREATESTREAM = 28 /* can't push rpc module (cots) */ + RPC_CANTCREATESTREAM = 28, /* can't push rpc module (cots) */ + /* + * TLS errors + */ + RPC_TLSCONNECT = 29 /* can't do TLS handshake */ }; #ifdef __cplusplus Modified: projects/nfs-over-tls/sys/rpc/clnt_vc.c ============================================================================== --- projects/nfs-over-tls/sys/rpc/clnt_vc.c Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/clnt_vc.c Sun Jan 26 18:43:31 2020 (r357152) @@ -733,6 +733,13 @@ clnt_vc_control(CLIENT *cl, u_int request, void *info) } break; + case CLSET_BLOCKRCV: + if (*(int *) info) + ct->ct_dontrcv = TRUE; + else + ct->ct_dontrcv = FALSE; + break; + default: mtx_unlock(&ct->ct_lock); return (FALSE); @@ -859,6 +866,15 @@ clnt_vc_soupcall(struct socket *so, void *arg, int wai struct cf_conn *cd; CTASSERT(sizeof(xid_plus_direction) == 2 * sizeof(uint32_t)); + + /* RPC-over-TLS needs to block reception during handshake upcall. */ + mtx_lock(&ct->ct_lock); + if (ct->ct_dontrcv) { + mtx_unlock(&ct->ct_lock); + return (SU_OK); + } + mtx_unlock(&ct->ct_lock); + ct->ct_upcallrefs++; uio.uio_td = curthread; do { Modified: projects/nfs-over-tls/sys/rpc/krpc.h ============================================================================== --- projects/nfs-over-tls/sys/rpc/krpc.h Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/krpc.h Sun Jan 26 18:43:31 2020 (r357152) @@ -78,6 +78,7 @@ struct rc_data { CLIENT* rc_client; /* underlying RPC client */ struct rpc_err rc_err; void *rc_backchannel; + int rc_tls; /* Enable TLS on connection */ }; struct ct_data { @@ -101,6 +102,7 @@ struct ct_data { struct ct_request_list ct_pending; int ct_upcallrefs; /* Ref cnt of upcalls in prog. */ SVCXPRT *ct_backchannelxprt; /* xprt for backchannel */ + bool_t ct_dontrcv; /* TRUE to block receiving */ }; struct cf_conn { /* kept in xprt->xp_p1 for actual connection */ Modified: projects/nfs-over-tls/sys/rpc/svc.h ============================================================================== --- projects/nfs-over-tls/sys/rpc/svc.h Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/svc.h Sun Jan 26 18:43:31 2020 (r357152) @@ -175,6 +175,7 @@ typedef struct __rpc_svcxprt { int xp_upcallset; /* socket upcall is set up */ uint32_t xp_snd_cnt; /* # of bytes to send to socket */ uint32_t xp_snt_cnt; /* # of bytes sent to socket */ + bool_t xp_dontrcv; /* Do not receive on the socket */ #else int xp_fd; u_short xp_port; /* associated port number */ Modified: projects/nfs-over-tls/sys/rpc/svc_auth.c ============================================================================== --- projects/nfs-over-tls/sys/rpc/svc_auth.c Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/svc_auth.c Sun Jan 26 18:43:31 2020 (r357152) @@ -104,6 +104,9 @@ _authenticate(struct svc_req *rqst, struct rpc_msg *ms return (AUTH_REJECTEDCRED); dummy = _svcauth_rpcsec_gss(rqst, msg); return (dummy); + case AUTH_TLS: + dummy = _svcauth_rpcsec_tls(rqst, msg); + return (dummy); default: break; } Modified: projects/nfs-over-tls/sys/rpc/svc_vc.c ============================================================================== --- projects/nfs-over-tls/sys/rpc/svc_vc.c Sun Jan 26 18:05:46 2020 (r357151) +++ projects/nfs-over-tls/sys/rpc/svc_vc.c Sun Jan 26 18:43:31 2020 (r357152) @@ -732,6 +732,15 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_msg *msg, } /* + * If receiving is disabled so that a TLS handshake can be + * done by the rpctlssd daemon, return FALSE here. + */ + if (xprt->xp_dontrcv) { + sx_xunlock(&xprt->xp_lock); + return (FALSE); + } + + /* * The socket upcall calls xprt_active() which will eventually * cause the server to call us here. We attempt to * read as much as possible from the socket and put From owner-svn-src-projects@freebsd.org Sun Jan 26 18:57:13 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 729881F7BF6 for ; Sun, 26 Jan 2020 18:57:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485MZ12JvNz4NW3; Sun, 26 Jan 2020 18:57:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AA5A25903; Sun, 26 Jan 2020 18:57:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QIvDei067996; Sun, 26 Jan 2020 18:57:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QIvD0i067995; Sun, 26 Jan 2020 18:57:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001261857.00QIvD0i067995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 26 Jan 2020 18:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357153 - projects/clang1000-import/lib/clang/libllvm X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/lib/clang/libllvm X-SVN-Commit-Revision: 357153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 18:57:13 -0000 Author: dim Date: Sun Jan 26 18:57:12 2020 New Revision: 357153 URL: https://svnweb.freebsd.org/changeset/base/357153 Log: Update build glue for a world stage, e.g. when not only clang, but also llvm-ar, llvm-nm, llvm-objdump and llvm-symbolizer are built. Modified: projects/clang1000-import/lib/clang/libllvm/Makefile Modified: projects/clang1000-import/lib/clang/libllvm/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/libllvm/Makefile Sun Jan 26 18:43:31 2020 (r357152) +++ projects/clang1000-import/lib/clang/libllvm/Makefile Sun Jan 26 18:57:12 2020 (r357153) @@ -774,6 +774,7 @@ SRCS_MIN+= Object/RecordStreamer.cpp SRCS_MIW+= Object/RelocationResolver.cpp SRCS_MIW+= Object/SymbolSize.cpp SRCS_MIN+= Object/SymbolicFile.cpp +SRCS_MIW+= Object/TapiUniversal.cpp SRCS_MIN+= Object/WasmObjectFile.cpp SRCS_MIW+= Object/WindowsMachineFlag.cpp SRCS_MIN+= Object/WindowsResource.cpp @@ -1320,6 +1321,14 @@ SRCS_MIN+= Target/X86/X86VZeroUpper.cpp SRCS_MIN+= Target/X86/X86WinAllocaExpander.cpp SRCS_MIN+= Target/X86/X86WinEHState.cpp .endif # MK_LLVM_TARGET_X86 +SRCS_MIW+= TextAPI/MachO/Architecture.cpp +SRCS_MIW+= TextAPI/MachO/ArchitectureSet.cpp +SRCS_MIW+= TextAPI/MachO/InterfaceFile.cpp +SRCS_MIW+= TextAPI/MachO/PackedVersion.cpp +SRCS_MIW+= TextAPI/MachO/Platform.cpp +SRCS_MIW+= TextAPI/MachO/Target.cpp +SRCS_MIW+= TextAPI/MachO/TextStub.cpp +SRCS_MIW+= TextAPI/MachO/TextStubCommon.cpp SRCS_MIN+= ToolDrivers/llvm-dlltool/DlltoolDriver.cpp SRCS_MIW+= ToolDrivers/llvm-lib/LibDriver.cpp SRCS_MIN+= Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp From owner-svn-src-projects@freebsd.org Sun Jan 26 18:57:34 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A58901F7C1C for ; Sun, 26 Jan 2020 18:57:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485MZQ4g91z4NbQ; Sun, 26 Jan 2020 18:57:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81FAB25904; Sun, 26 Jan 2020 18:57:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QIvYrU068056; Sun, 26 Jan 2020 18:57:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QIvXO3068052; Sun, 26 Jan 2020 18:57:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261857.00QIvXO3068052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 18:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357154 - in projects/nfs-over-tls/sys/rpc: . rpcsec_tls X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in projects/nfs-over-tls/sys/rpc: . rpcsec_tls X-SVN-Commit-Revision: 357154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 18:57:34 -0000 Author: rmacklem Date: Sun Jan 26 18:57:33 2020 New Revision: 357154 URL: https://svnweb.freebsd.org/changeset/base/357154 Log: Add some new files for the RPC-over-TLS kernel rpc. Added: projects/nfs-over-tls/sys/rpc/rpcsec_tls/ projects/nfs-over-tls/sys/rpc/rpcsec_tls.h (contents, props changed) projects/nfs-over-tls/sys/rpc/rpcsec_tls/auth_tls.c (contents, props changed) projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctls_impl.c (contents, props changed) projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctlscd.x projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctlssd.x Added: projects/nfs-over-tls/sys/rpc/rpcsec_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/sys/rpc/rpcsec_tls.h Sun Jan 26 18:57:33 2020 (r357154) @@ -0,0 +1,48 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Rick Macklem + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _RPCTLS_IMPL_H +#define _RPCTLS_IMPL_H + +/* Operation values for rpctls syscall. */ +#define RPCTLS_SYSC_SETPATH 1 +#define RPCTLS_SYSC_CONNECT 2 +#define RPCTLS_SYSC_SERVER 3 + +#ifdef _KERNEL +/* Functions that perform upcalls to the rpctlsd daemon. */ +enum clnt_stat rpctls_connect(CLIENT *newclient, struct socket *so); +enum clnt_stat rpctls_server(struct socket *so); + +/* String for AUTH_TLS reply verifier. */ +#define RPCTLS_START_STRING "STARTTLS" + +#endif /* _KERNEL */ + +#endif /* _RPCTLS_IMPL_H */ Added: projects/nfs-over-tls/sys/rpc/rpcsec_tls/auth_tls.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/sys/rpc/rpcsec_tls/auth_tls.c Sun Jan 26 18:57:33 2020 (r357154) @@ -0,0 +1,169 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * auth_none.c + * Creates a client authentication handle for passing "null" + * credentials and verifiers to remote systems. + * + * Copyright (C) 1984, Sun Microsystems, Inc. + */ + +/* + * Modified from auth_none.c to expect a reply verifier of "STARTTLS" + * for the RPC-over-TLS STARTTLS command. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define MAX_MARSHAL_SIZE 20 + +/* + * Authenticator operations routines + */ + +static bool_t authtls_marshal (AUTH *, uint32_t, XDR *, struct mbuf *); +static void authtls_verf (AUTH *); +static bool_t authtls_validate (AUTH *, uint32_t, struct opaque_auth *, + struct mbuf **); +static bool_t authtls_refresh (AUTH *, void *); +static void authtls_destroy (AUTH *); + +static struct auth_ops authtls_ops = { + .ah_nextverf = authtls_verf, + .ah_marshal = authtls_marshal, + .ah_validate = authtls_validate, + .ah_refresh = authtls_refresh, + .ah_destroy = authtls_destroy, +}; + +struct authtls_private { + AUTH no_client; + char mclient[MAX_MARSHAL_SIZE]; + u_int mcnt; +}; + +static struct authtls_private authtls_private; +static struct opaque_auth _tls_null_auth; + +static void +authtls_init(void *dummy) +{ + struct authtls_private *ap = &authtls_private; + XDR xdrs; + + _tls_null_auth.oa_flavor = AUTH_TLS; + _tls_null_auth.oa_base = NULL; + _tls_null_auth.oa_length = 0; + ap->no_client.ah_cred = _tls_null_auth; + ap->no_client.ah_verf = _null_auth; + ap->no_client.ah_ops = &authtls_ops; + xdrmem_create(&xdrs, ap->mclient, MAX_MARSHAL_SIZE, XDR_ENCODE); + xdr_opaque_auth(&xdrs, &ap->no_client.ah_cred); + xdr_opaque_auth(&xdrs, &ap->no_client.ah_verf); + ap->mcnt = XDR_GETPOS(&xdrs); + XDR_DESTROY(&xdrs); +} +SYSINIT(authtls_init, SI_SUB_KMEM, SI_ORDER_ANY, authtls_init, NULL); + +AUTH * +authtls_create(void) +{ + struct authtls_private *ap = &authtls_private; + + return (&ap->no_client); +} + +/*ARGSUSED*/ +static bool_t +authtls_marshal(AUTH *client, uint32_t xid, XDR *xdrs, struct mbuf *args) +{ + struct authtls_private *ap = &authtls_private; + + KASSERT(xdrs != NULL, ("authtls_marshal: xdrs is null")); + + if (!XDR_PUTBYTES(xdrs, ap->mclient, ap->mcnt)) + return (FALSE); + + xdrmbuf_append(xdrs, args); + + return (TRUE); +} + +/* All these unused parameters are required to keep ANSI-C from grumbling */ +/*ARGSUSED*/ +static void +authtls_verf(AUTH *client) +{ +} + +/*ARGSUSED*/ +static bool_t +authtls_validate(AUTH *client, uint32_t xid, struct opaque_auth *opaque, + struct mbuf **mrepp) +{ + size_t strsiz; + + strsiz = strlen(RPCTLS_START_STRING); + /* The verifier must be the string RPCTLS_START_STRING. */ + if (opaque != NULL && + (opaque->oa_length != strsiz || memcmp(opaque->oa_base, + RPCTLS_START_STRING, strsiz) != 0)) + return (FALSE); + return (TRUE); +} + +/*ARGSUSED*/ +static bool_t +authtls_refresh(AUTH *client, void *dummy) +{ + + return (FALSE); +} + +/*ARGSUSED*/ +static void +authtls_destroy(AUTH *client) +{ +} Added: projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctls_impl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctls_impl.c Sun Jan 26 18:57:33 2020 (r357154) @@ -0,0 +1,507 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Modified from the kernel GSSAPI code for RPC-over-TLS. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "rpctlscd.h" +#include "rpctlssd.h" + +extern struct fileops badfileops; + +/* + * Syscall hooks + */ +static struct syscall_helper_data rpctls_syscalls[] = { + SYSCALL_INIT_HELPER(gssd_syscall), + SYSCALL_INIT_LAST +}; + +#ifdef notnow +struct rpctls_syscall_args { + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; +}; +#endif + +static CLIENT *rpctls_connect_handle; +static struct mtx rpctls_connect_lock; +static struct socket *rpctls_connect_so = NULL; +static struct file *rpctls_connect_fp = NULL; +static int rpctls_connect_fd = -1; +static CLIENT *rpctls_server_handle; +static struct mtx rpctls_server_lock; +static struct socket *rpctls_server_so = NULL; +static struct file *rpctls_server_fp = NULL; +static int rpctls_server_fd = -1; +static struct opaque_auth rpctls_null_verf; + +static CLIENT *rpctls_connect_client(void); +static CLIENT *rpctls_server_client(void); + +static void +rpctls_init(void *dummy) +{ + int error; + + error = syscall_helper_register(rpctls_syscalls, SY_THR_STATIC_KLD); + if (error != 0) + printf("rpctls_init: cannot register syscall\n"); + mtx_init(&rpctls_connect_lock, "rpctls_connect_lock", NULL, + MTX_DEF); + mtx_init(&rpctls_server_lock, "rpctls_server_lock", NULL, + MTX_DEF); + rpctls_null_verf.oa_flavor = AUTH_NULL; + rpctls_null_verf.oa_base = RPCTLS_START_STRING; + rpctls_null_verf.oa_length = strlen(RPCTLS_START_STRING); +printf("RPCTLS init done\n"); +} +SYSINIT(rpctls_init, SI_SUB_KMEM, SI_ORDER_ANY, rpctls_init, NULL); + +int +sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap) +{ + struct sockaddr_un sun; + struct netconfig *nconf; + struct file *fp; + struct socket *so; + char path[MAXPATHLEN], *pathp; + int fd, error, retry_count = 5; + CLIENT *cl, *oldcl; + bool ssd; + +printf("in gssd syscall\n"); + error = priv_check(td, PRIV_NFS_DAEMON); +printf("aft priv_check=%d\n", error); + if (error != 0) + return (error); + +#ifdef notyet + switch (uap->op) { + case RPCTLS_SYSC_SETPATH: +#else + error = copyinstr(uap->path, path, sizeof(path), NULL); +printf("setting err=%d path=%s\n", error, path); + if (error != 0) + return (error); + if (path[0] == 'S') { + ssd = true; + pathp = &path[1]; + } else { + ssd = false; + pathp = &path[0]; + } + if (pathp[0] == '/' || pathp[0] == '\0') { +#endif + if (ssd) { + if (error == 0 && strlen(pathp) + 1 > sizeof(sun.sun_path)) + error = EINVAL; + + if (error == 0 && pathp[0] != '\0') { + sun.sun_family = AF_LOCAL; + strlcpy(sun.sun_path, pathp, sizeof(sun.sun_path)); + sun.sun_len = SUN_LEN(&sun); + + nconf = getnetconfigent("local"); + cl = clnt_reconnect_create(nconf, + (struct sockaddr *)&sun, RPCTLSSD, RPCTLSSDVERS, + RPC_MAXDATASIZE, RPC_MAXDATASIZE); +printf("got cl=%p\n", cl); + /* + * The number of retries defaults to INT_MAX, which + * effectively means an infinite, uninterruptable loop. + * Limiting it to five retries keeps it from running + * forever. + */ + if (cl != NULL) + CLNT_CONTROL(cl, CLSET_RETRIES, &retry_count); + } else + cl = NULL; + + mtx_lock(&rpctls_server_lock); + oldcl = rpctls_server_handle; + rpctls_server_handle = cl; + mtx_unlock(&rpctls_server_lock); + +printf("cl=%p oldcl=%p\n", cl, oldcl); + if (oldcl != NULL) { + CLNT_CLOSE(oldcl); + CLNT_RELEASE(oldcl); + } + } else { + if (error == 0 && strlen(pathp) + 1 > sizeof(sun.sun_path)) + error = EINVAL; + + if (error == 0 && pathp[0] != '\0') { + sun.sun_family = AF_LOCAL; + strlcpy(sun.sun_path, pathp, sizeof(sun.sun_path)); + sun.sun_len = SUN_LEN(&sun); + + nconf = getnetconfigent("local"); + cl = clnt_reconnect_create(nconf, + (struct sockaddr *)&sun, RPCTLSCD, RPCTLSCDVERS, + RPC_MAXDATASIZE, RPC_MAXDATASIZE); +printf("got cl=%p\n", cl); + /* + * The number of retries defaults to INT_MAX, which + * effectively means an infinite, uninterruptable loop. + * Limiting it to five retries keeps it from running + * forever. + */ + if (cl != NULL) + CLNT_CONTROL(cl, CLSET_RETRIES, &retry_count); + } else + cl = NULL; + + mtx_lock(&rpctls_connect_lock); + oldcl = rpctls_connect_handle; + rpctls_connect_handle = cl; + mtx_unlock(&rpctls_connect_lock); + +printf("cl=%p oldcl=%p\n", cl, oldcl); + if (oldcl != NULL) { + CLNT_CLOSE(oldcl); + CLNT_RELEASE(oldcl); + } + } + } else if (path[0] == 'C') { +printf("In connect\n"); + KASSERT(rpctls_connect_so != NULL, + ("rpctlsc syscall so != NULL")); + KASSERT(rpctls_connect_fd == -1, + ("rpctlsc syscall fd not -1")); + error = falloc(td, &fp, &fd, 0); +printf("falloc=%d fd=%d\n", error, fd); + if (error == 0) { + mtx_lock(&rpctls_connect_lock); + so = rpctls_connect_so; + rpctls_connect_so = NULL; + rpctls_connect_fp = fp; + rpctls_connect_fd = fd; + mtx_unlock(&rpctls_connect_lock); + finit(fp, FREAD | FWRITE, DTYPE_SOCKET, so, &socketops); + td->td_retval[0] = fd; + } +printf("returning=%d\n", fd); + } else if (path[0] == 'D') { +printf("In EOconnect\n"); + mtx_lock(&rpctls_connect_lock); + fd = rpctls_connect_fd; + rpctls_connect_fd = -1; + fp = rpctls_connect_fp; + rpctls_connect_fp = NULL; + mtx_unlock(&rpctls_connect_lock); +printf("fd=%d\n", fd); + if (fd >= 0) { + /* + * Since the daemon will not be using the fd any + * more, we want to close the fd, but we do not + * want to soclose() the associated socket. + * Set f_ops == badfileops so that kern_close() will + * not do a soclose(). + */ + fp->f_ops = &badfileops; + kern_close(td, fd); +printf("aft kern_close\n"); + } else + printf("rpctlsc fd -1\n"); + } else if (path[0] == 'E') { +printf("In srvconnect\n"); + KASSERT(rpctls_server_so != NULL, + ("rpctlss syscall so != NULL")); + KASSERT(rpctls_server_fd == -1, + ("rpctlss syscall fd not -1")); + error = falloc(td, &fp, &fd, 0); +printf("srv falloc=%d fd=%d\n", error, fd); + if (error == 0) { + mtx_lock(&rpctls_server_lock); + so = rpctls_server_so; + rpctls_server_so = NULL; + rpctls_server_fp = fp; + rpctls_server_fd = fd; + mtx_unlock(&rpctls_server_lock); + finit(fp, FREAD | FWRITE, DTYPE_SOCKET, so, &socketops); + td->td_retval[0] = fd; + } +printf("srv returning=%d\n", fd); + } else if (path[0] == 'F') { +printf("In EOserver\n"); + mtx_lock(&rpctls_server_lock); + fd = rpctls_server_fd; + rpctls_server_fd = -1; + fp = rpctls_server_fp; + rpctls_server_fp = NULL; + mtx_unlock(&rpctls_server_lock); +printf("srv fd=%d\n", fd); + if (fd >= 0) { + /* + * Since the daemon will not be using the fd any + * more, we want to close the fd, but we do not + * want to soclose() the associated socket. + * Set f_ops == badfileops so that kern_close() will + * not do a soclose(). + */ + fp->f_ops = &badfileops; + kern_close(td, fd); +printf("srv aft kern_close\n"); + } else + printf("rpctlss fd -1\n"); + } + + return (error); +} + +/* + * Acquire the rpctls_connect_handle and return it with a reference count, + * if it is available. + */ +static CLIENT * +rpctls_connect_client(void) +{ + CLIENT *cl; + + mtx_lock(&rpctls_connect_lock); + cl = rpctls_connect_handle; + if (cl != NULL) + CLNT_ACQUIRE(cl); + mtx_unlock(&rpctls_connect_lock); + return (cl); +} + +/* + * Acquire the rpctls_server_handle and return it with a reference count, + * if it is available. + */ +static CLIENT * +rpctls_server_client(void) +{ + CLIENT *cl; + + mtx_lock(&rpctls_server_lock); + cl = rpctls_server_handle; + if (cl != NULL) + CLNT_ACQUIRE(cl); + mtx_unlock(&rpctls_server_lock); + return (cl); +} + +/* Do an upcall for a new socket connect using TLS. */ +enum clnt_stat +rpctls_connect(CLIENT *newclient, struct socket *so) +{ + struct rpc_callextra ext; + struct timeval utimeout; + enum clnt_stat stat; + CLIENT *cl; + int val; + static bool rpctls_connect_busy = false; + +printf("In rpctls_connect\n"); + cl = rpctls_connect_client(); +printf("connect_client=%p\n", cl); + if (cl == NULL) + return (RPC_TLSCONNECT); + + /* First, do the AUTH_TLS NULL RPC. */ + memset(&ext, 0, sizeof(ext)); + utimeout.tv_sec = 30; + utimeout.tv_usec = 0; + ext.rc_auth = authtls_create(); +printf("authtls=%p\n", ext.rc_auth); + stat = clnt_call_private(newclient, &ext, NULLPROC, (xdrproc_t)xdr_void, + NULL, (xdrproc_t)xdr_void, NULL, utimeout); +printf("aft NULLRPC=%d\n", stat); + AUTH_DESTROY(ext.rc_auth); + if (stat != RPC_SUCCESS) + return (RPC_SYSTEMERROR); + + /* Serialize the connect upcalls. */ + mtx_lock(&rpctls_connect_lock); + while (rpctls_connect_busy) + msleep(&rpctls_connect_busy, &rpctls_connect_lock, PVFS, + "rtlscn", 0); + rpctls_connect_busy = true; + rpctls_connect_so = so; + mtx_unlock(&rpctls_connect_lock); +printf("rpctls_conect so=%p\n", so); + + /* Temporarily block reception during the handshake upcall. */ + val = 1; + CLNT_CONTROL(newclient, CLSET_BLOCKRCV, &val); + + /* Do the connect handshake upcall. */ + stat = rpctlscd_connect_1(NULL, NULL, cl); +printf("aft connect upcall=%d\n", stat); + CLNT_RELEASE(cl); + + /* Unblock reception. */ + val = 0; + CLNT_CONTROL(newclient, CLSET_BLOCKRCV, &val); + + /* Once the upcall is done, the daemon is done with the fp and so. */ + mtx_lock(&rpctls_connect_lock); + rpctls_connect_so = NULL; + rpctls_connect_fd = -1; + rpctls_connect_busy = false; + wakeup(&rpctls_connect_busy); + mtx_unlock(&rpctls_connect_lock); +printf("aft wakeup\n"); + + return (stat); +} + +/* Do an upcall for a new server socket using TLS. */ +enum clnt_stat +rpctls_server(struct socket *so) +{ + enum clnt_stat stat; + CLIENT *cl; + static bool rpctls_server_busy = false; + +printf("In rpctls_server\n"); + cl = rpctls_server_client(); +printf("server_client=%p\n", cl); + if (cl == NULL) + return (RPC_SYSTEMERROR); + + /* Serialize the server upcalls. */ + mtx_lock(&rpctls_server_lock); + while (rpctls_server_busy) + msleep(&rpctls_server_busy, &rpctls_server_lock, PVFS, + "rtlssn", 0); + rpctls_server_busy = true; + rpctls_server_so = so; + mtx_unlock(&rpctls_server_lock); +printf("rpctls_conect so=%p\n", so); + + /* Do the server upcall. */ + stat = rpctlssd_connect_1(NULL, NULL, cl); +printf("aft server upcall=%d\n", stat); + CLNT_RELEASE(cl); + + /* Once the upcall is done, the daemon is done with the fp and so. */ + mtx_lock(&rpctls_server_lock); + rpctls_server_so = NULL; + rpctls_server_fd = -1; + rpctls_server_busy = false; + wakeup(&rpctls_server_busy); + mtx_unlock(&rpctls_server_lock); +printf("aft wakeup\n"); + + return (stat); +} + +/* + * Handle the NULL RPC with authentication flavor of AUTH_TLS. + * This is a STARTTLS command, so do the upcall to the rpctlssd daemon, + * which will do the TLS handshake. + */ +enum auth_stat +_svcauth_rpcsec_tls(struct svc_req *rqst, struct rpc_msg *msg) + +{ + bool_t call_stat; + enum clnt_stat stat; + SVCXPRT *xprt; + + /* Initialize reply. */ + rqst->rq_verf = rpctls_null_verf; +printf("authtls: clen=%d vlen=%d fl=%d\n", rqst->rq_cred.oa_length, msg->rm_call.cb_verf.oa_length, msg->rm_call.cb_verf.oa_flavor); + + /* Check client credentials. */ + if (rqst->rq_cred.oa_length != 0 || + msg->rm_call.cb_verf.oa_length != 0 || + msg->rm_call.cb_verf.oa_flavor != AUTH_NULL) + return (AUTH_BADCRED); + +printf("authtls proc=%d\n", rqst->rq_proc); + if (rqst->rq_proc != NULLPROC) + return (AUTH_REJECTEDCRED); + + /* + * Disable reception for the krpc so that the TLS handshake can + * be done on the socket in the rpctlssd daemon. + */ + xprt = rqst->rq_xprt; + sx_xlock(&xprt->xp_lock); + xprt->xp_dontrcv = TRUE; + sx_xunlock(&xprt->xp_lock); + + /* + * Send the reply to the NULL RPC with AUTH_TLS, which is the + * STARTTLS command for Sun RPC. + */ + call_stat = svc_sendreply(rqst, (xdrproc_t)xdr_void, NULL); +printf("authtls: null reply=%d\n", call_stat); + if (!call_stat) { + sx_xlock(&xprt->xp_lock); + xprt->xp_dontrcv = FALSE; + sx_xunlock(&xprt->xp_lock); + xprt_active(xprt); /* Harmless if already active. */ + return (AUTH_FAILED); + } + + /* Do an upcall to do the TLS handshake. */ + stat = rpctls_server(rqst->rq_xprt->xp_socket); + + /* Re-enable reception on the socket within the krpc. */ + sx_xlock(&xprt->xp_lock); + xprt->xp_dontrcv = FALSE; + sx_xunlock(&xprt->xp_lock); + xprt_active(xprt); /* Harmless if already active. */ +printf("authtls: aft handshake stat=%d\n", stat); + + if (stat != RPC_SUCCESS) + return (AUTH_FAILED); + return (RPCSEC_GSS_NODISPATCH); +} + Added: projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctlscd.x ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctlscd.x Sun Jan 26 18:57:33 2020 (r357154) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Modified from gssd.x for the client side of RPC-over-TLS. */ + +/* $FreeBSD$ */ + +program RPCTLSCD { + version RPCTLSCDVERS { + void RPCTLSCD_NULL(void) = 0; + + void RPCTLSCD_CONNECT(void) = 1; + } = 1; +} = 0x40677374; Added: projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctlssd.x ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/sys/rpc/rpcsec_tls/rpctlssd.x Sun Jan 26 18:57:33 2020 (r357154) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Modified from gssd.x for the server side of RPC-over-TLS. */ + +/* $FreeBSD$ */ + +program RPCTLSSD { + version RPCTLSSDVERS { + void RPCTLSSD_NULL(void) = 0; + + void RPCTLSSD_CONNECT(void) = 1; + } = 1; +} = 0x40677375; From owner-svn-src-projects@freebsd.org Sun Jan 26 19:08:38 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D77A1F839B for ; Sun, 26 Jan 2020 19:08:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485MqB2p5Lz4PHx; Sun, 26 Jan 2020 19:08:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B51F25AE6; Sun, 26 Jan 2020 19:08:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QJ8cmF074149; Sun, 26 Jan 2020 19:08:38 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QJ8cZs074148; Sun, 26 Jan 2020 19:08:38 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261908.00QJ8cZs074148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 19:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357155 - projects/nfs-over-tls/sys/conf X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfs-over-tls/sys/conf X-SVN-Commit-Revision: 357155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 19:08:38 -0000 Author: rmacklem Date: Sun Jan 26 19:08:37 2020 New Revision: 357155 URL: https://svnweb.freebsd.org/changeset/base/357155 Log: Update sys/conf/files to build the new files for RPC-over-TLS. With this patch, the kernel should now build with the new RPC-over-TLS code in it. I have not yet added the Makefile changes for the kernel RPC module build to sys/modules/krpc. It sort of works, in the sense that it does a handshake when the rpctlscd (client) and rpctlssd (server) daemons are running, and then does unencrypted NFS RPCs (assuming the kernel does not have the KERN_KTLS option). The ktls needs to support receive before encryption can be done. It also currently (mis)uses the gssd_syscall, so the gssd can't be run with this kernel. Adding a new syscall will be done later. (It is just more convenient to test this was instead of having to build the libc syscall glue, etc.) Modified: projects/nfs-over-tls/sys/conf/files Modified: projects/nfs-over-tls/sys/conf/files ============================================================================== --- projects/nfs-over-tls/sys/conf/files Sun Jan 26 18:57:33 2020 (r357154) +++ projects/nfs-over-tls/sys/conf/files Sun Jan 26 19:08:37 2020 (r357155) @@ -4850,6 +4850,41 @@ rpc/svc_auth_unix.c optional krpc | nfslockd | nfscl rpc/svc_dg.c optional krpc | nfslockd | nfscl | nfsd rpc/svc_generic.c optional krpc | nfslockd | nfscl | nfsd rpc/svc_vc.c optional krpc | nfslockd | nfscl | nfsd +# +# Kernel RPC-over-TLS +# +rpctlscd.h optional krpc | nfslockd | nfscl | nfsd \ + dependency "$S/rpc/rpcsec_tls/rpctlscd.x" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -hM $S/rpc/rpcsec_tls/rpctlscd.x | grep -v pthread.h > rpctlscd.h" \ + no-obj no-implicit-rule before-depend local \ + clean "rpctlscd.h" +rpctlscd_xdr.c optional krpc | nfslockd | nfscl | nfsd \ + dependency "$S/rpc/rpcsec_tls/rpctlscd.x rpctlscd.h" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -c $S/rpc/rpcsec_tls/rpctlscd.x -o rpctlscd_xdr.c" \ + no-implicit-rule before-depend local \ + clean "rpctlscd_xdr.c" +rpctlscd_clnt.c optional krpc | nfslockd | nfscl | nfsd \ + dependency "$S/rpc/rpcsec_tls/rpctlscd.x rpctlscd.h" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -lM $S/rpc/rpcsec_tls/rpctlscd.x | grep -v string.h > rpctlscd_clnt.c" \ + no-implicit-rule before-depend local \ + clean "rpctlscd_clnt.c" +rpctlssd.h optional krpc | nfslockd | nfscl | nfsd \ + dependency "$S/rpc/rpcsec_tls/rpctlssd.x" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -hM $S/rpc/rpcsec_tls/rpctlssd.x | grep -v pthread.h > rpctlssd.h" \ + no-obj no-implicit-rule before-depend local \ + clean "rpctlssd.h" +rpctlssd_xdr.c optional krpc | nfslockd | nfscl | nfsd \ + dependency "$S/rpc/rpcsec_tls/rpctlssd.x rpctlssd.h" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -c $S/rpc/rpcsec_tls/rpctlssd.x -o rpctlssd_xdr.c" \ + no-implicit-rule before-depend local \ + clean "rpctlssd_xdr.c" +rpctlssd_clnt.c optional krpc | nfslockd | nfscl | nfsd \ + dependency "$S/rpc/rpcsec_tls/rpctlssd.x rpctlssd.h" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -lM $S/rpc/rpcsec_tls/rpctlssd.x | grep -v string.h > rpctlssd_clnt.c" \ + no-implicit-rule before-depend local \ + clean "rpctlssd_clnt.c" +rpc/rpcsec_tls/rpctls_impl.c optional krpc | nfslockd | nfscl | nfsd +rpc/rpcsec_tls/auth_tls.c optional krpc | nfslockd | nfscl | nfsd rpc/rpcsec_gss/rpcsec_gss.c optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi rpc/rpcsec_gss/rpcsec_gss_conf.c optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi rpc/rpcsec_gss/rpcsec_gss_misc.c optional krpc kgssapi | nfslockd kgssapi | nfscl kgssapi | nfsd kgssapi From owner-svn-src-projects@freebsd.org Sun Jan 26 19:16:37 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 858071F874F for ; Sun, 26 Jan 2020 19:16:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485N0P32Bnz4PsK; Sun, 26 Jan 2020 19:16:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 632A125CE1; Sun, 26 Jan 2020 19:16:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QJGbRO080010; Sun, 26 Jan 2020 19:16:37 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QJGbLY080009; Sun, 26 Jan 2020 19:16:37 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261916.00QJGbLY080009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 19:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357156 - projects/nfs-over-tls/sys/fs/nfs X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfs-over-tls/sys/fs/nfs X-SVN-Commit-Revision: 357156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 19:16:37 -0000 Author: rmacklem Date: Sun Jan 26 19:16:36 2020 New Revision: 357156 URL: https://svnweb.freebsd.org/changeset/base/357156 Log: Just enable NFS-over-TLS always for testing. A mount option to do this will be added later. Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonkrpc.c Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 26 19:08:37 2020 (r357155) +++ projects/nfs-over-tls/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 26 19:16:36 2020 (r357156) @@ -285,6 +285,7 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq CLNT_CONTROL(client, CLSET_INTERRUPTIBLE, &one); if ((nmp->nm_flag & NFSMNT_RESVPORT)) CLNT_CONTROL(client, CLSET_PRIVPORT, &one); +CLNT_CONTROL(client, CLSET_TLS, &one); if (NFSHASSOFT(nmp)) { if (nmp->nm_sotype == SOCK_DGRAM) /* From owner-svn-src-projects@freebsd.org Sun Jan 26 19:37:48 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC4EE1F9192 for ; Sun, 26 Jan 2020 19:37:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485NSr54rLz4Qh9; Sun, 26 Jan 2020 19:37:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AAD026073; Sun, 26 Jan 2020 19:37:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QJbmS3091908; Sun, 26 Jan 2020 19:37:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QJbl6n091901; Sun, 26 Jan 2020 19:37:47 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202001261937.00QJbl6n091901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jan 2020 19:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357157 - in projects/nfs-over-tls/usr.sbin: . rpctlscd rpctlssd X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in projects/nfs-over-tls/usr.sbin: . rpctlscd rpctlssd X-SVN-Commit-Revision: 357157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 19:37:48 -0000 Author: rmacklem Date: Sun Jan 26 19:37:46 2020 New Revision: 357157 URL: https://svnweb.freebsd.org/changeset/base/357157 Log: Add the rpctlscd and rpctlssd daemons to usr.sbin. These daemons do the client side (rpctlscd) and server side (rpctlssd) of the TLS handshake for the kernel RPC-over-TLS. They really need a review by someone who actually understands the OpenSSL API. Currently rpctlscd has 478 bytes in the recieve socket queue when SSL_connect() returns. SSL_read() knows how to skip over this, but for kernel socket use, the code just currently does a recv() to get it and throw it away. How to do this properly needs to be figured out. After the handshake, the code just currently does unencrypted RPCs in the kernel. Encryption can't be done until the kernel TLS knows how to do receive. Also, they currently (mis)use the gssd_syscall(), since it was easier for testing than adding a new syscall. Adding a new syscall will be done before this project is ready for head. Added: projects/nfs-over-tls/usr.sbin/rpctlscd/ projects/nfs-over-tls/usr.sbin/rpctlscd/Makefile (contents, props changed) projects/nfs-over-tls/usr.sbin/rpctlscd/rpctlscd.8 (contents, props changed) projects/nfs-over-tls/usr.sbin/rpctlscd/rpctlscd.c (contents, props changed) projects/nfs-over-tls/usr.sbin/rpctlssd/ projects/nfs-over-tls/usr.sbin/rpctlssd/Makefile (contents, props changed) projects/nfs-over-tls/usr.sbin/rpctlssd/rpctlssd.8 (contents, props changed) projects/nfs-over-tls/usr.sbin/rpctlssd/rpctlssd.c (contents, props changed) Modified: projects/nfs-over-tls/usr.sbin/Makefile Modified: projects/nfs-over-tls/usr.sbin/Makefile ============================================================================== --- projects/nfs-over-tls/usr.sbin/Makefile Sun Jan 26 19:16:36 2020 (r357156) +++ projects/nfs-over-tls/usr.sbin/Makefile Sun Jan 26 19:37:46 2020 (r357157) @@ -72,6 +72,8 @@ SUBDIR= adduser \ rarpd \ rmt \ rpcbind \ + rpctlscd \ + rpctlssd \ rpc.lockd \ rpc.statd \ rpc.umntall \ Added: projects/nfs-over-tls/usr.sbin/rpctlscd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/usr.sbin/rpctlscd/Makefile Sun Jan 26 19:37:46 2020 (r357157) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +.include + +PROG= rpctlscd +MAN= rpctlscd.8 +SRCS= rpctlscd.c rpctlscd.h rpctlscd_svc.c rpctlscd_xdr.c + +CFLAGS+= -I. +WARNS?= 1 + +LIBADD= ssl crypto + +CLEANFILES= rpctlscd_svc.c rpctlscd_xdr.c rpctlscd.h + +RPCSRC= /usr/src/sys.dec13-2019/rpc/rpcsec_tls/rpctlscd.x +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C -M + +rpctlscd_svc.c: ${RPCSRC} rpctlscd.h + ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + +rpctlscd_xdr.c: ${RPCSRC} rpctlscd.h + ${RPCGEN} -c -o ${.TARGET} ${RPCSRC} + +rpctlscd.h: ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + +.PATH: ${SRCTOP}/sys/rpc/rpcsec_tls + +.include Added: projects/nfs-over-tls/usr.sbin/rpctlscd/rpctlscd.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/usr.sbin/rpctlscd/rpctlscd.8 Sun Jan 26 19:37:46 2020 (r357157) @@ -0,0 +1,72 @@ +.\" Copyright (c) 2008 Isilon Inc http://www.isilon.com/ +.\" Authors: Doug Rabson +.\" Developed with Red Inc: Alfred Perlstein +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.\" Modified from gssd.8 for rpctlscd.8 by Rick Macklem. +.Dd January 21, 2020 +.Dt RPCTLSCD 8 +.Os +.Sh NAME +.Nm rpctlscd +.Nd "Sun RPC over TLS Client Daemon" +.Sh SYNOPSIS +.Nm +.Op Fl d +.Op Fl v +.Sh DESCRIPTION +The +.Nm +program provides support for the client side of the kernel Sun RPC over TLS +implementation. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl d +Run in debug mode. +In this mode, +.Nm +will not fork when it starts. +.It Fl v +Run in verbose mode. +In this mode, +.Nm +will log activity messages to syslog using LOG_INFO | LOG_DAEMON or to +stderr, if the +.Fl d +option has also been specified. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr openssl 3 , +.Xr syslog 3 , +.Xr mount_nfs 8 , +.Xr rpctlssd 8 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 13.0 . Added: projects/nfs-over-tls/usr.sbin/rpctlscd/rpctlscd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/usr.sbin/rpctlscd/rpctlscd.c Sun Jan 26 19:37:46 2020 (r357157) @@ -0,0 +1,345 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Modified from gssd.c for the client side of kernel RPC-over-TLS. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "rpctlscd.h" + +#ifndef _PATH_RPCTLSCDSOCK +#define _PATH_RPCTLSCDSOCK "/var/run/rpctlscd.sock" +#endif + +static int rpctls_debug_level; +static int rpctls_verbose; +static int testnossl; +static SSL_CTX *rpctls_ctx = NULL; + +static void rpctlscd_terminate(int); +static SSL_CTX *rpctls_setupcl_ssl(char *certpath); +static SSL *rpctls_connect(SSL_CTX *ctx, int s); + +extern void rpctlscd_1(struct svc_req *rqstp, SVCXPRT *transp); +extern int gssd_syscall(const char *path); + +int +main(int argc, char **argv) +{ + /* + * We provide an RPC service on a local-domain socket. The + * kernel rpctls code will upcall to this daemon to do the initial + * TLS handshake. + */ + struct sockaddr_un sun; + int fd, oldmask, ch; + SVCXPRT *xprt; + char *certpath; + + rpctls_verbose = 0; + testnossl = 0; + certpath = NULL; + while ((ch = getopt(argc, argv, "c:dtv")) != -1) { + switch (ch) { + case 'c': + certpath = optarg; + case 'd': + rpctls_debug_level++; + break; + case 't': + testnossl = 1; + break; + case 'v': + rpctls_verbose = 1; + break; + default: + fprintf(stderr, "usage: %s [-d] [-v]\n", argv[0]); + exit(1); + break; + } + } + + if (!rpctls_debug_level) { + if (daemon(0, 0) != 0) + err(1, "Can't daemonize"); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGHUP, SIG_IGN); + } + signal(SIGTERM, rpctlscd_terminate); + signal(SIGPIPE, rpctlscd_terminate); + + memset(&sun, 0, sizeof sun); + sun.sun_family = AF_LOCAL; + unlink(_PATH_RPCTLSCDSOCK); + strcpy(sun.sun_path, _PATH_RPCTLSCDSOCK); + sun.sun_len = SUN_LEN(&sun); + fd = socket(AF_LOCAL, SOCK_STREAM, 0); + if (fd < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't create local rpctlscd socket"); + exit(1); + } + err(1, "Can't create local rpctlscd socket"); + } + oldmask = umask(S_IXUSR|S_IRWXG|S_IRWXO); + if (bind(fd, (struct sockaddr *)&sun, sun.sun_len) < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't bind local rpctlscd socket"); + exit(1); + } + err(1, "Can't bind local rpctlscd socket"); + } + umask(oldmask); + if (listen(fd, SOMAXCONN) < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't listen on local rpctlscd socket"); + exit(1); + } + err(1, "Can't listen on local rpctlscd socket"); + } + xprt = svc_vc_create(fd, RPC_MAXDATASIZE, RPC_MAXDATASIZE); + if (!xprt) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't create transport for local rpctlscd socket"); + exit(1); + } + err(1, "Can't create transport for local rpctlscd socket"); + } + if (!svc_reg(xprt, RPCTLSCD, RPCTLSCDVERS, rpctlscd_1, NULL)) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't register service for local rpctlscd socket"); + exit(1); + } + err(1, "Can't register service for local rpctlscd socket"); + } + + /* Set up the OpenSSL TSL stuff. */ + rpctls_ctx = rpctls_setupcl_ssl(certpath); + if (rpctls_ctx == NULL) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't set up TSL context"); + exit(1); + } + err(1, "Can't set up TSL context"); + } + + gssd_syscall(_PATH_RPCTLSCDSOCK); + svc_run(); + gssd_syscall(""); + + SSL_CTX_free(rpctls_ctx); + EVP_cleanup(); + return (0); +} + +static void +rpctlscd_verbose_out(const char *fmt, ...) +{ + va_list ap; + + if (rpctls_verbose != 0) { + va_start(ap, fmt); + if (rpctls_debug_level == 0) + vsyslog(LOG_INFO | LOG_DAEMON, fmt, ap); + else + vfprintf(stderr, fmt, ap); + va_end(ap); + } +} + +bool_t +rpctlscd_null_1_svc(void *argp, void *result, struct svc_req *rqstp) +{ + + rpctlscd_verbose_out("rpctlscd_null: done\n"); + return (TRUE); +} + +bool_t +rpctlscd_connect_1_svc(void *argp, void *result, struct svc_req *rqstp) +{ + int s; + bool_t res; + SSL *ssl; + char buf[1024]; + ssize_t siz, ret; + + rpctlscd_verbose_out("rpctlsd_connect: started\n"); + /* Get the socket fd from the kernel. */ + s = gssd_syscall("C"); +rpctlscd_verbose_out("rpctlsd_connect s=%d\n", s); + if (s < 0) + return (FALSE); + + if (testnossl == 0) { + /* Do a TLS connect handshake. */ + ssl = rpctls_connect(rpctls_ctx, s); + if (ssl == NULL) + rpctlscd_verbose_out("rpctlsd_connect: can't do TLS " + "handshake\n"); + else { + /* Read the 478 bytes of junk off the socket. */ + siz = 478; + ret = 1; + while (siz > 0 && ret > 0) { + ret = recv(s, &buf[478 - siz], siz, 0); + siz -= ret; + } + } + } + + /* Done with socket fd, so let the kernel know. */ + gssd_syscall("D"); + if (ssl == NULL) + return (FALSE); + return (TRUE); +} + +int +rpctlscd_1_freeresult(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + + return (TRUE); +} + +static void +rpctlscd_terminate(int sig __unused) +{ + + gssd_syscall(""); + exit(0); +} + +static SSL_CTX * +rpctls_setupcl_ssl(char *certpath) +{ + SSL_CTX *ctx; + long flags; + int ret; + + OpenSSL_add_all_algorithms(); + + ctx = SSL_CTX_new(TLS_client_method()); + if (ctx == NULL) { + rpctlscd_verbose_out("rpctls_setupcl_ssl: SSL_CTX_new " + "failed\n"); + return (NULL); + } + SSL_CTX_set_ecdh_auto(ctx, 1); + + /* + * If certpath is set, it refers to the certifcate file to be used + * during an SSL_connect(). + */ + if (certpath != NULL) { + ret = SSL_CTX_use_certificate_file(ctx, certpath, + SSL_FILETYPE_PEM); + if (ret != 1) { + rpctlscd_verbose_out("rpctls_setupcl_ssl: can't use " + "the certificate file %s\n", certpath); + SSL_CTX_free(ctx); + return (NULL); + } + } + + /* RPC-over-TLS must use TLSv1.3. */ + flags = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | + SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2; + SSL_CTX_set_options(ctx, flags); + return (ctx); +} + +static SSL * +rpctls_connect(SSL_CTX *ctx, int s) +{ + SSL *ssl; + X509 *cert; + int ret; + + ssl = SSL_new(ctx); + if (ssl == NULL) { + rpctlscd_verbose_out("rpctls_connect: SSL_new failed\n"); + return (NULL); + } + if (SSL_set_fd(ssl, s) != 1) { + rpctlscd_verbose_out("rpctls_connect: SSL_set_fd failed\n"); + SSL_free(ssl); + return (NULL); + } + ret = SSL_connect(ssl); + if (ret != 1) { + rpctlscd_verbose_out("rpctls_connect: SSL_connect failed %d\n", + ret); + SSL_free(ssl); + return (NULL); + } + + cert = SSL_get_peer_certificate(ssl); + if (cert == NULL) { + rpctlscd_verbose_out("rpctls_connect: get peer certificate " + "failed\n"); + SSL_shutdown(ssl); + SSL_free(ssl); + return (NULL); + } + X509_free(cert); + +#ifdef notnow + ret = BIO_get_ktls_send(SSL_get_wbio(ssl)); + fprintf(stderr, "ktls_send=%d\n", ret); + ret = BIO_get_ktls_recv(SSL_get_rbio(ssl)); + fprintf(stderr, "ktls_recv=%d\n", ret); +#endif + return (ssl); +} + Added: projects/nfs-over-tls/usr.sbin/rpctlssd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/usr.sbin/rpctlssd/Makefile Sun Jan 26 19:37:46 2020 (r357157) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +.include + +PROG= rpctlssd +MAN= rpctlssd.8 +SRCS= rpctlssd.c rpctlssd.h rpctlssd_svc.c rpctlssd_xdr.c + +CFLAGS+= -I. +WARNS?= 1 + +LIBADD= ssl crypto + +CLEANFILES= rpctlssd_svc.c rpctlssd_xdr.c rpctlssd.h + +RPCSRC= /usr/src/sys.dec13-2019/rpc/rpcsec_tls/rpctlssd.x +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C -M + +rpctlssd_svc.c: ${RPCSRC} rpctlssd.h + ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + +rpctlssd_xdr.c: ${RPCSRC} rpctlssd.h + ${RPCGEN} -c -o ${.TARGET} ${RPCSRC} + +rpctlssd.h: ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + +.PATH: ${SRCTOP}/sys/rpc/rpcsec_tls + +.include Added: projects/nfs-over-tls/usr.sbin/rpctlssd/rpctlssd.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/usr.sbin/rpctlssd/rpctlssd.8 Sun Jan 26 19:37:46 2020 (r357157) @@ -0,0 +1,76 @@ +.\" Copyright (c) 2008 Isilon Inc http://www.isilon.com/ +.\" Authors: Doug Rabson +.\" Developed with Red Inc: Alfred Perlstein +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.\" Modified from gssd.8 for rpctlssd.8 by Rick Macklem. +.Dd January 21, 2020 +.Dt RPCTLSSD 8 +.Os +.Sh NAME +.Nm rpctlssd +.Nd "Sun RPC over TLS Server Daemon" +.Sh SYNOPSIS +.Nm +.Op Fl d +.Op Fl v +.Sh DESCRIPTION +The +.Nm +program provides support for the server side of the kernel Sun RPC over TLS +implementation. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl d +Run in debug mode. +In this mode, +.Nm +will not fork when it starts. +.It Fl v +Run in verbose mode. +In this mode, +.Nm +will log activity messages to syslog using LOG_INFO | LOG_DAEMON or to +stderr, if the +.Fl d +option has also been specified. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr openssl 3 , +.Xr syslog 3 , +.Xr mount_nfs 8 , +.Xr rpctlscd 8 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 13.0 . +.Sh AUTHORS +This +manual page was adapted from a manual page for the gssd daemon written by +.An Doug Rabson Aq Mt dfr@FreeBSD.org . Added: projects/nfs-over-tls/usr.sbin/rpctlssd/rpctlssd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/nfs-over-tls/usr.sbin/rpctlssd/rpctlssd.c Sun Jan 26 19:37:46 2020 (r357157) @@ -0,0 +1,358 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Modified from gssd.c for the server side of kernel RPC-over-TLS. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "rpctlssd.h" + +#ifndef _PATH_RPCTLSSDSOCK +#define _PATH_RPCTLSSDSOCK "/var/run/rpctlssd.sock" +#define _PATH_RPCTLSSDS "S/var/run/rpctlssd.sock" +#endif +#ifndef _PATH_CERTANDKEY +#define _PATH_CERTANDKEY "/etc/rpctlssd/" +#endif + +static int rpctls_debug_level; +static int rpctls_verbose; +static int testnossl; +static SSL_CTX *rpctls_ctx = NULL; +static char *rpctls_cafiles = NULL; +static char *rpctls_verify_loc = NULL; + +static void rpctlssd_terminate(int); +static SSL_CTX *rpctls_setup_ssl(char *certdir); +static SSL *rpctls_server(SSL_CTX *ctx, int s); + +extern void rpctlssd_1(struct svc_req *rqstp, SVCXPRT *transp); +extern int gssd_syscall(const char *path); + +int +main(int argc, char **argv) +{ + /* + * We provide an RPC service on a local-domain socket. The + * kernel rpctls code will upcall to this daemon to do the initial + * TLS handshake. + */ + struct sockaddr_un sun; + int fd, oldmask, ch, debug; + SVCXPRT *xprt; + + debug = 0; + rpctls_verbose = 0; + testnossl = 0; + while ((ch = getopt(argc, argv, "c:dl:tv")) != -1) { + switch (ch) { + case 'c': + rpctls_cafiles = optarg; + break; + case 'd': + rpctls_debug_level++; + break; + case 'l': + rpctls_verify_loc = optarg; + break; + case 't': + testnossl = 1; + break; + case 'v': + rpctls_verbose = 1; + break; + default: + fprintf(stderr, "usage: %s [-c ] [-d] " + "[-l ] [-v]\n", argv[0]); + exit(1); + break; + } + } + if ((rpctls_cafiles != NULL && rpctls_verify_loc == NULL) || + (rpctls_cafiles == NULL && rpctls_verify_loc != NULL)) { + fprintf(stderr, "usage: %s [-c ] [-d] " + "[-l ] [-v]\n", argv[0]); + exit(1); + } + + if (rpctls_debug_level == 0) { + if (daemon(0, 0) != 0) + err(1, "Can't daemonize"); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGHUP, SIG_IGN); + } + signal(SIGTERM, rpctlssd_terminate); + signal(SIGPIPE, rpctlssd_terminate); + + memset(&sun, 0, sizeof sun); + sun.sun_family = AF_LOCAL; + unlink(_PATH_RPCTLSSDSOCK); + strcpy(sun.sun_path, _PATH_RPCTLSSDSOCK); + sun.sun_len = SUN_LEN(&sun); + fd = socket(AF_LOCAL, SOCK_STREAM, 0); + if (fd < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't create local rpctlssd socket"); + exit(1); + } + err(1, "Can't create local rpctlssd socket"); + } + oldmask = umask(S_IXUSR|S_IRWXG|S_IRWXO); + if (bind(fd, (struct sockaddr *)&sun, sun.sun_len) < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't bind local rpctlssd socket"); + exit(1); + } + err(1, "Can't bind local rpctlssd socket"); + } + umask(oldmask); + if (listen(fd, SOMAXCONN) < 0) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't listen on local rpctlssd socket"); + exit(1); + } + err(1, "Can't listen on local rpctlssd socket"); + } + xprt = svc_vc_create(fd, RPC_MAXDATASIZE, RPC_MAXDATASIZE); + if (!xprt) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't create transport for local rpctlssd socket"); + exit(1); + } + err(1, "Can't create transport for local rpctlssd socket"); + } + if (!svc_reg(xprt, RPCTLSSD, RPCTLSSDVERS, rpctlssd_1, NULL)) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, + "Can't register service for local rpctlssd socket"); + exit(1); + } + err(1, "Can't register service for local rpctlssd socket"); + } + + rpctls_ctx = rpctls_setup_ssl(_PATH_CERTANDKEY); + if (rpctls_ctx == NULL) { + if (rpctls_debug_level == 0) { + syslog(LOG_ERR, "Can't create SSL context"); + exit(1); + } + err(1, "Can't create SSL context"); + } + + gssd_syscall(_PATH_RPCTLSSDS); + svc_run(); + gssd_syscall("S"); + + SSL_CTX_free(rpctls_ctx); + EVP_cleanup(); + return (0); +} + +static void +rpctlssd_verbose_out(const char *fmt, ...) +{ + va_list ap; + + if (rpctls_verbose != 0) { + va_start(ap, fmt); + if (rpctls_debug_level == 0) + vsyslog(LOG_INFO | LOG_DAEMON, fmt, ap); + else + vfprintf(stderr, fmt, ap); + va_end(ap); + } +} + +bool_t +rpctlssd_null_1_svc(void *argp, void *result, struct svc_req *rqstp) +{ + + rpctlssd_verbose_out("rpctlssd_null_svc: done\n"); + return (TRUE); +} + +bool_t +rpctlssd_connect_1_svc(void *argp, void *result, struct svc_req *rqstp) +{ + int s; + SSL *ssl; + + rpctlssd_verbose_out("rpctlsd_connect_svc: started\n"); + /* Get the socket fd from the kernel. */ + s = gssd_syscall("E"); +rpctlssd_verbose_out("rpctlsd_connect_svc s=%d\n", s); + if (s < 0) + return (FALSE); + + if (testnossl == 0) { + /* Do the server side of a TLS handshake. */ + ssl = rpctls_server(rpctls_ctx, s); + if (ssl == NULL) + rpctlssd_verbose_out("rpctlssd_connect_svc: ssl accept " + "failed\n"); + else + rpctlssd_verbose_out("rpctlssd_connect_svc: " + "succeeded\n"); + } + + /* Done with socket fd, so let the kernel know. */ + gssd_syscall("F"); + if (testnossl == 0 && ssl == NULL) + return (FALSE); + return (TRUE); +} + +int +rpctlssd_1_freeresult(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result) +{ + + return (TRUE); +} + +static void +rpctlssd_terminate(int sig __unused) +{ + + gssd_syscall("S"); + exit(0); +} + +static SSL_CTX * +rpctls_setup_ssl(char *certdir) +{ + SSL_CTX *ctx; + char path[PATH_MAX]; + size_t len, rlen; + int ret; + + OpenSSL_add_all_algorithms(); + + ctx = SSL_CTX_new(TLS_server_method()); + if (ctx == NULL) { + rpctlssd_verbose_out("rpctls_setup_ssl: SSL_CTX_new failed\n"); + return (NULL); + } + SSL_CTX_set_ecdh_auto(ctx, 1); + + /* Get the cert.pem and key.pem files from the directory certdir. */ + len = strlcpy(path, certdir, sizeof(path)); + rlen = sizeof(path) - len; + if (strlcpy(&path[len], "cert.pem", rlen) != 8) { + SSL_CTX_free(ctx); + return (NULL); + } + ret = SSL_CTX_use_certificate_file(ctx, path, SSL_FILETYPE_PEM); + if (ret != 1) { + rpctlssd_verbose_out("rpctls_setup_ssl: can't use certificate " + "file path=%s ret=%d\n", path, ret); + SSL_CTX_free(ctx); + return (NULL); + } + if (strlcpy(&path[len], "key.pem", rlen) != 7) { + SSL_CTX_free(ctx); + return (NULL); + } + ret = SSL_CTX_use_PrivateKey_file(ctx, path, SSL_FILETYPE_PEM); + if (ret != 1) { + rpctlssd_verbose_out("rpctls_setup_ssl: Can't use private " + "key path=%s ret=%d\n", path, ret); + SSL_CTX_free(ctx); + return (NULL); + } + + /* Set Mutual authentication, as required. */ + if (rpctls_cafiles != NULL && rpctls_verify_loc != NULL) { + rpctlssd_verbose_out("rpctls_setup_ssl: set mutual " + "authentication cafiles=%s verf_loc=%s\n", rpctls_cafiles, + rpctls_verify_loc); + ret = SSL_CTX_load_verify_locations(ctx, rpctls_verify_loc, + NULL); + if (ret != 1) { + rpctlssd_verbose_out("rpctls_setup_ssl: Can't load " + "verify locations\n"); + SSL_CTX_free(ctx); + return (NULL); + } + SSL_CTX_set_client_CA_list(ctx, + SSL_load_client_CA_file(rpctls_cafiles)); + SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | + SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); + } + return (ctx); +} + +static SSL * +rpctls_server(SSL_CTX *ctx, int s) +{ + SSL *ssl; + int ret; + + ssl = SSL_new(ctx); + if (ssl == NULL) { + rpctlssd_verbose_out("rpctls_server: SSL_new failed\n"); + return (NULL); + } + if (SSL_set_fd(ssl, s) != 1) { + rpctlssd_verbose_out("rpctls_server: SSL_set_fd failed\n"); + SSL_free(ssl); + return (NULL); + } + ret = SSL_accept(ssl); + if (ret != 1) { + rpctlssd_verbose_out("rpctls_server: SS_accept failed ret=%d\n", + ret); + SSL_free(ssl); + return (NULL); + } + return (ssl); +} + From owner-svn-src-projects@freebsd.org Sun Jan 26 20:57:30 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A39421FB73B for ; Sun, 26 Jan 2020 20:57:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485QDp3qTrz4V9W; Sun, 26 Jan 2020 20:57:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E77D26F30; Sun, 26 Jan 2020 20:57:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QKvU8E039848; Sun, 26 Jan 2020 20:57:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QKvTgk039844; Sun, 26 Jan 2020 20:57:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001262057.00QKvTgk039844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 26 Jan 2020 20:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357158 - in projects/clang1000-import: lib/clang/libllvm usr.bin/clang/llvm-objcopy usr.bin/clang/llvm-pdbutil usr.bin/clang/opt X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: lib/clang/libllvm usr.bin/clang/llvm-objcopy usr.bin/clang/llvm-pdbutil usr.bin/clang/opt X-SVN-Commit-Revision: 357158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 20:57:30 -0000 Author: dim Date: Sun Jan 26 20:57:29 2020 New Revision: 357158 URL: https://svnweb.freebsd.org/changeset/base/357158 Log: Update build glue for extra clang/llvm tools (MK_CLANG_EXTRAS=yes). Modified: projects/clang1000-import/lib/clang/libllvm/Makefile projects/clang1000-import/usr.bin/clang/llvm-objcopy/Makefile projects/clang1000-import/usr.bin/clang/llvm-pdbutil/Makefile projects/clang1000-import/usr.bin/clang/opt/Makefile Modified: projects/clang1000-import/lib/clang/libllvm/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/libllvm/Makefile Sun Jan 26 19:37:46 2020 (r357157) +++ projects/clang1000-import/lib/clang/libllvm/Makefile Sun Jan 26 20:57:29 2020 (r357158) @@ -564,6 +564,14 @@ SRCS_XDB+= ExecutionEngine/GDBRegistrationListener.cpp SRCS_XDB+= ExecutionEngine/Interpreter/Execution.cpp SRCS_XDB+= ExecutionEngine/Interpreter/ExternalFunctions.cpp SRCS_XDB+= ExecutionEngine/Interpreter/Interpreter.cpp +SRCS_EXT+= ExecutionEngine/JITLink/EHFrameSupport.cpp +SRCS_EXT+= ExecutionEngine/JITLink/JITLink.cpp +SRCS_EXT+= ExecutionEngine/JITLink/JITLinkGeneric.cpp +SRCS_EXT+= ExecutionEngine/JITLink/JITLinkMemoryManager.cpp +SRCS_EXT+= ExecutionEngine/JITLink/MachO.cpp +SRCS_EXT+= ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp +SRCS_EXT+= ExecutionEngine/JITLink/MachO_arm64.cpp +SRCS_EXT+= ExecutionEngine/JITLink/MachO_x86_64.cpp SRCS_XDB+= ExecutionEngine/MCJIT/MCJIT.cpp SRCS_EXT+= ExecutionEngine/Orc/CompileOnDemandLayer.cpp SRCS_EXT+= ExecutionEngine/Orc/CompileUtils.cpp @@ -578,11 +586,16 @@ SRCS_EXT+= ExecutionEngine/Orc/Layer.cpp SRCS_EXT+= ExecutionEngine/Orc/LazyReexports.cpp SRCS_EXT+= ExecutionEngine/Orc/Legacy.cpp SRCS_EXT+= ExecutionEngine/Orc/NullResolver.cpp +SRCS_EXT+= ExecutionEngine/Orc/ObjectLinkingLayer.cpp +SRCS_EXT+= ExecutionEngine/Orc/ObjectTransformLayer.cpp SRCS_EXT+= ExecutionEngine/Orc/OrcABISupport.cpp SRCS_EXT+= ExecutionEngine/Orc/OrcCBindings.cpp SRCS_EXT+= ExecutionEngine/Orc/OrcMCJITReplacement.cpp SRCS_EXT+= ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp +SRCS_EXT+= ExecutionEngine/Orc/Speculation.cpp SRCS_EXT+= ExecutionEngine/Orc/ThreadSafeModule.cpp +SRCS_EXT+= ExecutionEngine/OrcError/OrcError.cpp +SRCS_EXT+= ExecutionEngine/OrcError/RPCError.cpp SRCS_XDB+= ExecutionEngine/RuntimeDyld/JITSymbol.cpp SRCS_XDB+= ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp SRCS_XDB+= ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -733,6 +746,7 @@ SRCS_MIN+= MC/SubtargetFeature.cpp SRCS_MIN+= MC/WasmObjectWriter.cpp SRCS_MIN+= MC/WinCOFFObjectWriter.cpp SRCS_MIN+= MC/XCOFFObjectWriter.cpp +SRCS_EXT+= MCA/CodeEmitter.cpp SRCS_EXT+= MCA/Context.cpp SRCS_EXT+= MCA/HWEventListener.cpp SRCS_EXT+= MCA/HardwareUnits/HardwareUnit.cpp @@ -1506,6 +1520,7 @@ SRCS_MIN+= Transforms/Utils/CloneModule.cpp SRCS_MIN+= Transforms/Utils/CodeExtractor.cpp SRCS_MIN+= Transforms/Utils/CodeMoverUtils.cpp SRCS_MIN+= Transforms/Utils/CtorUtils.cpp +SRCS_EXT+= Transforms/Utils/Debugify.cpp SRCS_MIN+= Transforms/Utils/DemoteRegToStack.cpp SRCS_MIN+= Transforms/Utils/EntryExitInstrumenter.cpp SRCS_MIN+= Transforms/Utils/EscapeEnumerator.cpp Modified: projects/clang1000-import/usr.bin/clang/llvm-objcopy/Makefile ============================================================================== --- projects/clang1000-import/usr.bin/clang/llvm-objcopy/Makefile Sun Jan 26 19:37:46 2020 (r357157) +++ projects/clang1000-import/usr.bin/clang/llvm-objcopy/Makefile Sun Jan 26 20:57:29 2020 (r357158) @@ -10,8 +10,10 @@ SRCS+= COFF/Object.cpp SRCS+= COFF/Reader.cpp SRCS+= COFF/Writer.cpp SRCS+= CopyConfig.cpp +SRCS+= ELF/ELFConfig.cpp SRCS+= ELF/ELFObjcopy.cpp SRCS+= ELF/Object.cpp +SRCS+= MachO/MachOLayoutBuilder.cpp SRCS+= MachO/MachOObjcopy.cpp SRCS+= MachO/MachOReader.cpp SRCS+= MachO/MachOWriter.cpp @@ -25,11 +27,11 @@ CFLAGS+= -I${LLVM_BASE}/${SRCDIR} .include "${SRCTOP}/lib/clang/llvm.build.mk" -.for hdr in ObjcopyOpts StripOpts +.for hdr in InstallNameToolOpts ObjcopyOpts StripOpts ${hdr}.inc: ${LLVM_BASE}/${SRCDIR}/${hdr}.td ${LLVM_TBLGEN} -gen-opt-parser-defs \ - -I ${LLVM_SRCS}/include -d ${.TARGET}.d -o ${.TARGET} \ - ${LLVM_BASE}/${SRCDIR}/${hdr}.td + -I ${LLVM_SRCS}/tools/llvm-objcopy -I ${LLVM_SRCS}/include \ + -d ${.TARGET}.d -o ${.TARGET} ${LLVM_BASE}/${SRCDIR}/${hdr}.td TGHDRS+= ${hdr}.inc .endfor Modified: projects/clang1000-import/usr.bin/clang/llvm-pdbutil/Makefile ============================================================================== --- projects/clang1000-import/usr.bin/clang/llvm-pdbutil/Makefile Sun Jan 26 19:37:46 2020 (r357157) +++ projects/clang1000-import/usr.bin/clang/llvm-pdbutil/Makefile Sun Jan 26 20:57:29 2020 (r357158) @@ -27,4 +27,6 @@ SRCS+= TypeReferenceTracker.cpp SRCS+= YAMLOutputStyle.cpp SRCS+= llvm-pdbutil.cpp +LIBADD+= z + .include "../llvm.prog.mk" Modified: projects/clang1000-import/usr.bin/clang/opt/Makefile ============================================================================== --- projects/clang1000-import/usr.bin/clang/opt/Makefile Sun Jan 26 19:37:46 2020 (r357157) +++ projects/clang1000-import/usr.bin/clang/opt/Makefile Sun Jan 26 20:57:29 2020 (r357158) @@ -5,7 +5,6 @@ PROG_CXX= opt SRCDIR= llvm/tools/opt SRCS+= AnalysisWrappers.cpp SRCS+= BreakpointPrinter.cpp -SRCS+= Debugify.cpp SRCS+= GraphPrinters.cpp SRCS+= NewPMDriver.cpp SRCS+= PassPrinters.cpp From owner-svn-src-projects@freebsd.org Sun Jan 26 21:55:18 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4535B1FD82D for ; Sun, 26 Jan 2020 21:55:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485RWV16k6z4YRB; Sun, 26 Jan 2020 21:55:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2189727AC2; Sun, 26 Jan 2020 21:55:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00QLtIT6075294; Sun, 26 Jan 2020 21:55:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00QLtH7u075293; Sun, 26 Jan 2020 21:55:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001262155.00QLtH7u075293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 26 Jan 2020 21:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357160 - in projects/clang1000-import: contrib/llvm-project/lld/tools/lld usr.bin/clang/lld X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: contrib/llvm-project/lld/tools/lld usr.bin/clang/lld X-SVN-Commit-Revision: 357160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2020 21:55:18 -0000 Author: dim Date: Sun Jan 26 21:55:17 2020 New Revision: 357160 URL: https://svnweb.freebsd.org/changeset/base/357160 Log: Update build glue for lld (MK_LLD=yes). Also update invocation of elf::link() in lld.cpp. Modified: projects/clang1000-import/contrib/llvm-project/lld/tools/lld/lld.cpp projects/clang1000-import/usr.bin/clang/lld/Makefile Modified: projects/clang1000-import/contrib/llvm-project/lld/tools/lld/lld.cpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/lld/tools/lld/lld.cpp Sun Jan 26 21:34:46 2020 (r357159) +++ projects/clang1000-import/contrib/llvm-project/lld/tools/lld/lld.cpp Sun Jan 26 21:55:17 2020 (r357160) @@ -148,7 +148,7 @@ int main(int argc, const char **argv) { std::vector args(argv, argv + argc); #ifdef __FreeBSD__ - return !elf::link(args, true); + return !elf::link(args, canExitEarly(), llvm::outs(), llvm::errs()); #else switch (parseFlavor(args)) { case Gnu: Modified: projects/clang1000-import/usr.bin/clang/lld/Makefile ============================================================================== --- projects/clang1000-import/usr.bin/clang/lld/Makefile Sun Jan 26 21:34:46 2020 (r357159) +++ projects/clang1000-import/usr.bin/clang/lld/Makefile Sun Jan 26 21:55:17 2020 (r357160) @@ -27,6 +27,7 @@ CFLAGS+= -I${OBJTOP}/lib/clang/libllvm SRCDIR= lld SRCS+= Common/Args.cpp +SRCS+= Common/DWARF.cpp SRCS+= Common/ErrorHandler.cpp SRCS+= Common/Filesystem.cpp SRCS+= Common/Memory.cpp @@ -36,6 +37,7 @@ SRCS+= Common/TargetOptionsCommandFlags.cpp SRCS+= Common/Threads.cpp SRCS+= Common/Version.cpp SRCS+= ELF/AArch64ErrataFix.cpp +SRCS+= ELF/ARMErrataFix.cpp SRCS+= ELF/Arch/AArch64.cpp SRCS+= ELF/Arch/AMDGPU.cpp SRCS+= ELF/Arch/ARM.cpp From owner-svn-src-projects@freebsd.org Mon Jan 27 16:52:46 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5D4E1FC3BE for ; Mon, 27 Jan 2020 16:52:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485wly56nFz4b6d; Mon, 27 Jan 2020 16:52:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90918D2AB; Mon, 27 Jan 2020 16:52:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RGqkVI065526; Mon, 27 Jan 2020 16:52:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RGqjDr065519; Mon, 27 Jan 2020 16:52:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001271652.00RGqjDr065519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 16:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357174 - in projects/clang1000-import: contrib/llvm-project/lldb/source/API contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB lib/clang/include/lldb/Host lib/clang/liblldb lib/cla... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: contrib/llvm-project/lldb/source/API contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB lib/clang/include/lldb/Host lib/clang/liblldb lib/clang/libllvm usr.bin/clang/... X-SVN-Commit-Revision: 357174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 16:52:46 -0000 Author: dim Date: Mon Jan 27 16:52:44 2020 New Revision: 357174 URL: https://svnweb.freebsd.org/changeset/base/357174 Log: Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated Config.h, disable a few more parts in the code we don't use, and add a pre-generated man page. Added: projects/clang1000-import/usr.bin/clang/lldb/lldb.1 (contents, props changed) Modified: projects/clang1000-import/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp projects/clang1000-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp projects/clang1000-import/lib/clang/include/lldb/Host/Config.h projects/clang1000-import/lib/clang/liblldb/Makefile projects/clang1000-import/lib/clang/libllvm/Makefile projects/clang1000-import/usr.bin/clang/lldb/Makefile Modified: projects/clang1000-import/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp Mon Jan 27 15:09:13 2020 (r357173) +++ projects/clang1000-import/contrib/llvm-project/lldb/source/API/SystemInitializerFull.cpp Mon Jan 27 16:52:44 2020 (r357174) @@ -168,12 +168,22 @@ SystemInitializerFull::SystemInitializerFull() {} SystemInitializerFull::~SystemInitializerFull() {} +#ifdef LLDB_ENABLE_ALL #define LLDB_PROCESS_AArch64(op) \ ABIMacOSX_arm64::op(); \ ABISysV_arm64::op(); +#else // LLDB_ENABLE_ALL +#define LLDB_PROCESS_AArch64(op) \ + ABISysV_arm64::op(); +#endif // LLDB_ENABLE_ALL +#ifdef LLDB_ENABLE_ALL #define LLDB_PROCESS_ARM(op) \ ABIMacOSX_arm::op(); \ ABISysV_arm::op(); +#else // LLDB_ENABLE_ALL +#define LLDB_PROCESS_ARM(op) \ + ABISysV_arm::op(); +#endif // LLDB_ENABLE_ALL #define LLDB_PROCESS_ARC(op) \ ABISysV_arc::op(); #define LLDB_PROCESS_Hexagon(op) ABISysV_hexagon::op(); @@ -184,11 +194,17 @@ SystemInitializerFull::~SystemInitializerFull() {} ABISysV_ppc::op(); \ ABISysV_ppc64::op(); #define LLDB_PROCESS_SystemZ(op) ABISysV_s390x::op(); +#ifdef LLDB_ENABLE_ALL #define LLDB_PROCESS_X86(op) \ ABIMacOSX_i386::op(); \ ABISysV_i386::op(); \ ABISysV_x86_64::op(); \ ABIWindows_x86_64::op(); +#else // LLDB_ENABLE_ALL +#define LLDB_PROCESS_X86(op) \ + ABISysV_i386::op(); \ + ABISysV_x86_64::op(); +#endif // LLDB_ENABLE_ALL #define LLDB_PROCESS_AMDGPU(op) #define LLDB_PROCESS_AVR(op) Modified: projects/clang1000-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp Mon Jan 27 15:09:13 2020 (r357173) +++ projects/clang1000-import/contrib/llvm-project/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp Mon Jan 27 16:52:44 2020 (r357174) @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// #include "JITLoaderGDB.h" +#ifdef LLDB_ENABLE_ALL #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" +#endif #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" @@ -336,6 +338,7 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entr module_sp->GetObjectFile()->GetSymtab(); m_jit_objects.insert(std::make_pair(symbolfile_addr, module_sp)); +#ifdef LLDB_ENABLE_ALL if (auto image_object_file = llvm::dyn_cast(module_sp->GetObjectFile())) { const SectionList *section_list = image_object_file->GetSectionList(); @@ -347,7 +350,9 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entr symbolfile_size, vmaddrheuristic, lower, upper); } - } else { + } else +#endif + { bool changed = false; module_sp->SetLoadAddress(target, 0, true, changed); } Modified: projects/clang1000-import/lib/clang/include/lldb/Host/Config.h ============================================================================== --- projects/clang1000-import/lib/clang/include/lldb/Host/Config.h Mon Jan 27 15:09:13 2020 (r357173) +++ projects/clang1000-import/lib/clang/include/lldb/Host/Config.h Mon Jan 27 16:52:44 2020 (r357174) @@ -41,11 +41,11 @@ #define LLDB_ENABLE_LIBEDIT 1 -#define LLDB_ENABLE_LIBXML2 1 +#define LLDB_ENABLE_LIBXML2 0 -#define LLDB_ENABLE_LUA 1 +#define LLDB_ENABLE_LUA 0 -#define LLDB_ENABLE_PYTHON 1 +#define LLDB_ENABLE_PYTHON 0 /* #undef LLDB_PYTHON_HOME */ Modified: projects/clang1000-import/lib/clang/liblldb/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/liblldb/Makefile Mon Jan 27 15:09:13 2020 (r357173) +++ projects/clang1000-import/lib/clang/liblldb/Makefile Mon Jan 27 16:52:44 2020 (r357174) @@ -13,7 +13,6 @@ CFLAGS+= -I${LLDB_SRCS}/source/Plugins/Process/Utility CFLAGS+= -I${OBJTOP}/lib/clang/libllvm CFLAGS+= -I${OBJTOP}/lib/clang/libclang CFLAGS+= -I${OBJTOP}/lib/clang/liblldb -CFLAGS+= -DLLDB_DISABLE_PYTHON SRCS+= API/SBAddress.cpp SRCS+= API/SBAttachInfo.cpp @@ -34,6 +33,7 @@ SRCS+= API/SBError.cpp SRCS+= API/SBEvent.cpp SRCS+= API/SBExecutionContext.cpp SRCS+= API/SBExpressionOptions.cpp +SRCS+= API/SBFile.cpp SRCS+= API/SBFileSpec.cpp SRCS+= API/SBFileSpecList.cpp SRCS+= API/SBFrame.cpp @@ -110,7 +110,6 @@ SRCS+= Commands/CommandCompletions.cpp SRCS+= Commands/CommandObjectApropos.cpp SRCS+= Commands/CommandObjectBreakpoint.cpp SRCS+= Commands/CommandObjectBreakpointCommand.cpp -SRCS+= Commands/CommandObjectBugreport.cpp SRCS+= Commands/CommandObjectCommands.cpp SRCS+= Commands/CommandObjectDisassemble.cpp SRCS+= Commands/CommandObjectExpression.cpp @@ -153,6 +152,7 @@ SRCS+= Core/FileSpecList.cpp SRCS+= Core/FormatEntity.cpp SRCS+= Core/Highlighter.cpp SRCS+= Core/IOHandler.cpp +SRCS+= Core/IOHandlerCursesGUI.cpp SRCS+= Core/Mangled.cpp SRCS+= Core/Module.cpp SRCS+= Core/ModuleChild.cpp @@ -219,6 +219,7 @@ SRCS+= Host/common/HostInfoBase.cpp SRCS+= Host/common/HostNativeThreadBase.cpp SRCS+= Host/common/HostProcess.cpp SRCS+= Host/common/HostThread.cpp +SRCS+= Host/common/LZMA.cpp SRCS+= Host/common/LockFileBase.cpp SRCS+= Host/common/MainLoop.cpp SRCS+= Host/common/MonitoringProcessLauncher.cpp @@ -241,7 +242,7 @@ SRCS+= Host/freebsd/Host.cpp SRCS+= Host/freebsd/HostInfoFreeBSD.cpp SRCS+= Host/posix/ConnectionFileDescriptorPosix.cpp SRCS+= Host/posix/DomainSocket.cpp -SRCS+= Host/posix/FileSystem.cpp +SRCS+= Host/posix/FileSystemPosix.cpp SRCS+= Host/posix/HostInfoPosix.cpp SRCS+= Host/posix/HostProcessPosix.cpp SRCS+= Host/posix/HostThreadPosix.cpp @@ -266,6 +267,7 @@ SRCS+= Interpreter/OptionGroupFile.cpp SRCS+= Interpreter/OptionGroupFormat.cpp SRCS+= Interpreter/OptionGroupOutputFile.cpp SRCS+= Interpreter/OptionGroupPlatform.cpp +SRCS+= Interpreter/OptionGroupPythonClassWithDict.cpp SRCS+= Interpreter/OptionGroupString.cpp SRCS+= Interpreter/OptionGroupUInt64.cpp SRCS+= Interpreter/OptionGroupUUID.cpp @@ -280,7 +282,7 @@ SRCS+= Interpreter/OptionValueChar.cpp SRCS+= Interpreter/OptionValueDictionary.cpp SRCS+= Interpreter/OptionValueEnumeration.cpp SRCS+= Interpreter/OptionValueFileSpec.cpp -SRCS+= Interpreter/OptionValueFileSpecLIst.cpp +SRCS+= Interpreter/OptionValueFileSpecList.cpp SRCS+= Interpreter/OptionValueFormat.cpp SRCS+= Interpreter/OptionValueFormatEntity.cpp SRCS+= Interpreter/OptionValueLanguage.cpp @@ -309,11 +311,11 @@ SRCS+= Plugins/Disassembler/llvm/DisassemblerLLVMC.cp SRCS+= Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp SRCS+= Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp SRCS+= Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp -SRCS+= Plugins/ExpressionParser/Clang/ASTDumper.cpp SRCS+= Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp SRCS+= Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp SRCS+= Plugins/ExpressionParser/Clang/ASTUtils.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangASTSource.cpp +SRCS+= Plugins/ExpressionParser/Clang/ClangDeclVendor.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp @@ -324,6 +326,7 @@ SRCS+= Plugins/ExpressionParser/Clang/ClangModulesDec SRCS+= Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangUserExpression.cpp SRCS+= Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp +SRCS+= Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp SRCS+= Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp SRCS+= Plugins/ExpressionParser/Clang/IRForTarget.cpp SRCS+= Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -477,7 +480,6 @@ SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.c SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp -SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp SRCS+= Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp @@ -505,8 +507,8 @@ SRCS+= Symbol/ArmUnwindInfo.cpp SRCS+= Symbol/Block.cpp SRCS+= Symbol/ClangASTContext.cpp SRCS+= Symbol/ClangASTImporter.cpp +SRCS+= Symbol/ClangASTMetadata.cpp SRCS+= Symbol/ClangExternalASTSourceCallbacks.cpp -SRCS+= Symbol/ClangExternalASTSourceCommon.cpp SRCS+= Symbol/ClangUtil.cpp SRCS+= Symbol/CompactUnwindInfo.cpp SRCS+= Symbol/CompileUnit.cpp @@ -548,6 +550,7 @@ SRCS+= Target/Language.cpp SRCS+= Target/LanguageRuntime.cpp SRCS+= Target/Memory.cpp SRCS+= Target/MemoryHistory.cpp +SRCS+= Target/MemoryRegionInfo.cpp SRCS+= Target/ModuleCache.cpp SRCS+= Target/OperatingSystem.cpp SRCS+= Target/PathMappingList.cpp @@ -605,10 +608,9 @@ SRCS+= Utility/DataEncoder.cpp SRCS+= Utility/DataExtractor.cpp SRCS+= Utility/Environment.cpp SRCS+= Utility/Event.cpp -SRCS+= Utility/FileCollector.cpp SRCS+= Utility/FileSpec.cpp +SRCS+= Utility/GDBRemote.cpp SRCS+= Utility/IOObject.cpp -SRCS+= Utility/JSON.cpp SRCS+= Utility/LLDBAssert.cpp SRCS+= Utility/Listener.cpp SRCS+= Utility/Log.cpp @@ -626,7 +628,6 @@ SRCS+= Utility/State.cpp SRCS+= Utility/Status.cpp SRCS+= Utility/Stream.cpp SRCS+= Utility/StreamCallback.cpp -SRCS+= Utility/StreamGDBRemote.cpp SRCS+= Utility/StreamString.cpp SRCS+= Utility/StringExtractor.cpp SRCS+= Utility/StringExtractorGDBRemote.cpp @@ -644,13 +645,32 @@ SRCS+= Utility/VMRange.cpp SRCS+= lldb.cpp LLDB_TBLGEN?= lldb-tblgen -INCFILE= CommandOptions.inc -TDFILE= ${LLDB_SRCS}/source/Commands/Options.td -GENOPT= -gen-lldb-option-defs -${INCFILE}: ${TDFILE} - ${LLDB_TBLGEN} ${GENOPT} -I ${LLDB_SRCS}/source/Commands \ - -d ${.TARGET:C/$/.d/} -o ${.TARGET} ${TDFILE} -TGHDRS+= ${INCFILE} + +CommandOptions.inc: ${LLDB_SRCS}/source/Commands/Options.td + ${LLDB_TBLGEN} -gen-lldb-option-defs \ + -I ${LLDB_SRCS}/source/Commands -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${LLDB_SRCS}/source/Commands/Options.td +TGHDRS+= CommandOptions.inc + +.for path in \ + Core/Core \ + Interpreter/Interpreter \ + Plugins/JITLoader/GDB/JITLoaderGDB \ + Plugins/Process/gdb-remote/ProcessGDBRemote \ + Plugins/SymbolFile/DWARF/SymbolFileDWARF \ + Target/Target +${path:T}Properties.inc: ${LLDB_SRCS}/source/${path}Properties.td + ${LLDB_TBLGEN} -gen-lldb-property-defs \ + -I ${LLDB_SRCS}/source/${path:H} -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${LLDB_SRCS}/source/${path}Properties.td +TGHDRS+= ${path:T}Properties.inc + +${path:T}PropertiesEnum.inc: ${LLDB_SRCS}/source/${path}Properties.td + ${LLDB_TBLGEN} -gen-lldb-property-enum-defs \ + -I ${LLDB_SRCS}/source/${path:H} -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${LLDB_SRCS}/source/${path}Properties.td +TGHDRS+= ${path:T}PropertiesEnum.inc +.endfor DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} Modified: projects/clang1000-import/lib/clang/libllvm/Makefile ============================================================================== --- projects/clang1000-import/lib/clang/libllvm/Makefile Mon Jan 27 15:09:13 2020 (r357173) +++ projects/clang1000-import/lib/clang/libllvm/Makefile Mon Jan 27 16:52:44 2020 (r357174) @@ -859,6 +859,7 @@ SRCS_MIN+= Support/DynamicLibrary.cpp SRCS_MIN+= Support/Errno.cpp SRCS_MIN+= Support/Error.cpp SRCS_MIN+= Support/ErrorHandling.cpp +SRCS_XDB+= Support/FileCollector.cpp SRCS_EXL+= Support/FileOutputBuffer.cpp SRCS_MIN+= Support/FileUtilities.cpp SRCS_MIN+= Support/FoldingSet.cpp Modified: projects/clang1000-import/usr.bin/clang/lldb/Makefile ============================================================================== --- projects/clang1000-import/usr.bin/clang/lldb/Makefile Mon Jan 27 15:09:13 2020 (r357173) +++ projects/clang1000-import/usr.bin/clang/lldb/Makefile Mon Jan 27 16:52:44 2020 (r357174) @@ -4,8 +4,6 @@ PACKAGE= lldb PROG_CXX= lldb -# Man page directory -.PATH: ${LLDB_SRCS}/docs CFLAGS+= -I${LLDB_SRCS}/include CFLAGS+= -I${.OBJDIR} @@ -38,8 +36,9 @@ CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} LIBADD+= edit LIBADD+= execinfo -LIBADD+= panel +LIBADD+= lzma LIBADD+= ncursesw +LIBADD+= panel LIBADD+= pthread LIBADD+= z Added: projects/clang1000-import/usr.bin/clang/lldb/lldb.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang1000-import/usr.bin/clang/lldb/lldb.1 Mon Jan 27 16:52:44 2020 (r357174) @@ -0,0 +1,409 @@ +.\" $FreeBSD$ +.\" Man page generated from reStructuredText. +. +.TH "LLDB" "1" "Jan 27, 2020" "8" "LLDB" +.SH NAME +lldb \- LLDB Documentation +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SYNOPSIS +.nf +\fBlldb\fP [\fIoptions\fP] \fIexecutable\fP +.fi +.sp +.SH DESCRIPTION +.sp +\fBlldb\fP is a next generation, high\-performance debugger. It is built as +a set of reusable components which highly leverage existing libraries in the +larger LLVM Project, such as the Clang expression parser and LLVM disassembler. +.sp +\fBlldb\fP is the default debugger in Xcode on macOS and supports +debugging C, Objective\-C and C++ on the desktop and iOS devices and simulator. +.sp +All of the code in the LLDB project is available under the Apache 2.0 License +with LLVM exceptions. +.SH ATTACHING +.INDENT 0.0 +.TP +.B \-\-attach\-name +Tells the debugger to attach to a process with the given name. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-attach\-pid +Tells the debugger to attach to a process with the given pid. +.UNINDENT +.INDENT 0.0 +.TP +.B \-n +Alias for –attach\-name +.UNINDENT +.INDENT 0.0 +.TP +.B \-p +Alias for –attach\-pid +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-wait\-for +Tells the debugger to wait for a process with the given pid or name to launch before attaching. +.UNINDENT +.INDENT 0.0 +.TP +.B \-w +Alias for –wait\-for +.UNINDENT +.SH COMMANDS +.INDENT 0.0 +.TP +.B \-\-batch +Tells the debugger to run the commands from \-s, \-S, \-o & \-O, and then quit. +.UNINDENT +.INDENT 0.0 +.TP +.B \-b +Alias for –batch +.UNINDENT +.INDENT 0.0 +.TP +.B \-K +Alias for –source\-on\-crash +.UNINDENT +.INDENT 0.0 +.TP +.B \-k +Alias for –one\-line\-on\-crash +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-local\-lldbinit +Allow the debugger to parse the .lldbinit files in the current working directory, unless –no\-lldbinit is passed. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-lldbinit +Do not automatically parse any ‘.lldbinit’ files. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-one\-line\-before\-file +Tells the debugger to execute this one\-line lldb command before any file provided on the command line has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-one\-line\-on\-crash +When in batch mode, tells the debugger to run this one\-line lldb command if the target crashes. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-one\-line +Tells the debugger to execute this one\-line lldb command after any file provided on the command line has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-O +Alias for –one\-line\-before\-file +.UNINDENT +.INDENT 0.0 +.TP +.B \-o +Alias for –one\-line +.UNINDENT +.INDENT 0.0 +.TP +.B \-Q +Alias for –source\-quietly +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source\-before\-file +Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source\-on\-crash +When in batch mode, tells the debugger to source this file of lldb commands if the target crashes. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source\-quietly +Tells the debugger to execute this one\-line lldb command before any file has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-source +Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded. +.UNINDENT +.INDENT 0.0 +.TP +.B \-S +Alias for –source\-before\-file +.UNINDENT +.INDENT 0.0 +.TP +.B \-s +Alias for –source +.UNINDENT +.INDENT 0.0 +.TP +.B \-x +Alias for –no\-lldbinit +.UNINDENT +.SH OPTIONS +.INDENT 0.0 +.TP +.B \-\-arch +Tells the debugger to use the specified architecture when starting and running the program. +.UNINDENT +.INDENT 0.0 +.TP +.B \-a +Alias for –arch +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-capture\-path +Tells the debugger to use the given filename for the reproducer. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-capture +Tells the debugger to capture a reproducer. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-core +Tells the debugger to use the full path to as the core file. +.UNINDENT +.INDENT 0.0 +.TP +.B \-c +Alias for –core +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-debug +Tells the debugger to print out extra information for debugging itself. +.UNINDENT +.INDENT 0.0 +.TP +.B \-d +Alias for –debug +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-editor +Tells the debugger to open source files using the host’s “external editor” mechanism. +.UNINDENT +.INDENT 0.0 +.TP +.B \-e +Alias for –editor +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-file +Tells the debugger to use the file as the program to be debugged. +.UNINDENT +.INDENT 0.0 +.TP +.B \-f +Alias for –file +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-help +Prints out the usage information for the LLDB debugger. +.UNINDENT +.INDENT 0.0 +.TP +.B \-h +Alias for –help +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-use\-colors +Do not use colors. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-replay +Tells the debugger to replay a reproducer from . +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-version +Prints out the current version number of the LLDB debugger. +.UNINDENT +.INDENT 0.0 +.TP +.B \-v +Alias for –version +.UNINDENT +.INDENT 0.0 +.TP +.B \-X +Alias for –no\-use\-color +.UNINDENT +.SH REPL +.INDENT 0.0 +.TP +.B \-r= +Alias for –repl= +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-repl\-language +Chooses the language for the REPL. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-repl= +Runs lldb in REPL mode with a stub process with the given flags. +.UNINDENT +.INDENT 0.0 +.TP +.B \-R +Alias for –repl\-language +.UNINDENT +.SH SCRIPTING +.INDENT 0.0 +.TP +.B \-l +Alias for –script\-language +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-python\-path +Prints out the path to the lldb.py file for this version of lldb. +.UNINDENT +.INDENT 0.0 +.TP +.B \-P +Alias for –python\-path +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-script\-language +Tells the debugger to use the specified scripting language for user\-defined scripts. +.UNINDENT +.SH EXAMPLES +.sp +The debugger can be started in several modes. +.sp +Passing an executable as a positional argument prepares \fBlldb\fP to +debug the given executable. Arguments passed after – are considered arguments +to the debugged executable. +.INDENT 0.0 +.INDENT 3.5 +lldb –arch x86_64 /path/to/program – –arch arvm7 +.UNINDENT +.UNINDENT +.sp +Passing one of the attach options causes \fBlldb\fP to immediately attach +to the given process. +.INDENT 0.0 +.INDENT 3.5 +lldb \-p +lldb \-n +.UNINDENT +.UNINDENT +.sp +Passing –repl starts \fBlldb\fP in REPL mode. +.INDENT 0.0 +.INDENT 3.5 +lldb \-r +.UNINDENT +.UNINDENT +.sp +Passing –core causes \fBlldb\fP to debug the core file. +.INDENT 0.0 +.INDENT 3.5 +lldb \-c /path/to/core +.UNINDENT +.UNINDENT +.sp +Command options can be combined with these modes and cause \fBlldb\fP to +run the specified commands before or after events, like loading the file or +crashing, in the order provided on the command line. +.INDENT 0.0 +.INDENT 3.5 +lldb \-O ‘settings set stop\-disassembly\-count 20’ \-o ‘run’ \-o ‘bt’ +lldb \-S /source/before/file \-s /source/after/file +lldb \-K /source/before/crash \-k /source/after/crash +.UNINDENT +.UNINDENT +.sp +Note: In REPL mode no file is loaded, so commands specified to run after +loading the file (via \-o or \-s) will be ignored. +.SH USING LLDB +.sp +In \fBlldb\fP there is a help command which can be used to find +descriptions and examples of all \fBlldb\fP commands. To get help on +“breakpoint set” you would type “help breakpoint set”. +.sp +There is also an apropos command which will search the help text of all +commands for a given term ‐‐ this is useful for locating a command by topic. +For instance, “apropos breakpoint” will list any command that has the word +“breakpoint” in its help text. +.SH CONFIGURATION FILES +.sp +\fBlldb\fP reads things like settings, aliases and commands from the +.lldbinit file. It will first look for ~/.lldbinit and load that first. +Secondly, it will look for an .lldbinit file in the current working directory. +For security reasons, \fBlldb\fP will print a warning and not source this +file by default. This behavior can be changed by changing the +target.load\-cwd\-lldbinit setting. +.sp +To always load the .lldbinit file in the current working directory, add the +following command to ~/.lldbinit: +.INDENT 0.0 +.INDENT 3.5 +settings set target.load\-cwd\-lldbinit true +.UNINDENT +.UNINDENT +.sp +To never load the .lldbinit file in the current working directory and silence +the warning, add the following command to ~/.lldbinit: +.INDENT 0.0 +.INDENT 3.5 +settings set target.load\-cwd\-lldbinit false +.UNINDENT +.UNINDENT +.SH SEE ALSO +.sp +The LLDB project page \fI\%https://lldb.llvm.org\fP has many different resources +for \fBlldb\fP users ‐‐ the gdb/lldb command equivalence page +\fI\%https://lldb.llvm.org/use/map.html\fP can be especially helpful for users +coming from gdb. +.SH AUTHOR +LLVM project +.SH COPYRIGHT +2007-2020, The LLDB Team +.\" Generated by docutils manpage writer. +. From owner-svn-src-projects@freebsd.org Mon Jan 27 18:04:29 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78D7A1FE5DD for ; Mon, 27 Jan 2020 18:04:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485yLj2YsMz4fqb; Mon, 27 Jan 2020 18:04:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 527D1DFB6; Mon, 27 Jan 2020 18:04:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RI4TNS008419; Mon, 27 Jan 2020 18:04:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RI4Tb9008418; Mon, 27 Jan 2020 18:04:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001271804.00RI4Tb9008418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 18:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357175 - projects/clang1000-import/lib/libomp X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/lib/libomp X-SVN-Commit-Revision: 357175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 18:04:29 -0000 Author: dim Date: Mon Jan 27 18:04:28 2020 New Revision: 357175 URL: https://svnweb.freebsd.org/changeset/base/357175 Log: Update build glue for libomp. Modified: projects/clang1000-import/lib/libomp/Makefile Modified: projects/clang1000-import/lib/libomp/Makefile ============================================================================== --- projects/clang1000-import/lib/libomp/Makefile Mon Jan 27 16:52:44 2020 (r357174) +++ projects/clang1000-import/lib/libomp/Makefile Mon Jan 27 18:04:28 2020 (r357175) @@ -9,7 +9,7 @@ ITTSRC= ${OMPSRC}/thirdparty/ittnotify .PATH: ${OMPSRC} .PATH: ${ITTSRC} -SRCS+= ittnotify_static.c +SRCS+= ittnotify_static.cpp SRCS+= kmp_affinity.cpp SRCS+= kmp_alloc.cpp SRCS+= kmp_atomic.cpp From owner-svn-src-projects@freebsd.org Mon Jan 27 19:18:36 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E707E228B15 for ; Mon, 27 Jan 2020 19:18:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48600D5pMwz3Gd3; Mon, 27 Jan 2020 19:18:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C21B3ED05; Mon, 27 Jan 2020 19:18:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RJIasG049910; Mon, 27 Jan 2020 19:18:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RJIaBT049909; Mon, 27 Jan 2020 19:18:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001271918.00RJIaBT049909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 19:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357176 - projects/clang1000-import/lib/libc++ X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/lib/libc++ X-SVN-Commit-Revision: 357176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 19:18:37 -0000 Author: dim Date: Mon Jan 27 19:18:36 2020 New Revision: 357176 URL: https://svnweb.freebsd.org/changeset/base/357176 Log: Update build glue for libc++. Modified: projects/clang1000-import/lib/libc++/Makefile Modified: projects/clang1000-import/lib/libc++/Makefile ============================================================================== --- projects/clang1000-import/lib/libc++/Makefile Mon Jan 27 18:04:28 2020 (r357175) +++ projects/clang1000-import/lib/libc++/Makefile Mon Jan 27 19:18:36 2020 (r357176) @@ -78,7 +78,9 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -CXXSTD?= c++11 +CFLAGS+= -ffunction-sections +CFLAGS+= -fdata-sections +CXXSTD?= c++14 LIBADD+= cxxrt INCSGROUPS= STD EXP EXT From owner-svn-src-projects@freebsd.org Mon Jan 27 20:12:04 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8355A22C9EF for ; Mon, 27 Jan 2020 20:12:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48619w30tfz474N; Mon, 27 Jan 2020 20:12:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 603D7F923; Mon, 27 Jan 2020 20:12:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RKC4Nm013450; Mon, 27 Jan 2020 20:12:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RKC4Zv013449; Mon, 27 Jan 2020 20:12:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001272012.00RKC4Zv013449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 20:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357177 - projects/clang1000-import/lib/libcompiler_rt X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/lib/libcompiler_rt X-SVN-Commit-Revision: 357177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 20:12:04 -0000 Author: dim Date: Mon Jan 27 20:12:03 2020 New Revision: 357177 URL: https://svnweb.freebsd.org/changeset/base/357177 Log: Sort libcompiler_rt sources. Modified: projects/clang1000-import/lib/libcompiler_rt/Makefile.inc Modified: projects/clang1000-import/lib/libcompiler_rt/Makefile.inc ============================================================================== --- projects/clang1000-import/lib/libcompiler_rt/Makefile.inc Mon Jan 27 19:18:36 2020 (r357176) +++ projects/clang1000-import/lib/libcompiler_rt/Makefile.inc Mon Jan 27 20:12:03 2020 (r357177) @@ -80,11 +80,11 @@ SRCF+= mulodi4 SRCF+= mulosi4 SRCF+= muloti4 SRCF+= mulsc3 +SRCF+= multc3 SRCF+= multi3 SRCF+= mulvdi3 SRCF+= mulvsi3 SRCF+= mulvti3 -SRCF+= multc3 SRCF+= mulxc3 SRCF+= negdf2 SRCF+= negdi2 From owner-svn-src-projects@freebsd.org Mon Jan 27 20:46:30 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8ED0C22E771 for ; Mon, 27 Jan 2020 20:46:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4861xf3zqXz4B8l; Mon, 27 Jan 2020 20:46:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F196FF22; Mon, 27 Jan 2020 20:46:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RKkULr031670; Mon, 27 Jan 2020 20:46:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RKkQQt031648; Mon, 27 Jan 2020 20:46:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001272046.00RKkQQt031648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 20:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357178 - in projects/clang1000-import/lib/libclang_rt: . asan asan-preinit asan_cxx asan_dynamic cfi cfi_diag dd fuzzer fuzzer_no_main include msan msan_cxx profile safestack stats sta... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import/lib/libclang_rt: . asan asan-preinit asan_cxx asan_dynamic cfi cfi_diag dd fuzzer fuzzer_no_main include msan msan_cxx profile safestack stats stats_client tsan tsan_cxx u... X-SVN-Commit-Revision: 357178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 20:46:30 -0000 Author: dim Date: Mon Jan 27 20:46:26 2020 New Revision: 357178 URL: https://svnweb.freebsd.org/changeset/base/357178 Log: Update build glue for libclang_rt. Modified: projects/clang1000-import/lib/libclang_rt/Makefile.inc projects/clang1000-import/lib/libclang_rt/asan-preinit/Makefile projects/clang1000-import/lib/libclang_rt/asan/Makefile projects/clang1000-import/lib/libclang_rt/asan_cxx/Makefile projects/clang1000-import/lib/libclang_rt/asan_dynamic/Makefile projects/clang1000-import/lib/libclang_rt/cfi/Makefile projects/clang1000-import/lib/libclang_rt/cfi_diag/Makefile projects/clang1000-import/lib/libclang_rt/dd/Makefile projects/clang1000-import/lib/libclang_rt/fuzzer/Makefile projects/clang1000-import/lib/libclang_rt/fuzzer_no_main/Makefile projects/clang1000-import/lib/libclang_rt/include/Makefile projects/clang1000-import/lib/libclang_rt/msan/Makefile projects/clang1000-import/lib/libclang_rt/msan_cxx/Makefile projects/clang1000-import/lib/libclang_rt/profile/Makefile projects/clang1000-import/lib/libclang_rt/safestack/Makefile projects/clang1000-import/lib/libclang_rt/stats/Makefile projects/clang1000-import/lib/libclang_rt/stats_client/Makefile projects/clang1000-import/lib/libclang_rt/tsan/Makefile projects/clang1000-import/lib/libclang_rt/tsan_cxx/Makefile projects/clang1000-import/lib/libclang_rt/ubsan_minimal/Makefile projects/clang1000-import/lib/libclang_rt/ubsan_standalone/Makefile projects/clang1000-import/lib/libclang_rt/ubsan_standalone_cxx/Makefile projects/clang1000-import/lib/libclang_rt/xray-basic/Makefile projects/clang1000-import/lib/libclang_rt/xray-fdr/Makefile projects/clang1000-import/lib/libclang_rt/xray-profiling/Makefile projects/clang1000-import/lib/libclang_rt/xray/Makefile Modified: projects/clang1000-import/lib/libclang_rt/Makefile.inc ============================================================================== --- projects/clang1000-import/lib/libclang_rt/Makefile.inc Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/Makefile.inc Mon Jan 27 20:46:26 2020 (r357178) @@ -26,7 +26,6 @@ WARNS?= 0 SSP_CFLAGS= CFLAGS+= -DNDEBUG CFLAGS+= -DHAVE_RPC_XDR_H=0 -CFLAGS+= -DHAVE_TIRPC_RPC_XDR_H=0 CFLAGS+= -DSANITIZER_SUPPORTS_WEAK_HOOKS=0 CFLAGS+= -DUBSAN_CAN_USE_CXXABI CFLAGS+= ${PICFLAG} @@ -42,4 +41,4 @@ CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/include CFLAGS+= -I${CRTSRC}/lib -CXXSTD= c++11 +CXXSTD= c++14 Modified: projects/clang1000-import/lib/libclang_rt/asan-preinit/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/asan-preinit/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/asan-preinit/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,6 +4,6 @@ LIB= clang_rt.asan-preinit-${CRTARCH} -SRCS+= asan/asan_preinit.cc +SRCS+= asan/asan_preinit.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/asan/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/asan/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/asan/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,78 +4,78 @@ LIB= clang_rt.asan-${CRTARCH} -SRCS+= asan/asan_activation.cc -SRCS+= asan/asan_allocator.cc -SRCS+= asan/asan_debugging.cc -SRCS+= asan/asan_descriptions.cc -SRCS+= asan/asan_errors.cc -SRCS+= asan/asan_fake_stack.cc -SRCS+= asan/asan_flags.cc -SRCS+= asan/asan_globals.cc -SRCS+= asan/asan_interceptors.cc -SRCS+= asan/asan_interceptors_memintrinsics.cc -SRCS+= asan/asan_linux.cc -SRCS+= asan/asan_malloc_linux.cc -SRCS+= asan/asan_memory_profile.cc -SRCS+= asan/asan_poisoning.cc -SRCS+= asan/asan_posix.cc -SRCS+= asan/asan_preinit.cc -SRCS+= asan/asan_premap_shadow.cc -SRCS+= asan/asan_report.cc -SRCS+= asan/asan_rtl.cc -SRCS+= asan/asan_shadow_setup.cc -SRCS+= asan/asan_stack.cc -SRCS+= asan/asan_stats.cc -SRCS+= asan/asan_suppressions.cc -SRCS+= asan/asan_thread.cc -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= sanitizer_common/sancov_flags.cc -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_allocator_report.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_stackdepot.cc -SRCS+= sanitizer_common/sanitizer_stacktrace.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_symbolizer.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_report.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc -SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cc -SRCS+= ubsan/ubsan_diag.cc -SRCS+= ubsan/ubsan_flags.cc -SRCS+= ubsan/ubsan_handlers.cc -SRCS+= ubsan/ubsan_init.cc -SRCS+= ubsan/ubsan_monitor.cc -SRCS+= ubsan/ubsan_value.cc +SRCS+= asan/asan_activation.cpp +SRCS+= asan/asan_allocator.cpp +SRCS+= asan/asan_debugging.cpp +SRCS+= asan/asan_descriptions.cpp +SRCS+= asan/asan_errors.cpp +SRCS+= asan/asan_fake_stack.cpp +SRCS+= asan/asan_flags.cpp +SRCS+= asan/asan_globals.cpp +SRCS+= asan/asan_interceptors.cpp +SRCS+= asan/asan_interceptors_memintrinsics.cpp +SRCS+= asan/asan_linux.cpp +SRCS+= asan/asan_malloc_linux.cpp +SRCS+= asan/asan_memory_profile.cpp +SRCS+= asan/asan_poisoning.cpp +SRCS+= asan/asan_posix.cpp +SRCS+= asan/asan_preinit.cpp +SRCS+= asan/asan_premap_shadow.cpp +SRCS+= asan/asan_report.cpp +SRCS+= asan/asan_rtl.cpp +SRCS+= asan/asan_shadow_setup.cpp +SRCS+= asan/asan_stack.cpp +SRCS+= asan/asan_stats.cpp +SRCS+= asan/asan_suppressions.cpp +SRCS+= asan/asan_thread.cpp +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= sanitizer_common/sancov_flags.cpp +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_allocator_report.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_printf.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp +SRCS+= sanitizer_common/sanitizer_stackdepot.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cpp +SRCS+= sanitizer_common/sanitizer_suppressions.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp +SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_registry.cpp +SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp +SRCS+= sanitizer_common/sanitizer_type_traits.cpp +SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cpp +SRCS+= ubsan/ubsan_diag.cpp +SRCS+= ubsan/ubsan_flags.cpp +SRCS+= ubsan/ubsan_handlers.cpp +SRCS+= ubsan/ubsan_init.cpp +SRCS+= ubsan/ubsan_monitor.cpp +SRCS+= ubsan/ubsan_value.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/asan_cxx/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/asan_cxx/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/asan_cxx/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -6,9 +6,9 @@ LIB= clang_rt.asan_cxx-${CRTARCH} CXXFLAGS+= -frtti -SRCS+= asan/asan_new_delete.cc -SRCS+= ubsan/ubsan_handlers_cxx.cc -SRCS+= ubsan/ubsan_type_hash.cc -SRCS+= ubsan/ubsan_type_hash_itanium.cc +SRCS+= asan/asan_new_delete.cpp +SRCS+= ubsan/ubsan_handlers_cxx.cpp +SRCS+= ubsan/ubsan_type_hash.cpp +SRCS+= ubsan/ubsan_type_hash_itanium.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/asan_dynamic/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/asan_dynamic/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/asan_dynamic/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -7,82 +7,82 @@ SHLIB_NAME= libclang_rt.asan-${CRTARCH}.so CFLAGS+= -DASAN_DYNAMIC=1 -SRCS+= asan/asan_activation.cc -SRCS+= asan/asan_allocator.cc -SRCS+= asan/asan_debugging.cc -SRCS+= asan/asan_descriptions.cc -SRCS+= asan/asan_errors.cc -SRCS+= asan/asan_fake_stack.cc -SRCS+= asan/asan_flags.cc -SRCS+= asan/asan_globals.cc -SRCS+= asan/asan_interceptors.cc -SRCS+= asan/asan_interceptors_memintrinsics.cc -SRCS+= asan/asan_linux.cc -SRCS+= asan/asan_malloc_linux.cc -SRCS+= asan/asan_memory_profile.cc -SRCS+= asan/asan_new_delete.cc -SRCS+= asan/asan_poisoning.cc -SRCS+= asan/asan_posix.cc -SRCS+= asan/asan_premap_shadow.cc -SRCS+= asan/asan_report.cc -SRCS+= asan/asan_rtl.cc -SRCS+= asan/asan_shadow_setup.cc -SRCS+= asan/asan_stack.cc -SRCS+= asan/asan_stats.cc -SRCS+= asan/asan_suppressions.cc -SRCS+= asan/asan_thread.cc -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= sanitizer_common/sancov_flags.cc -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_allocator_report.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_stackdepot.cc -SRCS+= sanitizer_common/sanitizer_stacktrace.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_symbolizer.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_report.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc -SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cc -SRCS+= ubsan/ubsan_diag.cc -SRCS+= ubsan/ubsan_flags.cc -SRCS+= ubsan/ubsan_handlers.cc -SRCS+= ubsan/ubsan_handlers_cxx.cc -SRCS+= ubsan/ubsan_init.cc -SRCS+= ubsan/ubsan_monitor.cc -SRCS+= ubsan/ubsan_type_hash.cc -SRCS+= ubsan/ubsan_type_hash_itanium.cc -SRCS+= ubsan/ubsan_value.cc +SRCS+= asan/asan_activation.cpp +SRCS+= asan/asan_allocator.cpp +SRCS+= asan/asan_debugging.cpp +SRCS+= asan/asan_descriptions.cpp +SRCS+= asan/asan_errors.cpp +SRCS+= asan/asan_fake_stack.cpp +SRCS+= asan/asan_flags.cpp +SRCS+= asan/asan_globals.cpp +SRCS+= asan/asan_interceptors.cpp +SRCS+= asan/asan_interceptors_memintrinsics.cpp +SRCS+= asan/asan_linux.cpp +SRCS+= asan/asan_malloc_linux.cpp +SRCS+= asan/asan_memory_profile.cpp +SRCS+= asan/asan_new_delete.cpp +SRCS+= asan/asan_poisoning.cpp +SRCS+= asan/asan_posix.cpp +SRCS+= asan/asan_premap_shadow.cpp +SRCS+= asan/asan_report.cpp +SRCS+= asan/asan_rtl.cpp +SRCS+= asan/asan_shadow_setup.cpp +SRCS+= asan/asan_stack.cpp +SRCS+= asan/asan_stats.cpp +SRCS+= asan/asan_suppressions.cpp +SRCS+= asan/asan_thread.cpp +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= sanitizer_common/sancov_flags.cpp +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_allocator_report.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_printf.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp +SRCS+= sanitizer_common/sanitizer_stackdepot.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cpp +SRCS+= sanitizer_common/sanitizer_suppressions.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp +SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_registry.cpp +SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp +SRCS+= sanitizer_common/sanitizer_type_traits.cpp +SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cpp +SRCS+= ubsan/ubsan_diag.cpp +SRCS+= ubsan/ubsan_flags.cpp +SRCS+= ubsan/ubsan_handlers.cpp +SRCS+= ubsan/ubsan_handlers_cxx.cpp +SRCS+= ubsan/ubsan_init.cpp +SRCS+= ubsan/ubsan_monitor.cpp +SRCS+= ubsan/ubsan_type_hash.cpp +SRCS+= ubsan/ubsan_type_hash_itanium.cpp +SRCS+= ubsan/ubsan_value.cpp # Kludge around a bsd.lib.mk shortcoming: when SHLIB_NAME is defined, but LIB # and LIB_CXX are undefined (which forces building only a shared library), @@ -92,6 +92,6 @@ CC= ${CXX} .include -CXXFLAGS.ubsan_handlers_cxx.cc= -frtti -CXXFLAGS.ubsan_type_hash.cc= -frtti -CXXFLAGS.ubsan_type_hash_itanium.cc= -frtti +CXXFLAGS.ubsan_handlers_cxx.cpp= -frtti +CXXFLAGS.ubsan_type_hash.cpp= -frtti +CXXFLAGS.ubsan_type_hash_itanium.cpp= -frtti Modified: projects/clang1000-import/lib/libclang_rt/cfi/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/cfi/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/cfi/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -5,35 +5,35 @@ LIB= clang_rt.cfi-${CRTARCH} SRCS+= cfi/cfi.cpp -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_printf.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp +SRCS+= sanitizer_common/sanitizer_suppressions.cpp +SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_registry.cpp +SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp +SRCS+= sanitizer_common/sanitizer_type_traits.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/cfi_diag/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/cfi_diag/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/cfi_diag/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -5,54 +5,54 @@ LIB= clang_rt.cfi_diag-${CRTARCH} SRCS+= cfi/cfi.cpp -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= sanitizer_common/sancov_flags.cc -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_allocator_report.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_stackdepot.cc -SRCS+= sanitizer_common/sanitizer_stacktrace.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_symbolizer.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_report.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc -SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cc -SRCS+= ubsan/ubsan_diag.cc -SRCS+= ubsan/ubsan_flags.cc -SRCS+= ubsan/ubsan_handlers.cc -SRCS+= ubsan/ubsan_init.cc -SRCS+= ubsan/ubsan_monitor.cc -SRCS+= ubsan/ubsan_value.cc +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= sanitizer_common/sancov_flags.cpp +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_allocator_report.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_printf.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp +SRCS+= sanitizer_common/sanitizer_stackdepot.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cpp +SRCS+= sanitizer_common/sanitizer_suppressions.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp +SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_registry.cpp +SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp +SRCS+= sanitizer_common/sanitizer_type_traits.cpp +SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cpp +SRCS+= ubsan/ubsan_diag.cpp +SRCS+= ubsan/ubsan_flags.cpp +SRCS+= ubsan/ubsan_handlers.cpp +SRCS+= ubsan/ubsan_init.cpp +SRCS+= ubsan/ubsan_monitor.cpp +SRCS+= ubsan/ubsan_value.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/dd/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/dd/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/dd/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,37 +4,37 @@ LIB= clang_rt.dd-${CRTARCH} -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc -SRCS+= tsan/dd/dd_interceptors.cc -SRCS+= tsan/dd/dd_rtl.cc +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_printf.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp +SRCS+= sanitizer_common/sanitizer_suppressions.cpp +SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_registry.cpp +SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp +SRCS+= sanitizer_common/sanitizer_type_traits.cpp +SRCS+= tsan/dd/dd_interceptors.cpp +SRCS+= tsan/dd/dd_rtl.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/fuzzer/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/fuzzer/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/fuzzer/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -13,7 +13,6 @@ SRCS+= fuzzer/FuzzerExtraCounters.cpp SRCS+= fuzzer/FuzzerFork.cpp SRCS+= fuzzer/FuzzerIO.cpp SRCS+= fuzzer/FuzzerIOPosix.cpp -SRCS+= fuzzer/FuzzerIOWindows.cpp SRCS+= fuzzer/FuzzerLoop.cpp SRCS+= fuzzer/FuzzerMain.cpp SRCS+= fuzzer/FuzzerMerge.cpp Modified: projects/clang1000-import/lib/libclang_rt/fuzzer_no_main/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/fuzzer_no_main/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/fuzzer_no_main/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -13,7 +13,6 @@ SRCS+= fuzzer/FuzzerExtraCounters.cpp SRCS+= fuzzer/FuzzerFork.cpp SRCS+= fuzzer/FuzzerIO.cpp SRCS+= fuzzer/FuzzerIOPosix.cpp -SRCS+= fuzzer/FuzzerIOWindows.cpp SRCS+= fuzzer/FuzzerLoop.cpp SRCS+= fuzzer/FuzzerMerge.cpp SRCS+= fuzzer/FuzzerMutate.cpp Modified: projects/clang1000-import/lib/libclang_rt/include/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/include/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/include/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -19,5 +19,6 @@ INCS+= netbsd_syscall_hooks.h INCS+= scudo_interface.h INCS+= tsan_interface.h INCS+= tsan_interface_atomic.h +INCS+= ubsan_interface.h .include Modified: projects/clang1000-import/lib/libclang_rt/msan/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/msan/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/msan/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,62 +4,62 @@ LIB= clang_rt.msan-${CRTARCH} -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= msan/msan.cc -SRCS+= msan/msan_allocator.cc -SRCS+= msan/msan_chained_origin_depot.cc -SRCS+= msan/msan_interceptors.cc -SRCS+= msan/msan_linux.cc -SRCS+= msan/msan_poisoning.cc -SRCS+= msan/msan_report.cc -SRCS+= msan/msan_thread.cc -SRCS+= sanitizer_common/sancov_flags.cc -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_allocator_report.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_stackdepot.cc -SRCS+= sanitizer_common/sanitizer_stacktrace.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_symbolizer.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_report.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc -SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cc -SRCS+= ubsan/ubsan_diag.cc -SRCS+= ubsan/ubsan_flags.cc -SRCS+= ubsan/ubsan_handlers.cc -SRCS+= ubsan/ubsan_init.cc -SRCS+= ubsan/ubsan_monitor.cc -SRCS+= ubsan/ubsan_value.cc +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= msan/msan.cpp +SRCS+= msan/msan_allocator.cpp +SRCS+= msan/msan_chained_origin_depot.cpp +SRCS+= msan/msan_interceptors.cpp +SRCS+= msan/msan_linux.cpp +SRCS+= msan/msan_poisoning.cpp +SRCS+= msan/msan_report.cpp +SRCS+= msan/msan_thread.cpp +SRCS+= sanitizer_common/sancov_flags.cpp +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_allocator_report.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_printf.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp +SRCS+= sanitizer_common/sanitizer_stackdepot.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cpp +SRCS+= sanitizer_common/sanitizer_suppressions.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp +SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_registry.cpp +SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp +SRCS+= sanitizer_common/sanitizer_type_traits.cpp +SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cpp +SRCS+= ubsan/ubsan_diag.cpp +SRCS+= ubsan/ubsan_flags.cpp +SRCS+= ubsan/ubsan_handlers.cpp +SRCS+= ubsan/ubsan_init.cpp +SRCS+= ubsan/ubsan_monitor.cpp +SRCS+= ubsan/ubsan_value.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/msan_cxx/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/msan_cxx/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/msan_cxx/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -5,13 +5,13 @@ LIB= clang_rt.msan_cxx-${CRTARCH} -SRCS+= msan/msan_new_delete.cc -SRCS+= ubsan/ubsan_handlers_cxx.cc -SRCS+= ubsan/ubsan_type_hash.cc -SRCS+= ubsan/ubsan_type_hash_itanium.cc +SRCS+= msan/msan_new_delete.cpp +SRCS+= ubsan/ubsan_handlers_cxx.cpp +SRCS+= ubsan/ubsan_type_hash.cpp +SRCS+= ubsan/ubsan_type_hash_itanium.cpp .include -CXXFLAGS.ubsan_handlers_cxx.cc= -frtti -CXXFLAGS.ubsan_type_hash.cc= -frtti -CXXFLAGS.ubsan_type_hash_itanium.cc= -frtti +CXXFLAGS.ubsan_handlers_cxx.cpp= -frtti +CXXFLAGS.ubsan_type_hash.cpp= -frtti +CXXFLAGS.ubsan_type_hash_itanium.cpp= -frtti Modified: projects/clang1000-import/lib/libclang_rt/profile/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/profile/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/profile/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -20,7 +20,7 @@ SRCS+= profile/InstrProfilingMergeFile.c SRCS+= profile/InstrProfilingNameVar.c SRCS+= profile/InstrProfilingPlatformLinux.c SRCS+= profile/InstrProfilingPlatformOther.c -SRCS+= profile/InstrProfilingRuntime.cc +SRCS+= profile/InstrProfilingRuntime.cpp SRCS+= profile/InstrProfilingUtil.c SRCS+= profile/InstrProfilingValue.c SRCS+= profile/InstrProfilingWriter.c Modified: projects/clang1000-import/lib/libclang_rt/safestack/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/safestack/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/safestack/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,8 +4,8 @@ LIB= clang_rt.safestack-${CRTARCH} -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= safestack/safestack.cc +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= safestack/safestack.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/stats/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/stats/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/stats/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,45 +4,45 @@ LIB= clang_rt.stats-${CRTARCH} -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_allocator_report.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_stackdepot.cc -SRCS+= sanitizer_common/sanitizer_stacktrace.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_symbolizer.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_report.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc -SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cc -SRCS+= stats/stats.cc +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_allocator_report.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix.cpp +SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_printf.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp +SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp +SRCS+= sanitizer_common/sanitizer_stackdepot.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cpp +SRCS+= sanitizer_common/sanitizer_suppressions.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp +SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_registry.cpp +SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp +SRCS+= sanitizer_common/sanitizer_type_traits.cpp +SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cpp +SRCS+= stats/stats.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/stats_client/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/stats_client/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/stats_client/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,6 +4,6 @@ LIB= clang_rt.stats_client-${CRTARCH} -SRCS+= stats/stats_client.cc +SRCS+= stats/stats_client.cpp .include Modified: projects/clang1000-import/lib/libclang_rt/tsan/Makefile ============================================================================== --- projects/clang1000-import/lib/libclang_rt/tsan/Makefile Mon Jan 27 20:12:03 2020 (r357177) +++ projects/clang1000-import/lib/libclang_rt/tsan/Makefile Mon Jan 27 20:46:26 2020 (r357178) @@ -4,84 +4,84 @@ LIB= clang_rt.tsan-${CRTARCH} -SRCS+= interception/interception_linux.cc -SRCS+= interception/interception_type_test.cc -SRCS+= sanitizer_common/sancov_flags.cc -SRCS+= sanitizer_common/sanitizer_allocator.cc -SRCS+= sanitizer_common/sanitizer_allocator_checks.cc -SRCS+= sanitizer_common/sanitizer_allocator_report.cc -SRCS+= sanitizer_common/sanitizer_common.cc -SRCS+= sanitizer_common/sanitizer_common_libcdep.cc -SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cc -SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cc -SRCS+= sanitizer_common/sanitizer_errno.cc -SRCS+= sanitizer_common/sanitizer_file.cc -SRCS+= sanitizer_common/sanitizer_flag_parser.cc -SRCS+= sanitizer_common/sanitizer_flags.cc -SRCS+= sanitizer_common/sanitizer_libc.cc -SRCS+= sanitizer_common/sanitizer_libignore.cc -SRCS+= sanitizer_common/sanitizer_linux.cc -SRCS+= sanitizer_common/sanitizer_linux_libcdep.cc -SRCS+= sanitizer_common/sanitizer_persistent_allocator.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cc -SRCS+= sanitizer_common/sanitizer_platform_limits_posix.cc -SRCS+= sanitizer_common/sanitizer_posix.cc -SRCS+= sanitizer_common/sanitizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_printf.cc -SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cc -SRCS+= sanitizer_common/sanitizer_procmaps_common.cc -SRCS+= sanitizer_common/sanitizer_stackdepot.cc -SRCS+= sanitizer_common/sanitizer_stacktrace.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_libcdep.cc -SRCS+= sanitizer_common/sanitizer_stacktrace_printer.cc -SRCS+= sanitizer_common/sanitizer_suppressions.cc -SRCS+= sanitizer_common/sanitizer_symbolizer.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libbacktrace.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc -SRCS+= sanitizer_common/sanitizer_symbolizer_report.cc -SRCS+= sanitizer_common/sanitizer_termination.cc -SRCS+= sanitizer_common/sanitizer_thread_registry.cc -SRCS+= sanitizer_common/sanitizer_tls_get_addr.cc -SRCS+= sanitizer_common/sanitizer_type_traits.cc -SRCS+= sanitizer_common/sanitizer_unwind_linux_libcdep.cc -SRCS+= tsan/rtl/tsan_clock.cc -SRCS+= tsan/rtl/tsan_debugging.cc -SRCS+= tsan/rtl/tsan_external.cc -SRCS+= tsan/rtl/tsan_fd.cc -SRCS+= tsan/rtl/tsan_flags.cc -SRCS+= tsan/rtl/tsan_ignoreset.cc -SRCS+= tsan/rtl/tsan_interceptors.cc -SRCS+= tsan/rtl/tsan_interface.cc -SRCS+= tsan/rtl/tsan_interface_ann.cc -SRCS+= tsan/rtl/tsan_interface_atomic.cc -SRCS+= tsan/rtl/tsan_interface_java.cc -SRCS+= tsan/rtl/tsan_md5.cc -SRCS+= tsan/rtl/tsan_mman.cc -SRCS+= tsan/rtl/tsan_mutex.cc -SRCS+= tsan/rtl/tsan_mutexset.cc -SRCS+= tsan/rtl/tsan_platform_linux.cc -SRCS+= tsan/rtl/tsan_platform_posix.cc -SRCS+= tsan/rtl/tsan_preinit.cc -SRCS+= tsan/rtl/tsan_report.cc -SRCS+= tsan/rtl/tsan_rtl.cc +SRCS+= interception/interception_linux.cpp +SRCS+= interception/interception_type_test.cpp +SRCS+= sanitizer_common/sancov_flags.cpp +SRCS+= sanitizer_common/sanitizer_allocator.cpp +SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp +SRCS+= sanitizer_common/sanitizer_allocator_report.cpp +SRCS+= sanitizer_common/sanitizer_common.cpp +SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp +SRCS+= sanitizer_common/sanitizer_deadlock_detector2.cpp +SRCS+= sanitizer_common/sanitizer_errno.cpp +SRCS+= sanitizer_common/sanitizer_file.cpp +SRCS+= sanitizer_common/sanitizer_flag_parser.cpp +SRCS+= sanitizer_common/sanitizer_flags.cpp +SRCS+= sanitizer_common/sanitizer_libc.cpp +SRCS+= sanitizer_common/sanitizer_libignore.cpp +SRCS+= sanitizer_common/sanitizer_linux.cpp +SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp +SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp +SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Mon Jan 27 20:47:24 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 911C222E7AA for ; Mon, 27 Jan 2020 20:47:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4861yh43Hxz4BGN; Mon, 27 Jan 2020 20:47:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BF31FF3E; Mon, 27 Jan 2020 20:47:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00RKlOXV031799; Mon, 27 Jan 2020 20:47:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00RKlIwI031771; Mon, 27 Jan 2020 20:47:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001272047.00RKlIwI031771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 27 Jan 2020 20:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357179 - in projects/clang1000-import: bin/pwait bin/pwait/tests contrib/libxo contrib/libxo/doc contrib/libxo/encoder/csv contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/te... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: bin/pwait bin/pwait/tests contrib/libxo contrib/libxo/doc contrib/libxo/encoder/csv contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved lib/libxo ... X-SVN-Commit-Revision: 357179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 20:47:24 -0000 Author: dim Date: Mon Jan 27 20:47:18 2020 New Revision: 357179 URL: https://svnweb.freebsd.org/changeset/base/357179 Log: Merge ^/head r357119 through r357178. Modified: projects/clang1000-import/bin/pwait/pwait.1 projects/clang1000-import/bin/pwait/pwait.c projects/clang1000-import/bin/pwait/tests/pwait_test.sh projects/clang1000-import/contrib/libxo/configure.ac projects/clang1000-import/contrib/libxo/doc/api.rst projects/clang1000-import/contrib/libxo/doc/encoders.rst projects/clang1000-import/contrib/libxo/doc/options.rst projects/clang1000-import/contrib/libxo/encoder/csv/enc_csv.c projects/clang1000-import/contrib/libxo/libxo/libxo.c projects/clang1000-import/contrib/libxo/libxo/xo.h projects/clang1000-import/contrib/libxo/libxo/xo_encoder.c projects/clang1000-import/contrib/libxo/libxo/xo_encoder.h projects/clang1000-import/contrib/libxo/tests/core/Makefile.am projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.H.out projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HIPx.out projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HP.out projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.J.out projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.JP.out projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.T.err projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.X.out projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.XP.out projects/clang1000-import/contrib/libxo/tests/core/test_02.c projects/clang1000-import/contrib/libxo/tests/core/test_12.c projects/clang1000-import/lib/libxo/add.man projects/clang1000-import/lib/libxo/libxo/xo_config.h projects/clang1000-import/sbin/newfs_msdos/mkfs_msdos.c projects/clang1000-import/share/mk/bsd.compat.mk projects/clang1000-import/sys/conf/Makefile.mips projects/clang1000-import/sys/conf/Makefile.powerpc projects/clang1000-import/sys/conf/kern.post.mk projects/clang1000-import/sys/dev/mrsas/mrsas_cam.c projects/clang1000-import/sys/dev/msk/if_msk.c projects/clang1000-import/sys/dev/netmap/netmap_mem2.c projects/clang1000-import/sys/dev/sound/pci/emu10k1.c projects/clang1000-import/sys/dev/sound/pci/emu10kx-pcm.c projects/clang1000-import/sys/fs/msdosfs/msdosfsmount.h projects/clang1000-import/sys/fs/nfsserver/nfs_nfsdstate.c projects/clang1000-import/sys/geom/geom_subr.c projects/clang1000-import/sys/geom/stripe/g_stripe.c projects/clang1000-import/sys/kern/vfs_default.c projects/clang1000-import/sys/kern/vfs_subr.c projects/clang1000-import/sys/netinet/ip_divert.c projects/clang1000-import/sys/sys/tree.h projects/clang1000-import/sys/tools/vnode_if.awk projects/clang1000-import/sys/ufs/ffs/ffs_vfsops.c projects/clang1000-import/sys/ufs/ufs/ufs_vnops.c projects/clang1000-import/sys/x86/cpufreq/hwpstate_amd.c projects/clang1000-import/sys/x86/iommu/intel_dmar.h projects/clang1000-import/sys/x86/iommu/intel_drv.c projects/clang1000-import/sys/x86/iommu/intel_gas.c projects/clang1000-import/tests/sys/kern/ptrace_test.c projects/clang1000-import/tests/sys/netinet/Makefile projects/clang1000-import/tools/build/Makefile projects/clang1000-import/usr.bin/xohtml/xohtml.sh projects/clang1000-import/usr.sbin/makefs/msdos/msdosfs_denode.c projects/clang1000-import/usr.sbin/makefs/msdos/msdosfs_vnops.c Directory Properties: projects/clang1000-import/ (props changed) projects/clang1000-import/contrib/libxo/ (props changed) Modified: projects/clang1000-import/bin/pwait/pwait.1 ============================================================================== --- projects/clang1000-import/bin/pwait/pwait.1 Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/bin/pwait/pwait.1 Mon Jan 27 20:47:18 2020 (r357179) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2017 +.Dd January 26, 2020 .Dt PWAIT 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl t Ar duration -.Op Fl v +.Op Fl ov .Ar pid \&... .Sh DESCRIPTION @@ -51,6 +51,8 @@ utility will wait until each of the given processes ha .Pp The following option is available: .Bl -tag -width indent +.It Fl o +Exit when any of the given processes has terminated. .It Fl t Ar duration If any process is still running after .Ar duration , Modified: projects/clang1000-import/bin/pwait/pwait.c ============================================================================== --- projects/clang1000-import/bin/pwait/pwait.c Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/bin/pwait/pwait.c Mon Jan 27 20:47:18 2020 (r357179) @@ -53,8 +53,7 @@ static void usage(void) { - fprintf(stderr, "usage: pwait [-t timeout] [-v] pid ...\n"); - exit(EX_USAGE); + errx(EX_USAGE, "usage: pwait [-t timeout] [-ov] pid ..."); } /* @@ -64,25 +63,30 @@ int main(int argc, char *argv[]) { struct itimerval itv; - int kq; struct kevent *e; - int tflag, verbose; - int opt, nleft, n, i, duplicate, status; + int oflag, tflag, verbose; + int i, kq, n, nleft, opt, status; long pid; - char *s, *end; + char *end, *s; double timeout; - tflag = verbose = 0; + oflag = 0; + tflag = 0; + verbose = 0; memset(&itv, 0, sizeof(itv)); - while ((opt = getopt(argc, argv, "t:v")) != -1) { + + while ((opt = getopt(argc, argv, "ot:v")) != -1) { switch (opt) { + case 'o': + oflag = 1; + break; case 't': tflag = 1; errno = 0; timeout = strtod(optarg, &end); - if (end == optarg || errno == ERANGE || - timeout < 0) + if (end == optarg || errno == ERANGE || timeout < 0) { errx(EX_DATAERR, "timeout value"); + } switch(*end) { case 0: case 's': @@ -96,8 +100,9 @@ main(int argc, char *argv[]) default: errx(EX_DATAERR, "timeout unit"); } - if (timeout > 100000000L) + if (timeout > 100000000L) { errx(EX_DATAERR, "timeout value"); + } itv.it_value.tv_sec = (time_t)timeout; timeout -= (time_t)timeout; itv.it_value.tv_usec = @@ -115,77 +120,96 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc == 0) + if (argc == 0) { usage(); + } kq = kqueue(); - if (kq == -1) - err(1, "kqueue"); + if (kq == -1) { + err(EX_OSERR, "kqueue"); + } e = malloc((argc + tflag) * sizeof(struct kevent)); - if (e == NULL) - err(1, "malloc"); + if (e == NULL) { + err(EX_OSERR, "malloc"); + } nleft = 0; for (n = 0; n < argc; n++) { s = argv[n]; - if (!strncmp(s, "/proc/", 6)) /* Undocumented Solaris compat */ + /* Undocumented Solaris compat */ + if (!strncmp(s, "/proc/", 6)) { s += 6; + } errno = 0; pid = strtol(s, &end, 10); if (pid < 0 || *end != '\0' || errno != 0) { warnx("%s: bad process id", s); continue; } - duplicate = 0; - for (i = 0; i < nleft; i++) - if (e[i].ident == (uintptr_t)pid) - duplicate = 1; - if (!duplicate) { - EV_SET(e + nleft, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, - 0, NULL); - if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) - warn("%ld", pid); - else - nleft++; + for (i = 0; i < nleft; i++) { + if (e[i].ident == (uintptr_t)pid) { + break; + } } + if (i < nleft) { + /* Duplicate. */ + continue; + } + EV_SET(e + nleft, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL); + if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) { + warn("%ld", pid); + if (oflag) { + exit(EX_OK); + } + } else { + nleft++; + } } - if (tflag) { + if (nleft > 0 && tflag) { /* * Explicitly detect SIGALRM so that an exit status of 124 * can be returned rather than 142. */ EV_SET(e + nleft, SIGALRM, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); - if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) + if (kevent(kq, e + nleft, 1, NULL, 0, NULL) == -1) { err(EX_OSERR, "kevent"); + } /* Ignore SIGALRM to not interrupt kevent(2). */ signal(SIGALRM, SIG_IGN); - if (setitimer(ITIMER_REAL, &itv, NULL) == -1) + if (setitimer(ITIMER_REAL, &itv, NULL) == -1) { err(EX_OSERR, "setitimer"); + } } while (nleft > 0) { n = kevent(kq, NULL, 0, e, nleft + tflag, NULL); - if (n == -1) - err(1, "kevent"); + if (n == -1) { + err(EX_OSERR, "kevent"); + } for (i = 0; i < n; i++) { if (e[i].filter == EVFILT_SIGNAL) { - if (verbose) + if (verbose) { printf("timeout\n"); - return (124); + } + exit(124); } if (verbose) { status = e[i].data; - if (WIFEXITED(status)) + if (WIFEXITED(status)) { printf("%ld: exited with status %d.\n", (long)e[i].ident, WEXITSTATUS(status)); - else if (WIFSIGNALED(status)) + } else if (WIFSIGNALED(status)) { printf("%ld: killed by signal %d.\n", (long)e[i].ident, WTERMSIG(status)); - else + } else { printf("%ld: terminated.\n", (long)e[i].ident); + } + } + if (oflag) { + exit(EX_OK); } --nleft; } Modified: projects/clang1000-import/bin/pwait/tests/pwait_test.sh ============================================================================== --- projects/clang1000-import/bin/pwait/tests/pwait_test.sh Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/bin/pwait/tests/pwait_test.sh Mon Jan 27 20:47:18 2020 (r357179) @@ -232,6 +232,85 @@ timeout_many_cleanup() wait $p1 $p5 $p10 >/dev/null 2>&1 } +atf_test_case or_flag +or_flag_head() +{ + atf_set "descr" "Test OR flag" +} + +or_flag_body() +{ + sleep 2 & + p2=$! + + sleep 4 & + p4=$! + + sleep 6 & + p6=$! + + atf_check \ + -o inline:"$p2: exited with status 0.\n" \ + -e empty \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o -v $p2 $p4 $p6 + + atf_check \ + -o empty \ + -e inline:"pwait: $p2: No such process\n" \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p2 $p4 $p6 + + atf_check \ + -o empty \ + -e empty \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p4 $p6 + + atf_check \ + -o empty \ + -e inline:"pwait: $p4: No such process\n" \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p4 $p6 + + atf_check \ + -o inline:"$p6: exited with status 0.\n" \ + -e empty \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o -v $p6 + + atf_check \ + -o empty \ + -e inline:"pwait: $p6: No such process\n" \ + -s exit:0 \ + timeout --preserve-status 15 pwait -o $p6 + + atf_check \ + -o empty \ + -e inline:"kill: $p2: No such process\n" \ + -s exit:1 \ + kill -0 $p2 + + atf_check \ + -o empty \ + -e inline:"kill: $p4: No such process\n" \ + -s exit:1 \ + kill -0 $p4 + + atf_check \ + -o empty \ + -e inline:"kill: $p6: No such process\n" \ + -s exit:1 \ + kill -0 $p6 + +} + +or_flag_cleanup() +{ + kill $p2 $p4 $p6 >/dev/null 2>&1 + wait $p2 $p4 $p6 >/dev/null 2>&1 +} + atf_init_test_cases() { atf_add_test_case basic @@ -239,4 +318,5 @@ atf_init_test_cases() atf_add_test_case timeout_trigger_timeout atf_add_test_case timeout_no_timeout atf_add_test_case timeout_many + atf_add_test_case or_flag } Modified: projects/clang1000-import/contrib/libxo/configure.ac ============================================================================== --- projects/clang1000-import/contrib/libxo/configure.ac Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/configure.ac Mon Jan 27 20:47:18 2020 (r357179) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [1.3.1], [phil@juniper.net]) +AC_INIT([libxo], [1.4.0], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: projects/clang1000-import/contrib/libxo/doc/api.rst ============================================================================== --- projects/clang1000-import/contrib/libxo/doc/api.rst Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/doc/api.rst Mon Jan 27 20:47:18 2020 (r357179) @@ -1204,6 +1204,11 @@ message associated with either *errno* or the *code* p xo_err(1, "cannot open file '%s'", filename); .. index:: xo_error +.. index:: xo_error_h +.. index:: xo_error_hv +.. index:: xo_errorn +.. index:: xo_errorn_h +.. index:: xo_errorn_hv xo_error ~~~~~~~~ @@ -1214,6 +1219,50 @@ xo_error :type fmt: const char * :returns: void +.. c:function:: void xo_error_h (xo_handle_t *xop, const char *fmt, ...) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_error_hv (xo_handle_t *xop, const char *fmt, va_list vap) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :param vap: variadic arguments + :type xop: va_list + :returns: void + +.. c:function:: void xo_errorn (const char *fmt, ...) + + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_errorn_h (xo_handle_t *xop, const char *fmt, ...) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param need_newline: boolean indicating need for trailing newline + :type need_newline: int + :param fmt: Format string + :type fmt: const char * + :param vap: variadic arguments + :type xop: va_list + :returns: void + The `xo_error` function can be used for generic errors that should be reported over the handle, rather than to stderr. The `xo_error` function behaves like `xo_err` for TEXT and HTML output styles, but @@ -1225,6 +1274,16 @@ xo_error Does not compute JSON:: "error": { "message": "Does not compute" } + + The `xo_error_h` and `xo_error_hv` add a handle object and a + variadic-ized parameter to the signature, respectively. + + The `xo_errorn` function supplies a newline at the end the error + message if the format string does not include one. The + `xo_errorn_h` and `xo_errorn_hv` functions add a handle object and + a variadic-ized parameter to the signature, respectively. The + `xo_errorn_hv` function also adds a boolean to indicate the need for + a trailing newline. .. index:: xo_no_setlocale .. index:: Locale Modified: projects/clang1000-import/contrib/libxo/doc/encoders.rst ============================================================================== --- projects/clang1000-import/contrib/libxo/doc/encoders.rst Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/doc/encoders.rst Mon Jan 27 20:47:18 2020 (r357179) @@ -26,12 +26,13 @@ example uses the "cbor" encoder, saving the output int df --libxo encoder=cbor > df-output.cbor Encoders can support specific options that can be accessed by -following the encoder name with a colon (':') and one of more options, -separated by a plus sign "+":: +following the encoder name with a colon (':') or a plus sign ('+') and +one of more options, separated by the same character:: - df --libxo encoder=csv:path=filesystem+leaf=name+no-header + df --libxo encoder=csv+path=filesystem+leaf=name+no-header + df --libxo encoder=csv:path=filesystem:leaf=name:no-header -This example instructs libxo to load the "csv" encoder and pass the +These examples instructs libxo to load the "csv" encoder and pass the following options:: path=filesystem @@ -41,6 +42,10 @@ following options:: Each of these option is interpreted by the encoder, and all such options names and semantics are specific to the particular encoder. Refer to the intended encoder for documentation on its options. + +The string "@" can be used in place of the string "encoder=". + + df --libxo @csv:no-header .. _csv_encoder: Modified: projects/clang1000-import/contrib/libxo/doc/options.rst ============================================================================== --- projects/clang1000-import/contrib/libxo/doc/options.rst Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/doc/options.rst Mon Jan 27 20:47:18 2020 (r357179) @@ -162,3 +162,23 @@ foreground and background output to "yellow", give onl mapping, skipping the first four mappings with bare plus signs ("+"):: --libxo colors=++++yellow/yellow + +Encoders +-------- + +In addition to the four "built-in" formats, libxo supports an +extensible mechanism for adding encoders. These are activated +using the "encoder" keyword:: + + --libxo encoder=cbor + +The encoder can include encoder-specific options, separated by either +colons (":") or plus signs ("+"): + + --libxo encoder=csv+path=filesystem+leaf=name+no-header + --libxo encoder=csv:path=filesystem:leaf=name:no-header + +For brevity, the string "@" can be used in place of the string +"encoder=". + + df --libxo @csv:no-header Modified: projects/clang1000-import/contrib/libxo/encoder/csv/enc_csv.c ============================================================================== --- projects/clang1000-import/contrib/libxo/encoder/csv/enc_csv.c Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/encoder/csv/enc_csv.c Mon Jan 27 20:47:18 2020 (r357179) @@ -41,10 +41,12 @@ * (double) quote characters. * - Leading and trialing whitespace require fields be quoted. * - * Cheesy, but simple. The RFC also requires MS-DOS end-of-line, which - * we only do with the "dos" option. Strange that we still live in a - * DOS-friendly world, but then again, we make spaceships based on the - * horse butts (http://www.astrodigital.org/space/stshorse.html). + * Cheesy, but simple. The RFC also requires MS-DOS end-of-line, + * which we only do with the "dos" option. Strange that we still live + * in a DOS-friendly world, but then again, we make spaceships based + * on the horse butts (http://www.astrodigital.org/space/stshorse.html + * though the "built by English expatriates” bit is rubbish; better to + * say the first engines used in America were built by Englishmen.) */ #include @@ -655,10 +657,12 @@ csv_record_path (xo_handle_t *xop, csv_private_t *csv, /* * Extract the option values. The format is: - * -libxo encoder=csv:kw=val+kw=val+kw=val,pretty,etc + * -libxo encoder=csv:kw=val:kw=val:kw=val,pretty + * -libxo encoder=csv+kw=val+kw=val+kw=val,pretty */ static int -csv_options (xo_handle_t *xop, csv_private_t *csv, const char *raw_opts) +csv_options (xo_handle_t *xop, csv_private_t *csv, + const char *raw_opts, char opts_char) { ssize_t len = strlen(raw_opts); char *options = alloca(len + 1); @@ -667,7 +671,7 @@ csv_options (xo_handle_t *xop, csv_private_t *csv, con char *cp, *ep, *np, *vp; for (cp = options, ep = options + len + 1; cp && cp < ep; cp = np) { - np = strchr(cp, '+'); + np = strchr(cp, opts_char); if (np) *np++ = '\0'; @@ -761,7 +765,11 @@ csv_handler (XO_ENCODER_HANDLER_ARGS) break; case XO_OP_OPTIONS: - rc = csv_options(xop, csv, value); + rc = csv_options(xop, csv, value, ':'); + break; + + case XO_OP_OPTIONS_PLUS: + rc = csv_options(xop, csv, value, '+'); break; case XO_OP_OPEN_LIST: Modified: projects/clang1000-import/contrib/libxo/libxo/libxo.c ============================================================================== --- projects/clang1000-import/contrib/libxo/libxo/libxo.c Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/libxo/libxo.c Mon Jan 27 20:47:18 2020 (r357179) @@ -2371,6 +2371,25 @@ xo_set_options (xo_handle_t *xop, const char *input) if (np) *np++ = '\0'; + /* + * "@foo" is a shorthand for "encoder=foo". This is driven + * chiefly by a desire to make pluggable encoders not appear + * so distinct from built-in encoders. + */ + if (*cp == '@') { + vp = cp + 1; + + if (*vp == '\0') + xo_failure(xop, "missing value for encoder option"); + else { + rc = xo_encoder_init(xop, vp); + if (rc) + xo_warnx("error initializing encoder: %s", vp); + } + + continue; + } + vp = strchr(cp, '='); if (vp) *vp++ = '\0'; @@ -8007,7 +8026,7 @@ xo_finish_atexit (void) * Generate an error message, such as would be displayed on stderr */ void -xo_error_hv (xo_handle_t *xop, const char *fmt, va_list vap) +xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap) { xop = xo_default(xop); @@ -8015,13 +8034,15 @@ xo_error_hv (xo_handle_t *xop, const char *fmt, va_lis * If the format string doesn't end with a newline, we pop * one on ourselves. */ - ssize_t len = strlen(fmt); - if (len > 0 && fmt[len - 1] != '\n') { - char *newfmt = alloca(len + 2); - memcpy(newfmt, fmt, len); - newfmt[len] = '\n'; - newfmt[len + 1] = '\0'; - fmt = newfmt; + if (need_newline) { + ssize_t len = strlen(fmt); + if (len > 0 && fmt[len - 1] != '\n') { + char *newfmt = alloca(len + 2); + memcpy(newfmt, fmt, len); + newfmt[len] = '\n'; + newfmt[len + 1] = '\0'; + fmt = newfmt; + } } switch (xo_style(xop)) { @@ -8069,7 +8090,7 @@ xo_error_h (xo_handle_t *xop, const char *fmt, ...) va_list vap; va_start(vap, fmt); - xo_error_hv(xop, fmt, vap); + xo_errorn_hv(xop, 0, fmt, vap); va_end(vap); } @@ -8082,11 +8103,34 @@ xo_error (const char *fmt, ...) va_list vap; va_start(vap, fmt); - xo_error_hv(NULL, fmt, vap); + xo_errorn_hv(NULL, 0, fmt, vap); va_end(vap); } +void +xo_errorn_h (xo_handle_t *xop, const char *fmt, ...) +{ + va_list vap; + + va_start(vap, fmt); + xo_errorn_hv(xop, 1, fmt, vap); + va_end(vap); +} + /* + * Generate an error message, such as would be displayed on stderr + */ +void +xo_errorn (const char *fmt, ...) +{ + va_list vap; + + va_start(vap, fmt); + xo_errorn_hv(NULL, 1, fmt, vap); + va_end(vap); +} + +/* * Parse any libxo-specific options from the command line, removing them * so the main() argument parsing won't see them. We return the new value * for argc or -1 for error. If an error occurred, the program should @@ -8099,21 +8143,30 @@ xo_parse_args (int argc, char **argv) char *cp; int i, save; - /* Save our program name for xo_err and friends */ - xo_program = argv[0]; - cp = strrchr(xo_program, '/'); - if (cp) - xo_program = ++cp; - else - cp = argv[0]; /* Reset to front of string */ + /* + * If xo_set_program has always been called, we honor that value + */ + if (xo_program == NULL) { + /* Save our program name for xo_err and friends */ + xo_program = argv[0]; + cp = strrchr(xo_program, '/'); + if (cp) + xo_program = ++cp; + else + cp = argv[0]; /* Reset to front of string */ - /* GNU tools add an annoying ".test" as the program extension; remove it */ - size_t len = strlen(xo_program); - static const char gnu_ext[] = ".test"; - if (len >= sizeof(gnu_ext)) { - cp += len + 1 - sizeof(gnu_ext); - if (xo_streq(cp, gnu_ext)) - *cp = '\0'; + /* + * GNU libtool add an annoying ".test" as the program + * extension; we remove it. libtool also adds a "lt-" prefix + * that we cannot remove. + */ + size_t len = strlen(xo_program); + static const char gnu_ext[] = ".test"; + if (len >= sizeof(gnu_ext)) { + cp += len + 1 - sizeof(gnu_ext); + if (xo_streq(cp, gnu_ext)) + *cp = '\0'; + } } xo_handle_t *xop = xo_default(NULL); Modified: projects/clang1000-import/contrib/libxo/libxo/xo.h ============================================================================== --- projects/clang1000-import/contrib/libxo/libxo/xo.h Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/libxo/xo.h Mon Jan 27 20:47:18 2020 (r357179) @@ -389,6 +389,15 @@ xo_error_h (xo_handle_t *xop, const char *fmt, ...); void xo_error (const char *fmt, ...); +void +xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap); + +void +xo_errorn_h (xo_handle_t *xop, const char *fmt, ...); + +void +xo_errorn (const char *fmt, ...); + xo_ssize_t xo_flush_h (xo_handle_t *xop); Modified: projects/clang1000-import/contrib/libxo/libxo/xo_encoder.c ============================================================================== --- projects/clang1000-import/contrib/libxo/libxo/xo_encoder.c Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/libxo/xo_encoder.c Mon Jan 27 20:47:18 2020 (r357179) @@ -290,8 +290,21 @@ xo_encoder_init (xo_handle_t *xop, const char *name) { xo_encoder_setup(); - const char *opts = strchr(name, ':'); + char opts_char = '\0'; + const char *col_opts = strchr(name, ':'); + const char *plus_opts = strchr(name, '+'); + + /* + * Find the option-separating character (plus or colon) which + * appears first in the options string. + */ + const char *opts = (col_opts == NULL) ? plus_opts + : (plus_opts == NULL) ? col_opts + : (plus_opts < col_opts) ? plus_opts : col_opts; + if (opts) { + opts_char = *opts; + /* Make a writable copy of the name */ size_t len = strlen(name); char *copy = alloca(len + 1); @@ -329,7 +342,11 @@ xo_encoder_init (xo_handle_t *xop, const char *name) int rc = xo_encoder_handle(xop, XO_OP_CREATE, name, NULL, 0); if (rc == 0 && opts != NULL) { - rc = xo_encoder_handle(xop, XO_OP_OPTIONS, name, opts, 0); + xo_encoder_op_t op; + + /* Encoder API is limited, so we're stuck with two different options */ + op = (opts_char == '+') ? XO_OP_OPTIONS_PLUS : XO_OP_OPTIONS; + rc = xo_encoder_handle(xop, op, name, opts, 0); } return rc; Modified: projects/clang1000-import/contrib/libxo/libxo/xo_encoder.h ============================================================================== --- projects/clang1000-import/contrib/libxo/libxo/xo_encoder.h Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/libxo/xo_encoder.h Mon Jan 27 20:47:18 2020 (r357179) @@ -90,6 +90,7 @@ typedef unsigned xo_encoder_op_t; #define XO_OP_ATTRIBUTE 15 /* Attribute name/value */ #define XO_OP_VERSION 16 /* Version string */ #define XO_OP_OPTIONS 17 /* Additional command line options */ +#define XO_OP_OPTIONS_PLUS 18 /* Additional command line options */ #define XO_ENCODER_HANDLER_ARGS \ xo_handle_t *xop __attribute__ ((__unused__)), \ Modified: projects/clang1000-import/contrib/libxo/tests/core/Makefile.am ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/Makefile.am Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/Makefile.am Mon Jan 27 20:47:18 2020 (r357179) @@ -88,7 +88,7 @@ TEST_JIG = \ TEST_JIG2 = \ echo "... $$test ... $$fmt ..."; \ -xoopts==warn,encoder=csv$$csv ; \ +xoopts==warn,$$csv ; \ ${TEST_JIG}; true; TEST_FORMATS = T XP JP HP X J H HIPx @@ -111,9 +111,12 @@ test tests: ${bin_PROGRAMS} done) \ done) -@ (${TEST_TRACE} test=test_01.c; base=test_01; \ - ( fmt=Ecsv1; csv= ; ${TEST_JIG2} ); \ - ( fmt=Ecsv2; csv=:path=top/data/item+no-header ; ${TEST_JIG2} ); \ - ( fmt=Ecsv3; csv=:path=item+leafs=sku.sold+no-quotes ; ${TEST_JIG2} ); \ + ( fmt=Ecsv1; csv=encoder=csv ; \ + ${TEST_JIG2} ); \ + ( fmt=Ecsv2; csv=encoder=csv:path=top/data/item:no-header ; \ + ${TEST_JIG2} ); \ + ( fmt=Ecsv3; csv=@csv:path=item:leafs=sku.sold:no-quotes ; \ + ${TEST_JIG2} ); \ ) Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.H.out ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.H.out Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.H.out Mon Jan 27 20:47:18 2020 (r357179) @@ -4,4 +4,7 @@
length
abcdef
close
-1
returned
Bad file descriptor
good
close
-1
returned
Bad fi
good
improper use of profanity; ten yard penalty; first down
20
30
40
file
0
bytes
1
byte
2
bytes
3
bytes
4
bytes
10
/
20
/
30
mbufs <&> in use (current/cache/total)
50
from
Boston
64
left out of
640
64
left out of
640
beforeworkingafter:
string
:
10
11
1010
packets here/there/everywhere
1010
packets here/there/everywhere
(
15
/
20
/
125
)
(
15
/
20
/
125
)
(
15
/
20
/
125
)
(
15
/
20
/
125
)
Humanize:
21
,
57 K
,
96M
,
44M
,
1.2G
one
two
three
(null)
1:
1000
2:
test5000
3:
ten-longx
4:
xtest
this is an error
two more errors
this is an warning
two more warnings
V1/V2 packets
:
10
0004
tries
improper use of profanity; ten yard penalty; first down
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +
err message (1)
err message (2) +
err message (1) +
err message (2)
\ No newline at end of file Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HIPx.out ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HIPx.out Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HIPx.out Mon Jan 27 20:47:18 2020 (r357179) @@ -225,3 +225,18 @@
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
+
+
err message (1)
+
+
+
err message (2) +
+
+
+
err message (1) +
+
+
+
err message (2) +
+
Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HP.out ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HP.out Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.HP.out Mon Jan 27 20:47:18 2020 (r357179) @@ -225,3 +225,18 @@
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
+
+
err message (1)
+
+
+
err message (2) +
+
+
+
err message (1) +
+
+
+
err message (2) +
+
Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.J.out ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.J.out Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.J.out Mon Jan 27 20:47:18 2020 (r357179) @@ -1 +1 @@ -{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}}}} +{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}, "error": {"message":"err message (1)"}, "error": {"message":"err message (2)\n"}, "error": {"message":"err message (1)\n"}, "error": {"message":"err message (2)\n"}}}} Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.JP.out ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.JP.out Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.JP.out Mon Jan 27 20:47:18 2020 (r357179) @@ -80,6 +80,18 @@ "test": 4, "error": { "message": "Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n" + }, + "error": { + "message": "err message (1)" + }, + "error": { + "message": "err message (2)\n" + }, + "error": { + "message": "err message (1)\n" + }, + "error": { + "message": "err message (2)\n" } } } Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.T.err ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.T.err Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.T.err Mon Jan 27 20:47:18 2020 (r357179) @@ -1,2 +1,5 @@ test_02: key field emitted after normal value field: 'name' Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +err message (1)err message (2) +err message (1) +err message (2) Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.X.out ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.X.out Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.X.out Mon Jan 27 20:47:18 2020 (r357179) @@ -4,4 +4,7 @@ abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down 2030400123410203050Boston646406464010111010101015201251520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more er rors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +err message (1)err message (2) +err message (1) +err message (2) \ No newline at end of file Modified: projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.XP.out ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.XP.out Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/saved/test_02.XP.out Mon Jan 27 20:47:18 2020 (r357179) @@ -87,5 +87,20 @@ Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> + + err message (1) + + + err message (2) + + + + err message (1) + + + + err message (2) + + Modified: projects/clang1000-import/contrib/libxo/tests/core/test_02.c ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/test_02.c Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/test_02.c Mon Jan 27 20:47:18 2020 (r357179) @@ -21,6 +21,8 @@ int main (int argc, char **argv) { + xo_set_program("test_02"); + argc = xo_parse_args(argc, argv); if (argc < 0) return 1; @@ -144,6 +146,10 @@ main (int argc, char **argv) "ten yard penalty", "first down"); xo_error("Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"); + xo_error("err message (%d)", 1); + xo_error("err message (%d)\n", 2); + xo_errorn("err message (%d)", 1); + xo_errorn("err message (%d)\n", 2); xo_close_container("data"); Modified: projects/clang1000-import/contrib/libxo/tests/core/test_12.c ============================================================================== --- projects/clang1000-import/contrib/libxo/tests/core/test_12.c Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/contrib/libxo/tests/core/test_12.c Mon Jan 27 20:47:18 2020 (r357179) @@ -25,6 +25,8 @@ main (int argc, char **argv) xo_emit_flags_t flags = XOEF_RETAIN; int opt_color = 1; + xo_set_program("test_12"); + argc = xo_parse_args(argc, argv); if (argc < 0) return 1; Modified: projects/clang1000-import/lib/libxo/add.man ============================================================================== --- projects/clang1000-import/lib/libxo/add.man Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/lib/libxo/add.man Mon Jan 27 20:47:18 2020 (r357179) @@ -3,10 +3,10 @@ .Fx uses .Nm libxo -version 1.3.1. +version 1.4.0. Complete documentation can be found on github: .Bd -literal -offset indent -https://juniper.github.io/libxo/1.3.1/html/index.html +https://juniper.github.io/libxo/1.4.0/html/index.html .Ed .Pp .Nm libxo Modified: projects/clang1000-import/lib/libxo/libxo/xo_config.h ============================================================================== --- projects/clang1000-import/lib/libxo/libxo/xo_config.h Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/lib/libxo/libxo/xo_config.h Mon Jan 27 20:47:18 2020 (r357179) @@ -183,16 +183,16 @@ /* #undef LIBXO_TEXT_ONLY */ /* Version number as dotted value */ -#define LIBXO_VERSION "1.3.1" +#define LIBXO_VERSION "1.4.0" /* Version number extra information */ #define LIBXO_VERSION_EXTRA "" /* Version number as a number */ -#define LIBXO_VERSION_NUMBER 1003001 +#define LIBXO_VERSION_NUMBER 1004000 /* Version number as string */ -#define LIBXO_VERSION_STRING "1003001" +#define LIBXO_VERSION_STRING "1004000" /* Enable local wcwidth implementation */ #define LIBXO_WCWIDTH 1 @@ -210,7 +210,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 1.3.1" +#define PACKAGE_STRING "libxo 1.4.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -219,7 +219,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.3.1" +#define PACKAGE_VERSION "1.4.0" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -236,7 +236,7 @@ /* #undef USE_INT_RETURN_CODES */ /* Version number of package */ -#define VERSION "1.3.1" +#define VERSION "1.4.0" /* Retain hash bucket size */ /* #undef XO_RETAIN_SIZE */ Modified: projects/clang1000-import/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- projects/clang1000-import/sbin/newfs_msdos/mkfs_msdos.c Mon Jan 27 20:46:26 2020 (r357178) +++ projects/clang1000-import/sbin/newfs_msdos/mkfs_msdos.c Mon Jan 27 20:47:18 2020 (r357179) @@ -31,10 +31,15 @@ static const char rcsid[] = #endif /* not lint */ #include +#ifdef MAKEFS +/* In the makefs case we only want struct disklabel */ +#include +#else #include #include #include #include +#endif #include #include @@ -285,14 +290,18 @@ mkfs_msdos(const char *fname, const char *dtype, const if (!S_ISREG(sb.st_mode)) warnx("warning, %s is not a regular file", fname); } else { -#ifndef MAKEFS +#ifdef MAKEFS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Tue Jan 28 18:04:18 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA072235E69 for ; Tue, 28 Jan 2020 18:04:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486ZJ26235z4K5C; Tue, 28 Jan 2020 18:04:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA0DF26F4B; Tue, 28 Jan 2020 18:04:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SI4IOI007436; Tue, 28 Jan 2020 18:04:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SI4HmL007429; Tue, 28 Jan 2020 18:04:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001281804.00SI4HmL007429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 18:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357209 - in projects/clang1000-import/contrib/llvm-project/libunwind: include src X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import/contrib/llvm-project/libunwind: include src X-SVN-Commit-Revision: 357209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 18:04:18 -0000 Author: dim Date: Tue Jan 28 18:04:17 2020 New Revision: 357209 URL: https://svnweb.freebsd.org/changeset/base/357209 Log: Prefer upstream RISC-V additions in libunwind instead of ours, as these arrived via roundabout way upstream, and got updated in the mean time. Modified: projects/clang1000-import/contrib/llvm-project/libunwind/include/__libunwind_config.h projects/clang1000-import/contrib/llvm-project/libunwind/include/libunwind.h projects/clang1000-import/contrib/llvm-project/libunwind/src/Registers.hpp projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindCursor.hpp projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersRestore.S projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersSave.S projects/clang1000-import/contrib/llvm-project/libunwind/src/libunwind.cpp Modified: projects/clang1000-import/contrib/llvm-project/libunwind/include/__libunwind_config.h ============================================================================== --- projects/clang1000-import/contrib/llvm-project/libunwind/include/__libunwind_config.h Tue Jan 28 17:48:17 2020 (r357208) +++ projects/clang1000-import/contrib/llvm-project/libunwind/include/__libunwind_config.h Tue Jan 28 18:04:17 2020 (r357209) @@ -21,7 +21,6 @@ #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 95 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM 287 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K 32 -#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 95 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS 65 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64 @@ -83,12 +82,6 @@ # define _LIBUNWIND_CONTEXT_SIZE 16 # define _LIBUNWIND_CURSOR_SIZE 24 # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K -# elif defined(__riscv) -# define _LIBUNWIND_TARGET_RISCV 1 -# define _LIBUNWIND_CONTEXT_SIZE 64 -# define _LIBUNWIND_CURSOR_SIZE 76 -# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV -# define _LIBUNWIND_MAX_REGISTER 96 # elif defined(__mips__) # if defined(_ABIO32) && _MIPS_SIM == _ABIO32 # define _LIBUNWIND_TARGET_MIPS_O32 1 Modified: projects/clang1000-import/contrib/llvm-project/libunwind/include/libunwind.h ============================================================================== --- projects/clang1000-import/contrib/llvm-project/libunwind/include/libunwind.h Tue Jan 28 17:48:17 2020 (r357208) +++ projects/clang1000-import/contrib/llvm-project/libunwind/include/libunwind.h Tue Jan 28 18:04:17 2020 (r357209) @@ -726,77 +726,6 @@ enum { UNW_OR1K_EPCR = 32, }; -// 64-bit RISC-V registers -enum { - UNW_RISCV_X0 = 0, - UNW_RISCV_X1 = 1, - UNW_RISCV_RA = 1, - UNW_RISCV_X2 = 2, - UNW_RISCV_SP = 2, - UNW_RISCV_X3 = 3, - UNW_RISCV_X4 = 4, - UNW_RISCV_X5 = 5, - UNW_RISCV_X6 = 6, - UNW_RISCV_X7 = 7, - UNW_RISCV_X8 = 8, - UNW_RISCV_X9 = 9, - UNW_RISCV_X10 = 10, - UNW_RISCV_X11 = 11, - UNW_RISCV_X12 = 12, - UNW_RISCV_X13 = 13, - UNW_RISCV_X14 = 14, - UNW_RISCV_X15 = 15, - UNW_RISCV_X16 = 16, - UNW_RISCV_X17 = 17, - UNW_RISCV_X18 = 18, - UNW_RISCV_X19 = 19, - UNW_RISCV_X20 = 20, - UNW_RISCV_X21 = 21, - UNW_RISCV_X22 = 22, - UNW_RISCV_X23 = 23, - UNW_RISCV_X24 = 24, - UNW_RISCV_X25 = 25, - UNW_RISCV_X26 = 26, - UNW_RISCV_X27 = 27, - UNW_RISCV_X28 = 28, - UNW_RISCV_X29 = 29, - UNW_RISCV_X30 = 30, - UNW_RISCV_X31 = 31, - // reserved block - UNW_RISCV_D0 = 64, - UNW_RISCV_D1 = 65, - UNW_RISCV_D2 = 66, - UNW_RISCV_D3 = 67, - UNW_RISCV_D4 = 68, - UNW_RISCV_D5 = 69, - UNW_RISCV_D6 = 70, - UNW_RISCV_D7 = 71, - UNW_RISCV_D8 = 72, - UNW_RISCV_D9 = 73, - UNW_RISCV_D10 = 74, - UNW_RISCV_D11 = 75, - UNW_RISCV_D12 = 76, - UNW_RISCV_D13 = 77, - UNW_RISCV_D14 = 78, - UNW_RISCV_D15 = 79, - UNW_RISCV_D16 = 80, - UNW_RISCV_D17 = 81, - UNW_RISCV_D18 = 82, - UNW_RISCV_D19 = 83, - UNW_RISCV_D20 = 84, - UNW_RISCV_D21 = 85, - UNW_RISCV_D22 = 86, - UNW_RISCV_D23 = 87, - UNW_RISCV_D24 = 88, - UNW_RISCV_D25 = 89, - UNW_RISCV_D26 = 90, - UNW_RISCV_D27 = 91, - UNW_RISCV_D28 = 92, - UNW_RISCV_D29 = 93, - UNW_RISCV_D30 = 94, - UNW_RISCV_D31 = 95, -}; - // MIPS registers enum { UNW_MIPS_R0 = 0, Modified: projects/clang1000-import/contrib/llvm-project/libunwind/src/Registers.hpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/libunwind/src/Registers.hpp Tue Jan 28 17:48:17 2020 (r357208) +++ projects/clang1000-import/contrib/llvm-project/libunwind/src/Registers.hpp Tue Jan 28 18:04:17 2020 (r357209) @@ -31,7 +31,6 @@ enum { REGISTERS_ARM64, REGISTERS_ARM, REGISTERS_OR1K, - REGISTERS_RISCV, REGISTERS_MIPS_O32, REGISTERS_MIPS_NEWABI, REGISTERS_SPARC, @@ -2722,267 +2721,6 @@ inline const char *Registers_or1k::getRegisterName(int } #endif // _LIBUNWIND_TARGET_OR1K - -#if defined(_LIBUNWIND_TARGET_RISCV) -/// Registers_riscv holds the register state of a thread in a 64-bit RISC-V -/// process. -class _LIBUNWIND_HIDDEN Registers_riscv { -public: - Registers_riscv(); - Registers_riscv(const void *registers); - - bool validRegister(int num) const; - uint64_t getRegister(int num) const; - void setRegister(int num, uint64_t value); - bool validFloatRegister(int num) const; - double getFloatRegister(int num) const; - void setFloatRegister(int num, double value); - bool validVectorRegister(int num) const; - v128 getVectorRegister(int num) const; - void setVectorRegister(int num, v128 value); - static const char *getRegisterName(int num); - void jumpto(); - static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV; } - static int getArch() { return REGISTERS_RISCV; } - - uint64_t getSP() const { return _registers.__x[2]; } - void setSP(uint64_t value) { _registers.__x[2] = value; } - uint64_t getIP() const { return _registers.__x[1]; } - void setIP(uint64_t value) { _registers.__x[1] = value; } - -private: - struct GPRs { - uint64_t __x[32]; // x0-x31 - }; - - GPRs _registers; - double _vectorHalfRegisters[32]; - // Currently only the lower double in 128-bit vectore registers - // is perserved during unwinding. We could define new register - // numbers (> 96) which mean whole vector registers, then this - // struct would need to change to contain whole vector registers. -}; - -inline Registers_riscv::Registers_riscv(const void *registers) { - static_assert((check_fit::does_fit), - "riscv registers do not fit into unw_context_t"); - memcpy(&_registers, registers, sizeof(_registers)); - static_assert(sizeof(GPRs) == 0x100, - "expected VFP registers to be at offset 256"); - memcpy(_vectorHalfRegisters, - static_cast(registers) + sizeof(GPRs), - sizeof(_vectorHalfRegisters)); -} - -inline Registers_riscv::Registers_riscv() { - memset(&_registers, 0, sizeof(_registers)); - memset(&_vectorHalfRegisters, 0, sizeof(_vectorHalfRegisters)); -} - -inline bool Registers_riscv::validRegister(int regNum) const { - if (regNum == UNW_REG_IP) - return true; - if (regNum == UNW_REG_SP) - return true; - if (regNum < 0) - return false; - if (regNum > 95) - return false; - if ((regNum > 31) && (regNum < 64)) - return false; - return true; -} - -inline uint64_t Registers_riscv::getRegister(int regNum) const { - if (regNum == UNW_REG_IP) - return _registers.__x[1]; - if (regNum == UNW_REG_SP) - return _registers.__x[2]; - if ((regNum >= 0) && (regNum < 32)) - return _registers.__x[regNum]; - _LIBUNWIND_ABORT("unsupported riscv register"); -} - -inline void Registers_riscv::setRegister(int regNum, uint64_t value) { - if (regNum == UNW_REG_IP) - _registers.__x[1] = value; - else if (regNum == UNW_REG_SP) - _registers.__x[2] = value; - else if ((regNum >= 0) && (regNum < 32)) - _registers.__x[regNum] = value; - else - _LIBUNWIND_ABORT("unsupported riscv register"); -} - -inline const char *Registers_riscv::getRegisterName(int regNum) { - switch (regNum) { - case UNW_REG_IP: - return "ra"; - case UNW_REG_SP: - return "sp"; - case UNW_RISCV_X0: - return "x0"; - case UNW_RISCV_X1: - return "ra"; - case UNW_RISCV_X2: - return "sp"; - case UNW_RISCV_X3: - return "x3"; - case UNW_RISCV_X4: - return "x4"; - case UNW_RISCV_X5: - return "x5"; - case UNW_RISCV_X6: - return "x6"; - case UNW_RISCV_X7: - return "x7"; - case UNW_RISCV_X8: - return "x8"; - case UNW_RISCV_X9: - return "x9"; - case UNW_RISCV_X10: - return "x10"; - case UNW_RISCV_X11: - return "x11"; - case UNW_RISCV_X12: - return "x12"; - case UNW_RISCV_X13: - return "x13"; - case UNW_RISCV_X14: - return "x14"; - case UNW_RISCV_X15: - return "x15"; - case UNW_RISCV_X16: - return "x16"; - case UNW_RISCV_X17: - return "x17"; - case UNW_RISCV_X18: - return "x18"; - case UNW_RISCV_X19: - return "x19"; - case UNW_RISCV_X20: - return "x20"; - case UNW_RISCV_X21: - return "x21"; - case UNW_RISCV_X22: - return "x22"; - case UNW_RISCV_X23: - return "x23"; - case UNW_RISCV_X24: - return "x24"; - case UNW_RISCV_X25: - return "x25"; - case UNW_RISCV_X26: - return "x26"; - case UNW_RISCV_X27: - return "x27"; - case UNW_RISCV_X28: - return "x28"; - case UNW_RISCV_X29: - return "x29"; - case UNW_RISCV_X30: - return "x30"; - case UNW_RISCV_X31: - return "x31"; - case UNW_RISCV_D0: - return "d0"; - case UNW_RISCV_D1: - return "d1"; - case UNW_RISCV_D2: - return "d2"; - case UNW_RISCV_D3: - return "d3"; - case UNW_RISCV_D4: - return "d4"; - case UNW_RISCV_D5: - return "d5"; - case UNW_RISCV_D6: - return "d6"; - case UNW_RISCV_D7: - return "d7"; - case UNW_RISCV_D8: - return "d8"; - case UNW_RISCV_D9: - return "d9"; - case UNW_RISCV_D10: - return "d10"; - case UNW_RISCV_D11: - return "d11"; - case UNW_RISCV_D12: - return "d12"; - case UNW_RISCV_D13: - return "d13"; - case UNW_RISCV_D14: - return "d14"; - case UNW_RISCV_D15: - return "d15"; - case UNW_RISCV_D16: - return "d16"; - case UNW_RISCV_D17: - return "d17"; - case UNW_RISCV_D18: - return "d18"; - case UNW_RISCV_D19: - return "d19"; - case UNW_RISCV_D20: - return "d20"; - case UNW_RISCV_D21: - return "d21"; - case UNW_RISCV_D22: - return "d22"; - case UNW_RISCV_D23: - return "d23"; - case UNW_RISCV_D24: - return "d24"; - case UNW_RISCV_D25: - return "d25"; - case UNW_RISCV_D26: - return "d26"; - case UNW_RISCV_D27: - return "d27"; - case UNW_RISCV_D28: - return "d28"; - case UNW_RISCV_D29: - return "d29"; - case UNW_RISCV_D30: - return "d30"; - case UNW_RISCV_D31: - return "d31"; - default: - return "unknown register"; - } -} - -inline bool Registers_riscv::validFloatRegister(int regNum) const { - if (regNum < UNW_RISCV_D0) - return false; - if (regNum > UNW_RISCV_D31) - return false; - return true; -} - -inline double Registers_riscv::getFloatRegister(int regNum) const { - assert(validFloatRegister(regNum)); - return _vectorHalfRegisters[regNum - UNW_RISCV_D0]; -} - -inline void Registers_riscv::setFloatRegister(int regNum, double value) { - assert(validFloatRegister(regNum)); - _vectorHalfRegisters[regNum - UNW_RISCV_D0] = value; -} - -inline bool Registers_riscv::validVectorRegister(int) const { - return false; -} - -inline v128 Registers_riscv::getVectorRegister(int) const { - _LIBUNWIND_ABORT("no riscv vector register support yet"); -} - -inline void Registers_riscv::setVectorRegister(int, v128) { - _LIBUNWIND_ABORT("no riscv vector register support yet"); -} -#endif // _LIBUNWIND_TARGET_RISCV #if defined(_LIBUNWIND_TARGET_MIPS_O32) /// Registers_mips_o32 holds the register state of a thread in a 32-bit MIPS Modified: projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindCursor.hpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindCursor.hpp Tue Jan 28 17:48:17 2020 (r357208) +++ projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindCursor.hpp Tue Jan 28 18:04:17 2020 (r357209) @@ -1123,12 +1123,6 @@ class UnwindCursor : public AbstractUnwindCursor{ (pri } #endif -#if defined (_LIBUNWIND_TARGET_RISCV) - compact_unwind_encoding_t dwarfEncoding(Registers_riscv &) const { - return 0; - } -#endif - #if defined (_LIBUNWIND_TARGET_MIPS_O32) compact_unwind_encoding_t dwarfEncoding(Registers_mips_o32 &) const { return 0; Modified: projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersRestore.S Tue Jan 28 17:48:17 2020 (r357208) +++ projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersRestore.S Tue Jan 28 18:04:17 2020 (r357209) @@ -808,87 +808,6 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind14Registers_or1 l.jr r9 l.nop -#elif defined(__riscv) - -// -// void libunwind::Registers_riscv::jumpto() -// -// On entry: -// thread_state pointer is in a0 -// - .p2align 2 -DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv) -#ifdef __riscv_float_abi_double - fld f0, (8 * 32 + 8 * 0)(a0) - fld f1, (8 * 32 + 8 * 1)(a0) - fld f2, (8 * 32 + 8 * 2)(a0) - fld f3, (8 * 32 + 8 * 3)(a0) - fld f4, (8 * 32 + 8 * 4)(a0) - fld f5, (8 * 32 + 8 * 5)(a0) - fld f6, (8 * 32 + 8 * 6)(a0) - fld f7, (8 * 32 + 8 * 7)(a0) - fld f8, (8 * 32 + 8 * 8)(a0) - fld f9, (8 * 32 + 8 * 9)(a0) - fld f10, (8 * 32 + 8 * 10)(a0) - fld f11, (8 * 32 + 8 * 11)(a0) - fld f12, (8 * 32 + 8 * 12)(a0) - fld f13, (8 * 32 + 8 * 13)(a0) - fld f14, (8 * 32 + 8 * 14)(a0) - fld f15, (8 * 32 + 8 * 15)(a0) - fld f16, (8 * 32 + 8 * 16)(a0) - fld f17, (8 * 32 + 8 * 17)(a0) - fld f18, (8 * 32 + 8 * 18)(a0) - fld f19, (8 * 32 + 8 * 19)(a0) - fld f20, (8 * 32 + 8 * 20)(a0) - fld f21, (8 * 32 + 8 * 21)(a0) - fld f22, (8 * 32 + 8 * 22)(a0) - fld f23, (8 * 32 + 8 * 23)(a0) - fld f24, (8 * 32 + 8 * 24)(a0) - fld f25, (8 * 32 + 8 * 25)(a0) - fld f26, (8 * 32 + 8 * 26)(a0) - fld f27, (8 * 32 + 8 * 27)(a0) - fld f28, (8 * 32 + 8 * 28)(a0) - fld f29, (8 * 32 + 8 * 29)(a0) - fld f30, (8 * 32 + 8 * 30)(a0) - fld f31, (8 * 32 + 8 * 31)(a0) -#endif - - // x0 is zero - ld x1, (8 * 1)(a0) - ld x2, (8 * 2)(a0) - ld x3, (8 * 3)(a0) - ld x4, (8 * 4)(a0) - ld x5, (8 * 5)(a0) - ld x6, (8 * 6)(a0) - ld x7, (8 * 7)(a0) - ld x8, (8 * 8)(a0) - ld x9, (8 * 9)(a0) - // skip a0 for now - ld x11, (8 * 11)(a0) - ld x12, (8 * 12)(a0) - ld x13, (8 * 13)(a0) - ld x14, (8 * 14)(a0) - ld x15, (8 * 15)(a0) - ld x16, (8 * 16)(a0) - ld x17, (8 * 17)(a0) - ld x18, (8 * 18)(a0) - ld x19, (8 * 19)(a0) - ld x20, (8 * 20)(a0) - ld x21, (8 * 21)(a0) - ld x22, (8 * 22)(a0) - ld x23, (8 * 23)(a0) - ld x24, (8 * 24)(a0) - ld x25, (8 * 25)(a0) - ld x26, (8 * 26)(a0) - ld x27, (8 * 27)(a0) - ld x28, (8 * 28)(a0) - ld x29, (8 * 29)(a0) - ld x30, (8 * 30)(a0) - ld x31, (8 * 31)(a0) - ld x10, (8 * 10)(a0) // restore a0 - - ret // jump to ra - #elif defined(__mips__) && defined(_ABIO32) && _MIPS_SIM == _ABIO32 // Modified: projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersSave.S ============================================================================== --- projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersSave.S Tue Jan 28 17:48:17 2020 (r357208) +++ projects/clang1000-import/contrib/llvm-project/libunwind/src/UnwindRegistersSave.S Tue Jan 28 18:04:17 2020 (r357209) @@ -557,7 +557,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) #elif defined(__ppc__) // -// extern int __unw_getcontext(unw_context_t* thread_state) +// extern int unw_getcontext(unw_context_t* thread_state) // // On entry: // thread_state pointer is in r3 @@ -944,86 +944,6 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) l.sw 128(r3), r9 # zero epcr l.sw 132(r3), r0 - -#elif defined(__riscv) - -# -# extern int __unw_getcontext(unw_context_t* thread_state) -# -# On entry: -# thread_state pointer is in a0 -# -DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) - // x0 is zero - sd x1, (8 * 1)(a0) - sd x2, (8 * 2)(a0) - sd x3, (8 * 3)(a0) - sd x4, (8 * 4)(a0) - sd x5, (8 * 5)(a0) - sd x6, (8 * 6)(a0) - sd x7, (8 * 7)(a0) - sd x8, (8 * 8)(a0) - sd x9, (8 * 9)(a0) - sd x10, (8 * 10)(a0) - sd x11, (8 * 11)(a0) - sd x12, (8 * 12)(a0) - sd x13, (8 * 13)(a0) - sd x14, (8 * 14)(a0) - sd x15, (8 * 15)(a0) - sd x16, (8 * 16)(a0) - sd x17, (8 * 17)(a0) - sd x18, (8 * 18)(a0) - sd x19, (8 * 19)(a0) - sd x20, (8 * 20)(a0) - sd x21, (8 * 21)(a0) - sd x22, (8 * 22)(a0) - sd x23, (8 * 23)(a0) - sd x24, (8 * 24)(a0) - sd x25, (8 * 25)(a0) - sd x26, (8 * 26)(a0) - sd x27, (8 * 27)(a0) - sd x28, (8 * 28)(a0) - sd x29, (8 * 29)(a0) - sd x30, (8 * 30)(a0) - sd x31, (8 * 31)(a0) - -#ifdef __riscv_float_abi_double - fsd f0, (8 * 32 + 8 * 0)(a0) - fsd f1, (8 * 32 + 8 * 1)(a0) - fsd f2, (8 * 32 + 8 * 2)(a0) - fsd f3, (8 * 32 + 8 * 3)(a0) - fsd f4, (8 * 32 + 8 * 4)(a0) - fsd f5, (8 * 32 + 8 * 5)(a0) - fsd f6, (8 * 32 + 8 * 6)(a0) - fsd f7, (8 * 32 + 8 * 7)(a0) - fsd f8, (8 * 32 + 8 * 8)(a0) - fsd f9, (8 * 32 + 8 * 9)(a0) - fsd f10, (8 * 32 + 8 * 10)(a0) - fsd f11, (8 * 32 + 8 * 11)(a0) - fsd f12, (8 * 32 + 8 * 12)(a0) - fsd f13, (8 * 32 + 8 * 13)(a0) - fsd f14, (8 * 32 + 8 * 14)(a0) - fsd f15, (8 * 32 + 8 * 15)(a0) - fsd f16, (8 * 32 + 8 * 16)(a0) - fsd f17, (8 * 32 + 8 * 17)(a0) - fsd f18, (8 * 32 + 8 * 18)(a0) - fsd f19, (8 * 32 + 8 * 19)(a0) - fsd f20, (8 * 32 + 8 * 20)(a0) - fsd f21, (8 * 32 + 8 * 21)(a0) - fsd f22, (8 * 32 + 8 * 22)(a0) - fsd f23, (8 * 32 + 8 * 23)(a0) - fsd f24, (8 * 32 + 8 * 24)(a0) - fsd f25, (8 * 32 + 8 * 25)(a0) - fsd f26, (8 * 32 + 8 * 26)(a0) - fsd f27, (8 * 32 + 8 * 27)(a0) - fsd f28, (8 * 32 + 8 * 28)(a0) - fsd f29, (8 * 32 + 8 * 29)(a0) - fsd f30, (8 * 32 + 8 * 30)(a0) - fsd f31, (8 * 32 + 8 * 31)(a0) -#endif - - li a0, 0 // return UNW_ESUCCESS - ret // jump to ra #elif defined(__sparc__) Modified: projects/clang1000-import/contrib/llvm-project/libunwind/src/libunwind.cpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/libunwind/src/libunwind.cpp Tue Jan 28 17:48:17 2020 (r357208) +++ projects/clang1000-import/contrib/llvm-project/libunwind/src/libunwind.cpp Tue Jan 28 18:04:17 2020 (r357209) @@ -50,8 +50,6 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *c # define REGISTER_KIND Registers_arm #elif defined(__or1k__) # define REGISTER_KIND Registers_or1k -#elif defined(__riscv) -# define REGISTER_KIND Registers_riscv #elif defined(__mips__) && defined(_ABIO32) && _MIPS_SIM == _ABIO32 # define REGISTER_KIND Registers_mips_o32 #elif defined(__mips64) From owner-svn-src-projects@freebsd.org Tue Jan 28 19:07:38 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A6CC238509 for ; Tue, 28 Jan 2020 19:07:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bj628nVz4Pb0; Tue, 28 Jan 2020 19:07:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44CEB27A93; Tue, 28 Jan 2020 19:07:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SJ7crL044227; Tue, 28 Jan 2020 19:07:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SJ7c5B044226; Tue, 28 Jan 2020 19:07:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001281907.00SJ7c5B044226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 19:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357221 - projects/clang1000-import/lib/libcompiler_rt X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/lib/libcompiler_rt X-SVN-Commit-Revision: 357221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 19:07:38 -0000 Author: dim Date: Tue Jan 28 19:07:37 2020 New Revision: 357221 URL: https://svnweb.freebsd.org/changeset/base/357221 Log: Add internal floating point environment builtins to libcompiler_rt and libgcc, as these are used in a few other builtin implementations. Modified: projects/clang1000-import/lib/libcompiler_rt/Makefile.inc Modified: projects/clang1000-import/lib/libcompiler_rt/Makefile.inc ============================================================================== --- projects/clang1000-import/lib/libcompiler_rt/Makefile.inc Tue Jan 28 18:58:37 2020 (r357220) +++ projects/clang1000-import/lib/libcompiler_rt/Makefile.inc Tue Jan 28 19:07:37 2020 (r357221) @@ -143,6 +143,14 @@ SRCF+= floatundixf SRCF+= cpu_model .endif +# The fp_mode implementation for amd64 and i386 is shared, while other +# architectures use the regular approach. +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +SRCS+= i386/fp_mode.c +.else +SRCF+= fp_mode +.endif + # # 128-bit quad precision long double support, # only used on some architectures. @@ -205,13 +213,11 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif - .if "${COMPILER_TYPE}" == "clang" && \ (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") SRCS+= atomic.c CFLAGS.atomic.c+= -Wno-atomic-alignment .endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ From owner-svn-src-projects@freebsd.org Tue Jan 28 19:19:56 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48805238C84 for ; Tue, 28 Jan 2020 19:19:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486bzJ19sCz4QC2; Tue, 28 Jan 2020 19:19:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2331A27CA2; Tue, 28 Jan 2020 19:19:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SJJun6050311; Tue, 28 Jan 2020 19:19:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SJJuhL050310; Tue, 28 Jan 2020 19:19:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001281919.00SJJuhL050310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 19:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357222 - projects/clang1000-import/libexec/rbootd X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/libexec/rbootd X-SVN-Commit-Revision: 357222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 19:19:56 -0000 Author: dim Date: Tue Jan 28 19:19:55 2020 New Revision: 357222 URL: https://svnweb.freebsd.org/changeset/base/357222 Log: Fix the following -Werror warning from clang 10.0.0 in rbootd: libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced] filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; ~ ^ MFC after: 3 days Modified: projects/clang1000-import/libexec/rbootd/rmpproto.c Modified: projects/clang1000-import/libexec/rbootd/rmpproto.c ============================================================================== --- projects/clang1000-import/libexec/rbootd/rmpproto.c Tue Jan 28 19:07:37 2020 (r357221) +++ projects/clang1000-import/libexec/rbootd/rmpproto.c Tue Jan 28 19:19:55 2020 (r357222) @@ -332,7 +332,8 @@ SendBootRepl(struct rmp_packet *req, RMPCONN *rconn, c * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; + filename = strrchr(filepath,'/'); + filename = filename? filename + 1: filepath; /* * Check that this is a valid boot file name. From owner-svn-src-projects@freebsd.org Tue Jan 28 20:09:24 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA1FC23AF6E for ; Tue, 28 Jan 2020 20:09:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486d4N40rsz4TFt; Tue, 28 Jan 2020 20:09:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A9A3641; Tue, 28 Jan 2020 20:09:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SK9OME080186; Tue, 28 Jan 2020 20:09:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SK9O6c080185; Tue, 28 Jan 2020 20:09:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001282009.00SK9O6c080185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 20:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357224 - projects/clang1000-import/contrib/binutils/bfd X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/contrib/binutils/bfd X-SVN-Commit-Revision: 357224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:09:24 -0000 Author: dim Date: Tue Jan 28 20:09:23 2020 New Revision: 357224 URL: https://svnweb.freebsd.org/changeset/base/357224 Log: Fix the following -Werror warning from clang 10.0.0 in binutils: contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (efi) ^ contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) ^ contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (!efi) ^ contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) ^ MFC after: 3 days Modified: projects/clang1000-import/contrib/binutils/bfd/peicode.h Modified: projects/clang1000-import/contrib/binutils/bfd/peicode.h ============================================================================== --- projects/clang1000-import/contrib/binutils/bfd/peicode.h Tue Jan 28 20:05:25 2020 (r357223) +++ projects/clang1000-import/contrib/binutils/bfd/peicode.h Tue Jan 28 20:09:23 2020 (r357224) @@ -1353,13 +1353,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch) continue; - if (efi) - { - /* TARGET_PTR is an EFI backend. Don't match - TARGET with a EFI file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (efi) + { + /* TARGET_PTR is an EFI backend. Don't match + TARGET with a EFI file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } else if (bfd_target_pei_p (*target_ptr)) { @@ -1367,13 +1367,13 @@ pe_bfd_object_p (bfd * abfd) if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) continue; - if (!efi) - { - /* TARGET_PTR is a PE backend. Don't match - TARGET with a PE file. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + if (!efi) + { + /* TARGET_PTR is a PE backend. Don't match + TARGET with a PE file. */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } } } From owner-svn-src-projects@freebsd.org Tue Jan 28 20:10:27 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DEE123B019 for ; Tue, 28 Jan 2020 20:10:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486d5Z6Z0jz4TM0; Tue, 28 Jan 2020 20:10:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCA38648; Tue, 28 Jan 2020 20:10:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SKAQsZ080315; Tue, 28 Jan 2020 20:10:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SKAQEU080314; Tue, 28 Jan 2020 20:10:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001282010.00SKAQEU080314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 20:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357225 - projects/clang1000-import/sbin/newfs_msdos X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/sbin/newfs_msdos X-SVN-Commit-Revision: 357225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 20:10:27 -0000 Author: dim Date: Tue Jan 28 20:10:26 2020 New Revision: 357225 URL: https://svnweb.freebsd.org/changeset/base/357225 Log: Fix the following -Werror warning from clang 10.0.0 in newfs_msdos: sbin/newfs_msdos/newfs_msdos.c:181:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (o.align) { ^ sbin/newfs_msdos/newfs_msdos.c:179:5: note: previous statement is here if (argc < 1 || argc > 2) ^ MFC after: 3 days Modified: projects/clang1000-import/sbin/newfs_msdos/newfs_msdos.c Modified: projects/clang1000-import/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- projects/clang1000-import/sbin/newfs_msdos/newfs_msdos.c Tue Jan 28 20:09:23 2020 (r357224) +++ projects/clang1000-import/sbin/newfs_msdos/newfs_msdos.c Tue Jan 28 20:10:26 2020 (r357225) @@ -178,10 +178,10 @@ main(int argc, char *argv[]) argv += optind; if (argc < 1 || argc > 2) usage(); - if (o.align) { - if (o.reserved_sectors) - errx(1, "align (-A) is incompatible with -r"); - } + if (o.align) { + if (o.reserved_sectors) + errx(1, "align (-A) is incompatible with -r"); + } fname = *argv++; if (!o.create_size && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); From owner-svn-src-projects@freebsd.org Tue Jan 28 21:41:38 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93812241E60 for ; Tue, 28 Jan 2020 21:41:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486g6p38bDz4g9d; Tue, 28 Jan 2020 21:41:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6790618BC; Tue, 28 Jan 2020 21:41:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SLfcNm037558; Tue, 28 Jan 2020 21:41:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SLfcp4037557; Tue, 28 Jan 2020 21:41:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001282141.00SLfcp4037557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 28 Jan 2020 21:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357231 - projects/clang1000-import/stand/i386/gptboot X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/stand/i386/gptboot X-SVN-Commit-Revision: 357231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 21:41:38 -0000 Author: dim Date: Tue Jan 28 21:41:37 2020 New Revision: 357231 URL: https://svnweb.freebsd.org/changeset/base/357231 Log: Work around assembler error from clang 10.0.0 in gptboot: stand/i386/gptboot/gptldr.S:141:3: error: value of 36878 is too large for field of 2 bytes. jmp MEM_JMP # Start BTX ^ Use the same construct as in stand/i386/boot2/boot1.S, which ensures the jump distance does not become too large. MFC after: 3 days Modified: projects/clang1000-import/stand/i386/gptboot/gptldr.S Modified: projects/clang1000-import/stand/i386/gptboot/gptldr.S ============================================================================== --- projects/clang1000-import/stand/i386/gptboot/gptldr.S Tue Jan 28 20:56:40 2020 (r357230) +++ projects/clang1000-import/stand/i386/gptboot/gptldr.S Tue Jan 28 21:41:37 2020 (r357231) @@ -138,5 +138,5 @@ seta20.3: sti # Enable interrupts * Save drive number from BIOS so boot2 can see it and start BTX. */ movb %dl,MEM_ARG - jmp MEM_JMP # Start BTX + jmp start+MEM_JMP-MEM_ORG # Start BTX end: From owner-svn-src-projects@freebsd.org Wed Jan 29 16:57:56 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA6C51F6260 for ; Wed, 29 Jan 2020 16:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4878n04bfqz3Ktc; Wed, 29 Jan 2020 16:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 990E4F32F; Wed, 29 Jan 2020 16:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TGvuUV029762; Wed, 29 Jan 2020 16:57:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TGvuPe029761; Wed, 29 Jan 2020 16:57:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001291657.00TGvuPe029761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 16:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357259 - projects/clang1000-import/contrib/llvm-project/lld/ELF X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/contrib/llvm-project/lld/ELF X-SVN-Commit-Revision: 357259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 16:57:56 -0000 Author: dim Date: Wed Jan 29 16:57:55 2020 New Revision: 357259 URL: https://svnweb.freebsd.org/changeset/base/357259 Log: Revert upstream lld r371957 (git commit 06bb7dfbd) by Fangrui Song: [ELF] Map the ELF header at imageBase If there is no readonly section, we map: * The ELF header at imageBase+maxPageSize * Program headers at imageBase+maxPageSize+sizeof(Ehdr) * The first section .text at imageBase+maxPageSize+sizeof(Ehdr)+sizeof(program headers) Due to the interaction between Writer::fixSectionAlignments and LinkerScript::allocateHeaders, `alignDown(p_vaddr(R PT_LOAD)) = alignDown(p_vaddr(RX PT_LOAD))`. The RX PT_LOAD will override the R PT_LOAD at runtime, which is not ideal: ``` // PHDR at 0x401034, should be 0x400034 PHDR 0x000034 0x00401034 0x00401034 0x000a0 0x000a0 R 0x4 // R PT_LOAD contains just Ehdr and program headers. // At 0x401000, should be 0x400000 LOAD 0x000000 0x00401000 0x00401000 0x000d4 0x000d4 R 0x1000 LOAD 0x0000d4 0x004010d4 0x004010d4 0x00001 0x00001 R E 0x1000 ``` * createPhdrs allocates the headers to the R PT_LOAD. * fixSectionAlignments assigns `imageBase+maxPageSize+sizeof(Ehdr)+sizeof(program headers)` (formula: `alignTo(dot, maxPageSize) + dot % config->maxPageSize`) to addrExpr of .text * allocateHeaders computes the minimum address among SHF_ALLOC sections, i.e. addr(.text) * allocateHeaders sets address of ELF header to `addr(.text)-sizeof(Ehdr)-sizeof(program headers) = imageBase+maxPageSize` The main observation is that when the SECTIONS command is not used, we don't have to call allocateHeaders. This requires an assumption that the presence of PT_PHDR and addresses of headers can be decided regardless of address information. This may seem natural because dot is not manipulated by a linker script. The other thing is that we have to drop the special rule for -T
in `getInitialDot`. If -Ttext is smaller than the image base, the headers will not be allocated with the old behavior (allocateHeaders is called) but always allocated with the new behavior. The behavior change is not a problem. Whether and where headers are allocated can vary among linkers, or ld.bfd across different versions (--enable-separate-code or not). It is thus advised to use a linker script with the PHDRS command to have a consistent behavior across linkers. If PT_PHDR is needed, an explicit --image-base can be a simpler alternative. Differential Revision: https://reviews.llvm.org/D67325 llvm-svn: 371957 This causes "ld: error: output file too large: 18446744073707016908 bytes" when linking our loader_4th and loader_lua. Clearly, something is wrong when using -Ttext 0x0: I will file an upstream bug report for this. Modified: projects/clang1000-import/contrib/llvm-project/lld/ELF/LinkerScript.cpp projects/clang1000-import/contrib/llvm-project/lld/ELF/Writer.cpp Modified: projects/clang1000-import/contrib/llvm-project/lld/ELF/LinkerScript.cpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/lld/ELF/LinkerScript.cpp Wed Jan 29 16:52:12 2020 (r357258) +++ projects/clang1000-import/contrib/llvm-project/lld/ELF/LinkerScript.cpp Wed Jan 29 16:57:55 2020 (r357259) @@ -1020,13 +1020,17 @@ static uint64_t computeBase(uint64_t min, bool allocat return alignDown(min, config->maxPageSize); } -// When the SECTIONS command is used, try to find an address for the file and -// program headers output sections, which can be added to the first PT_LOAD -// segment when program headers are created. +// Try to find an address for the file and program headers output sections, +// which were unconditionally added to the first PT_LOAD segment earlier. // -// We check if the headers fit below the first allocated section. If there isn't -// enough space for these sections, we'll remove them from the PT_LOAD segment, -// and we'll also remove the PT_PHDR segment. +// When using the default layout, we check if the headers fit below the first +// allocated section. When using a linker script, we also check if the headers +// are covered by the output section. This allows omitting the headers by not +// leaving enough space for them in the linker script; this pattern is common +// in embedded systems. +// +// If there isn't enough space for these sections, we'll remove them from the +// PT_LOAD segment, and we'll also remove the PT_PHDR segment. void LinkerScript::allocateHeaders(std::vector &phdrs) { uint64_t min = std::numeric_limits::max(); for (OutputSection *sec : outputSections) @@ -1072,23 +1076,28 @@ LinkerScript::AddressState::AddressState() { } } +static uint64_t getInitialDot() { + // By default linker scripts use an initial value of 0 for '.', + // but prefer -image-base if set. + if (script->hasSectionsCommand) + return config->imageBase ? *config->imageBase : 0; + + uint64_t startAddr = UINT64_MAX; + // The sections with -T
have been sorted in order of ascending + // address. We must lower startAddr if the lowest -T
as + // calls to setDot() must be monotonically increasing. + for (auto &kv : config->sectionStartMap) + startAddr = std::min(startAddr, kv.second); + return std::min(startAddr, target->getImageBase() + elf::getHeaderSize()); +} + // Here we assign addresses as instructed by linker script SECTIONS // sub-commands. Doing that allows us to use final VA values, so here // we also handle rest commands like symbol assignments and ASSERTs. // Returns a symbol that has changed its section or value, or nullptr if no // symbol has changed. const Defined *LinkerScript::assignAddresses() { - if (script->hasSectionsCommand) { - // With a linker script, assignment of addresses to headers is covered by - // allocateHeaders(). - dot = config->imageBase.getValueOr(0); - } else { - // Assign addresses to headers right now. - dot = target->getImageBase(); - Out::elfHeader->addr = dot; - Out::programHeaders->addr = dot + Out::elfHeader->size; - dot += getHeaderSize(); - } + dot = getInitialDot(); auto deleter = std::make_unique(); ctx = deleter.get(); Modified: projects/clang1000-import/contrib/llvm-project/lld/ELF/Writer.cpp ============================================================================== --- projects/clang1000-import/contrib/llvm-project/lld/ELF/Writer.cpp Wed Jan 29 16:52:12 2020 (r357258) +++ projects/clang1000-import/contrib/llvm-project/lld/ELF/Writer.cpp Wed Jan 29 16:57:55 2020 (r357259) @@ -569,8 +569,7 @@ template void Writer::run() { for (OutputSection *sec : outputSections) sec->maybeCompress(); - if (script->hasSectionsCommand) - script->allocateHeaders(mainPart->phdrs); + script->allocateHeaders(mainPart->phdrs); // Remove empty PT_LOAD to avoid causing the dynamic linker to try to mmap a // 0 sized region. This has to be done late since only after assignAddresses From owner-svn-src-projects@freebsd.org Wed Jan 29 17:01:03 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55C571F6647 for ; Wed, 29 Jan 2020 17:01:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4878rb0V0Qz3LCb; Wed, 29 Jan 2020 17:01:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0D29F48C; Wed, 29 Jan 2020 17:01:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TH12dL033955; Wed, 29 Jan 2020 17:01:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TH12Kn033954; Wed, 29 Jan 2020 17:01:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001291701.00TH12Kn033954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 17:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357260 - projects/clang1000-import/usr.bin/procstat X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/usr.bin/procstat X-SVN-Commit-Revision: 357260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 17:01:03 -0000 Author: dim Date: Wed Jan 29 17:01:02 2020 New Revision: 357260 URL: https://svnweb.freebsd.org/changeset/base/357260 Log: Fix the following -Werror warning from clang 10.0.0 in procstat: usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] xo_close_container(name); ^ usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here } else ^ The intent was to group the xo_close_container() call to the previous snprintf() call. MFC after: 3 days Modified: projects/clang1000-import/usr.bin/procstat/procstat_sigs.c Modified: projects/clang1000-import/usr.bin/procstat/procstat_sigs.c ============================================================================== --- projects/clang1000-import/usr.bin/procstat/procstat_sigs.c Wed Jan 29 16:57:55 2020 (r357259) +++ projects/clang1000-import/usr.bin/procstat/procstat_sigs.c Wed Jan 29 17:01:02 2020 (r357260) @@ -74,9 +74,10 @@ procstat_close_signame(int sig) for (i = 0; name[i] != 0; i++) name[i] = toupper(name[i]); xo_close_container(name); - } else + } else { snprintf(name, 12, "%d", sig); xo_close_container(name); + } } static void From owner-svn-src-projects@freebsd.org Wed Jan 29 20:56:32 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 961BE1FE134 for ; Wed, 29 Jan 2020 20:56:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487G4J3Q4pz49YJ; Wed, 29 Jan 2020 20:56:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705C11A1F9; Wed, 29 Jan 2020 20:56:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TKuWR8078199; Wed, 29 Jan 2020 20:56:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TKuW3t078198; Wed, 29 Jan 2020 20:56:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001292056.00TKuW3t078198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 20:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357267 - projects/clang1000-import/usr.bin/tip/tip X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/usr.bin/tip/tip X-SVN-Commit-Revision: 357267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 20:56:32 -0000 Author: dim Date: Wed Jan 29 20:56:31 2020 New Revision: 357267 URL: https://svnweb.freebsd.org/changeset/base/357267 Log: Fix the following -Werror warning from clang 10.0.0 in tip: usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if (gch == EOF) ^ usr.bin/tip/tip/tip.c:426:5: note: previous statement is here } else if (!cumode && gch == character(value(FORCE))) ^ The intent was to have the EOF check grouped with the getchar() call just above it. This was accidentally introduced in r354624. MFC after: 3 days Modified: projects/clang1000-import/usr.bin/tip/tip/tip.c Modified: projects/clang1000-import/usr.bin/tip/tip/tip.c ============================================================================== --- projects/clang1000-import/usr.bin/tip/tip/tip.c Wed Jan 29 18:54:21 2020 (r357266) +++ projects/clang1000-import/usr.bin/tip/tip/tip.c Wed Jan 29 20:56:31 2020 (r357267) @@ -423,11 +423,12 @@ tipin(void) if (boolean(value(HALFDUPLEX))) printf("\r\n"); continue; - } else if (!cumode && gch == character(value(FORCE))) + } else if (!cumode && gch == character(value(FORCE))) { gch = getchar(); if (gch == EOF) return; gch = gch & STRIP_PAR; + } bol = any(gch, value(EOL)); if (boolean(value(RAISE)) && islower(gch)) gch = toupper(gch); From owner-svn-src-projects@freebsd.org Wed Jan 29 21:09:53 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49A4A1FECE9 for ; Wed, 29 Jan 2020 21:09:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487GMj1ynmz4Br5; Wed, 29 Jan 2020 21:09:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E5491A400; Wed, 29 Jan 2020 21:09:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TL9rbm084521; Wed, 29 Jan 2020 21:09:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TL9aRW084511; Wed, 29 Jan 2020 21:09:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001292109.00TL9aRW084511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 21:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357270 - in projects/clang1000-import: cddl/contrib/opensolaris/lib/libzfs/common contrib/netbsd-tests/lib/libc/c063 contrib/sqlite3 contrib/sqlite3/tea contrib/sqlite3/tea/generic con... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: cddl/contrib/opensolaris/lib/libzfs/common contrib/netbsd-tests/lib/libc/c063 contrib/sqlite3 contrib/sqlite3/tea contrib/sqlite3/tea/generic contrib/sqlite3/tea/win etc/... X-SVN-Commit-Revision: 357270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 21:09:53 -0000 Author: dim Date: Wed Jan 29 21:09:36 2020 New Revision: 357270 URL: https://svnweb.freebsd.org/changeset/base/357270 Log: Merge ^/head r357179 through r357269. Added: projects/clang1000-import/release/packages/caroot.ucl - copied unchanged from r357269, head/release/packages/caroot.ucl projects/clang1000-import/secure/caroot/Makefile.inc - copied unchanged from r357269, head/secure/caroot/Makefile.inc projects/clang1000-import/sys/dev/xilinx/xlnx_pcib.c - copied unchanged from r357269, head/sys/dev/xilinx/xlnx_pcib.c projects/clang1000-import/sys/dev/xilinx/xlnx_pcib.h - copied unchanged from r357269, head/sys/dev/xilinx/xlnx_pcib.h projects/clang1000-import/sys/dts/arm64/overlays/rk3328-dwc3.dtso - copied unchanged from r357269, head/sys/dts/arm64/overlays/rk3328-dwc3.dtso projects/clang1000-import/tests/sys/net/if_epair.c - copied unchanged from r357269, head/tests/sys/net/if_epair.c Deleted: projects/clang1000-import/release/packages/clibs.ucl projects/clang1000-import/release/packages/docs.ucl Modified: projects/clang1000-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c projects/clang1000-import/contrib/netbsd-tests/lib/libc/c063/t_o_search.c projects/clang1000-import/contrib/sqlite3/Makefile.msc projects/clang1000-import/contrib/sqlite3/configure projects/clang1000-import/contrib/sqlite3/configure.ac projects/clang1000-import/contrib/sqlite3/shell.c projects/clang1000-import/contrib/sqlite3/sqlite3.c projects/clang1000-import/contrib/sqlite3/sqlite3.h projects/clang1000-import/contrib/sqlite3/sqlite3ext.h projects/clang1000-import/contrib/sqlite3/tea/configure projects/clang1000-import/contrib/sqlite3/tea/configure.ac projects/clang1000-import/contrib/sqlite3/tea/generic/tclsqlite3.c projects/clang1000-import/contrib/sqlite3/tea/win/makefile.vc projects/clang1000-import/etc/mtree/BSD.usr.dist projects/clang1000-import/lib/csu/powerpc64/Makefile projects/clang1000-import/lib/geom/part/gpart.8 projects/clang1000-import/lib/libc/amd64/string/memcmp.S projects/clang1000-import/lib/libc/gen/opendir.c projects/clang1000-import/lib/libfetch/fetch.c projects/clang1000-import/lib/libpmc/pmu-events/jevents.c projects/clang1000-import/release/packages/generate-ucl.sh projects/clang1000-import/release/tools/openstack.conf projects/clang1000-import/secure/caroot/Makefile projects/clang1000-import/secure/caroot/blacklisted/Makefile projects/clang1000-import/share/man/man4/umass.4 projects/clang1000-import/share/misc/committers-src.dot projects/clang1000-import/sys/amd64/amd64/support.S projects/clang1000-import/sys/arm/allwinner/aw_mmc.c projects/clang1000-import/sys/arm64/rockchip/clk/rk3328_cru.c projects/clang1000-import/sys/arm64/rockchip/rk_dwc3.c projects/clang1000-import/sys/cam/mmc/mmc_all.h projects/clang1000-import/sys/cam/mmc/mmc_xpt.c projects/clang1000-import/sys/cam/scsi/scsi_da.c projects/clang1000-import/sys/compat/linux/linux_mib.c projects/clang1000-import/sys/compat/linux/linux_mib.h projects/clang1000-import/sys/compat/linux/linux_socket.c projects/clang1000-import/sys/compat/linux/linux_socket.h projects/clang1000-import/sys/compat/linuxkpi/common/src/linux_compat.c projects/clang1000-import/sys/conf/config.mk projects/clang1000-import/sys/conf/files.riscv projects/clang1000-import/sys/conf/kmod.mk projects/clang1000-import/sys/dev/amdsmn/amdsmn.c projects/clang1000-import/sys/dev/amdtemp/amdtemp.c projects/clang1000-import/sys/dev/bnxt/bnxt_hwrm.c projects/clang1000-import/sys/dev/cadence/if_cgem.c projects/clang1000-import/sys/dev/ixgbe/if_ix.c projects/clang1000-import/sys/dev/mmc/host/dwmmc.c projects/clang1000-import/sys/dev/qlxgb/qla_os.c projects/clang1000-import/sys/dev/qlxge/qls_os.c projects/clang1000-import/sys/dev/sdhci/sdhci.c projects/clang1000-import/sys/fs/nullfs/null.h projects/clang1000-import/sys/fs/nullfs/null_subr.c projects/clang1000-import/sys/fs/nullfs/null_vfsops.c projects/clang1000-import/sys/kern/kern_cpu.c projects/clang1000-import/sys/kern/uipc_mqueue.c projects/clang1000-import/sys/modules/dtb/rockchip/Makefile projects/clang1000-import/sys/net/if_clone.c projects/clang1000-import/sys/net/if_clone.h projects/clang1000-import/sys/net/if_epair.c projects/clang1000-import/sys/net/if_vlan.c projects/clang1000-import/sys/netinet/sctp_asconf.c projects/clang1000-import/sys/netinet/sctp_output.c projects/clang1000-import/sys/powerpc/powernv/platform_powernv.c projects/clang1000-import/sys/riscv/include/riscvreg.h projects/clang1000-import/sys/sys/systm.h projects/clang1000-import/sys/vm/vm_fault.c projects/clang1000-import/sys/x86/cpufreq/hwpstate_intel.c projects/clang1000-import/sys/x86/x86/identcpu.c projects/clang1000-import/tests/sys/geom/class/eli/attach_test.sh projects/clang1000-import/tests/sys/net/Makefile projects/clang1000-import/tests/sys/sys/qmath_test.c projects/clang1000-import/usr.bin/calendar/calendars/calendar.freebsd projects/clang1000-import/usr.sbin/bsdinstall/scripts/auto projects/clang1000-import/usr.sbin/ypldap/ber.c Directory Properties: projects/clang1000-import/ (props changed) projects/clang1000-import/cddl/ (props changed) projects/clang1000-import/cddl/contrib/opensolaris/ (props changed) projects/clang1000-import/cddl/contrib/opensolaris/lib/libzfs/ (props changed) projects/clang1000-import/contrib/binutils/ (props changed) projects/clang1000-import/contrib/netbsd-tests/ (props changed) projects/clang1000-import/contrib/sqlite3/ (props changed) Modified: projects/clang1000-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- projects/clang1000-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed Jan 29 21:07:46 2020 (r357269) +++ projects/clang1000-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed Jan 29 21:09:36 2020 (r357270) @@ -1244,12 +1244,20 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importarg avl_tree_t slice_cache; rdsk_node_t *slice; void *cookie; + boolean_t skip_zvols = B_FALSE; + int value; + size_t size = sizeof(value); if (dirs == 0) { dirs = 1; dir = &default_dir; } + if (sysctlbyname("vfs.zfs.vol.recursive", &value, &size, NULL, 0) == 0 + && value == 0) { + skip_zvols = B_TRUE; + } + /* * Go through and read the label configuration information from every * possible device, organizing the information according to pool GUID @@ -1314,6 +1322,10 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importarg } LIST_FOREACH(mp, &mesh.lg_class, lg_class) { + if (skip_zvols && + strcmp(mp->lg_name, "ZFS::ZVOL") == 0) { + continue; + } LIST_FOREACH(gp, &mp->lg_geom, lg_geom) { LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { slice = zfs_alloc(hdl, sizeof (rdsk_node_t)); Modified: projects/clang1000-import/contrib/netbsd-tests/lib/libc/c063/t_o_search.c ============================================================================== --- projects/clang1000-import/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Jan 29 21:07:46 2020 (r357269) +++ projects/clang1000-import/contrib/netbsd-tests/lib/libc/c063/t_o_search.c Wed Jan 29 21:09:36 2020 (r357270) @@ -79,7 +79,7 @@ ATF_TC_BODY(o_search_perm1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1); ATF_REQUIRE(errno == EACCES); @@ -109,12 +109,12 @@ ATF_TC_BODY(o_search_root_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -141,12 +141,12 @@ ATF_TC_BODY(o_search_unpriv_flag1, tc) ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) != -1); @@ -173,7 +173,7 @@ ATF_TC_BODY(o_search_perm2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == -1); ATF_REQUIRE(errno == EACCES); @@ -202,11 +202,11 @@ ATF_TC_BODY(o_search_root_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); @@ -232,11 +232,11 @@ ATF_TC_BODY(o_search_unpriv_flag2, tc) ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 644) == 0); + ATF_REQUIRE(fchmod(dfd, 0644) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); - ATF_REQUIRE(fchmod(dfd, 444) == 0); + ATF_REQUIRE(fchmod(dfd, 0444) == 0); ATF_REQUIRE(faccessat(dfd, BASEFILE, W_OK, 0) == 0); Modified: projects/clang1000-import/contrib/sqlite3/Makefile.msc ============================================================================== --- projects/clang1000-import/contrib/sqlite3/Makefile.msc Wed Jan 29 21:07:46 2020 (r357269) +++ projects/clang1000-import/contrib/sqlite3/Makefile.msc Wed Jan 29 21:09:36 2020 (r357270) @@ -210,6 +210,12 @@ OPTIMIZATIONS = 2 SESSION = 0 !ENDIF +# Set this to non-0 to enable support for the rbu extension. +# +!IFNDEF RBU +RBU = 0 +!ENDIF + # Set the source code file to be used by executables and libraries when # they need the amalgamation. # @@ -282,7 +288,6 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 @@ -296,6 +301,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Should the rbu extension be enabled? If so, add compilation options +# to enable it. +# +!IF $(RBU)!=0 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1 +!ENDIF + # These are the "extended" SQLite compilation options used when compiling for # the Windows 10 platform. # @@ -978,7 +990,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: projects/clang1000-import/contrib/sqlite3/configure ============================================================================== --- projects/clang1000-import/contrib/sqlite3/configure Wed Jan 29 21:07:46 2020 (r357269) +++ projects/clang1000-import/contrib/sqlite3/configure Wed Jan 29 21:09:36 2020 (r357270) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.30.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.31.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.30.1' -PACKAGE_STRING='sqlite 3.30.1' +PACKAGE_VERSION='3.31.0' +PACKAGE_STRING='sqlite 3.31.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.31.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.30.1:";; + short | recursive ) echo "Configuration of sqlite 3.31.0:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.30.1 +sqlite configure 3.31.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.30.1, which was +It was created by sqlite $as_me 3.31.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.30.1' + VERSION='3.31.0' cat >>confdefs.h <<_ACEOF @@ -13653,7 +13653,7 @@ else fi if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.30.1, which was +This file was extended by sqlite $as_me 3.31.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.30.1 +sqlite config.status 3.31.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: projects/clang1000-import/contrib/sqlite3/configure.ac ============================================================================== --- projects/clang1000-import/contrib/sqlite3/configure.ac Wed Jan 29 21:07:46 2020 (r357269) +++ projects/clang1000-import/contrib/sqlite3/configure.ac Wed Jan 29 21:09:36 2020 (r357270) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.30.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.31.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -161,7 +161,7 @@ AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- Modified: projects/clang1000-import/contrib/sqlite3/shell.c ============================================================================== --- projects/clang1000-import/contrib/sqlite3/shell.c Wed Jan 29 21:07:46 2020 (r357269) +++ projects/clang1000-import/contrib/sqlite3/shell.c Wed Jan 29 21:09:36 2020 (r357270) @@ -2007,19 +2007,23 @@ int sqlite3_shathree_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sha3", 1, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 1, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 2, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 1, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 2, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } return rc; } @@ -2613,6 +2617,7 @@ static int fsdirConnect( pNew = (fsdir_tab*)sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); } *ppVtab = (sqlite3_vtab*)pNew; return rc; @@ -3006,10 +3011,12 @@ int sqlite3_fileio_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "readfile", 1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, readfileFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "writefile", -1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "writefile", -1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, writefileFunc, 0, 0); } if( rc==SQLITE_OK ){ @@ -3144,6 +3151,7 @@ static int completionConnect( #define COMPLETION_COLUMN_WHOLELINE 2 /* Entire line seen so far */ #define COMPLETION_COLUMN_PHASE 3 /* ePhase - used for debugging only */ + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); rc = sqlite3_declare_vtab(db, "CREATE TABLE x(" " candidate TEXT," @@ -4578,6 +4586,7 @@ static int zipfileConnect( zipfileDequote(pNew->zFile); } } + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); *ppVtab = (sqlite3_vtab*)pNew; return rc; } @@ -5190,25 +5199,25 @@ static int zipfileDeflate( u8 **ppOut, int *pnOut, /* Output */ char **pzErr /* OUT: Error message */ ){ - sqlite3_int64 nAlloc = compressBound(nIn); - u8 *aOut; int rc = SQLITE_OK; + sqlite3_int64 nAlloc; + z_stream str; + u8 *aOut; + memset(&str, 0, sizeof(str)); + str.next_in = (Bytef*)aIn; + str.avail_in = nIn; + deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); + + nAlloc = deflateBound(&str, nIn); aOut = (u8*)sqlite3_malloc64(nAlloc); if( aOut==0 ){ rc = SQLITE_NOMEM; }else{ int res; - z_stream str; - memset(&str, 0, sizeof(str)); - str.next_in = (Bytef*)aIn; - str.avail_in = nIn; str.next_out = aOut; str.avail_out = nAlloc; - - deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); res = deflate(&str, Z_FINISH); - if( res==Z_STREAM_END ){ *ppOut = aOut; *pnOut = (int)str.total_out; @@ -5517,10 +5526,10 @@ static int zipfileBestIndex( idx = i; } } + pIdxInfo->estimatedCost = 1000.0; if( idx>=0 ){ pIdxInfo->aConstraintUsage[idx].argvIndex = 1; pIdxInfo->aConstraintUsage[idx].omit = 1; - pIdxInfo->estimatedCost = 1000.0; pIdxInfo->idxNum = 1; }else if( unusable ){ return SQLITE_CONSTRAINT; @@ -5642,8 +5651,8 @@ static int zipfileGetMode( ** identical, ignoring any trailing '/' character in either path. */ static int zipfileComparePath(const char *zA, const char *zB, int nB){ int nA = (int)strlen(zA); - if( zA[nA-1]=='/' ) nA--; - if( zB[nB-1]=='/' ) nB--; + if( nA>0 && zA[nA-1]=='/' ) nA--; + if( nB>0 && zB[nB-1]=='/' ) nB--; if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0; return 1; } @@ -5653,6 +5662,10 @@ static int zipfileBegin(sqlite3_vtab *pVtab){ int rc = SQLITE_OK; assert( pTab->pWriteFd==0 ); + if( pTab->zFile==0 || pTab->zFile[0]==0 ){ + pTab->base.zErrMsg = sqlite3_mprintf("zipfile: missing filename"); + return SQLITE_ERROR; + } /* Open a write fd on the file. Also load the entire central directory ** structure into memory. During the transaction any new file data is @@ -5827,6 +5840,7 @@ static int zipfileUpdate( if( rc==SQLITE_OK ){ zPath = (const char*)sqlite3_value_text(apVal[2]); + if( zPath==0 ) zPath = ""; nPath = (int)strlen(zPath); mTime = zipfileGetTime(apVal[4]); } @@ -5836,11 +5850,15 @@ static int zipfileUpdate( ** '/'. This appears to be required for compatibility with info-zip ** (the unzip command on unix). It does not create directories ** otherwise. */ - if( zPath[nPath-1]!='/' ){ + if( nPath<=0 || zPath[nPath-1]!='/' ){ zFree = sqlite3_mprintf("%s/", zPath); - if( zFree==0 ){ rc = SQLITE_NOMEM; } zPath = (const char*)zFree; - nPath++; + if( zFree==0 ){ + rc = SQLITE_NOMEM; + nPath = 0; + }else{ + nPath = (int)strlen(zPath); + } } } @@ -6233,19 +6251,19 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqli ** at the end of the path. Or, if this is not a directory and the path ** ends in '/' it is an error. */ if( bIsDir==0 ){ - if( zName[nName-1]=='/' ){ + if( nName>0 && zName[nName-1]=='/' ){ zErr = sqlite3_mprintf("non-directory name must not end with /"); rc = SQLITE_ERROR; goto zipfile_step_out; } }else{ - if( zName[nName-1]!='/' ){ + if( nName==0 || zName[nName-1]!='/' ){ zName = zFree = sqlite3_mprintf("%s/", zName); - nName++; if( zName==0 ){ rc = SQLITE_NOMEM; goto zipfile_step_out; } + nName = (int)strlen(zName); }else{ while( nName>1 && zName[nName-2]=='/' ) nName--; } @@ -6501,10 +6519,12 @@ int sqlite3_sqlar_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sqlar_compress", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_compress", 1, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarCompressFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sqlar_uncompress", 2, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_uncompress", 2, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarUncompressFunc, 0, 0); } return rc; @@ -6525,8 +6545,8 @@ int sqlite3_sqlar_init( ** ************************************************************************* */ - - +#if !defined(SQLITEEXPERT_H) +#define SQLITEEXPERT_H 1 /* #include "sqlite3.h" */ typedef struct sqlite3expert sqlite3expert; @@ -6680,8 +6700,8 @@ const char *sqlite3_expert_report(sqlite3expert*, int */ void sqlite3_expert_destroy(sqlite3expert*); +#endif /* !defined(SQLITEEXPERT_H) */ - /************************* End ../ext/expert/sqlite3expert.h ********************/ /************************* Begin ../ext/expert/sqlite3expert.c ******************/ /* @@ -9566,6 +9586,7 @@ struct ShellState { int outCount; /* Revert to stdout when reaching zero */ int cnt; /* Number of records displayed so far */ int lineno; /* Line number of last line read from in */ + int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */ FILE *in; /* Read commands from this stream */ FILE *out; /* Write results here */ FILE *traceOut; /* Output for sqlite3_trace() */ @@ -10400,19 +10421,22 @@ static int shell_callback( const int *colWidth; int showHdr; char *rowSep; + int nWidth; if( p->cMode==MODE_Column ){ colWidth = p->colWidth; + nWidth = ArraySize(p->colWidth); showHdr = p->showHeader; rowSep = p->rowSeparator; }else{ colWidth = aExplainWidths; + nWidth = ArraySize(aExplainWidths); showHdr = 1; rowSep = SEP_Row; } if( p->cnt++==0 ){ for(i=0; icolWidth) ){ + if( idb, SQLITE_DBCONFIG_DEFENSIVE, -1, &defensiveMode); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); sqlite3_exec(p->db, @@ -11311,6 +11338,7 @@ static void bind_table_init(ShellState *p){ ") WITHOUT ROWID;", 0, 0, 0); sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_DEFENSIVE, defensiveMode, 0); } /* @@ -12053,9 +12081,7 @@ static const char *(azHelp[]) = { ".excel Display the output of next command in spreadsheet", ".exit ?CODE? Exit this program with return-code CODE", ".expert EXPERIMENTAL. Suggest indexes for queries", -/* Because explain mode comes on automatically now, the ".explain" mode -** is removed from the help screen. It is still supported for legacy, however */ -/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off",*/ + ".explain ?on|off|auto? Change the EXPLAIN formatting mode. Default: auto", ".filectrl CMD ... Run various sqlite3_file_control() operations", " Run \".filectrl\" with no arguments for details", ".fullschema ?--indent? Show schema and the content of sqlite_stat tables", @@ -12106,6 +12132,7 @@ static const char *(azHelp[]) = { " --maxsize N Maximum size for --hexdb or --deserialized database", #endif " --new Initialize FILE to an empty database", + " --nofollow Do not follow symbolic links", " --readonly Open FILE readonly", " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", @@ -12670,7 +12697,7 @@ static void open_db(ShellState *p, int openFlags){ switch( p->openMode ){ case SHELL_OPEN_APPENDVFS: { sqlite3_open_v2(p->zDbFilename, &p->db, - SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs"); + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, "apndvfs"); break; } case SHELL_OPEN_HEXDB: @@ -12683,12 +12710,14 @@ static void open_db(ShellState *p, int openFlags){ break; } case SHELL_OPEN_READONLY: { - sqlite3_open_v2(p->zDbFilename, &p->db, SQLITE_OPEN_READONLY, 0); + sqlite3_open_v2(p->zDbFilename, &p->db, + SQLITE_OPEN_READONLY|p->openFlags, 0); break; } case SHELL_OPEN_UNSPEC: case SHELL_OPEN_NORMAL: { - sqlite3_open(p->zDbFilename, &p->db); + sqlite3_open_v2(p->zDbFilename, &p->db, + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|p->openFlags, 0); break; } } @@ -13462,7 +13491,7 @@ static unsigned int get4byteInt(unsigned char *a){ } /* -** Implementation of the ".info" command. +** Implementation of the ".dbinfo" command. ** ** Return 1 on error, 2 to exit, and 0 otherwise. */ @@ -15699,20 +15728,22 @@ static int do_meta_command(char *zLine, ShellState *p) const char *zName; int op; } aDbConfig[] = { + { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, + { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, + { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, { "enable_fkey", SQLITE_DBCONFIG_ENABLE_FKEY }, + { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, { "enable_trigger", SQLITE_DBCONFIG_ENABLE_TRIGGER }, { "enable_view", SQLITE_DBCONFIG_ENABLE_VIEW }, { "fts3_tokenizer", SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER }, + { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, + { "legacy_file_format", SQLITE_DBCONFIG_LEGACY_FILE_FORMAT }, { "load_extension", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION }, { "no_ckpt_on_close", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE }, - { "enable_qpsg", SQLITE_DBCONFIG_ENABLE_QPSG }, - { "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP }, { "reset_database", SQLITE_DBCONFIG_RESET_DATABASE }, - { "defensive", SQLITE_DBCONFIG_DEFENSIVE }, + { "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP }, + { "trusted_schema", SQLITE_DBCONFIG_TRUSTED_SCHEMA }, { "writable_schema", SQLITE_DBCONFIG_WRITABLE_SCHEMA }, - { "legacy_alter_table", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, - { "dqs_dml", SQLITE_DBCONFIG_DQS_DML }, - { "dqs_ddl", SQLITE_DBCONFIG_DQS_DDL }, }; int ii, v; open_db(p, 0); @@ -15722,7 +15753,7 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_db_config(p->db, aDbConfig[ii].op, booleanValue(azArg[2]), 0); } sqlite3_db_config(p->db, aDbConfig[ii].op, -1, &v); - utf8_printf(p->out, "%18s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); + utf8_printf(p->out, "%19s %s\n", aDbConfig[ii].zName, v ? "on" : "off"); if( nArg>1 ) break; } if( nArg>1 && ii==ArraySize(aDbConfig) ){ @@ -16303,10 +16334,19 @@ static int do_meta_command(char *zLine, ShellState *p) char *zCollist = 0; sqlite3_stmt *pStmt; int tnum = 0; + int isWO = 0; /* True if making an imposter of a WITHOUT ROWID table */ + int lenPK = 0; /* Length of the PRIMARY KEY string for isWO tables */ int i; if( !(nArg==3 || (nArg==2 && sqlite3_stricmp(azArg[1],"off")==0)) ){ utf8_printf(stderr, "Usage: .imposter INDEX IMPOSTER\n" " .imposter off\n"); + /* Also allowed, but not documented: + ** + ** .imposter TABLE IMPOSTER + ** + ** where TABLE is a WITHOUT ROWID table. In that case, the + ** imposter is another WITHOUT ROWID table with the columns in + ** storage order. */ rc = 1; goto meta_command_exit; } @@ -16315,19 +16355,22 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 0, 1); goto meta_command_exit; } - zSql = sqlite3_mprintf("SELECT rootpage FROM sqlite_master" - " WHERE name='%q' AND type='index'", azArg[1]); + zSql = sqlite3_mprintf( + "SELECT rootpage, 0 FROM sqlite_master" + " WHERE name='%q' AND type='index'" + "UNION ALL " + "SELECT rootpage, 1 FROM sqlite_master" + " WHERE name='%q' AND type='table'" + " AND sql LIKE '%%without%%rowid%%'", + azArg[1], azArg[1] + ); sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); if( sqlite3_step(pStmt)==SQLITE_ROW ){ tnum = sqlite3_column_int(pStmt, 0); + isWO = sqlite3_column_int(pStmt, 1); } sqlite3_finalize(pStmt); - if( tnum==0 ){ - utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); - rc = 1; - goto meta_command_exit; - } zSql = sqlite3_mprintf("PRAGMA index_xinfo='%q'", azArg[1]); rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); @@ -16344,6 +16387,9 @@ static int do_meta_command(char *zLine, ShellState *p) zCol = zLabel; } } + if( isWO && lenPK==0 && sqlite3_column_int(pStmt,5)==0 && zCollist ){ + lenPK = (int)strlen(zCollist); + } if( zCollist==0 ){ zCollist = sqlite3_mprintf("\"%w\"", zCol); }else{ @@ -16351,9 +16397,16 @@ static int do_meta_command(char *zLine, ShellState *p) } } sqlite3_finalize(pStmt); + if( i==0 || tnum==0 ){ + utf8_printf(stderr, "no such index: \"%s\"\n", azArg[1]); + rc = 1; + sqlite3_free(zCollist); + goto meta_command_exit; + } + if( lenPK==0 ) lenPK = 100000; zSql = sqlite3_mprintf( - "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%s))WITHOUT ROWID", - azArg[2], zCollist, zCollist); + "CREATE TABLE \"%w\"(%s,PRIMARY KEY(%.*s))WITHOUT ROWID", + azArg[2], zCollist, lenPK, zCollist); sqlite3_free(zCollist); rc = sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->db, "main", 1, tnum); if( rc==SQLITE_OK ){ @@ -16364,7 +16417,8 @@ static int do_meta_command(char *zLine, ShellState *p) }else{ utf8_printf(stdout, "%s;\n", zSql); raw_printf(stdout, - "WARNING: writing to an imposter table will corrupt the index!\n" + "WARNING: writing to an imposter table will corrupt the \"%s\" %s!\n", + azArg[1], isWO ? "table" : "index" ); } }else{ @@ -16562,6 +16616,7 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_free(p->zFreeOnClose); p->zFreeOnClose = 0; p->openMode = SHELL_OPEN_UNSPEC; + p->openFlags = 0; p->szMax = 0; /* Check for command-line arguments */ for(iName=1; iNameopenMode = SHELL_OPEN_APPENDVFS; }else if( optionMatch(z, "readonly") ){ p->openMode = SHELL_OPEN_READONLY; + }else if( optionMatch(z, "nofollow") ){ + p->openFlags |= SQLITE_OPEN_NOFOLLOW; #ifdef SQLITE_ENABLE_DESERIALIZE }else if( optionMatch(z, "deserialize") ){ p->openMode = SHELL_OPEN_DESERIALIZE; @@ -17732,7 +17789,7 @@ static int do_meta_command(char *zLine, ShellState *p) { "extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,"BOOLEAN" }, /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" },*/ { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, - { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, + { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "" }, { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, @@ -17848,7 +17905,6 @@ static int do_meta_command(char *zLine, ShellState *p) /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: case SQLITE_TESTCTRL_ALWAYS: - case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: if( nArg==3 ){ int opt = booleanValue(azArg[2]); rc2 = sqlite3_test_control(testctrl, opt); @@ -17866,6 +17922,12 @@ static int do_meta_command(char *zLine, ShellState *p) } break; + /* sqlite3_test_control(sqlite3*) */ + case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: + rc2 = sqlite3_test_control(testctrl, p->db); + isOk = 3; + break; + case SQLITE_TESTCTRL_IMPOSTER: if( nArg==5 ){ rc2 = sqlite3_test_control(testctrl, p->db, @@ -18496,6 +18558,7 @@ static const char zOptions[] = " -multiplex enable the multiplexor VFS\n" #endif " -newline SEP set output row separator. Default: '\\n'\n" + " -nofollow refuse to open symbolic links to database files\n" " -nullvalue TEXT set text string for NULL values. Default ''\n" " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n" " -quote set output mode to 'quote'\n" @@ -18806,6 +18869,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; + }else if( strcmp(z,"-nofollow")==0 ){ + data.openFlags = SQLITE_OPEN_NOFOLLOW; #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) }else if( strncmp(z, "-A",2)==0 ){ /* All remaining command-line arguments are passed to the ".archive" @@ -18909,6 +18974,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ #endif }else if( strcmp(z,"-readonly")==0 ){ data.openMode = SHELL_OPEN_READONLY; + }else if( strcmp(z,"-nofollow")==0 ){ + data.openFlags |= SQLITE_OPEN_NOFOLLOW; }else if( strcmp(z,"-ascii")==0 ){ data.mode = MODE_Ascii; sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator, Modified: projects/clang1000-import/contrib/sqlite3/sqlite3.c ============================================================================== --- projects/clang1000-import/contrib/sqlite3/sqlite3.c Wed Jan 29 21:07:46 2020 (r357269) +++ projects/clang1000-import/contrib/sqlite3/sqlite3.c Wed Jan 29 21:09:36 2020 (r357270) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.30.1. By combining all the individual C code files into this +** version 3.31.0. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1165,9 +1165,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.30.1" -#define SQLITE_VERSION_NUMBER 3030001 -#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b" +#define SQLITE_VERSION "3.31.0" +#define SQLITE_VERSION_NUMBER 3031000 +#define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1558,6 +1558,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) #define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) /* Not Used */ +#define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) @@ -1577,11 +1578,13 @@ SQLITE_API int sqlite3_exec( #define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8)) #define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8)) #define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) +#define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) +#define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) /* ** CAPI3REF: Flags For File Open Operations @@ -1610,6 +1613,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ +#define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */ /* Reserved: 0x00F00000 */ @@ -2021,16 +2025,16 @@ struct sqlite3_io_methods { ** ^The [SQLITE_FCNTL_BUSYHANDLER] ** file-control may be invoked by SQLite on the database file handle ** shortly after it is opened in order to provide a custom VFS with access -** to the connections busy-handler callback. The argument is of type (void **) +** to the connection's busy-handler callback. The argument is of type (void**) ** - an array of two (void *) values. The first (void *) actually points -** to a function of type (int (*)(void *)). In order to invoke the connections +** to a function of type (int (*)(void *)). In order to invoke the connection's ** busy-handler, this function should be invoked with the second (void *) in ** the array as the only argument. If it returns non-zero, then the operation ** should be retried. If it returns zero, the custom VFS should abandon the ** current operation. ** **
  • [[SQLITE_FCNTL_TEMPFILENAME]] -** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control ** to have SQLite generate a ** temporary filename using the same algorithm that is followed to generate ** temporary filenames for TEMP tables and other internal uses. The @@ -2143,12 +2147,18 @@ struct sqlite3_io_methods { ** not provide a mechanism to detect changes to MAIN only. Also, the ** [sqlite3_total_changes()] interface responds to internal changes only and ** omits changes made by other database connections. The -** [PRAGMA data_version] command provide a mechanism to detect changes to +** [PRAGMA data_version] command provides a mechanism to detect changes to ** a single attached database that occur due to other database connections, ** but omits changes implemented by the database connection on which it is ** called. This file control is the only mechanism to detect changes that ** happen either internally or externally and that are associated with ** a particular attached database. +** +**
  • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -2186,6 +2196,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_LOCK_TIMEOUT 34 #define SQLITE_FCNTL_DATA_VERSION 35 #define SQLITE_FCNTL_SIZE_LIMIT 36 +#define SQLITE_FCNTL_CKPT_DONE 37 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -2231,10 +2242,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields ** may be appended to the sqlite3_vfs object and the iVersion value ** may increase again in future versions of SQLite. -** Note that the structure -** of the sqlite3_vfs object changes in the transition from +** Note that due to an oversight, the structure +** of the sqlite3_vfs object changed in the transition from ** SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] -** and yet the iVersion field was not modified. +** and yet the iVersion field was not increased. ** ** The szOsFile field is the size of the subclassed [sqlite3_file] ** structure used by this VFS. mxPathname is the maximum length of @@ -2325,7 +2336,7 @@ typedef struct sqlite3_api_routines sqlite3_api_routin ** for exclusive access. ** ** ^At least szOsFile bytes of memory are allocated by SQLite -** to hold the [sqlite3_file] structure passed as the third +** to hold the [sqlite3_file] structure passed as the third ** argument to xOpen. The xOpen method does not have to ** allocate the structure; it should just fill it in. Note that ** the xOpen method must set the sqlite3_file.pMethods to either @@ -2662,7 +2673,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ... ** that causes the corresponding memory allocation to fail. ** ** The xInit method initializes the memory allocator. For example, -** it might allocate any require mutexes or initialize internal data +** it might allocate any required mutexes or initialize internal data ** structures. The xShutdown method is invoked (indirectly) by ** [sqlite3_shutdown()] and should deallocate any resources acquired ** by xInit. The pAppData pointer is used as the only parameter to @@ -2784,6 +2795,7 @@ struct sqlite3_mem_methods { ** memory allocation statistics. ^(When memory allocation statistics are ** disabled, the following SQLite interfaces become non-operational: **
      +**
    • [sqlite3_hard_heap_limit64()] **
    • [sqlite3_memory_used()] **
    • [sqlite3_memory_highwater()] **
    • [sqlite3_soft_heap_limit64()] @@ -2802,7 +2814,7 @@ struct sqlite3_mem_methods { **
      ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool ** that SQLite can use for the database page cache with the default page ** cache implementation. -** This configuration option is a no-op if an application-define page +** This configuration option is a no-op if an application-defined page ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to ** 8-byte aligned memory (pMem), the size of each page cache line (sz), @@ -3287,7 +3299,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_DBCONFIG_DQS_DML]] **
      SQLITE_DBCONFIG_DQS_DML **
      The SQLITE_DBCONFIG_DQS_DML option activates or deactivates -** the legacy [double-quoted string literal] misfeature for DML statement +** the legacy [double-quoted string literal] misfeature for DML statements ** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. @@ -3301,6 +3313,49 @@ struct sqlite3_mem_methods { ** default value of this setting is determined by the [-DSQLITE_DQS] ** compile-time option. **
      +** +** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]] +**
      SQLITE_DBCONFIG_TRUSTED_SCHEMA +**
      The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to +** assume that database schemas (the contents of the [sqlite_master] tables) +** are untainted by malicious content. +** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite +** takes additional defensive steps to protect the application from harm +** including: +**
        +**
      • Prohibit the use of SQL functions inside triggers, views, +** CHECK constraints, DEFAULT clauses, expression indexes, +** partial indexes, or generated columns +** unless those functions are tagged with [SQLITE_INNOCUOUS]. +**
      • Prohibit the use of virtual tables inside of triggers or views +** unless those virtual tables are tagged with [SQLITE_VTAB_INNOCUOUS]. +**
      +** This setting defaults to "on" for legacy compatibility, however +** all applications are advised to turn it off if possible. This setting +** can also be controlled using the [PRAGMA trusted_schema] statement. +**
      +** +** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]] +**
      SQLITE_DBCONFIG_LEGACY_FILE_FORMAT +**
      The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates +** the legacy file format flag. When activated, this flag causes all newly +** created database file to have a schema format version number (the 4-byte +** integer found at offset 44 into the database header) of 1. This in turn +** means that the resulting database file will be readable and writable by +** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, +** newly created databases are generally not understandable by SQLite versions +** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there +** is now scarcely any need to generated database files that are compatible +** all the way back to version 3.0.0, and so this setting is of little *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Wed Jan 29 21:40:35 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDA181FFDA9 for ; Wed, 29 Jan 2020 21:40:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487H374dxnz4DhP; Wed, 29 Jan 2020 21:40:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AAA81A9CB; Wed, 29 Jan 2020 21:40:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00TLeZ31002616; Wed, 29 Jan 2020 21:40:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00TLeZY2002615; Wed, 29 Jan 2020 21:40:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001292140.00TLeZY2002615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 29 Jan 2020 21:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357271 - projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_bridge X-SVN-Commit-Revision: 357271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2020 21:40:35 -0000 Author: dim Date: Wed Jan 29 21:40:35 2020 New Revision: 357271 URL: https://svnweb.freebsd.org/changeset/base/357271 Log: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. MFC after: 3 days Modified: projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Modified: projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c ============================================================================== --- projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Wed Jan 29 21:09:36 2020 (r357270) +++ projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c Wed Jan 29 21:40:35 2020 (r357271) @@ -1232,9 +1232,9 @@ op_begemot_stp_port(struct snmp_context *ctx, struct s case LEAF_begemotBridgeStpPortEnable: if (val->v.integer != - begemotBridgeStpPortEnable_enabled || + (int32_t)begemotBridgeStpPortEnable_enabled || val->v.integer != - begemotBridgeStpPortEnable_disabled) + (int32_t)begemotBridgeStpPortEnable_disabled) return (SNMP_ERR_WRONG_VALUE); ctx->scratch->int1 = bp->enable; From owner-svn-src-projects@freebsd.org Fri Jan 31 18:09:28 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AA62247FB5 for ; Fri, 31 Jan 2020 18:09:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488QGc2B5Dz42Ps; Fri, 31 Jan 2020 18:09:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4625E19F70; Fri, 31 Jan 2020 18:09:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VI9SXx003081; Fri, 31 Jan 2020 18:09:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VI9S7O003080; Fri, 31 Jan 2020 18:09:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311809.00VI9S7O003080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 18:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357339 - projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_pf X-SVN-Commit-Revision: 357339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 18:09:28 -0000 Author: dim Date: Fri Jan 31 18:09:27 2020 New Revision: 357339 URL: https://svnweb.freebsd.org/changeset/base/357339 Log: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. MFC after: 3 days Modified: projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Modified: projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Fri Jan 31 18:04:04 2020 (r357338) +++ projects/clang1000-import/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Fri Jan 31 18:09:27 2020 (r357339) @@ -1655,10 +1655,11 @@ altq_is_enabled(int pfdev) syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); return (0); - } else + } else { syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); + } } return (1); } From owner-svn-src-projects@freebsd.org Fri Jan 31 18:26:24 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 316BB1E8AFC for ; Fri, 31 Jan 2020 18:26:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488Qf80Pj0z43st; Fri, 31 Jan 2020 18:26:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08A761A30B; Fri, 31 Jan 2020 18:26:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VIQNeH014966; Fri, 31 Jan 2020 18:26:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VIQNW6014965; Fri, 31 Jan 2020 18:26:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311826.00VIQNW6014965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 18:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357342 - projects/clang1000-import/share/mk X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang1000-import/share/mk X-SVN-Commit-Revision: 357342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 18:26:24 -0000 Author: dim Date: Fri Jan 31 18:26:23 2020 New Revision: 357342 URL: https://svnweb.freebsd.org/changeset/base/357342 Log: Work around two -Werror warning issues in googletest, which have been solved upstream in the mean time. The first issue is because one of googletest's generated headers contain classes with a user-declared copy assignment operator, but rely on the generation by the compiler of an implicit copy constructor, which is now deprecated: /usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-param-util-generated.h:5284:8: error: definition of implicit copy constructor for 'CartesianProductHolder3, testing::internal::ValueArray3, testing::internal::ValueArray4 >' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy] void operator=(const CartesianProductHolder3& other); ^ /usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/gtest-param-test.h:1277:10: note: in implicit copy constructor for 'testing::internal::CartesianProductHolder3, testing::internal::ValueArray3, testing::internal::ValueArray4 >' first required here return internal::CartesianProductHolder3( ^ /usr/src/tests/sys/fs/fusefs/io.cc:534:2: note: in instantiation of function template specialization 'testing::Combine, testing::internal::ValueArray3, testing::internal::ValueArray4 >' requested here Combine(Bool(), /* async read */ ^ For now, silence the warning using -Wno-deprecated-copy. The second issue is because one of the googlemock test programs attempts to use "unsigned wchar_t" and "signed wchar_t", which are non-standard and at best, hazily defined: contrib/googletest/googlemock/test/gmock-actions_test.cc:111:37: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar] EXPECT_EQ(0U, BuiltInDefaultValue::Get()); ^ contrib/googletest/googlemock/test/gmock-actions_test.cc:112:36: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar] EXPECT_EQ(0, BuiltInDefaultValue::Get()); ^ For now, silence the warning using -Wno-signed-unsigned-wchar. MFC after: 3 days Modified: projects/clang1000-import/share/mk/googletest.test.inc.mk Modified: projects/clang1000-import/share/mk/googletest.test.inc.mk ============================================================================== --- projects/clang1000-import/share/mk/googletest.test.inc.mk Fri Jan 31 18:26:13 2020 (r357341) +++ projects/clang1000-import/share/mk/googletest.test.inc.mk Fri Jan 31 18:26:23 2020 (r357342) @@ -5,6 +5,18 @@ GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti +.include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000 +# Required until googletest is upgraded to a more recent version (after +# upstream commit efecb0bfa687cf87836494f5d62868485c00fb66). +GTESTS_CXXFLAGS+= -Wno-deprecated-copy + +# Required until googletest is upgraded to a more recent version (after +# upstream commit d44b137fd104dfffdcdea103f7de11b9eccc45c2). +GTESTS_CXXFLAGS+= -Wno-signed-unsigned-wchar +.endif + # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private From owner-svn-src-projects@freebsd.org Fri Jan 31 19:02:54 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F67C1E99B6 for ; Fri, 31 Jan 2020 19:02:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488RSG2ptGz45mV; Fri, 31 Jan 2020 19:02:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BA971AA81; Fri, 31 Jan 2020 19:02:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VJ2sAI038637; Fri, 31 Jan 2020 19:02:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VJ2sxL038635; Fri, 31 Jan 2020 19:02:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311902.00VJ2sxL038635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 19:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357345 - in projects/clang1000-import: share/mk usr.bin/lex X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: share/mk usr.bin/lex X-SVN-Commit-Revision: 357345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 19:02:54 -0000 Author: dim Date: Fri Jan 31 19:02:53 2020 New Revision: 357345 URL: https://svnweb.freebsd.org/changeset/base/357345 Log: Disable new clang 10.0.0 warnings about misleading indentation in flex. As this is contributed code with very messy indentation, which will almost certainly never be upgraded, just disable the warning. MFC after: 3 days Modified: projects/clang1000-import/share/mk/bsd.sys.mk projects/clang1000-import/usr.bin/lex/Makefile Modified: projects/clang1000-import/share/mk/bsd.sys.mk ============================================================================== --- projects/clang1000-import/share/mk/bsd.sys.mk Fri Jan 31 19:00:48 2020 (r357344) +++ projects/clang1000-import/share/mk/bsd.sys.mk Fri Jan 31 19:02:53 2020 (r357345) @@ -111,6 +111,11 @@ CWARNFLAGS.clang+= -Wno-parentheses .if defined(NO_WARRAY_BOUNDS) CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS +.if defined(NO_WMISLEADING_INDENTATION) && \ + ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) +CWARNFLAGS+= -Wno-misleading-indentation +.endif # NO_WMISLEADING_INDENTATION .endif # WARNS .if defined(FORMAT_AUDIT) @@ -154,8 +159,7 @@ CWARNFLAGS+= -Wno-error=address \ # GCC 6.1.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=misleading-indentation \ - -Wno-error=nonnull-compare \ +CWARNFLAGS+= -Wno-error=nonnull-compare \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable Modified: projects/clang1000-import/usr.bin/lex/Makefile ============================================================================== --- projects/clang1000-import/usr.bin/lex/Makefile Fri Jan 31 19:00:48 2020 (r357344) +++ projects/clang1000-import/usr.bin/lex/Makefile Fri Jan 31 19:02:53 2020 (r357345) @@ -32,6 +32,8 @@ MLINKS+= lex.1 lex++.1 WARNS?= 3 +NO_WMISLEADING_INDENTATION= + CLEANFILES= scan.c skel.c GENFILES= parse.c parse.h scan.c skel.c From owner-svn-src-projects@freebsd.org Fri Jan 31 19:35:22 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84EE71EA869 for ; Fri, 31 Jan 2020 19:35:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488S9k1CzBz47kQ; Fri, 31 Jan 2020 19:35:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CCAF1B006; Fri, 31 Jan 2020 19:35:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VJZLaR056711; Fri, 31 Jan 2020 19:35:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VJZLUj056708; Fri, 31 Jan 2020 19:35:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311935.00VJZLUj056708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 19:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357348 - in projects/clang1000-import/sys: conf modules/tpm X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import/sys: conf modules/tpm X-SVN-Commit-Revision: 357348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 19:35:22 -0000 Author: dim Date: Fri Jan 31 19:35:21 2020 New Revision: 357348 URL: https://svnweb.freebsd.org/changeset/base/357348 Log: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. MFC after: 3 days Modified: projects/clang1000-import/sys/conf/files.amd64 projects/clang1000-import/sys/conf/kern.mk projects/clang1000-import/sys/modules/tpm/Makefile Modified: projects/clang1000-import/sys/conf/files.amd64 ============================================================================== --- projects/clang1000-import/sys/conf/files.amd64 Fri Jan 31 19:06:49 2020 (r357347) +++ projects/clang1000-import/sys/conf/files.amd64 Fri Jan 31 19:35:21 2020 (r357348) @@ -323,7 +323,8 @@ dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/tpm/tpm.c optional tpm dev/tpm/tpm20.c optional tpm -dev/tpm/tpm_crb.c optional tpm acpi +dev/tpm/tpm_crb.c optional tpm acpi \ + compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" dev/tpm/tpm_tis.c optional tpm acpi dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa Modified: projects/clang1000-import/sys/conf/kern.mk ============================================================================== --- projects/clang1000-import/sys/conf/kern.mk Fri Jan 31 19:06:49 2020 (r357347) +++ projects/clang1000-import/sys/conf/kern.mk Fri Jan 31 19:35:21 2020 (r357348) @@ -37,6 +37,9 @@ CWARNEXTRA+= -Wno-error-shift-negative-value .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member .endif +.if ${COMPILER_VERSION} >= 100000 +NO_WINT_IN_BOOL_CONTEXT= -Wno-int-in-bool-context +.endif .endif .if ${COMPILER_TYPE} == "gcc" Modified: projects/clang1000-import/sys/modules/tpm/Makefile ============================================================================== --- projects/clang1000-import/sys/modules/tpm/Makefile Fri Jan 31 19:06:49 2020 (r357347) +++ projects/clang1000-import/sys/modules/tpm/Makefile Fri Jan 31 19:35:21 2020 (r357348) @@ -11,3 +11,5 @@ SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_i SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include + +CWARNFLAGS.tpm_crb.c+= ${NO_WINT_IN_BOOL_CONTEXT} From owner-svn-src-projects@freebsd.org Fri Jan 31 19:40:46 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C8EB1EA99F for ; Fri, 31 Jan 2020 19:40:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488SHy0rrfz4868; Fri, 31 Jan 2020 19:40:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 183791B021; Fri, 31 Jan 2020 19:40:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00VJejNa059375; Fri, 31 Jan 2020 19:40:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00VJeeum059351; Fri, 31 Jan 2020 19:40:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001311940.00VJeeum059351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 31 Jan 2020 19:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357350 - in projects/clang1000-import: . contrib/apr/random/unix contrib/apr/strings contrib/bmake/mk gnu/lib include lib/csu lib/libc/amd64/string lib/libc/stdio lib/libusb release/ar... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: . contrib/apr/random/unix contrib/apr/strings contrib/bmake/mk gnu/lib include lib/csu lib/libc/amd64/string lib/libc/stdio lib/libusb release/arm64 release/packages shar... X-SVN-Commit-Revision: 357350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 19:40:46 -0000 Author: dim Date: Fri Jan 31 19:40:40 2020 New Revision: 357350 URL: https://svnweb.freebsd.org/changeset/base/357350 Log: Merge ^/head r357270 through r357349. Added: projects/clang1000-import/sys/kern/subr_smr.c - copied unchanged from r357349, head/sys/kern/subr_smr.c projects/clang1000-import/sys/sys/_smr.h - copied unchanged from r357349, head/sys/sys/_smr.h projects/clang1000-import/sys/sys/smr.h - copied unchanged from r357349, head/sys/sys/smr.h projects/clang1000-import/tools/uma/ - copied from r357349, head/tools/uma/ Deleted: projects/clang1000-import/release/packages/acct.ucl projects/clang1000-import/release/packages/acpi.ucl projects/clang1000-import/release/packages/amd.ucl projects/clang1000-import/release/packages/apm.ucl projects/clang1000-import/release/packages/at.ucl projects/clang1000-import/release/packages/autofs.ucl projects/clang1000-import/release/packages/bhyve.ucl projects/clang1000-import/release/packages/bluetooth.ucl projects/clang1000-import/release/packages/bsdinstall.ucl projects/clang1000-import/release/packages/bsnmp.ucl projects/clang1000-import/release/packages/dma.ucl projects/clang1000-import/release/packages/ee.ucl projects/clang1000-import/release/packages/hostapd.ucl projects/clang1000-import/release/packages/jail-debug.ucl projects/clang1000-import/release/packages/jail-development.ucl projects/clang1000-import/release/packages/jail-lib32-debug.ucl projects/clang1000-import/release/packages/jail-lib32-development.ucl projects/clang1000-import/release/packages/jail-lib32-profile.ucl projects/clang1000-import/release/packages/jail-lib32.ucl projects/clang1000-import/release/packages/jail-profile.ucl projects/clang1000-import/release/packages/rcmds.ucl projects/clang1000-import/release/packages/runtime-debug.ucl projects/clang1000-import/release/packages/runtime-development.ucl projects/clang1000-import/release/packages/runtime-lib32.ucl projects/clang1000-import/release/packages/runtime-manuals.ucl projects/clang1000-import/release/packages/runtime-profile.ucl projects/clang1000-import/release/packages/syscons.ucl projects/clang1000-import/release/packages/tests.ucl projects/clang1000-import/release/packages/vi.ucl projects/clang1000-import/release/packages/wpa.ucl projects/clang1000-import/tools/build/options/WITHOUT_BSD_CRTBEGIN projects/clang1000-import/tools/build/options/WITH_BSD_CRTBEGIN Modified: projects/clang1000-import/Makefile.inc1 projects/clang1000-import/contrib/apr/random/unix/apr_random.c projects/clang1000-import/contrib/apr/strings/apr_snprintf.c projects/clang1000-import/contrib/bmake/mk/meta2deps.sh projects/clang1000-import/gnu/lib/Makefile projects/clang1000-import/include/stdio.h projects/clang1000-import/lib/csu/Makefile.inc projects/clang1000-import/lib/libc/amd64/string/memcmp.S projects/clang1000-import/lib/libc/stdio/Makefile.inc projects/clang1000-import/lib/libc/stdio/Symbol.map projects/clang1000-import/lib/libc/stdio/fflush.3 projects/clang1000-import/lib/libc/stdio/fflush.c projects/clang1000-import/lib/libc/stdio/fputc.c projects/clang1000-import/lib/libc/stdio/fputs.3 projects/clang1000-import/lib/libc/stdio/fputs.c projects/clang1000-import/lib/libc/stdio/fread.3 projects/clang1000-import/lib/libc/stdio/fread.c projects/clang1000-import/lib/libc/stdio/fwrite.c projects/clang1000-import/lib/libc/stdio/putc.3 projects/clang1000-import/lib/libusb/libusb10_hotplug.c projects/clang1000-import/release/arm64/RPI3.conf projects/clang1000-import/release/packages/binutils.ucl projects/clang1000-import/release/packages/caroot.ucl projects/clang1000-import/release/packages/clang.ucl projects/clang1000-import/release/packages/gdb.ucl projects/clang1000-import/release/packages/generate-ucl.sh projects/clang1000-import/release/packages/groff.ucl projects/clang1000-import/release/packages/jail.ucl projects/clang1000-import/release/packages/lld.ucl projects/clang1000-import/release/packages/lldb.ucl projects/clang1000-import/release/packages/runtime.ucl projects/clang1000-import/release/packages/ssh.ucl projects/clang1000-import/release/packages/svn.ucl projects/clang1000-import/release/packages/unbound.ucl projects/clang1000-import/share/man/man4/cpufreq.4 projects/clang1000-import/share/man/man5/src.conf.5 projects/clang1000-import/share/man/man9/stack.9 projects/clang1000-import/share/mk/local.dirdeps-options.mk projects/clang1000-import/share/mk/local.dirdeps.mk projects/clang1000-import/share/mk/local.gendirdeps.mk projects/clang1000-import/share/mk/meta2deps.sh projects/clang1000-import/share/mk/src.opts.mk projects/clang1000-import/sys/amd64/amd64/support.S projects/clang1000-import/sys/amd64/amd64/trap.c projects/clang1000-import/sys/arm/arm/stack_machdep.c projects/clang1000-import/sys/arm64/acpica/acpi_iort.c projects/clang1000-import/sys/arm64/arm64/gicv3_its.c projects/clang1000-import/sys/arm64/arm64/stack_machdep.c projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c projects/clang1000-import/sys/conf/config.mk projects/clang1000-import/sys/conf/files projects/clang1000-import/sys/dev/acpi_support/acpi_ibm.c projects/clang1000-import/sys/dev/aic7xxx/aic79xx_inline.h projects/clang1000-import/sys/dev/bwi/if_bwi.c projects/clang1000-import/sys/dev/bwn/if_bwn.c projects/clang1000-import/sys/dev/ipw/if_ipw.c projects/clang1000-import/sys/dev/iwi/if_iwi.c projects/clang1000-import/sys/dev/iwm/if_iwm.c projects/clang1000-import/sys/dev/iwn/if_iwn.c projects/clang1000-import/sys/dev/malo/if_malo.c projects/clang1000-import/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c projects/clang1000-import/sys/dev/mlx5/cq.h projects/clang1000-import/sys/dev/mlx5/driver.h projects/clang1000-import/sys/dev/mlx5/mlx5_core/mlx5_cq.c projects/clang1000-import/sys/dev/mlx5/mlx5_en/mlx5_en_main.c projects/clang1000-import/sys/dev/mwl/if_mwl.c projects/clang1000-import/sys/dev/ral/rt2560.c projects/clang1000-import/sys/dev/ral/rt2661.c projects/clang1000-import/sys/dev/ral/rt2860.c projects/clang1000-import/sys/dev/rtwn/pci/rtwn_pci_rx.c projects/clang1000-import/sys/dev/usb/wlan/if_rum.c projects/clang1000-import/sys/dev/usb/wlan/if_run.c projects/clang1000-import/sys/dev/usb/wlan/if_uath.c projects/clang1000-import/sys/dev/usb/wlan/if_upgt.c projects/clang1000-import/sys/dev/usb/wlan/if_ural.c projects/clang1000-import/sys/dev/usb/wlan/if_urtw.c projects/clang1000-import/sys/dev/usb/wlan/if_zyd.c projects/clang1000-import/sys/dev/wi/if_wi.c projects/clang1000-import/sys/dev/wpi/if_wpi.c projects/clang1000-import/sys/dev/wtap/if_wtap.c projects/clang1000-import/sys/fs/nullfs/null_subr.c projects/clang1000-import/sys/fs/nullfs/null_vnops.c projects/clang1000-import/sys/i386/i386/trap.c projects/clang1000-import/sys/kern/imgact_binmisc.c projects/clang1000-import/sys/kern/imgact_elf.c projects/clang1000-import/sys/kern/init_main.c projects/clang1000-import/sys/kern/kern_alq.c projects/clang1000-import/sys/kern/kern_conf.c projects/clang1000-import/sys/kern/kern_exit.c projects/clang1000-import/sys/kern/kern_hhook.c projects/clang1000-import/sys/kern/kern_jail.c projects/clang1000-import/sys/kern/kern_kcov.c projects/clang1000-import/sys/kern/kern_kthread.c projects/clang1000-import/sys/kern/kern_linker.c projects/clang1000-import/sys/kern/kern_lockf.c projects/clang1000-import/sys/kern/kern_mib.c projects/clang1000-import/sys/kern/kern_mtxpool.c projects/clang1000-import/sys/kern/kern_pmc.c projects/clang1000-import/sys/kern/kern_poll.c projects/clang1000-import/sys/kern/kern_proc.c projects/clang1000-import/sys/kern/kern_resource.c projects/clang1000-import/sys/kern/kern_rmlock.c projects/clang1000-import/sys/kern/kern_sig.c projects/clang1000-import/sys/kern/kern_switch.c projects/clang1000-import/sys/kern/kern_sysctl.c projects/clang1000-import/sys/kern/kern_tc.c projects/clang1000-import/sys/kern/kern_time.c projects/clang1000-import/sys/kern/kern_ubsan.c projects/clang1000-import/sys/kern/kern_umtx.c projects/clang1000-import/sys/kern/link_elf.c projects/clang1000-import/sys/kern/link_elf_obj.c projects/clang1000-import/sys/kern/sched_4bsd.c projects/clang1000-import/sys/kern/sched_ule.c projects/clang1000-import/sys/kern/subr_acl_posix1e.c projects/clang1000-import/sys/kern/subr_blist.c projects/clang1000-import/sys/kern/subr_bufring.c projects/clang1000-import/sys/kern/subr_bus.c projects/clang1000-import/sys/kern/subr_clock.c projects/clang1000-import/sys/kern/subr_csan.c projects/clang1000-import/sys/kern/subr_fattime.c projects/clang1000-import/sys/kern/subr_filter.c projects/clang1000-import/sys/kern/subr_gtaskqueue.c projects/clang1000-import/sys/kern/subr_hints.c projects/clang1000-import/sys/kern/subr_intr.c projects/clang1000-import/sys/kern/subr_kdb.c projects/clang1000-import/sys/kern/subr_sbuf.c projects/clang1000-import/sys/kern/subr_sleepqueue.c projects/clang1000-import/sys/kern/subr_smp.c projects/clang1000-import/sys/kern/subr_stats.c projects/clang1000-import/sys/kern/subr_unit.c projects/clang1000-import/sys/kern/subr_vmem.c projects/clang1000-import/sys/kern/subr_witness.c projects/clang1000-import/sys/kern/sys_generic.c projects/clang1000-import/sys/kern/sys_pipe.c projects/clang1000-import/sys/kern/sys_process.c projects/clang1000-import/sys/kern/sysv_msg.c projects/clang1000-import/sys/kern/sysv_shm.c projects/clang1000-import/sys/kern/tty_info.c projects/clang1000-import/sys/kern/uipc_mbuf.c projects/clang1000-import/sys/kern/uipc_usrreq.c projects/clang1000-import/sys/kern/vfs_acl.c projects/clang1000-import/sys/kern/vfs_bio.c projects/clang1000-import/sys/kern/vfs_cluster.c projects/clang1000-import/sys/kern/vfs_extattr.c projects/clang1000-import/sys/kern/vfs_init.c projects/clang1000-import/sys/kern/vfs_subr.c projects/clang1000-import/sys/kern/vfs_syscalls.c projects/clang1000-import/sys/kern/vfs_vnops.c projects/clang1000-import/sys/mips/mips/stack_machdep.c projects/clang1000-import/sys/modules/if_lagg/Makefile projects/clang1000-import/sys/modules/if_vlan/Makefile projects/clang1000-import/sys/netinet/tcp_usrreq.c projects/clang1000-import/sys/netinet6/udp6_usrreq.c projects/clang1000-import/sys/powerpc/powerpc/stack_machdep.c projects/clang1000-import/sys/riscv/include/db_machdep.h projects/clang1000-import/sys/riscv/include/pcb.h projects/clang1000-import/sys/riscv/include/riscvreg.h projects/clang1000-import/sys/riscv/riscv/exception.S projects/clang1000-import/sys/riscv/riscv/genassym.c projects/clang1000-import/sys/riscv/riscv/machdep.c projects/clang1000-import/sys/riscv/riscv/stack_machdep.c projects/clang1000-import/sys/sparc64/sparc64/stack_machdep.c projects/clang1000-import/sys/sys/rmlock.h projects/clang1000-import/sys/sys/stack.h projects/clang1000-import/sys/sys/vnode.h projects/clang1000-import/sys/ufs/ufs/ufs_inode.c projects/clang1000-import/sys/vm/uma.h projects/clang1000-import/sys/vm/uma_core.c projects/clang1000-import/sys/vm/uma_int.h projects/clang1000-import/sys/x86/cpufreq/hwpstate_amd.c projects/clang1000-import/sys/x86/include/apicvar.h projects/clang1000-import/sys/x86/include/stack.h projects/clang1000-import/sys/x86/x86/mp_x86.c projects/clang1000-import/sys/x86/x86/stack_machdep.c projects/clang1000-import/targets/pseudo/userland/gnu/Makefile.depend projects/clang1000-import/tests/sys/sys/qmath_test.c projects/clang1000-import/usr.sbin/makefs/msdos/msdosfs_denode.c projects/clang1000-import/usr.sbin/services_mkdb/services Directory Properties: projects/clang1000-import/ (props changed) projects/clang1000-import/contrib/apr/ (props changed) projects/clang1000-import/contrib/bmake/ (props changed) projects/clang1000-import/gnu/lib/ (props changed) projects/clang1000-import/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/clang1000-import/Makefile.inc1 ============================================================================== --- projects/clang1000-import/Makefile.inc1 Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/Makefile.inc1 Fri Jan 31 19:40:40 2020 (r357350) @@ -2783,13 +2783,10 @@ _prereq_libs+= lib/libssp_nonshared # These dependencies are not automatically generated: # -# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before +# gnu/lib/libgcc, lib/csu and lib/libc must be built before # all shared libraries for ELF. # _startup_libs= lib/csu -.if ${MK_BSD_CRTBEGIN} == "no" -_startup_libs+= gnu/lib/csu -.endif _startup_libs+= lib/libc _startup_libs+= lib/libc_nonshared .if ${MK_LIBCPLUSPLUS} != "no" Modified: projects/clang1000-import/contrib/apr/random/unix/apr_random.c ============================================================================== --- projects/clang1000-import/contrib/apr/random/unix/apr_random.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/contrib/apr/random/unix/apr_random.c Fri Jan 31 19:40:40 2020 (r357350) @@ -13,285 +13,51 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * See the paper "On Randomness" by Ben Laurie for an explanation of this PRNG. - * http://www.apache-ssl.org/randomness.pdf - * XXX: Is there a formal proof of this PRNG? Couldn't we use the more popular - * Mersenne Twister PRNG (and BSD licensed)? - */ #include "apr.h" #include "apr_pools.h" #include "apr_random.h" #include "apr_thread_proc.h" #include +#include -#ifdef min -#undef min -#endif -#define min(a,b) ((a) < (b) ? (a) : (b)) - -#define APR_RANDOM_DEFAULT_POOLS 32 -#define APR_RANDOM_DEFAULT_REHASH_SIZE 1024 -#define APR_RANDOM_DEFAULT_RESEED_SIZE 32 -#define APR_RANDOM_DEFAULT_HASH_SECRET_SIZE 32 -#define APR_RANDOM_DEFAULT_G_FOR_INSECURE 32 -#define APR_RANDOM_DEFAULT_G_FOR_SECURE 320 - -typedef struct apr_random_pool_t { - unsigned char *pool; - unsigned int bytes; - unsigned int pool_size; -} apr_random_pool_t; - -#define hash_init(h) (h)->init(h) -#define hash_add(h,b,n) (h)->add(h,b,n) -#define hash_finish(h,r) (h)->finish(h,r) - -#define hash(h,r,b,n) hash_init(h),hash_add(h,b,n),hash_finish(h,r) - -#define crypt_setkey(c,k) (c)->set_key((c)->data,k) -#define crypt_crypt(c,out,in) (c)->crypt((c)->date,out,in) - -struct apr_random_t { - apr_pool_t *apr_pool; - apr_crypto_hash_t *pool_hash; - unsigned int npools; - apr_random_pool_t *pools; - unsigned int next_pool; - unsigned int generation; - apr_size_t rehash_size; - apr_size_t reseed_size; - apr_crypto_hash_t *key_hash; -#define K_size(g) ((g)->key_hash->size) - apr_crypto_hash_t *prng_hash; -#define B_size(g) ((g)->prng_hash->size) - - unsigned char *H; - unsigned char *H_waiting; -#define H_size(g) (B_size(g)+K_size(g)) -#define H_current(g) (((g)->insecure_started && !(g)->secure_started) \ - ? (g)->H_waiting : (g)->H) - - unsigned char *randomness; - apr_size_t random_bytes; - unsigned int g_for_insecure; - unsigned int g_for_secure; - unsigned int secure_base; - unsigned int insecure_started:1; - unsigned int secure_started:1; - - apr_random_t *next; -}; - -static apr_random_t *all_random; - -static apr_status_t random_cleanup(void *data) -{ - apr_random_t *remove_this = data, - *cur = all_random, - **prev_ptr = &all_random; - while (cur) { - if (cur == remove_this) { - *prev_ptr = cur->next; - break; - } - prev_ptr = &cur->next; - cur = cur->next; - } - return APR_SUCCESS; -} - - APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, apr_crypto_hash_t *pool_hash, apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash) { - unsigned int n; - - g->apr_pool = p; - - g->pool_hash = pool_hash; - g->key_hash = key_hash; - g->prng_hash = prng_hash; - - g->npools = APR_RANDOM_DEFAULT_POOLS; - g->pools = apr_palloc(p,g->npools*sizeof *g->pools); - for (n = 0; n < g->npools; ++n) { - g->pools[n].bytes = g->pools[n].pool_size = 0; - g->pools[n].pool = NULL; - } - g->next_pool = 0; - - g->generation = 0; - - g->rehash_size = APR_RANDOM_DEFAULT_REHASH_SIZE; - /* Ensure that the rehash size is twice the size of the pool hasher */ - g->rehash_size = ((g->rehash_size+2*g->pool_hash->size-1)/g->pool_hash->size - /2)*g->pool_hash->size*2; - g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE; - - g->H = apr_pcalloc(p,H_size(g)); - g->H_waiting = apr_pcalloc(p,H_size(g)); - - g->randomness = apr_palloc(p,B_size(g)); - g->random_bytes = 0; - - g->g_for_insecure = APR_RANDOM_DEFAULT_G_FOR_INSECURE; - g->secure_base = 0; - g->g_for_secure = APR_RANDOM_DEFAULT_G_FOR_SECURE; - g->secure_started = g->insecure_started = 0; - - g->next = all_random; - all_random = g; - apr_pool_cleanup_register(p, g, random_cleanup, apr_pool_cleanup_null); + (void)g; + (void)p; + (void)pool_hash; + (void)key_hash; + (void)prng_hash; } -static void mix_pid(apr_random_t *g,unsigned char *H,pid_t pid) -{ - hash_init(g->key_hash); - hash_add(g->key_hash,H,H_size(g)); - hash_add(g->key_hash,&pid,sizeof pid); - hash_finish(g->key_hash,H); -} - -static void mixer(apr_random_t *g,pid_t pid) -{ - unsigned char *H = H_current(g); - - /* mix the PID into the current H */ - mix_pid(g,H,pid); - /* if we are in waiting, then also mix into main H */ - if (H != g->H) - mix_pid(g,g->H,pid); - /* change order of pool mixing for good measure - note that going - backwards is much better than going forwards */ - --g->generation; - /* blow away any lingering randomness */ - g->random_bytes = 0; -} - APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc) { - apr_random_t *r; - - for (r = all_random; r; r = r->next) - /* - * XXX Note: the pid does not provide sufficient entropy to - * actually call this secure. See Ben's paper referenced at - * the top of this file. - */ - mixer(r,proc->pid); + (void)proc; } APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p) { - apr_random_t *r = apr_palloc(p,sizeof *r); - - apr_random_init(r,p,apr_crypto_sha256_new(p),apr_crypto_sha256_new(p), - apr_crypto_sha256_new(p)); - return r; + /* apr_random_t is an opaque struct type. */ + return (void *)0x1; } -static void rekey(apr_random_t *g) -{ - unsigned int n; - unsigned char *H = H_current(g); - - hash_init(g->key_hash); - hash_add(g->key_hash,H,H_size(g)); - for (n = 0 ; n < g->npools && (n == 0 || g->generation&(1 << (n-1))) - ; ++n) { - hash_add(g->key_hash,g->pools[n].pool,g->pools[n].bytes); - g->pools[n].bytes = 0; - } - hash_finish(g->key_hash,H+B_size(g)); - - ++g->generation; - if (!g->insecure_started && g->generation > g->g_for_insecure) { - g->insecure_started = 1; - if (!g->secure_started) { - memcpy(g->H_waiting,g->H,H_size(g)); - g->secure_base = g->generation; - } - } - - if (!g->secure_started && g->generation > g->secure_base+g->g_for_secure) { - g->secure_started = 1; - memcpy(g->H,g->H_waiting,H_size(g)); - } -} - APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, apr_size_t bytes) { - unsigned int n; - const unsigned char *entropy = entropy_; - - for (n = 0; n < bytes; ++n) { - apr_random_pool_t *p = &g->pools[g->next_pool]; - - if (++g->next_pool == g->npools) - g->next_pool = 0; - - if (p->pool_size < p->bytes+1) { - unsigned char *np = apr_palloc(g->apr_pool,(p->bytes+1)*2); - - memcpy(np,p->pool,p->bytes); - p->pool = np; - p->pool_size = (p->bytes+1)*2; - } - p->pool[p->bytes++] = entropy[n]; - - if (p->bytes == g->rehash_size) { - apr_size_t r; - - for (r = 0; r < p->bytes/2; r+=g->pool_hash->size) - hash(g->pool_hash,p->pool+r,p->pool+r*2,g->pool_hash->size*2); - p->bytes/=2; - } - assert(p->bytes < g->rehash_size); - } - - if (g->pools[0].bytes >= g->reseed_size) - rekey(g); + (void)g; + (void)entropy_; + (void)bytes; } -/* This will give g->B_size bytes of randomness */ -static void apr_random_block(apr_random_t *g,unsigned char *random) -{ - /* FIXME: in principle, these are different hashes */ - hash(g->prng_hash,g->H,g->H,H_size(g)); - hash(g->prng_hash,random,g->H,B_size(g)); -} - -static void apr_random_bytes(apr_random_t *g,unsigned char *random, - apr_size_t bytes) -{ - apr_size_t n; - - for (n = 0; n < bytes; ) { - apr_size_t l; - - if (g->random_bytes == 0) { - apr_random_block(g,g->randomness); - g->random_bytes = B_size(g); - } - l = min(bytes-n,g->random_bytes); - memcpy(&random[n],g->randomness+B_size(g)-g->random_bytes,l); - g->random_bytes-=l; - n+=l; - } -} - APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, void *random, apr_size_t bytes) { - if (!g->secure_started) - return APR_ENOTENOUGHENTROPY; - apr_random_bytes(g,random,bytes); + (void)g; + arc4random_buf(random, bytes); return APR_SUCCESS; } @@ -299,28 +65,24 @@ APR_DECLARE(apr_status_t) apr_random_insecure_bytes(ap void *random, apr_size_t bytes) { - if (!g->insecure_started) - return APR_ENOTENOUGHENTROPY; - apr_random_bytes(g,random,bytes); + (void)g; + arc4random_buf(random, bytes); return APR_SUCCESS; } APR_DECLARE(void) apr_random_barrier(apr_random_t *g) { - g->secure_started = 0; - g->secure_base = g->generation; + (void)g; } APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r) { - if (!r->secure_started) - return APR_ENOTENOUGHENTROPY; + (void)r; return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r) { - if (!r->insecure_started) - return APR_ENOTENOUGHENTROPY; + (void)r; return APR_SUCCESS; } Modified: projects/clang1000-import/contrib/apr/strings/apr_snprintf.c ============================================================================== --- projects/clang1000-import/contrib/apr/strings/apr_snprintf.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/contrib/apr/strings/apr_snprintf.c Fri Jan 31 19:40:40 2020 (r357350) @@ -708,6 +708,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_ char num_buf[NUM_BUF_SIZE]; char char_buf[2]; /* for printing %% and % */ + char buf[5]; /* for printing %B, %F, and %S */ enum var_type_enum { IS_QUAD, IS_LONG, IS_SHORT, IS_INT @@ -1246,7 +1247,6 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_ case 'F': case 'S': { - char buf[5]; apr_off_t size = 0; if (*fmt == 'B') { Modified: projects/clang1000-import/contrib/bmake/mk/meta2deps.sh ============================================================================== --- projects/clang1000-import/contrib/bmake/mk/meta2deps.sh Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/contrib/bmake/mk/meta2deps.sh Fri Jan 31 19:40:40 2020 (r357350) @@ -49,7 +49,6 @@ # The output, is a set of absolute paths with "SB" like: #.nf # -# $SB/obj-i386/bsd/gnu/lib/csu # $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include # $SB/obj-i386/bsd/lib/csu/i386 Modified: projects/clang1000-import/gnu/lib/Makefile ============================================================================== --- projects/clang1000-import/gnu/lib/Makefile Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/gnu/lib/Makefile Fri Jan 31 19:40:40 2020 (r357350) @@ -10,10 +10,6 @@ SUBDIR+= libgomp .endif SUBDIR.${MK_TESTS}+= tests -.if ${MK_BSD_CRTBEGIN} == "no" -SUBDIR+= csu -.endif - .if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ ${MK_GDB} != "no" SUBDIR+= libregex Modified: projects/clang1000-import/include/stdio.h ============================================================================== --- projects/clang1000-import/include/stdio.h Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/include/stdio.h Fri Jan 31 19:40:40 2020 (r357350) @@ -346,7 +346,12 @@ int putchar_unlocked(int); void clearerr_unlocked(FILE *); int feof_unlocked(FILE *); int ferror_unlocked(FILE *); +int fflush_unlocked(FILE *); int fileno_unlocked(FILE *); +int fputs_unlocked(const char * __restrict, FILE * __restrict); +size_t fread_unlocked(void * __restrict, size_t, size_t, FILE * __restrict); +size_t fwrite_unlocked(const void * __restrict, size_t, size_t, + FILE * __restrict); #endif #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 @@ -507,10 +512,11 @@ extern int __isthreaded; * See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12 * B.8.2.7 for the rationale behind the *_unlocked() macros. */ +#define clearerr_unlocked(p) __sclearerr(p) #define feof_unlocked(p) __sfeof(p) #define ferror_unlocked(p) __sferror(p) -#define clearerr_unlocked(p) __sclearerr(p) #define fileno_unlocked(p) __sfileno(p) +#define fputc_unlocked(s, p) __sputc(s, p) #endif #if __POSIX_VISIBLE >= 199506 #define getc_unlocked(fp) __sgetc(fp) Modified: projects/clang1000-import/lib/csu/Makefile.inc ============================================================================== --- projects/clang1000-import/lib/csu/Makefile.inc Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/csu/Makefile.inc Fri Jan 31 19:40:40 2020 (r357350) @@ -8,7 +8,7 @@ NO_WMISSING_VARIABLE_DECLARATIONS= .include -.if ${MK_BSD_CRTBEGIN} != "no" && !defined(BUILDING_TESTS) +.if !defined(BUILDING_TESTS) OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o Modified: projects/clang1000-import/lib/libc/amd64/string/memcmp.S ============================================================================== --- projects/clang1000-import/lib/libc/amd64/string/memcmp.S Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/amd64/string/memcmp.S Fri Jan 31 19:40:40 2020 (r357350) @@ -45,7 +45,7 @@ ENTRY(memcmp) movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f movq -8(%rdi,%rdx),%r8 movq -8(%rsi,%rdx),%r9 cmpq %r8,%r9 @@ -54,34 +54,33 @@ ENTRY(memcmp) 100408: cmpb $4,%dl jl 100204f - movl (%rsi),%r8d - movl (%rdi),%r9d + movl (%rdi),%r8d + movl (%rsi),%r9d cmpl %r8d,%r9d - jne 1f - movl -4(%rsi,%rdx),%r8d - movl -4(%rdi,%rdx),%r9d + jne 80f + movl -4(%rdi,%rdx),%r8d + movl -4(%rsi,%rdx),%r9d cmpl %r8d,%r9d - jne 1f + jne 10040804f ret 100204: cmpb $2,%dl jl 100001f - movzwl (%rsi),%r8d - movzwl (%rdi),%r9d + movzwl (%rdi),%r8d + movzwl (%rsi),%r9d cmpl %r8d,%r9d jne 1f - movzwl -2(%rsi,%rdx),%r8d - movzwl -2(%rdi,%rdx),%r9d + movzwl -2(%rdi,%rdx),%r8d + movzwl -2(%rsi,%rdx),%r9d cmpl %r8d,%r9d jne 1f ret 100001: cmpb $1,%dl jl 100000f - movzbl (%rdi),%r8d - movzbl (%rsi),%r9d - cmpb %r8b,%r9b - jne 1f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax 100000: ret ALIGN_TEXT @@ -91,11 +90,11 @@ ALIGN_TEXT movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f movq 8(%rdi),%r8 movq 8(%rsi),%r9 cmpq %r8,%r9 - jne 10163208f + jne 10163208f movq -16(%rdi,%rdx),%r8 movq -16(%rsi,%rdx),%r9 cmpq %r8,%r9 @@ -111,14 +110,14 @@ ALIGN_TEXT movq 8(%rdi),%r9 subq (%rsi),%r8 subq 8(%rsi),%r9 - or %r8,%r9 + orq %r8,%r9 jnz 10320000f movq 16(%rdi),%r8 movq 24(%rdi),%r9 subq 16(%rsi),%r8 subq 24(%rsi),%r9 - or %r8,%r9 + orq %r8,%r9 jnz 10320016f leaq 32(%rdi),%rdi @@ -130,40 +129,57 @@ ALIGN_TEXT jne 10b ret +/* + * Mismatch was found. + * + * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). + */ +ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi 10320000: -/* - * Mismatch was found within a 16 bytes range. The part of the routine - * which calculates it only operates on sizes up to 8 bytes. Find the - * right part. - */ movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 - jne 1f + jne 80f leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT +10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi - jmp 1f + jmp 80f +ALIGN_TEXT 10163208: -10081608: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi + jmp 80f +ALIGN_TEXT +10040804: + leaq -4(%rdi,%rdx),%rdi + leaq -4(%rsi,%rdx),%rsi jmp 1f +ALIGN_TEXT +80: + movl (%rdi),%r8d + movl (%rsi),%r9d + cmpl %r8d,%r9d + jne 1f + leaq 4(%rdi),%rdi + leaq 4(%rsi),%rsi + /* - * Mismatch was found. We have no more than 8 bytes to inspect. + * We have up to 4 bytes to inspect. */ -ALIGN_TEXT 1: movzbl (%rdi),%eax movzbl (%rsi),%r8d @@ -182,31 +198,6 @@ ALIGN_TEXT movzbl 3(%rdi),%eax movzbl 3(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 4(%rdi),%eax - movzbl 4(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 5(%rdi),%eax - movzbl 5(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 6(%rdi),%eax - movzbl 6(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - movzbl 7(%rdi),%eax - movzbl 7(%rsi),%r8d - cmpb %r8b,%al - jne 2f - - xorl %eax,%eax - ret 2: subl %r8d,%eax ret Modified: projects/clang1000-import/lib/libc/stdio/Makefile.inc ============================================================================== --- projects/clang1000-import/lib/libc/stdio/Makefile.inc Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/Makefile.inc Fri Jan 31 19:40:40 2020 (r357350) @@ -48,13 +48,17 @@ MLINKS+=ferror.3 ferror_unlocked.3 \ ferror.3 clearerr.3 ferror.3 clearerr_unlocked.3 \ ferror.3 feof.3 ferror.3 feof_unlocked.3 \ ferror.3 fileno.3 ferror.3 fileno_unlocked.3 -MLINKS+=fflush.3 fpurge.3 +MLINKS+=fflush.3 fflush_unlocked.3 \ + fflush.3 fpurge.3 MLINKS+=fgets.3 gets.3 MLINKS+=fgets.3 gets_s.3 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3 MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3 -MLINKS+=fputs.3 puts.3 -MLINKS+=fread.3 fwrite.3 +MLINKS+=fputs.3 fputs_unlocked.3 \ + fputs.3 puts.3 +MLINKS+=fread.3 fread_unlocked.3 \ + fread.3 fwrite.3 \ + fread.3 fwrite_unlocked.3 MLINKS+=fseek.3 fgetpos.3 fseek.3 fseeko.3 fseek.3 fsetpos.3 fseek.3 ftell.3 \ fseek.3 ftello.3 fseek.3 rewind.3 MLINKS+=funopen.3 fropen.3 funopen.3 fwopen.3 Modified: projects/clang1000-import/lib/libc/stdio/Symbol.map ============================================================================== --- projects/clang1000-import/lib/libc/stdio/Symbol.map Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/Symbol.map Fri Jan 31 19:40:40 2020 (r357350) @@ -172,6 +172,10 @@ FBSD_1.5 { }; FBSD_1.6 { + fflush_unlocked; + fputs_unlocked; + fread_unlocked; + fwrite_unlocked; mkostempsat; }; Modified: projects/clang1000-import/lib/libc/stdio/fflush.3 ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fflush.3 Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fflush.3 Fri Jan 31 19:40:40 2020 (r357350) @@ -32,11 +32,12 @@ .\" @(#)fflush.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 25, 2017 +.Dd January 23, 2020 .Dt FFLUSH 3 .Os .Sh NAME .Nm fflush , +.Nm fflush_unlocked , .Nm fpurge .Nd flush a stream .Sh LIBRARY @@ -46,6 +47,8 @@ .Ft int .Fn fflush "FILE *stream" .Ft int +.Fn fflush_unlocked "FILE *stream" +.Ft int .Fn fpurge "FILE *stream" .Sh DESCRIPTION The function @@ -63,6 +66,16 @@ argument is flushes .Em all open output streams. +.Pp +The +.Fn fflush_unlocked +function is equivalent to +.Fn fflush , +except that the caller is responsible for locking the stream with +.Xr flockfile 3 +before calling it. +This function may be used to avoid the overhead of locking the stream and to +prevent races when multiple threads are operating on the same stream. .Pp The function .Fn fpurge Modified: projects/clang1000-import/lib/libc/stdio/fflush.c ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fflush.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fflush.c Fri Jan 31 19:40:40 2020 (r357350) @@ -100,6 +100,8 @@ __fflush(FILE *fp) return (retval); } +__weak_reference(__fflush, fflush_unlocked); + int __sflush(FILE *fp) { Modified: projects/clang1000-import/lib/libc/stdio/fputc.c ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fputc.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fputc.c Fri Jan 31 19:40:40 2020 (r357350) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include "local.h" #include "libc_private.h" +#undef fputc_unlocked + int fputc(int c, FILE *fp) { Modified: projects/clang1000-import/lib/libc/stdio/fputs.3 ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fputs.3 Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fputs.3 Fri Jan 31 19:40:40 2020 (r357350) @@ -32,11 +32,12 @@ .\" @(#)fputs.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 23, 2020 .Dt FPUTS 3 .Os .Sh NAME .Nm fputs , +.Nm fputs_unlocked , .Nm puts .Nd output a line to a stream .Sh LIBRARY @@ -46,6 +47,8 @@ .Ft int .Fn fputs "const char *str" "FILE *stream" .Ft int +.Fn fputs_unlocked "const char *str" "FILE *stream" +.Ft int .Fn puts "const char *str" .Sh DESCRIPTION The function @@ -57,6 +60,16 @@ to the stream pointed to by .\" The terminating .\" .Dv NUL .\" character is not written. +.Pp +The +.Fn fputs_unlocked +function is equivalent to +.Fn fputs , +except that the caller is responsible for locking the stream with +.Xr flockfile 3 +before calling it. +This function may be used to avoid the overhead of locking the stream and to +prevent races when multiple threads are operating on the same stream. .Pp The function .Fn puts Modified: projects/clang1000-import/lib/libc/stdio/fputs.c ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fputs.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fputs.c Fri Jan 31 19:40:40 2020 (r357350) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); * Write the given string to the given file. */ int -fputs(const char * __restrict s, FILE * __restrict fp) +fputs_unlocked(const char * __restrict s, FILE * __restrict fp) { int retval; struct __suio uio; @@ -61,11 +61,20 @@ fputs(const char * __restrict s, FILE * __restrict fp) uio.uio_resid = iov.iov_len = strlen(s); uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); retval = __sfvwrite(fp, &uio); - FUNLOCKFILE_CANCELSAFE(); if (retval == 0) return (iov.iov_len > INT_MAX ? INT_MAX : iov.iov_len); + return (retval); +} + +int +fputs(const char * __restrict s, FILE * __restrict fp) +{ + int retval; + + FLOCKFILE_CANCELSAFE(fp); + retval = fputs_unlocked(s, fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: projects/clang1000-import/lib/libc/stdio/fread.3 ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fread.3 Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fread.3 Fri Jan 31 19:40:40 2020 (r357350) @@ -32,12 +32,14 @@ .\" @(#)fread.3 8.2 (Berkeley) 3/8/94 .\" $FreeBSD$ .\" -.Dd March 8, 1994 +.Dd January 23, 2020 .Dt FREAD 3 .Os .Sh NAME .Nm fread , -.Nm fwrite +.Nm fread_unlocked , +.Nm fwrite , +.Nm fwrite_unlocked .Nd binary stream input/output .Sh LIBRARY .Lb libc @@ -46,7 +48,11 @@ .Ft size_t .Fn fread "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Ft size_t +.Fn fread_unlocked "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" +.Ft size_t .Fn fwrite "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" +.Ft size_t +.Fn fwrite_unlocked "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Sh DESCRIPTION The function .Fn fread @@ -69,6 +75,21 @@ bytes long, to the stream pointed to by .Fa stream , obtaining them from the location given by .Fa ptr . +.Pp +The +.Fn fread_unlocked +and +.Fn fwrite_unlocked +functions are equivalent to +.Fn fread +and +.Fn fwrite +respectively, except that the caller is responsible for locking the stream +with +.Xr flockfile 3 +before calling them. +These functions may be used to avoid the overhead of locking the stream +and to prevent races when multiple threads are operating on the same stream. .Sh RETURN VALUES The functions .Fn fread Modified: projects/clang1000-import/lib/libc/stdio/fread.c ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fread.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fread.c Fri Jan 31 19:40:40 2020 (r357350) @@ -115,3 +115,5 @@ __fread(void * __restrict buf, size_t size, size_t cou fp->_p += resid; return (count); } + +__weak_reference(__fread, fread_unlocked); Modified: projects/clang1000-import/lib/libc/stdio/fwrite.c ============================================================================== --- projects/clang1000-import/lib/libc/stdio/fwrite.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/fwrite.c Fri Jan 31 19:40:40 2020 (r357350) @@ -52,7 +52,8 @@ __FBSDID("$FreeBSD$"); * Return the number of whole objects written. */ size_t -fwrite(const void * __restrict buf, size_t size, size_t count, FILE * __restrict fp) +fwrite_unlocked(const void * __restrict buf, size_t size, size_t count, + FILE * __restrict fp) { size_t n; struct __suio uio; @@ -84,7 +85,6 @@ fwrite(const void * __restrict buf, size_t size, size_ uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); /* * The usual case is success (__sfvwrite returns 0); @@ -93,6 +93,17 @@ fwrite(const void * __restrict buf, size_t size, size_ */ if (__sfvwrite(fp, &uio) != 0) count = (n - uio.uio_resid) / size; - FUNLOCKFILE_CANCELSAFE(); return (count); +} + +size_t +fwrite(const void * __restrict buf, size_t size, size_t count, + FILE * __restrict fp) +{ + size_t n; + + FLOCKFILE_CANCELSAFE(fp); + n = fwrite_unlocked(buf, size, count, fp); + FUNLOCKFILE_CANCELSAFE(); + return (n); } Modified: projects/clang1000-import/lib/libc/stdio/putc.3 ============================================================================== --- projects/clang1000-import/lib/libc/stdio/putc.3 Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libc/stdio/putc.3 Fri Jan 31 19:40:40 2020 (r357350) @@ -32,11 +32,12 @@ .\" @(#)putc.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 10, 2003 +.Dd January 23, 2020 .Dt PUTC 3 .Os .Sh NAME .Nm fputc , +.Nm fputc_unlocked , .Nm putc , .Nm putc_unlocked , .Nm putchar , @@ -50,6 +51,8 @@ .Ft int .Fn fputc "int c" "FILE *stream" .Ft int +.Fn fputc_unlocked "int c" "FILE *stream" +.Ft int .Fn putc "int c" "FILE *stream" .Ft int .Fn putc_unlocked "int c" "FILE *stream" @@ -97,11 +100,13 @@ to the named output .Fa stream . .Pp The -.Fn putc_unlocked +.Fn fputc_unlocked , +.Fn putc_unlocked , and .Fn putchar_unlocked functions are equivalent to -.Fn putc +.Fn fputc , +.Fn putc , and .Fn putchar respectively, Modified: projects/clang1000-import/lib/libusb/libusb10_hotplug.c ============================================================================== --- projects/clang1000-import/lib/libusb/libusb10_hotplug.c Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/lib/libusb/libusb10_hotplug.c Fri Jan 31 19:40:40 2020 (r357350) @@ -123,8 +123,10 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) { + HOTPLUG_UNLOCK(ctx); continue; + } } else { do_loop = 0; } Modified: projects/clang1000-import/release/arm64/RPI3.conf ============================================================================== --- projects/clang1000-import/release/arm64/RPI3.conf Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/release/arm64/RPI3.conf Fri Jan 31 19:40:40 2020 (r357350) @@ -25,7 +25,9 @@ arm_install_uboot() { UBOOT_FILES="README u-boot.bin" DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \ fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ - start_cd.elf start_db.elf start_x.elf start.elf ${DTB}" + start_cd.elf start_db.elf start_x.elf start.elf \ + fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat start4.elf \ + start4cd.elf start4db.elf start4x.elf ${DTB}" FATMOUNT="${DESTDIR%${KERNEL}}fat" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} Modified: projects/clang1000-import/release/packages/binutils.ucl ============================================================================== --- projects/clang1000-import/release/packages/binutils.ucl Fri Jan 31 19:36:14 2020 (r357349) +++ projects/clang1000-import/release/packages/binutils.ucl Fri Jan 31 19:40:40 2020 (r357350) @@ -15,10 +15,4 @@ licenses = [ GPLv2 ] desc = < Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3132E1FC905 for ; Sat, 1 Feb 2020 17:03:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4890m86gVzz3HVZ; Sat, 1 Feb 2020 17:03:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5B7720E0; Sat, 1 Feb 2020 17:03:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011H3alk026670; Sat, 1 Feb 2020 17:03:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011H3VV8026644; Sat, 1 Feb 2020 17:03:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002011703.011H3VV8026644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Feb 2020 17:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357368 - in projects/clang1000-import: bin/pwait share/man/man4 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/conf sys/dev/tpm s... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: bin/pwait share/man/man4 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/conf sys/dev/tpm sys/geom sys/kern sys/modu... X-SVN-Commit-Revision: 357368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:03:37 -0000 Author: dim Date: Sat Feb 1 17:03:31 2020 New Revision: 357368 URL: https://svnweb.freebsd.org/changeset/base/357368 Log: Merge ^/head r357350 through r357367. Modified: projects/clang1000-import/bin/pwait/pwait.c projects/clang1000-import/share/man/man4/bridge.4 projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c projects/clang1000-import/sys/conf/files.amd64 projects/clang1000-import/sys/conf/kern.mk projects/clang1000-import/sys/conf/kern.post.mk projects/clang1000-import/sys/dev/tpm/tpm_crb.c projects/clang1000-import/sys/geom/geom_disk.c projects/clang1000-import/sys/kern/kern_exec.c projects/clang1000-import/sys/kern/subr_smr.c projects/clang1000-import/sys/kern/vfs_lookup.c projects/clang1000-import/sys/kern/vfs_subr.c projects/clang1000-import/sys/kern/vnode_if.src projects/clang1000-import/sys/modules/tpm/Makefile projects/clang1000-import/sys/net/if_vlan.c projects/clang1000-import/sys/sys/smr.h projects/clang1000-import/sys/sys/vnode.h projects/clang1000-import/sys/ufs/ufs/ufs_vnops.c projects/clang1000-import/sys/vm/vm_mmap.c projects/clang1000-import/tests/sys/net/if_epair.c projects/clang1000-import/tools/uma/smrstress/smrstress.c Directory Properties: projects/clang1000-import/ (props changed) projects/clang1000-import/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/clang1000-import/bin/pwait/pwait.c ============================================================================== --- projects/clang1000-import/bin/pwait/pwait.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/bin/pwait/pwait.c Sat Feb 1 17:03:31 2020 (r357368) @@ -53,7 +53,8 @@ static void usage(void) { - errx(EX_USAGE, "usage: pwait [-t timeout] [-ov] pid ..."); + fprintf(stderr, "usage: pwait [-t timeout] [-ov] pid ...\n"); + exit(EX_USAGE); } /* Modified: projects/clang1000-import/share/man/man4/bridge.4 ============================================================================== --- projects/clang1000-import/share/man/man4/bridge.4 Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/share/man/man4/bridge.4 Sat Feb 1 17:03:31 2020 (r357368) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2017 +.Dd February 01, 2020 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -480,13 +480,6 @@ ifconfig gif0 tunnel 1.2.3.4 5.6.7.8 up ifconfig bridge0 create ifconfig bridge0 addm fxp0 addm gif0 up .Ed -.Pp -Note that -.Fx -6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 have a bug in the EtherIP protocol. -For more details and workaround, see the -.Xr gif 4 -manual page. .Sh SEE ALSO .Xr gif 4 , .Xr ipf 4 , Modified: projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Feb 1 17:03:31 2020 (r357368) @@ -106,7 +106,7 @@ struct zfsvfs { #define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ rms_wunlock(&(zfsvfs)->z_teardown_inactive_lock) -#define ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ rms_wowned(&(zfsvfs)->z_teardown_inactive_lock) /* Modified: projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Feb 1 17:03:31 2020 (r357368) @@ -2437,7 +2437,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds) znode_t *zp; ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); - ASSERT(ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); + ASSERT(ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs)); /* * We already own this, so just update the objset_t, as the one we Modified: projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Feb 1 17:03:31 2020 (r357368) @@ -606,7 +606,7 @@ zfs_znode_dmu_fini(znode_t *zp) { ASSERT(MUTEX_HELD(ZFS_OBJ_MUTEX(zp->z_zfsvfs, zp->z_id)) || zp->z_unlinked || - ZFS_WLOCK_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); + ZFS_TEARDOWN_INACTIVE_WLOCKED(zp->z_zfsvfs)); sa_handle_destroy(zp->z_sa_hdl); zp->z_sa_hdl = NULL; Modified: projects/clang1000-import/sys/conf/files.amd64 ============================================================================== --- projects/clang1000-import/sys/conf/files.amd64 Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/conf/files.amd64 Sat Feb 1 17:03:31 2020 (r357368) @@ -323,8 +323,7 @@ dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/tpm/tpm.c optional tpm dev/tpm/tpm20.c optional tpm -dev/tpm/tpm_crb.c optional tpm acpi \ - compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" +dev/tpm/tpm_crb.c optional tpm acpi dev/tpm/tpm_tis.c optional tpm acpi dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa Modified: projects/clang1000-import/sys/conf/kern.mk ============================================================================== --- projects/clang1000-import/sys/conf/kern.mk Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/conf/kern.mk Sat Feb 1 17:03:31 2020 (r357368) @@ -37,9 +37,6 @@ CWARNEXTRA+= -Wno-error-shift-negative-value .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member .endif -.if ${COMPILER_VERSION} >= 100000 -NO_WINT_IN_BOOL_CONTEXT= -Wno-int-in-bool-context -.endif .endif .if ${COMPILER_TYPE} == "gcc" Modified: projects/clang1000-import/sys/conf/kern.post.mk ============================================================================== --- projects/clang1000-import/sys/conf/kern.post.mk Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/conf/kern.post.mk Sat Feb 1 17:03:31 2020 (r357368) @@ -389,7 +389,7 @@ kernel-cleandepend: .PHONY kernel-tags: @ls .depend.* > /dev/null 2>&1 || \ - { echo "you must make depend first"; exit 1; } + { echo "you must make all first"; exit 1; } sh $S/conf/systags.sh kernel-install: .PHONY Modified: projects/clang1000-import/sys/dev/tpm/tpm_crb.c ============================================================================== --- projects/clang1000-import/sys/dev/tpm/tpm_crb.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/dev/tpm/tpm_crb.c Sat Feb 1 17:03:31 2020 (r357368) @@ -298,7 +298,7 @@ tpmcrb_cancel_cmd(struct tpm_sc *sc) return (false); } - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); return (true); } @@ -330,7 +330,7 @@ tpmcrb_transmit(struct tpm_sc *sc, size_t length) return (EIO); } /* Clear cancellation bit */ - WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); /* Switch device to idle state if necessary */ if (!(RD4(sc, TPM_CRB_CTRL_STS) & TPM_CRB_CTRL_STS_IDLE_BIT)) { Modified: projects/clang1000-import/sys/geom/geom_disk.c ============================================================================== --- projects/clang1000-import/sys/geom/geom_disk.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/geom/geom_disk.c Sat Feb 1 17:03:31 2020 (r357368) @@ -268,7 +268,6 @@ g_disk_ioctl(struct g_provider *pp, u_long cmd, void * { struct disk *dp; struct g_disk_softc *sc; - int error; sc = pp->private; dp = sc->dp; @@ -277,8 +276,7 @@ g_disk_ioctl(struct g_provider *pp, u_long cmd, void * if (dp->d_ioctl == NULL) return (ENOIOCTL); - error = dp->d_ioctl(dp, cmd, data, fflag, td); - return (error); + return (dp->d_ioctl(dp, cmd, data, fflag, td)); } static off_t Modified: projects/clang1000-import/sys/kern/kern_exec.c ============================================================================== --- projects/clang1000-import/sys/kern/kern_exec.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/kern/kern_exec.c Sat Feb 1 17:03:31 2020 (r357368) @@ -870,7 +870,7 @@ interpret: /* Set values passed into the program in registers. */ (*p->p_sysent->sv_setregs)(td, imgp, stack_base); - vfs_mark_atime(imgp->vp, td->td_ucred); + VOP_MMAPPED(imgp->vp); SDT_PROBE1(proc, , , exec__success, args->fname); Modified: projects/clang1000-import/sys/kern/subr_smr.c ============================================================================== --- projects/clang1000-import/sys/kern/subr_smr.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/kern/subr_smr.c Sat Feb 1 17:03:31 2020 (r357368) @@ -195,7 +195,7 @@ smr_advance(smr_t smr) * odd and an observed value of 0 in a particular CPU means * it is not currently in a read section. */ - s = smr->c_shared; + s = zpcpu_get(smr)->c_shared; goal = atomic_fetchadd_int(&s->s_wr_seq, SMR_SEQ_INCR) + SMR_SEQ_INCR; /* @@ -242,16 +242,21 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) */ success = true; critical_enter(); - s = smr->c_shared; + s = zpcpu_get(smr)->c_shared; /* * Acquire barrier loads s_wr_seq after s_rd_seq so that we can not * observe an updated read sequence that is larger than write. */ s_rd_seq = atomic_load_acq_int(&s->s_rd_seq); - s_wr_seq = smr_current(smr); /* + * wr_seq must be loaded prior to any c_seq value so that a stale + * c_seq can only reference time after this wr_seq. + */ + s_wr_seq = atomic_load_acq_int(&s->s_wr_seq); + + /* * Detect whether the goal is valid and has already been observed. * * The goal must be in the range of s_wr_seq >= goal >= s_rd_seq for @@ -335,6 +340,12 @@ smr_poll(smr_t smr, smr_seq_t goal, bool wait) out: critical_exit(); + + /* + * Serialize with smr_advance()/smr_exit(). The caller is now free + * to modify memory as expected. + */ + atomic_thread_fence_acq(); return (success); } Modified: projects/clang1000-import/sys/kern/vfs_lookup.c ============================================================================== --- projects/clang1000-import/sys/kern/vfs_lookup.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/kern/vfs_lookup.c Sat Feb 1 17:03:31 2020 (r357368) @@ -254,7 +254,7 @@ namei_cleanup_cnp(struct componentname *cnp) } static int -namei_handle_root(struct nameidata *ndp, struct vnode **dpp) +namei_handle_root(struct nameidata *ndp, struct vnode **dpp, u_int n) { struct componentname *cnp; @@ -276,7 +276,7 @@ namei_handle_root(struct nameidata *ndp, struct vnode ndp->ni_pathlen--; } *dpp = ndp->ni_rootdir; - vrefact(*dpp); + vrefactn(*dpp, n); return (0); } @@ -395,8 +395,11 @@ namei(struct nameidata *ndp) * Get starting point for the translation. */ FILEDESC_SLOCK(fdp); + /* + * The reference on ni_rootdir is acquired in the block below to avoid + * back-to-back atomics for absolute lookups. + */ ndp->ni_rootdir = fdp->fd_rdir; - vrefact(ndp->ni_rootdir); ndp->ni_topdir = fdp->fd_jdir; /* @@ -412,15 +415,29 @@ namei(struct nameidata *ndp) cnp->cn_nameptr = cnp->cn_pnbuf; if (cnp->cn_pnbuf[0] == '/') { ndp->ni_resflags |= NIRES_ABS; - error = namei_handle_root(ndp, &dp); + error = namei_handle_root(ndp, &dp, 2); + if (error != 0) { + /* + * Simplify error handling, we should almost never be + * here. + */ + vrefact(ndp->ni_rootdir); + } } else { if (ndp->ni_startdir != NULL) { + vrefact(ndp->ni_rootdir); dp = ndp->ni_startdir; startdir_used = 1; } else if (ndp->ni_dirfd == AT_FDCWD) { dp = fdp->fd_cdir; - vrefact(dp); + if (dp == ndp->ni_rootdir) { + vrefactn(dp, 2); + } else { + vrefact(ndp->ni_rootdir); + vrefact(dp); + } } else { + vrefact(ndp->ni_rootdir); rights = ndp->ni_rightsneeded; cap_rights_set(&rights, CAP_LOOKUP); @@ -567,7 +584,7 @@ namei(struct nameidata *ndp) cnp->cn_nameptr = cnp->cn_pnbuf; if (*(cnp->cn_nameptr) == '/') { vrele(dp); - error = namei_handle_root(ndp, &dp); + error = namei_handle_root(ndp, &dp, 1); if (error != 0) goto out; } Modified: projects/clang1000-import/sys/kern/vfs_subr.c ============================================================================== --- projects/clang1000-import/sys/kern/vfs_subr.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/kern/vfs_subr.c Sat Feb 1 17:03:31 2020 (r357368) @@ -3046,6 +3046,19 @@ vrefact(struct vnode *vp) #endif } +void +vrefactn(struct vnode *vp, u_int n) +{ + + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); +#ifdef INVARIANTS + int old = atomic_fetchadd_int(&vp->v_usecount, n); + VNASSERT(old > 0, vp, ("%s: wrong use count %d", __func__, old)); +#else + atomic_add_int(&vp->v_usecount, n); +#endif +} + /* * Return reference count of a vnode. * @@ -5940,23 +5953,6 @@ vfs_read_dirent(struct vop_readdir_args *ap, struct di (*ap->a_cookies)[*ap->a_ncookies] = off; *ap->a_ncookies += 1; return (0); -} - -/* - * Mark for update the access time of the file if the filesystem - * supports VOP_MARKATIME. This functionality is used by execve and - * mmap, so we want to avoid the I/O implied by directly setting - * va_atime for the sake of efficiency. - */ -void -vfs_mark_atime(struct vnode *vp, struct ucred *cred) -{ - struct mount *mp; - - mp = vp->v_mount; - ASSERT_VOP_LOCKED(vp, "vfs_mark_atime"); - if (mp != NULL && (mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) - (void)VOP_MARKATIME(vp); } /* Modified: projects/clang1000-import/sys/kern/vnode_if.src ============================================================================== --- projects/clang1000-import/sys/kern/vnode_if.src Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/kern/vnode_if.src Sat Feb 1 17:03:31 2020 (r357368) @@ -181,9 +181,9 @@ vop_setattr { }; -%% markatime vp L L L +%% mmapped vp L L L -vop_markatime { +vop_mmapped { IN struct vnode *vp; }; Modified: projects/clang1000-import/sys/modules/tpm/Makefile ============================================================================== --- projects/clang1000-import/sys/modules/tpm/Makefile Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/modules/tpm/Makefile Sat Feb 1 17:03:31 2020 (r357368) @@ -11,5 +11,3 @@ SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_i SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include - -CWARNFLAGS.tpm_crb.c+= ${NO_WINT_IN_BOOL_CONTEXT} Modified: projects/clang1000-import/sys/net/if_vlan.c ============================================================================== --- projects/clang1000-import/sys/net/if_vlan.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/net/if_vlan.c Sat Feb 1 17:03:31 2020 (r357368) @@ -921,7 +921,7 @@ vnet_vlan_uninit(const void *unused __unused) if_clone_detach(V_vlan_cloner); } -VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, +VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_vlan_uninit, NULL); #endif Modified: projects/clang1000-import/sys/sys/smr.h ============================================================================== --- projects/clang1000-import/sys/sys/smr.h Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/sys/smr.h Sat Feb 1 17:03:31 2020 (r357368) @@ -70,10 +70,17 @@ struct smr { * Return the current write sequence number. */ static inline smr_seq_t +smr_shared_current(smr_shared_t s) +{ + + return (atomic_load_int(&s->s_wr_seq)); +} + +static inline smr_seq_t smr_current(smr_t smr) { - return (atomic_load_int(&smr->c_shared->s_wr_seq)); + return (smr_shared_current(zpcpu_get(smr)->c_shared)); } /* @@ -106,7 +113,7 @@ smr_enter(smr_t smr) * is detected and handled there. */ /* This is an add because we do not have atomic_store_acq_int */ - atomic_add_acq_int(&smr->c_seq, smr_current(smr)); + atomic_add_acq_int(&smr->c_seq, smr_shared_current(smr->c_shared)); } /* Modified: projects/clang1000-import/sys/sys/vnode.h ============================================================================== --- projects/clang1000-import/sys/sys/vnode.h Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/sys/vnode.h Sat Feb 1 17:03:31 2020 (r357368) @@ -900,6 +900,7 @@ void vrele(struct vnode *vp); void vref(struct vnode *vp); void vrefl(struct vnode *vp); void vrefact(struct vnode *vp); +void vrefactn(struct vnode *vp, u_int n); int vrefcnt(struct vnode *vp); void v_addpollinfo(struct vnode *vp); @@ -936,7 +937,6 @@ void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); int vfs_kqfilter(struct vop_kqfilter_args *); -void vfs_mark_atime(struct vnode *vp, struct ucred *cred); struct dirent; int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); int vfs_emptydir(struct vnode *vp); Modified: projects/clang1000-import/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- projects/clang1000-import/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/ufs/ufs/ufs_vnops.c Sat Feb 1 17:03:31 2020 (r357368) @@ -108,7 +108,7 @@ static vop_getattr_t ufs_getattr; static vop_ioctl_t ufs_ioctl; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *, const char *); -static vop_markatime_t ufs_markatime; +static vop_mmapped_t ufs_mmapped; static vop_mkdir_t ufs_mkdir; static vop_mknod_t ufs_mknod; static vop_open_t ufs_open; @@ -676,19 +676,22 @@ out: } #endif /* UFS_ACL */ -/* - * Mark this file's access time for update for vfs_mark_atime(). This - * is called from execve() and mmap(). - */ static int -ufs_markatime(ap) - struct vop_markatime_args /* { +ufs_mmapped(ap) + struct vop_mmapped_args /* { struct vnode *a_vp; } */ *ap; { - struct inode *ip = VTOI(ap->a_vp); + struct vnode *vp; + struct inode *ip; + struct mount *mp; - UFS_INODE_SET_FLAG_SHARED(ip, IN_ACCESS); + vp = ap->a_vp; + ip = VTOI(vp); + mp = vp->v_mount; + + if ((mp->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) + UFS_INODE_SET_FLAG_SHARED(ip, IN_ACCESS); /* * XXXKIB No UFS_UPDATE(ap->a_vp, 0) there. */ @@ -2741,7 +2744,7 @@ struct vop_vector ufs_vnodeops = { .vop_ioctl = ufs_ioctl, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, - .vop_markatime = ufs_markatime, + .vop_mmapped = ufs_mmapped, .vop_mkdir = ufs_mkdir, .vop_mknod = ufs_mknod, .vop_need_inactive = ufs_need_inactive, @@ -2783,7 +2786,6 @@ struct vop_vector ufs_fifoops = { .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, .vop_kqfilter = ufsfifo_kqfilter, - .vop_markatime = ufs_markatime, .vop_pathconf = ufs_pathconf, .vop_print = ufs_print, .vop_read = VOP_PANIC, Modified: projects/clang1000-import/sys/vm/vm_mmap.c ============================================================================== --- projects/clang1000-import/sys/vm/vm_mmap.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/sys/vm/vm_mmap.c Sat Feb 1 17:03:31 2020 (r357368) @@ -1354,7 +1354,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, *objp = obj; *flagsp = flags; - vfs_mark_atime(vp, cred); + VOP_MMAPPED(vp); done: if (error != 0 && *writecounted) { Modified: projects/clang1000-import/tests/sys/net/if_epair.c ============================================================================== --- projects/clang1000-import/tests/sys/net/if_epair.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/tests/sys/net/if_epair.c Sat Feb 1 17:03:31 2020 (r357368) @@ -25,17 +25,19 @@ * $FreeBSD$ */ +#include #include #include #include -#include #include #include #include +#include #include #include +#include #include @@ -51,7 +53,7 @@ ATF_TC_BODY(params, tc) int s; s = kldload("if_epair"); - if (s != 0) + if (s != 0 && errno != EEXIST) atf_tc_fail("Failed to load if_epair"); s = socket(AF_INET, SOCK_DGRAM, 0); Modified: projects/clang1000-import/tools/uma/smrstress/smrstress.c ============================================================================== --- projects/clang1000-import/tools/uma/smrstress/smrstress.c Sat Feb 1 17:02:26 2020 (r357367) +++ projects/clang1000-import/tools/uma/smrstress/smrstress.c Sat Feb 1 17:03:31 2020 (r357368) @@ -84,7 +84,7 @@ smrs_read(void) /* Wait for the writer to exit. */ while (smrs_completed == 0) { smr_enter(smrs_smr); - cur = (void *)atomic_load_ptr(&smrs_current); + cur = (void *)atomic_load_acq_ptr(&smrs_current); if (cur->generation == -1) smrs_error(cur, "read early: Use after free!\n"); atomic_add_int(&cur->count, 1); @@ -107,6 +107,7 @@ smrs_write(void) for (i = 0; i < smrs_iterations; i++) { cur = uma_zalloc_smr(smrs_zone, M_WAITOK); + atomic_thread_fence_rel(); cur = (void *)atomic_swap_ptr(&smrs_current, (uintptr_t)cur); uma_zfree_smr(smrs_zone, cur); } From owner-svn-src-projects@freebsd.org Sat Feb 1 22:07:41 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B11B22E215 for ; Sat, 1 Feb 2020 22:07:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4897W12T6Sz47xP; Sat, 1 Feb 2020 22:07:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B96D5B88; Sat, 1 Feb 2020 22:07:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011M7fu0005581; Sat, 1 Feb 2020 22:07:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011M7b8K005558; Sat, 1 Feb 2020 22:07:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002012207.011M7b8K005558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Feb 2020 22:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r357390 - in projects/clang1000-import: include lib/libc/stdlib share/man/man4 sys/compat/linux sys/dev/tpm sys/fs/devfs sys/fs/pseudofs sys/fs/tmpfs sys/kern sys/riscv/sifive sys/sys s... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1000-import: include lib/libc/stdlib share/man/man4 sys/compat/linux sys/dev/tpm sys/fs/devfs sys/fs/pseudofs sys/fs/tmpfs sys/kern sys/riscv/sifive sys/sys sys/vm sys/x86/cpufreq sys... X-SVN-Commit-Revision: 357390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 22:07:41 -0000 Author: dim Date: Sat Feb 1 22:07:37 2020 New Revision: 357390 URL: https://svnweb.freebsd.org/changeset/base/357390 Log: Merge ^/head r357368 through r357388. Modified: projects/clang1000-import/include/stdlib.h projects/clang1000-import/lib/libc/stdlib/Symbol.map projects/clang1000-import/lib/libc/stdlib/rand.3 projects/clang1000-import/lib/libc/stdlib/rand.c projects/clang1000-import/lib/libc/stdlib/random.3 projects/clang1000-import/lib/libc/stdlib/random.c projects/clang1000-import/lib/libc/stdlib/random.h projects/clang1000-import/share/man/man4/hwpstate_intel.4 projects/clang1000-import/sys/compat/linux/linux_getcwd.c projects/clang1000-import/sys/dev/tpm/tpm_crb.c projects/clang1000-import/sys/dev/tpm/tpm_tis.c projects/clang1000-import/sys/fs/devfs/devfs_vnops.c projects/clang1000-import/sys/fs/pseudofs/pseudofs_vnops.c projects/clang1000-import/sys/fs/tmpfs/tmpfs_vnops.c projects/clang1000-import/sys/kern/kern_sig.c projects/clang1000-import/sys/kern/vfs_cache.c projects/clang1000-import/sys/kern/vfs_default.c projects/clang1000-import/sys/kern/vnode_if.src projects/clang1000-import/sys/riscv/sifive/fu540_prci.c projects/clang1000-import/sys/sys/syscallsubr.h projects/clang1000-import/sys/sys/vnode.h projects/clang1000-import/sys/vm/vm_page.c projects/clang1000-import/sys/vm/vm_page.h projects/clang1000-import/sys/x86/cpufreq/hwpstate_intel.c projects/clang1000-import/sys/x86/include/specialreg.h projects/clang1000-import/sys/x86/x86/identcpu.c projects/clang1000-import/tests/sys/net/if_epair.c Directory Properties: projects/clang1000-import/ (props changed) Modified: projects/clang1000-import/include/stdlib.h ============================================================================== --- projects/clang1000-import/include/stdlib.h Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/include/stdlib.h Sat Feb 1 22:07:37 2020 (r357390) @@ -73,7 +73,11 @@ typedef struct { #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 -#define RAND_MAX 0x7ffffffd +/* + * I.e., INT_MAX; rand(3) returns a signed integer but must produce output in + * the range [0, RAND_MAX], so half of the possible output range is unused. + */ +#define RAND_MAX 0x7fffffff __BEGIN_DECLS #ifdef _XLOCALE_H_ Modified: projects/clang1000-import/lib/libc/stdlib/Symbol.map ============================================================================== --- projects/clang1000-import/lib/libc/stdlib/Symbol.map Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/lib/libc/stdlib/Symbol.map Sat Feb 1 22:07:37 2020 (r357390) @@ -54,8 +54,6 @@ FBSD_1.0 { radixsort; sradixsort; rand_r; - rand; - srand; srandom; srandomdev; initstate; @@ -125,6 +123,8 @@ FBSD_1.5 { FBSD_1.6 { qsort_s; + rand; + srand; }; FBSDprivate_1.0 { Modified: projects/clang1000-import/lib/libc/stdlib/rand.3 ============================================================================== --- projects/clang1000-import/lib/libc/stdlib/rand.3 Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/lib/libc/stdlib/rand.3 Sat Feb 1 22:07:37 2020 (r357390) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 14, 2019 +.Dd February 1, 2020 .Dt RAND 3 .Os .Sh NAME @@ -59,49 +59,52 @@ Applications which require unpredictable random number instead. .Ef .Pp -These interfaces are obsoleted by -.Xr random 3 . -.Pp The .Fn rand function computes a sequence of pseudo-random integers in the range of 0 to -.Dv RAND_MAX -(as defined by the header file -.In stdlib.h ) . +.Dv RAND_MAX , +inclusive. .Pp The .Fn srand -function sets its argument +function seeds the algorithm with the .Fa seed -as the seed for a new sequence of -pseudo-random numbers to be returned by -.Fn rand . -These sequences are repeatable by calling +parameter. +Repeatable sequences of +.Fn rand +output may be obtained by calling .Fn srand -with the same seed value. +with the same +.Fa seed . +.Fn rand +is implicitly initialized as if +.Fn srand "1" +had been invoked explicitly. .Pp -If no -.Fa seed -value is provided, the functions are automatically -seeded with a value of 1. -.Pp -The +In +.Fx 13 , +.Fn rand +is implemented using the same 128-byte state LFSR generator algorithm as +.Xr random 3 . +However, the legacy .Fn rand_r -function -provides the same functionality as -.Fn rand . -A pointer to the context value -.Fa ctx -must be supplied by the caller. -.Pp -For better generator quality, use -.Xr random 3 -or -.Xr lrand48 3 . +function is not (and can not be, because of its limited +.Fa *ctx +size). +.Fn rand_r +implements the historical, poor-quality Park-Miller 32-bit LCG and should not +be used in new designs. +.Sh IMPLEMENTATION NOTES +Since +.Fx 13 , +.Fn rand +is implemented with the same generator as +.Xr random 3 , +so the low-order bits should no longer be significantly worse than the +high-order bits. .Sh SEE ALSO .Xr arc4random 3 , -.Xr lrand48 3 , .Xr random 3 , .Xr random 4 .Sh STANDARDS @@ -115,5 +118,32 @@ conform to .Pp The .Fn rand_r -function is marked as obsolescent in POSIX and may be removed in a future -revision of the standard. +function is not part of +.St -isoC +and is marked obsolescent in +.St -p1003.1-2008 . +It may be removed in a future revision of POSIX. +.Sh CAVEATS +Prior to +.Fx 13 , +.Fn rand +used the historical Park-Miller generator with 32 bits of state and produced +poor quality output, especially in the lower bits. +.Fn rand +in earlier versions of +.Fx , +as well as other standards-conforming implementations, may continue to produce +poor quality output. +.Pp +.Em These functions should not be used in portable applications that want a +.Em high quality or high performance pseudorandom number generator . +One possible replacement, +.Xr random 3 , +is portable to Linux — but it is not especially fast, nor standardized. +.Pp +If broader portability or better performance is desired, any of the widely +available and permissively licensed SFC64/32, JSF64/32, PCG64/32, or SplitMix64 +algorithm implementations may be embedded in your application. +These algorithms have the benefit of requiring less space than +.Xr random 3 +and being quite fast (in header inline implementations). Modified: projects/clang1000-import/lib/libc/stdlib/rand.c ============================================================================== --- projects/clang1000-import/lib/libc/stdlib/rand.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/lib/libc/stdlib/rand.c Sat Feb 1 22:07:37 2020 (r357390) @@ -40,11 +40,60 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include #include "un-namespace.h" +#include "random.h" + +/* + * Implement rand(3), the standard C PRNG API, using the non-standard but + * higher quality random(3) implementation and the same size 128-byte state + * LFSR as the random(3) default. + * + * It turns out there are portable applications that want a PRNG but are too + * lazy to use better-but-nonstandard interfaces like random(3), when + * available, and too lazy to import higher-quality and faster PRNGs into their + * codebase (such as any of SFC, JSF, 128-bit LCGs, PCG, or Splitmix64). + * + * Since we're stuck with rand(3) due to the C standard, we can at least have + * it produce a relatively good PRNG sequence using our existing random(3) + * LFSR. The random(3) design is not particularly fast nor compact, but it has + * the advantage of being the one already in the tree. + */ +static struct __random_state *rand3_state; + +static void +initialize_rand3(void) +{ + int error; + + rand3_state = allocatestate(TYPE_3); + error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3); + assert(error == 0); +} + +int +rand(void) +{ + if (rand3_state == NULL) + initialize_rand3(); + return ((int)random_r(rand3_state)); +} + +void +srand(unsigned seed) +{ + if (rand3_state == NULL) + initialize_rand3(); + srandom_r(rand3_state, seed); +} + +/* + * FreeBSD 12 and prior compatibility implementation of rand(3). + */ static int do_rand(unsigned long *ctx) { @@ -71,7 +120,9 @@ do_rand(unsigned long *ctx) return (x); } - +/* + * Can't fix this garbage; too little state. + */ int rand_r(unsigned *ctx) { @@ -84,21 +135,23 @@ rand_r(unsigned *ctx) return (r); } - static u_long next = 1; +int __rand_fbsd12(void); int -rand(void) +__rand_fbsd12(void) { return (do_rand(&next)); } +__sym_compat(rand, __rand_fbsd12, FBSD_1.0); +void __srand_fbsd12(unsigned seed); void -srand(unsigned seed) +__srand_fbsd12(unsigned seed) { next = seed; } - +__sym_compat(srand, __srand_fbsd12, FBSD_1.0); void __sranddev_fbsd12(void); void Modified: projects/clang1000-import/lib/libc/stdlib/random.3 ============================================================================== --- projects/clang1000-import/lib/libc/stdlib/random.3 Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/lib/libc/stdlib/random.3 Sat Feb 1 22:07:37 2020 (r357390) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 20, 2020 +.Dd February 1, 2020 .Dt RANDOM 3 .Os .Sh NAME @@ -74,8 +74,7 @@ The period of this random number generator is very lar .Pp If initialized with less than 32 bytes of state, .Fn random -uses the same poor-quality Park-Miller LCG as -.Xr rand 3 . +uses the poor-quality 32-bit Park-Miller LCG. .Pp The .Fn random @@ -85,9 +84,6 @@ functions are analagous to .Xr rand 3 and .Xr srand 3 . -The difference is that -.Xr rand 3 -is a worse pseudo-random number generator. .Pp Like .Xr rand 3 , Modified: projects/clang1000-import/lib/libc/stdlib/random.c ============================================================================== --- projects/clang1000-import/lib/libc/stdlib/random.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/lib/libc/stdlib/random.c Sat Feb 1 22:07:37 2020 (r357390) @@ -104,48 +104,13 @@ __FBSDID("$FreeBSD$"); * byte buffer it is about 5 percent faster. */ -/* - * For each of the currently supported random number generators, we have a - * break value on the amount of state information (you need at least this - * many bytes of state info to support this random number generator), a degree - * for the polynomial (actually a trinomial) that the R.N.G. is based on, and - * the separation between the two lower order coefficients of the trinomial. - */ -#define TYPE_0 0 /* linear congruential */ -#define BREAK_0 8 -#define DEG_0 0 -#define SEP_0 0 - -#define TYPE_1 1 /* x**7 + x**3 + 1 */ -#define BREAK_1 32 -#define DEG_1 7 -#define SEP_1 3 - -#define TYPE_2 2 /* x**15 + x + 1 */ -#define BREAK_2 64 -#define DEG_2 15 -#define SEP_2 1 - -#define TYPE_3 3 /* x**31 + x**3 + 1 */ -#define BREAK_3 128 -#define DEG_3 31 -#define SEP_3 3 - -#define TYPE_4 4 /* x**63 + x + 1 */ -#define BREAK_4 256 -#define DEG_4 63 -#define SEP_4 1 - -/* - * Array versions of the above information to make code run faster -- - * relies on fact that TYPE_i == i. - */ -#define MAX_TYPES 5 /* max number of types above */ - #define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; -static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; +static const int seps[MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; +static const int breaks[MAX_TYPES] = { + BREAK_0, BREAK_1, BREAK_2, BREAK_3, BREAK_4 +}; /* * Initially, everything is set up as if from: @@ -523,4 +488,20 @@ long random(void) { return (random_r(&implicit)); +} + +struct __random_state * +allocatestate(unsigned type) +{ + size_t asize; + + /* No point using this interface to get the Park-Miller LCG. */ + if (type < TYPE_1) + abort(); + /* Clamp to widest supported variant. */ + if (type > (MAX_TYPES - 1)) + type = (MAX_TYPES - 1); + + asize = sizeof(struct __random_state) + (size_t)breaks[type]; + return (malloc(asize)); } Modified: projects/clang1000-import/lib/libc/stdlib/random.h ============================================================================== --- projects/clang1000-import/lib/libc/stdlib/random.h Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/lib/libc/stdlib/random.h Sat Feb 1 22:07:37 2020 (r357390) @@ -27,6 +27,44 @@ #pragma once +/* + * For each of the currently supported random number generators, we have a + * break value on the amount of state information (you need at least this + * many bytes of state info to support this random number generator), a degree + * for the polynomial (actually a trinomial) that the R.N.G. is based on, and + * the separation between the two lower order coefficients of the trinomial. + */ +#define TYPE_0 0 /* linear congruential */ +#define BREAK_0 8 +#define DEG_0 0 +#define SEP_0 0 + +#define TYPE_1 1 /* x**7 + x**3 + 1 */ +#define BREAK_1 32 +#define DEG_1 7 +#define SEP_1 3 + +#define TYPE_2 2 /* x**15 + x + 1 */ +#define BREAK_2 64 +#define DEG_2 15 +#define SEP_2 1 + +#define TYPE_3 3 /* x**31 + x**3 + 1 */ +#define BREAK_3 128 +#define DEG_3 31 +#define SEP_3 3 + +#define TYPE_4 4 /* x**63 + x + 1 */ +#define BREAK_4 256 +#define DEG_4 63 +#define SEP_4 1 + +/* + * Array versions of the above information to make code run faster -- + * relies on fact that TYPE_i == i. + */ +#define MAX_TYPES 5 /* max number of types above */ + /* A full instance of the random(3) generator. */ struct __random_state { uint32_t *rst_fptr; @@ -40,6 +78,7 @@ struct __random_state { uint32_t rst_randtbl[]; }; +struct __random_state *allocatestate(unsigned type); int initstate_r(struct __random_state *, unsigned, uint32_t *, size_t); long random_r(struct __random_state *); void srandom_r(struct __random_state *, unsigned); Modified: projects/clang1000-import/share/man/man4/hwpstate_intel.4 ============================================================================== --- projects/clang1000-import/share/man/man4/hwpstate_intel.4 Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/share/man/man4/hwpstate_intel.4 Sat Feb 1 22:07:37 2020 (r357390) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2020 +.Dd February 1, 2020 .Dt HWPSTATE_INTEL 4 .Os .Sh NAME @@ -49,7 +49,15 @@ Can be used to disable .Nm , allowing other compatible drivers to manage performance states, like .Xr est 4 . -.Pq default 0 +Defaults to +.Dv Qq 0 +(enabled). +.It Va machdep.hwpstate_pkg_ctrl +Selects between package-level control (the default) and per-core control. +.Dv Qq 1 +selects package-level control and +.Dv Qq 0 +selects core-level control. .El .Sh SYSCTL VARIABLES The following Modified: projects/clang1000-import/sys/compat/linux/linux_getcwd.c ============================================================================== --- projects/clang1000-import/sys/compat/linux/linux_getcwd.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/compat/linux/linux_getcwd.c Sat Feb 1 22:07:37 2020 (r357390) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -60,28 +60,25 @@ __FBSDID("$FreeBSD$"); * Find pathname of process's current directory. */ int -linux_getcwd(struct thread *td, struct linux_getcwd_args *args) +linux_getcwd(struct thread *td, struct linux_getcwd_args *uap) { - char *path; - int error, lenused; + char *buf, *retbuf; + size_t buflen; + int error; - /* - * Linux returns ERANGE instead of EINVAL. - */ - if (args->bufsize < 2) + buflen = uap->bufsize; + if (__predict_false(buflen < 2)) return (ERANGE); + if (buflen > LINUX_PATH_MAX) + buflen = LINUX_PATH_MAX; - path = malloc(LINUX_PATH_MAX, M_LINUX, M_WAITOK); - - error = kern___getcwd(td, path, UIO_SYSSPACE, args->bufsize, - LINUX_PATH_MAX); + buf = malloc(buflen, M_TEMP, M_WAITOK); + error = vn_getcwd(td, buf, &retbuf, &buflen); if (error == 0) { - lenused = strlen(path) + 1; - error = copyout(path, args->buf, lenused); + error = copyout(retbuf, uap->buf, buflen); if (error == 0) - td->td_retval[0] = lenused; + td->td_retval[0] = buflen; } - - free(path, M_LINUX); + free(buf, M_TEMP); return (error); } Modified: projects/clang1000-import/sys/dev/tpm/tpm_crb.c ============================================================================== --- projects/clang1000-import/sys/dev/tpm/tpm_crb.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/dev/tpm/tpm_crb.c Sat Feb 1 22:07:37 2020 (r357390) @@ -70,7 +70,8 @@ __FBSDID("$FreeBSD$"); #define TPM_CRB_CTRL_STS_ERR_BIT BIT(0) #define TPM_CRB_CTRL_STS_IDLE_BIT BIT(1) -#define TPM_CRB_CTRL_CANCEL_CMD BIT(0) +#define TPM_CRB_CTRL_CANCEL_CMD 0x1 +#define TPM_CRB_CTRL_CANCEL_CLEAR 0x0 #define TPM_CRB_CTRL_START_CMD BIT(0) @@ -298,7 +299,7 @@ tpmcrb_cancel_cmd(struct tpm_sc *sc) return (false); } - WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR; return (true); } @@ -330,7 +331,7 @@ tpmcrb_transmit(struct tpm_sc *sc, size_t length) return (EIO); } /* Clear cancellation bit */ - WR4(sc, TPM_CRB_CTRL_CANCEL, ~TPM_CRB_CTRL_CANCEL_CMD); + WR4(sc, TPM_CRB_CTRL_CANCEL, TPM_CRB_CTRL_CANCEL_CLEAR; /* Switch device to idle state if necessary */ if (!(RD4(sc, TPM_CRB_CTRL_STS) & TPM_CRB_CTRL_STS_IDLE_BIT)) { Modified: projects/clang1000-import/sys/dev/tpm/tpm_tis.c ============================================================================== --- projects/clang1000-import/sys/dev/tpm/tpm_tis.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/dev/tpm/tpm_tis.c Sat Feb 1 22:07:37 2020 (r357390) @@ -386,12 +386,11 @@ tpmtis_go_ready(struct tpm_sc *sc) mask = TPM_STS_CMD_RDY; sc->intr_type = TPM_INT_STS_CMD_RDY; - OR4(sc, TPM_STS, TPM_STS_CMD_RDY); + WR4(sc, TPM_STS, TPM_STS_CMD_RDY); bus_barrier(sc->mem_res, TPM_STS, 4, BUS_SPACE_BARRIER_WRITE); if (!tpm_wait_for_u32(sc, TPM_STS, mask, mask, TPM_TIMEOUT_B)) return (false); - AND4(sc, TPM_STS, ~TPM_STS_CMD_RDY); return (true); } Modified: projects/clang1000-import/sys/fs/devfs/devfs_vnops.c ============================================================================== --- projects/clang1000-import/sys/fs/devfs/devfs_vnops.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/fs/devfs/devfs_vnops.c Sat Feb 1 22:07:37 2020 (r357390) @@ -274,7 +274,7 @@ devfs_vptocnp(struct vop_vptocnp_args *ap) struct vnode **dvp = ap->a_vpp; struct devfs_mount *dmp; char *buf = ap->a_buf; - int *buflen = ap->a_buflen; + size_t *buflen = ap->a_buflen; struct devfs_dirent *dd, *de; int i, error; Modified: projects/clang1000-import/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- projects/clang1000-import/sys/fs/pseudofs/pseudofs_vnops.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/fs/pseudofs/pseudofs_vnops.c Sat Feb 1 22:07:37 2020 (r357390) @@ -377,7 +377,7 @@ pfs_vptocnp(struct vop_vptocnp_args *ap) struct pfs_node *pn; struct mount *mp; char *buf = ap->a_buf; - int *buflen = ap->a_buflen; + size_t *buflen = ap->a_buflen; char pidbuf[PFS_NAMELEN]; pid_t pid = pvd->pvd_pid; int len, i, error, locked; Modified: projects/clang1000-import/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- projects/clang1000-import/sys/fs/tmpfs/tmpfs_vnops.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/fs/tmpfs/tmpfs_vnops.c Sat Feb 1 22:07:37 2020 (r357390) @@ -1491,7 +1491,7 @@ tmpfs_vptocnp_dir(struct tmpfs_node *tn, struct tmpfs_ static int tmpfs_vptocnp_fill(struct vnode *vp, struct tmpfs_node *tn, - struct tmpfs_node *tnp, char *buf, int *buflen, struct vnode **dvp) + struct tmpfs_node *tnp, char *buf, size_t *buflen, struct vnode **dvp) { struct tmpfs_dirent *de; int error, i; @@ -1531,7 +1531,7 @@ tmpfs_vptocnp(struct vop_vptocnp_args *ap) struct tmpfs_dirent *de; struct tmpfs_mount *tm; char *buf; - int *buflen; + size_t *buflen; int error; vp = ap->a_vp; Modified: projects/clang1000-import/sys/kern/kern_sig.c ============================================================================== --- projects/clang1000-import/sys/kern/kern_sig.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/kern/kern_sig.c Sat Feb 1 22:07:37 2020 (r357390) @@ -3608,6 +3608,7 @@ coredump(struct thread *td) struct vnode *vp; struct flock lf; struct vattr vattr; + size_t fullpathsize; int error, error1, locked; char *name; /* name of corefile */ void *rl_cookie; @@ -3711,13 +3712,14 @@ coredump(struct thread *td) * if the path of the core is relative, add the current dir in front if it. */ if (name[0] != '/') { - fullpath = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - if (kern___getcwd(td, fullpath, UIO_SYSSPACE, MAXPATHLEN, MAXPATHLEN) != 0) { - free(fullpath, M_TEMP); + fullpathsize = MAXPATHLEN; + freepath = malloc(fullpathsize, M_TEMP, M_WAITOK); + if (vn_getcwd(td, freepath, &fullpath, &fullpathsize) != 0) { + free(freepath, M_TEMP); goto out2; } devctl_safe_quote_sb(sb, fullpath); - free(fullpath, M_TEMP); + free(freepath, M_TEMP); sbuf_putc(sb, '/'); } devctl_safe_quote_sb(sb, name); Modified: projects/clang1000-import/sys/kern/vfs_cache.c ============================================================================== --- projects/clang1000-import/sys/kern/vfs_cache.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/kern/vfs_cache.c Sat Feb 1 22:07:37 2020 (r357390) @@ -364,7 +364,7 @@ STATNODE_COUNTER(numposhits, "Number of cache hits (po STATNODE_COUNTER(numnegzaps, "Number of cache hits (negative) we do not want to cache"); STATNODE_COUNTER(numneghits, "Number of cache hits (negative)"); -/* These count for kern___getcwd(), too. */ +/* These count for vn_getcwd(), too. */ STATNODE_COUNTER(numfullpathcalls, "Number of fullpath search calls"); STATNODE_COUNTER(numfullpathfail1, "Number of fullpath search errors (ENOTDIR)"); STATNODE_COUNTER(numfullpathfail2, @@ -388,7 +388,7 @@ STATNODE_COUNTER(shrinking_skipped, static void cache_zap_locked(struct namecache *ncp, bool neg_locked); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, u_int buflen); + char *buf, char **retbuf, size_t *buflen); static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); @@ -2167,39 +2167,35 @@ vfs_cache_lookup(struct vop_lookup_args *ap) return (error); } -/* - * XXX All of these sysctls would probably be more productive dead. - */ -static int __read_mostly disablecwd; -SYSCTL_INT(_debug, OID_AUTO, disablecwd, CTLFLAG_RW, &disablecwd, 0, - "Disable the getcwd syscall"); - /* Implementation of the getcwd syscall. */ int sys___getcwd(struct thread *td, struct __getcwd_args *uap) { + char *buf, *retbuf; + size_t buflen; + int error; - return (kern___getcwd(td, uap->buf, UIO_USERSPACE, uap->buflen, - MAXPATHLEN)); + buflen = uap->buflen; + if (__predict_false(buflen < 2)) + return (EINVAL); + if (buflen > MAXPATHLEN) + buflen = MAXPATHLEN; + + buf = malloc(buflen, M_TEMP, M_WAITOK); + error = vn_getcwd(td, buf, &retbuf, &buflen); + if (error == 0) + error = copyout(retbuf, uap->buf, buflen); + free(buf, M_TEMP); + return (error); } int -kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, size_t buflen, - size_t path_max) +vn_getcwd(struct thread *td, char *buf, char **retbuf, size_t *buflen) { - char *bp, *tmpbuf; struct filedesc *fdp; struct vnode *cdir, *rdir; int error; - if (__predict_false(disablecwd)) - return (ENODEV); - if (__predict_false(buflen < 2)) - return (EINVAL); - if (buflen > path_max) - buflen = path_max; - - tmpbuf = malloc(buflen, M_TEMP, M_WAITOK); fdp = td->td_proc->p_fd; FILEDESC_SLOCK(fdp); cdir = fdp->fd_cdir; @@ -2207,33 +2203,18 @@ kern___getcwd(struct thread *td, char *buf, enum uio_s rdir = fdp->fd_rdir; vrefact(rdir); FILEDESC_SUNLOCK(fdp); - error = vn_fullpath1(td, cdir, rdir, tmpbuf, &bp, buflen); + error = vn_fullpath1(td, cdir, rdir, buf, retbuf, buflen); vrele(rdir); vrele(cdir); - if (!error) { - if (bufseg == UIO_SYSSPACE) - bcopy(bp, buf, strlen(bp) + 1); - else - error = copyout(bp, buf, strlen(bp) + 1); #ifdef KTRACE - if (KTRPOINT(curthread, KTR_NAMEI)) - ktrnamei(bp); + if (KTRPOINT(curthread, KTR_NAMEI) && error == 0) + ktrnamei(*retbuf); #endif - } - free(tmpbuf, M_TEMP); return (error); } /* - * Thus begins the fullpath magic. - */ - -static int __read_mostly disablefullpath; -SYSCTL_INT(_debug, OID_AUTO, disablefullpath, CTLFLAG_RW, &disablefullpath, 0, - "Disable the vn_fullpath function"); - -/* * Retrieve the full filesystem path that correspond to a vnode from the name * cache (if available) */ @@ -2243,20 +2224,20 @@ vn_fullpath(struct thread *td, struct vnode *vn, char char *buf; struct filedesc *fdp; struct vnode *rdir; + size_t buflen; int error; - if (__predict_false(disablefullpath)) - return (ENODEV); if (__predict_false(vn == NULL)) return (EINVAL); - buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + buflen = MAXPATHLEN; + buf = malloc(buflen, M_TEMP, M_WAITOK); fdp = td->td_proc->p_fd; FILEDESC_SLOCK(fdp); rdir = fdp->fd_rdir; vrefact(rdir); FILEDESC_SUNLOCK(fdp); - error = vn_fullpath1(td, vn, rdir, buf, retbuf, MAXPATHLEN); + error = vn_fullpath1(td, vn, rdir, buf, retbuf, &buflen); vrele(rdir); if (!error) @@ -2277,14 +2258,14 @@ vn_fullpath_global(struct thread *td, struct vnode *vn char **retbuf, char **freebuf) { char *buf; + size_t buflen; int error; - if (__predict_false(disablefullpath)) - return (ENODEV); if (__predict_false(vn == NULL)) return (EINVAL); - buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, MAXPATHLEN); + buflen = MAXPATHLEN; + buf = malloc(buflen, M_TEMP, M_WAITOK); + error = vn_fullpath1(td, vn, rootvnode, buf, retbuf, &buflen); if (!error) *freebuf = buf; else @@ -2293,7 +2274,7 @@ vn_fullpath_global(struct thread *td, struct vnode *vn } int -vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, u_int *buflen) +vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, size_t *buflen) { struct vnode *dvp; struct namecache *ncp; @@ -2355,18 +2336,21 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char } /* - * The magic behind kern___getcwd() and vn_fullpath(). + * The magic behind vn_getcwd() and vn_fullpath(). */ static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, u_int buflen) + char *buf, char **retbuf, size_t *len) { int error, slash_prefixed; #ifdef KDTRACE_HOOKS struct vnode *startvp = vp; #endif struct vnode *vp1; + size_t buflen; + buflen = *len; + buflen--; buf[buflen] = '\0'; error = 0; @@ -2457,6 +2441,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, stru SDT_PROBE3(vfs, namecache, fullpath, return, 0, startvp, buf + buflen); *retbuf = buf + buflen; + *len -= buflen; return (0); } @@ -2515,9 +2500,6 @@ vn_commname(struct vnode *vp, char *buf, u_int buflen) * Requires a locked, referenced vnode. * Vnode is re-locked on success or ENODEV, otherwise unlocked. * - * If sysctl debug.disablefullpath is set, ENODEV is returned, - * vnode is left locked and path remain untouched. - * * If vp is a directory, the call to vn_fullpath_global() always succeeds * because it falls back to the ".." lookup if the namecache lookup fails. */ @@ -2531,10 +2513,6 @@ vn_path_to_global_path(struct thread *td, struct vnode int error; ASSERT_VOP_ELOCKED(vp, __func__); - - /* Return ENODEV if sysctl debug.disablefullpath==1 */ - if (__predict_false(disablefullpath)) - return (ENODEV); /* Construct global filesystem path from vp. */ VOP_UNLOCK(vp); Modified: projects/clang1000-import/sys/kern/vfs_default.c ============================================================================== --- projects/clang1000-import/sys/kern/vfs_default.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/kern/vfs_default.c Sat Feb 1 22:07:37 2020 (r357390) @@ -804,7 +804,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) struct vnode **dvp = ap->a_vpp; struct ucred *cred = ap->a_cred; char *buf = ap->a_buf; - int *buflen = ap->a_buflen; + size_t *buflen = ap->a_buflen; char *dirbuf, *cpos; int i, error, eofflag, dirbuflen, flags, locked, len, covered; off_t off; Modified: projects/clang1000-import/sys/kern/vnode_if.src ============================================================================== --- projects/clang1000-import/sys/kern/vnode_if.src Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/kern/vnode_if.src Sat Feb 1 22:07:37 2020 (r357390) @@ -640,7 +640,7 @@ vop_vptocnp { OUT struct vnode **vpp; IN struct ucred *cred; INOUT char *buf; - INOUT int *buflen; + INOUT size_t *buflen; }; Modified: projects/clang1000-import/sys/riscv/sifive/fu540_prci.c ============================================================================== --- projects/clang1000-import/sys/riscv/sifive/fu540_prci.c Sat Feb 1 21:47:34 2020 (r357389) +++ projects/clang1000-import/sys/riscv/sifive/fu540_prci.c Sat Feb 1 22:07:37 2020 (r357390) @@ -45,11 +45,21 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include + +static struct ofw_compat_data compat_data[] = { + { "sifive,aloeprci0", 1 }, + { "sifive,ux00prci0", 1 }, + { "sifive,fu540-c000-prci", 1 }, + { NULL, 0 }, +}; + static struct resource_spec prci_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, RESOURCE_SPEC_END @@ -68,6 +78,7 @@ struct prci_softc { struct prci_clk_pll_sc { struct prci_softc *parent_sc; + uint32_t reg; }; #define PRCI_LOCK(sc) mtx_lock(&(sc)->mtx) @@ -75,17 +86,51 @@ struct prci_clk_pll_sc { #define PRCI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); #define PRCI_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); -#define PRCI_COREPLL 0x4 -#define PRCI_COREPLL_DIVR_MASK 0x3f -#define PRCI_COREPLL_DIVR_SHIFT 0 -#define PRCI_COREPLL_DIVF_MASK 0x7fc0 -#define PRCI_COREPLL_DIVF_SHIFT 6 -#define PRCI_COREPLL_DIVQ_MASK 0x38000 -#define PRCI_COREPLL_DIVQ_SHIFT 15 +#define PRCI_COREPLL_CFG0 0x4 +#define PRCI_DDRPLL_CFG0 0xC +#define PRCI_GEMGXLPLL_CFG0 0x1C +#define PRCI_PLL_DIVR_MASK 0x3f +#define PRCI_PLL_DIVR_SHIFT 0 +#define PRCI_PLL_DIVF_MASK 0x7fc0 +#define PRCI_PLL_DIVF_SHIFT 6 +#define PRCI_PLL_DIVQ_MASK 0x38000 +#define PRCI_PLL_DIVQ_SHIFT 15 + #define PRCI_READ(_sc, _reg) \ bus_space_read_4((_sc)->bst, (_sc)->bsh, (_reg)) +struct prci_pll_def { + uint32_t id; + const char *name; + uint32_t reg; +}; + +#define PLL(_id, _name, _base) \ +{ \ + .id = (_id), \ + .name = (_name), \ + .reg = (_base), \ +} + +/* PLL Clocks */ +struct prci_pll_def pll_clks[] = { + PLL(PRCI_CLK_COREPLL, "coreclk", PRCI_COREPLL_CFG0), + PLL(PRCI_CLK_DDRPLL, "ddrclk", PRCI_DDRPLL_CFG0), + PLL(PRCI_CLK_GEMGXLPLL, "gemgxclk", PRCI_GEMGXLPLL_CFG0), +}; + +/* Fixed divisor clock TLCLK. */ +struct clk_fixed_def tlclk_def = { + .clkdef.id = PRCI_CLK_TLCLK, + .clkdef.name = "prci_tlclk", + .clkdef.parent_names = (const char *[]){"coreclk"}, + .clkdef.parent_cnt = 1, + .clkdef.flags = CLK_NODE_STATIC_STRINGS, + .mult = 1, + .div = 2, +}; + static int prci_clk_pll_init(struct clknode *clk, device_t dev) { @@ -121,11 +166,11 @@ prci_clk_pll_recalc(struct clknode *clk, uint64_t *fre } /* Calculate the PLL output */ - val = PRCI_READ(sc->parent_sc, PRCI_COREPLL); + val = PRCI_READ(sc->parent_sc, sc->reg); - divf = (val & PRCI_COREPLL_DIVF_MASK) >> PRCI_COREPLL_DIVF_SHIFT; - divq = (val & PRCI_COREPLL_DIVQ_MASK) >> PRCI_COREPLL_DIVQ_SHIFT; - divr = (val & PRCI_COREPLL_DIVR_MASK) >> PRCI_COREPLL_DIVR_SHIFT; + divf = (val & PRCI_PLL_DIVF_MASK) >> PRCI_PLL_DIVF_SHIFT; + divq = (val & PRCI_PLL_DIVQ_MASK) >> PRCI_PLL_DIVQ_SHIFT; + divr = (val & PRCI_PLL_DIVR_MASK) >> PRCI_PLL_DIVR_SHIFT; *freq = refclk / (divr + 1) * (2 * (divf + 1)) / (1 << divq); @@ -151,7 +196,7 @@ prci_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "sifive,aloeprci0")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "SiFive FU540 Power Reset Clocking Interrupt"); @@ -160,7 +205,8 @@ prci_probe(device_t dev) } static void -prci_pll_register(struct prci_softc *parent_sc, struct clknode_init_def *clkdef) +prci_pll_register(struct prci_softc *parent_sc, struct clknode_init_def *clkdef, + uint32_t reg) { struct clknode *clk; struct prci_clk_pll_sc *sc; @@ -172,6 +218,7 @@ prci_pll_register(struct prci_softc *parent_sc, struct sc = clknode_get_softc(clk); sc->parent_sc = parent_sc; + sc->reg = reg; clknode_register(parent_sc->clkdom, clk); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***