From nobody Fri May 09 20:32:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZvLKT1Dbzz5w6qh; Fri, 09 May 2025 20:32:45 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZvLKT0ZSQz3q6N; Fri, 09 May 2025 20:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746822765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k0lQor08ceZDjzYol5VicGwHSvpwFMiRlSH47/HnsK8=; b=Zm/SIH0tfvRtbcC6Rq9Z+HEgwkEFejO4uKL+PRAhm0XkFORw6ZmN2UCU263+mL2MFglDfX FRxcn2vlJUqV+8QNwPu/Ctu0wbF4NRyrr4Zg/CewFbHSgrLQeTrbLuSiLVdk8XIfX1du9h f9A7tFs3Ldt4Y5XMPa9dui7XsTRi0sAaLEGWBhVfWZcMaxhrtGoZVInIPnZDX/BelQlBFf vy32GUq1yc3ESRYd4p8mFjBk/q6PYaA411bAGtHypyEa+xMrQWcAN2LK0Likr1npkguCqK +2ZLXhSz4l12L6EIialOv9WdSkP1ihUm6NO/M9ypw6n7vzGrRcrUI7hzN51qWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746822765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k0lQor08ceZDjzYol5VicGwHSvpwFMiRlSH47/HnsK8=; b=nTNTXhlB9o6nxUasjR9b6nG/srN0/VoYPS3dL3VEQhRyAs7eZ+RAEomUzneTdjsuGzYR98 wWaZD4+hbXEkVLUpYdQxTcb2Q4QzSLjw7CmpGvH4SoCBO5odlA/kHgClrpYSjLXTNt+oRN R9i9SvlgbUF33FcwNg8pyH7JF/pnbtmfofa3bVjJP8GvXImlFBjmAtPjA2tudGP1fOToCY 7HKnlilY3f1/iWNBqcvBfnS1s/cP3zmai7+g9l7sxAxBmZzO1WzJ9GM0hknhWdukZHqUfH IyNxWRBDAUIZM7rGKMc4BmtosOdUE/S9eWg8Bg0cDvwV3/4DPHQMjGsEz7qxAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1746822765; a=rsa-sha256; cv=none; b=rWD5ObR83uok1WyKpmwtQjUsUS7SZGWEWpfAvHAhjSxgjdQLI3OZo37x+e3z5NMumPVfDQ Zn2WK2Ws2D306Xj27W0RztXFcnoQAMrRYpXqLVmB45+pk6kAVK7bWWWM5d6hvVoo64CeCO ThAvKQ5mW+gPEBUksePjtRqumkkoGbs4luUlZr2SfjsN+wL0ia/qyWHEhhCy+tshq6Nsjz yMQSXZWjlHs6Z/RppVdEUrTQAuFgyxDCn34nOZJP6zJ+Dtu9SWD2+gic8NiGU+tacDddFG G0KTUINcSyAf7gP9uCbvb5+HEeSq+z2jWqE4t1Q8wIvRuZMG6kaG79/o+4V9/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZvLKS756Gz1HJ; Fri, 09 May 2025 20:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 549KWiAi073969; Fri, 9 May 2025 20:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 549KWiw2073966; Fri, 9 May 2025 20:32:44 GMT (envelope-from git) Date: Fri, 9 May 2025 20:32:44 GMT Message-Id: <202505092032.549KWiw2073966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a743b3f1a4c5 - stable/14 - Convert libllvm, libclang and liblldb into private shared libraries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a743b3f1a4c538c50236b5322d4c82db08a3d9f2 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a743b3f1a4c538c50236b5322d4c82db08a3d9f2 commit a743b3f1a4c538c50236b5322d4c82db08a3d9f2 Author: Dimitry Andric AuthorDate: 2025-04-25 17:56:39 +0000 Commit: Dimitry Andric CommitDate: 2025-05-09 17:16:18 +0000 Convert libllvm, libclang and liblldb into private shared libraries This allows clang, lld, lldb, and other llvm tools to be linked against these shared libraries, which makes them smaller and avoids duplication. Since these are not quite the same as the shared libraries shipped by the upstream llvm build system, and we do not want to expose the ABI to external programs such as ports, make them private libraries. Note that during the cross-tools stage they are still built as static libraries, so the cross compiler and linker are static binaries, as they have always been. This also requires a depend-cleanup.sh kludge which will be added in a follow-up commit, to ensure binaries are rebuilt against the shared libraries in case of incremental builds. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D49967 (cherry picked from commit 2e47f35be5dc61945afdbd1a70e8fd505c032c94) --- lib/clang/libclang/Makefile | 83 ++++++++++++----- lib/clang/liblldb/Makefile | 23 ++++- lib/clang/libllvm/Makefile | 152 +++++++++++++++++-------------- tools/build/mk/OptionalObsoleteFiles.inc | 10 ++ usr.bin/clang/Makefile.inc | 2 + usr.bin/clang/clang.prog.mk | 12 ++- usr.bin/clang/lld/Makefile | 12 ++- usr.bin/clang/lldb-server/Makefile | 7 +- usr.bin/clang/lldb/Makefile | 7 +- usr.bin/clang/llvm.prog.mk | 8 +- 10 files changed, 211 insertions(+), 105 deletions(-) diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile index 14c3778d514a..5e20b37c1183 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -2,7 +2,22 @@ .include .include "../clang.pre.mk" +.if defined(TOOLS_PREFIX) +# Build static library during cross-tools stage LIB= clang +INTERNALLIB= +.else +PACKAGE= clang +SHLIB_CXX= clang +SHLIB_MAJOR= 19 +PRIVATELIB= +.if ${MACHINE} == "powerpc" +# Work around "relocation R_PPC_GOT16 out of range" errors +PICFLAG= -fPIC +.endif +.endif + +SHARED_CXXFLAGS+= -UPIC # To avoid compile errors CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${OBJTOP}/lib/clang/libllvm @@ -71,7 +86,7 @@ SRCS_MIN+= AST/CommentParser.cpp SRCS_MIN+= AST/CommentSema.cpp SRCS_MIN+= AST/ComparisonCategories.cpp SRCS_MIN+= AST/ComputeDependence.cpp -SRCS_FUL+= AST/DataCollection.cpp +SRCS_MIN+= AST/DataCollection.cpp SRCS_MIN+= AST/Decl.cpp SRCS_MIN+= AST/DeclBase.cpp SRCS_MIN+= AST/DeclCXX.cpp @@ -159,7 +174,9 @@ SRCS_MIN+= AST/VTableBuilder.cpp SRCS_MIN+= ASTMatchers/ASTMatchFinder.cpp SRCS_MIN+= ASTMatchers/ASTMatchersInternal.cpp SRCS_MIN+= ASTMatchers/Dynamic/Diagnostics.cpp +SRCS_MIN+= ASTMatchers/Dynamic/Marshallers.cpp SRCS_MIN+= ASTMatchers/Dynamic/Registry.cpp +SRCS_MIN+= ASTMatchers/Dynamic/VariantValue.cpp SRCS_MIN+= Analysis/AnalysisDeclContext.cpp SRCS_MIN+= Analysis/BodyFarm.cpp SRCS_MIN+= Analysis/CFG.cpp @@ -425,27 +442,27 @@ SRCS_MIN+= ExtractAPI/DeclarationFragments.cpp SRCS_MIN+= ExtractAPI/ExtractAPIConsumer.cpp SRCS_MIN+= ExtractAPI/Serialization/SymbolGraphSerializer.cpp SRCS_MIN+= ExtractAPI/TypedefUnderlyingTypeResolver.cpp -SRCS_EXT+= Format/AffectedRangeManager.cpp -SRCS_EXT+= Format/BreakableToken.cpp -SRCS_EXT+= Format/ContinuationIndenter.cpp -SRCS_EXT+= Format/DefinitionBlockSeparator.cpp -SRCS_EXT+= Format/Format.cpp -SRCS_EXT+= Format/FormatToken.cpp -SRCS_EXT+= Format/FormatTokenLexer.cpp -SRCS_EXT+= Format/IntegerLiteralSeparatorFixer.cpp -SRCS_EXT+= Format/MacroCallReconstructor.cpp -SRCS_EXT+= Format/MacroExpander.cpp +SRCS_MIN+= Format/AffectedRangeManager.cpp +SRCS_MIN+= Format/BreakableToken.cpp +SRCS_MIN+= Format/ContinuationIndenter.cpp +SRCS_MIN+= Format/DefinitionBlockSeparator.cpp +SRCS_MIN+= Format/Format.cpp +SRCS_MIN+= Format/FormatToken.cpp +SRCS_MIN+= Format/FormatTokenLexer.cpp +SRCS_MIN+= Format/IntegerLiteralSeparatorFixer.cpp +SRCS_MIN+= Format/MacroCallReconstructor.cpp +SRCS_MIN+= Format/MacroExpander.cpp SRCS_EXT+= Format/MatchFilePath.cpp -SRCS_EXT+= Format/NamespaceEndCommentsFixer.cpp -SRCS_EXT+= Format/ObjCPropertyAttributeOrderFixer.cpp -SRCS_EXT+= Format/QualifierAlignmentFixer.cpp -SRCS_EXT+= Format/SortJavaScriptImports.cpp -SRCS_EXT+= Format/TokenAnalyzer.cpp -SRCS_EXT+= Format/TokenAnnotator.cpp -SRCS_EXT+= Format/UnwrappedLineFormatter.cpp -SRCS_EXT+= Format/UnwrappedLineParser.cpp -SRCS_EXT+= Format/UsingDeclarationsSorter.cpp -SRCS_EXT+= Format/WhitespaceManager.cpp +SRCS_MIN+= Format/NamespaceEndCommentsFixer.cpp +SRCS_MIN+= Format/ObjCPropertyAttributeOrderFixer.cpp +SRCS_MIN+= Format/QualifierAlignmentFixer.cpp +SRCS_MIN+= Format/SortJavaScriptImports.cpp +SRCS_MIN+= Format/TokenAnalyzer.cpp +SRCS_MIN+= Format/TokenAnnotator.cpp +SRCS_MIN+= Format/UnwrappedLineFormatter.cpp +SRCS_MIN+= Format/UnwrappedLineParser.cpp +SRCS_MIN+= Format/UsingDeclarationsSorter.cpp +SRCS_MIN+= Format/WhitespaceManager.cpp SRCS_MIN+= Frontend/ASTConsumers.cpp SRCS_MIN+= Frontend/ASTMerge.cpp SRCS_MIN+= Frontend/ASTUnit.cpp @@ -825,9 +842,12 @@ SRCS_MIN+= Tooling/ArgumentsAdjusters.cpp SRCS_MIN+= Tooling/CommonOptionsParser.cpp SRCS_MIN+= Tooling/CompilationDatabase.cpp SRCS_MIN+= Tooling/Core/Replacement.cpp +SRCS_MIN+= Tooling/ExpandResponseFilesCompilationDatabase.cpp SRCS_MIN+= Tooling/FileMatchTrie.cpp -SRCS_EXT+= Tooling/Inclusions/HeaderIncludes.cpp -SRCS_EXT+= Tooling/Inclusions/IncludeStyle.cpp +SRCS_MIN+= Tooling/GuessTargetAndModeCompilationDatabase.cpp +SRCS_MIN+= Tooling/Inclusions/HeaderIncludes.cpp +SRCS_MIN+= Tooling/Inclusions/IncludeStyle.cpp +SRCS_MIN+= Tooling/InterpolatingCompilationDatabase.cpp SRCS_MIN+= Tooling/JSONCompilationDatabase.cpp SRCS_MIN+= Tooling/Refactoring.cpp SRCS_MIN+= Tooling/RefactoringCallbacks.cpp @@ -845,6 +865,21 @@ SRCS_ALL+= ${SRCS_LDB} .endif SRCS+= ${SRCS_ALL:O} +LIBDEPS+= llvm + +.if defined(TOOLS_PREFIX) +LIBPRIV= +LIBEXT= a +.else +LIBPRIV= private +LIBEXT= so +.endif + +.for lib in ${LIBDEPS} +DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +.endfor + clang/AST/AbstractBasicReader.inc: \ ${CLANG_SRCS}/include/clang/AST/PropertiesBase.td ${CLANG_TBLGEN} -gen-clang-basic-reader \ @@ -1300,6 +1335,4 @@ CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} .include "../clang.build.mk" -INTERNALLIB= - .include diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile index 48966d7cccf5..408ebc440686 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -2,7 +2,13 @@ .include .include "../lldb.pre.mk" -LIB= lldb +PACKAGE= lldb +SHLIB_CXX= lldb +SHLIB_MAJOR= 19 +PRIVATELIB= + +SHARED_CXXFLAGS+= -UPIC # To avoid compile errors + SRCDIR= lldb/source CFLAGS+= -I${LLDB_SRCS}/include @@ -745,6 +751,19 @@ SRCS+= Utility/VMRange.cpp SRCS+= Utility/XcodeSDK.cpp SRCS+= Version/Version.cpp +LIBDEPS+= clang +LIBDEPS+= llvm + +LIBPRIV= private +LIBEXT= so + +.for lib in ${LIBDEPS} +DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +.endfor + +LIBADD+= kvm + LLDB_TBLGEN?= lldb-tblgen CommandOptions.inc: ${LLDB_SRCS}/source/Commands/Options.td @@ -780,8 +799,6 @@ CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} .include "../clang.build.mk" -INTERNALLIB= - # Building lldb's bindings requires swig, but we do not want to include it in # the FreeBSD base system (as a build tool) because it has non-trivial # dependencies. As a workaround we commit the generated file. Requires the diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 14122e117021..cb16d39961ae 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -2,8 +2,22 @@ .include .include "../llvm.pre.mk" +.if defined(TOOLS_PREFIX) +# Build static library during cross-tools stage LIB= llvm INTERNALLIB= +.else +PACKAGE= clang +SHLIB_CXX= llvm +SHLIB_MAJOR= 19 +PRIVATELIB= +.if ${MACHINE} == "powerpc" +# Work around "relocation R_PPC_GOT16 out of range" errors +PICFLAG= -fPIC +.endif +.endif + +SHARED_CXXFLAGS+= -UPIC # To avoid compile errors CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/lib @@ -509,24 +523,24 @@ SRCS_EXT+= DWP/DWP.cpp SRCS_EXT+= DWP/DWPError.cpp SRCS_MIW+= DebugInfo/BTF/BTFContext.cpp SRCS_MIW+= DebugInfo/BTF/BTFParser.cpp -SRCS_EXT+= DebugInfo/CodeView/AppendingTypeTableBuilder.cpp +SRCS_MIN+= DebugInfo/CodeView/AppendingTypeTableBuilder.cpp SRCS_MIN+= DebugInfo/CodeView/CVSymbolVisitor.cpp SRCS_MIN+= DebugInfo/CodeView/CVTypeVisitor.cpp SRCS_MIN+= DebugInfo/CodeView/CodeViewError.cpp SRCS_MIN+= DebugInfo/CodeView/CodeViewRecordIO.cpp SRCS_MIN+= DebugInfo/CodeView/ContinuationRecordBuilder.cpp SRCS_MIN+= DebugInfo/CodeView/DebugChecksumsSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugCrossExSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugCrossImpSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugCrossExSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugCrossImpSubsection.cpp SRCS_MIN+= DebugInfo/CodeView/DebugFrameDataSubsection.cpp SRCS_MIN+= DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp SRCS_MIN+= DebugInfo/CodeView/DebugLinesSubsection.cpp SRCS_MIN+= DebugInfo/CodeView/DebugStringTableSubsection.cpp -SRCS_MIW+= DebugInfo/CodeView/DebugSubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugSubsectionRecord.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugSubsectionVisitor.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugSymbolRVASubsection.cpp -SRCS_EXT+= DebugInfo/CodeView/DebugSymbolsSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugSubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugSubsectionRecord.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugSubsectionVisitor.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugSymbolRVASubsection.cpp +SRCS_MIN+= DebugInfo/CodeView/DebugSymbolsSubsection.cpp SRCS_MIN+= DebugInfo/CodeView/EnumTables.cpp SRCS_MIN+= DebugInfo/CodeView/Formatters.cpp SRCS_MIN+= DebugInfo/CodeView/GlobalTypeTableBuilder.cpp @@ -540,7 +554,7 @@ SRCS_EXT+= DebugInfo/CodeView/StringsAndChecksums.cpp SRCS_MIN+= DebugInfo/CodeView/SymbolDumper.cpp SRCS_MIN+= DebugInfo/CodeView/SymbolRecordHelpers.cpp SRCS_MIN+= DebugInfo/CodeView/SymbolRecordMapping.cpp -SRCS_EXT+= DebugInfo/CodeView/SymbolSerializer.cpp +SRCS_MIN+= DebugInfo/CodeView/SymbolSerializer.cpp SRCS_MIN+= DebugInfo/CodeView/TypeDumpVisitor.cpp SRCS_MIN+= DebugInfo/CodeView/TypeHashing.cpp SRCS_MIN+= DebugInfo/CodeView/TypeIndex.cpp @@ -549,37 +563,37 @@ SRCS_EXT+= DebugInfo/CodeView/TypeRecordHelpers.cpp SRCS_MIN+= DebugInfo/CodeView/TypeRecordMapping.cpp SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp SRCS_MIN+= DebugInfo/CodeView/TypeTableCollection.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFAddressRange.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDataExtractor.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAddr.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugPubTable.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRnglists.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDie.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFAddressRange.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFCompileUnit.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFContext.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDataExtractor.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugAddr.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugAranges.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugFrame.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugLine.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugLoc.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugMacro.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugPubTable.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugRangeList.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDebugRnglists.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFDie.cpp SRCS_MIN+= DebugInfo/DWARF/DWARFExpression.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFGdbIndex.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFListTable.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFTypePrinter.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFVerifier.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFFormValue.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFGdbIndex.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFListTable.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFTypePrinter.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFTypeUnit.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFUnit.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFUnitIndex.cpp +SRCS_MIN+= DebugInfo/DWARF/DWARFVerifier.cpp SRCS_MIN+= DebugInfo/MSF/MSFBuilder.cpp SRCS_MIN+= DebugInfo/MSF/MSFCommon.cpp -SRCS_EXT+= DebugInfo/MSF/MSFError.cpp +SRCS_MIN+= DebugInfo/MSF/MSFError.cpp SRCS_MIN+= DebugInfo/MSF/MappedBlockStream.cpp SRCS_EXT+= DebugInfo/PDB/GenericError.cpp SRCS_EXT+= DebugInfo/PDB/IPDBSourceFile.cpp @@ -867,7 +881,7 @@ SRCS_MIN+= LTO/LTO.cpp SRCS_MIN+= LTO/LTOBackend.cpp SRCS_EXL+= LTO/LTOCodeGenerator.cpp SRCS_EXL+= LTO/LTOModule.cpp -SRCS_EXL+= LTO/SummaryBasedOptimizations.cpp +SRCS_MIN+= LTO/SummaryBasedOptimizations.cpp SRCS_EXL+= LTO/ThinLTOCodeGenerator.cpp SRCS_MIN+= LTO/UpdateCompilerUsed.cpp SRCS_MIN+= Linker/IRMover.cpp @@ -892,7 +906,7 @@ SRCS_MIN+= MC/MCContext.cpp SRCS_MIN+= MC/MCDXContainerStreamer.cpp SRCS_MIN+= MC/MCDXContainerWriter.cpp SRCS_XDL+= MC/MCDisassembler/Disassembler.cpp -SRCS_XDW+= MC/MCDisassembler/MCDisassembler.cpp +SRCS_MIN+= MC/MCDisassembler/MCDisassembler.cpp SRCS_XDW+= MC/MCDisassembler/MCExternalSymbolizer.cpp SRCS_MIN+= MC/MCDisassembler/MCRelocationInfo.cpp SRCS_XDW+= MC/MCDisassembler/MCSymbolizer.cpp @@ -1006,9 +1020,9 @@ SRCS_MIW+= ObjCopy/wasm/WasmWriter.cpp SRCS_MIN+= Object/Archive.cpp SRCS_MIN+= Object/ArchiveWriter.cpp SRCS_MIN+= Object/Binary.cpp -SRCS_MIW+= Object/BuildID.cpp +SRCS_MIN+= Object/BuildID.cpp SRCS_MIN+= Object/COFFImportFile.cpp -SRCS_MIW+= Object/COFFModuleDefinition.cpp +SRCS_MIN+= Object/COFFModuleDefinition.cpp SRCS_MIN+= Object/COFFObjectFile.cpp SRCS_MIN+= Object/Decompressor.cpp SRCS_MIN+= Object/ELF.cpp @@ -1018,31 +1032,34 @@ SRCS_MIW+= Object/FaultMapParser.cpp SRCS_MIN+= Object/IRObjectFile.cpp SRCS_MIN+= Object/IRSymtab.cpp SRCS_MIN+= Object/MachOObjectFile.cpp -SRCS_MIW+= Object/MachOUniversal.cpp +SRCS_MIN+= Object/MachOUniversal.cpp SRCS_MIW+= Object/MachOUniversalWriter.cpp -SRCS_MIW+= Object/Minidump.cpp +SRCS_MIN+= Object/Minidump.cpp SRCS_MIN+= Object/ModuleSymbolTable.cpp SRCS_EXT+= Object/Object.cpp SRCS_MIN+= Object/ObjectFile.cpp -SRCS_MIW+= Object/OffloadBinary.cpp +SRCS_MIN+= Object/OffloadBinary.cpp SRCS_MIN+= Object/RecordStreamer.cpp -SRCS_MIW+= Object/RelocationResolver.cpp +SRCS_MIN+= Object/RelocationResolver.cpp SRCS_MIW+= Object/SymbolSize.cpp SRCS_MIN+= Object/SymbolicFile.cpp -SRCS_MIW+= Object/TapiFile.cpp -SRCS_MIW+= Object/TapiUniversal.cpp +SRCS_MIN+= Object/TapiFile.cpp +SRCS_MIN+= Object/TapiUniversal.cpp SRCS_MIN+= Object/WasmObjectFile.cpp SRCS_MIW+= Object/WindowsMachineFlag.cpp SRCS_MIN+= Object/WindowsResource.cpp SRCS_MIN+= Object/XCOFFObjectFile.cpp SRCS_MIN+= ObjectYAML/COFFYAML.cpp -SRCS_EXT+= ObjectYAML/CodeViewYAMLDebugSections.cpp -SRCS_EXT+= ObjectYAML/CodeViewYAMLSymbols.cpp -SRCS_EXT+= ObjectYAML/CodeViewYAMLTypes.cpp +SRCS_MIN+= ObjectYAML/CodeViewYAMLDebugSections.cpp +SRCS_MIN+= ObjectYAML/CodeViewYAMLSymbols.cpp +SRCS_MIN+= ObjectYAML/CodeViewYAMLTypeHashing.cpp +SRCS_MIN+= ObjectYAML/CodeViewYAMLTypes.cpp +SRCS_MIN+= ObjectYAML/DWARFEmitter.cpp SRCS_MIN+= ObjectYAML/DWARFYAML.cpp +SRCS_MIN+= ObjectYAML/ELFEmitter.cpp SRCS_MIN+= ObjectYAML/ELFYAML.cpp SRCS_MIN+= ObjectYAML/MachOYAML.cpp -SRCS_EXT+= ObjectYAML/YAML.cpp +SRCS_MIN+= ObjectYAML/YAML.cpp SRCS_MIN+= Option/Arg.cpp SRCS_MIN+= Option/ArgList.cpp SRCS_MIN+= Option/OptTable.cpp @@ -1135,7 +1152,7 @@ SRCS_MIN+= Support/ErrorHandling.cpp SRCS_MIN+= Support/ExponentialBackoff.cpp SRCS_MIN+= Support/ExtensibleRTTI.cpp SRCS_MIN+= Support/FileCollector.cpp -SRCS_MIW+= Support/FileOutputBuffer.cpp +SRCS_MIN+= Support/FileOutputBuffer.cpp SRCS_MIN+= Support/FileUtilities.cpp SRCS_MIN+= Support/FloatingPointMode.cpp SRCS_MIN+= Support/FoldingSet.cpp @@ -1161,7 +1178,7 @@ SRCS_MIW+= Support/MSP430Attributes.cpp SRCS_MIN+= Support/ManagedStatic.cpp SRCS_MIN+= Support/MathExtras.cpp SRCS_MIN+= Support/MemAlloc.cpp -SRCS_MIW+= Support/Memory.cpp +SRCS_MIN+= Support/Memory.cpp SRCS_MIN+= Support/MemoryBuffer.cpp SRCS_MIN+= Support/MemoryBufferRef.cpp SRCS_MIN+= Support/NativeFormatting.cpp @@ -1200,7 +1217,7 @@ SRCS_MIN+= Support/SuffixTree.cpp SRCS_MIN+= Support/SuffixTreeNode.cpp SRCS_EXT+= Support/SystemUtils.cpp SRCS_LLD+= Support/TarWriter.cpp -SRCS_MIW+= Support/ThreadPool.cpp +SRCS_MIN+= Support/ThreadPool.cpp SRCS_MIN+= Support/Threading.cpp SRCS_MIN+= Support/TimeProfiler.cpp SRCS_MIN+= Support/Timer.cpp @@ -1695,21 +1712,22 @@ SRCS_MIN+= TargetParser/SubtargetFeature.cpp SRCS_MIN+= TargetParser/TargetParser.cpp SRCS_MIN+= TargetParser/Triple.cpp SRCS_MIN+= TargetParser/X86TargetParser.cpp -SRCS_MIW+= TextAPI/Architecture.cpp -SRCS_MIW+= TextAPI/ArchitectureSet.cpp +SRCS_MIN+= TextAPI/Architecture.cpp +SRCS_MIN+= TextAPI/ArchitectureSet.cpp SRCS_MIW+= TextAPI/BinaryReader/DylibReader.cpp -SRCS_MIW+= TextAPI/InterfaceFile.cpp -SRCS_MIW+= TextAPI/PackedVersion.cpp -SRCS_MIW+= TextAPI/Platform.cpp +SRCS_MIN+= TextAPI/InterfaceFile.cpp +SRCS_MIN+= TextAPI/PackedVersion.cpp +SRCS_MIN+= TextAPI/Platform.cpp SRCS_MIW+= TextAPI/RecordVisitor.cpp -SRCS_MIW+= TextAPI/Symbol.cpp -SRCS_MIW+= TextAPI/SymbolSet.cpp -SRCS_MIW+= TextAPI/Target.cpp -SRCS_MIW+= TextAPI/TextAPIError.cpp -SRCS_MIW+= TextAPI/TextStub.cpp -SRCS_MIW+= TextAPI/TextStubCommon.cpp -SRCS_MIW+= TextAPI/TextStubV5.cpp -SRCS_MIW+= TextAPI/Utils.cpp +SRCS_MIW+= TextAPI/RecordsSlice.cpp +SRCS_MIN+= TextAPI/Symbol.cpp +SRCS_MIN+= TextAPI/SymbolSet.cpp +SRCS_MIN+= TextAPI/Target.cpp +SRCS_MIN+= TextAPI/TextAPIError.cpp +SRCS_MIN+= TextAPI/TextStub.cpp +SRCS_MIN+= TextAPI/TextStubCommon.cpp +SRCS_MIN+= TextAPI/TextStubV5.cpp +SRCS_MIN+= TextAPI/Utils.cpp SRCS_MIN+= ToolDrivers/llvm-dlltool/DlltoolDriver.cpp SRCS_MIW+= ToolDrivers/llvm-lib/LibDriver.cpp SRCS_MIN+= Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index b985adbd1e0b..3b8c0c1dff55 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -880,6 +880,15 @@ OLD_FILES+=usr/share/man/man4/ccd.4.gz OLD_FILES+=usr/share/man/man8/ccdconfig.8.gz .endif +.if ${MK_CLANG} == no && ${MK_CLANG_FORMAT} == no && ${MK_LLDB} == no +OLD_LIBS+=usr/lib/libprivateclang.so.19 +.endif + +.if ${MK_CLANG_EXTRAS} == no && ${MK_CLANG} == no && ${MK_LLDB} == no && \ + ${MK_LLD} == no && ${MK_LLVM_BINUTILS} == no && ${MK_LLVM_COV} == no +OLD_LIBS+=usr/lib/libprivatellvm.so.19 +.endif + .if ${MK_CLANG} == no && ${MK_LLVM_BINUTILS} == no OLD_FILES+=usr/bin/llvm-addr2line OLD_FILES+=usr/bin/llvm-ar @@ -3704,6 +3713,7 @@ OLD_FILES+=usr/bin/ld.lld .if ${MK_LLDB} == no OLD_FILES+=usr/bin/lldb OLD_FILES+=usr/bin/lldb-server +OLD_LIBS+=usr/lib/libprivatelldb.so.19 OLD_FILES+=usr/share/man/man1/lldb-server.1.gz OLD_FILES+=usr/share/man/man1/lldb.1.gz .endif diff --git a/usr.bin/clang/Makefile.inc b/usr.bin/clang/Makefile.inc index 99e993b57cb2..68e749ef131d 100644 --- a/usr.bin/clang/Makefile.inc +++ b/usr.bin/clang/Makefile.inc @@ -1,7 +1,9 @@ .include +.if defined(TOOLS_PREFIX) MK_PIE:= no # Explicit libXXX.a references +.endif .if ${MK_LLVM_FULL_DEBUGINFO} == "no" .if ${COMPILER_TYPE} == "clang" diff --git a/usr.bin/clang/clang.prog.mk b/usr.bin/clang/clang.prog.mk index cf48f02359e9..36c601bcbe36 100644 --- a/usr.bin/clang/clang.prog.mk +++ b/usr.bin/clang/clang.prog.mk @@ -18,9 +18,17 @@ LIBADD+= z LIBADD+= zstd .endif +.if defined(TOOLS_PREFIX) +LIBPRIV= +LIBEXT= a +.else +LIBPRIV= private +LIBEXT= so +.endif + .for lib in ${LIBDEPS} -DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} .endfor PACKAGE= clang diff --git a/usr.bin/clang/lld/Makefile b/usr.bin/clang/lld/Makefile index aabccc8805ca..6403835b10b6 100644 --- a/usr.bin/clang/lld/Makefile +++ b/usr.bin/clang/lld/Makefile @@ -82,9 +82,17 @@ SRCS+= tools/lld/lld.cpp LIBDEPS+= llvm +.if defined(TOOLS_PREFIX) +LIBPRIV= +LIBEXT= a +.else +LIBPRIV= private +LIBEXT= so +.endif + .for lib in ${LIBDEPS} -DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} .endfor INCFILE= Options.inc diff --git a/usr.bin/clang/lldb-server/Makefile b/usr.bin/clang/lldb-server/Makefile index 3a16c470fe2b..e51923545956 100644 --- a/usr.bin/clang/lldb-server/Makefile +++ b/usr.bin/clang/lldb-server/Makefile @@ -23,9 +23,12 @@ LIBDEPS+= lldb LIBDEPS+= clang LIBDEPS+= llvm +LIBPRIV= private +LIBEXT= so + .for lib in ${LIBDEPS} -DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} .endfor INCFILE= LLGSOptions.inc diff --git a/usr.bin/clang/lldb/Makefile b/usr.bin/clang/lldb/Makefile index f9c09c8d697b..b7668c03e6e5 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -16,9 +16,12 @@ LIBDEPS+= lldb LIBDEPS+= clang LIBDEPS+= llvm +LIBPRIV= private +LIBEXT= so + .for lib in ${LIBDEPS} -DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} .endfor INCFILE= Options.inc diff --git a/usr.bin/clang/llvm.prog.mk b/usr.bin/clang/llvm.prog.mk index 27a3312726df..f702082e31bd 100644 --- a/usr.bin/clang/llvm.prog.mk +++ b/usr.bin/clang/llvm.prog.mk @@ -10,15 +10,19 @@ CFLAGS+= -I${OBJTOP}/lib/clang/libllvm (${PROG_CXX} == "clang-tblgen" || ${PROG_CXX} == "lldb-tblgen" || \ ${PROG_CXX} == "llvm-min-tblgen" || ${PROG_CXX} == "llvm-tblgen") LIBDEPS+= llvmminimal +LIBPRIV= +LIBEXT= a .else LIBDEPS+= llvm +LIBPRIV= private +LIBEXT= so LIBADD+= z LIBADD+= zstd .endif .for lib in ${LIBDEPS} -DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} +LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} .endfor PACKAGE= clang