From nobody Fri Apr 25 17:59:59 2025 X-Original-To: dev-commits-src-main@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 4Zkgbh0s1Bz5tqp0; Fri, 25 Apr 2025 18:00:00 +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 4Zkgbg2fGqz44WH; Fri, 25 Apr 2025 17:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745603999; 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=EDf0FGlYCUElPDsM8XW2YZG9YG3DXXQmr+s676wqmPA=; b=Wv4rOWLjVpwl92scXfbKA9kAjXNFTr6HxhYjQMnbi/swqJSrrasYfTI7qnQaBVxMe1LnxI Jin0cmBMCT18zsu9s1Tul6Z8rpA55uR4Opk9HJERpkMGRfltNhCxAdIx37UtNg5693q+q1 oLZIZn7KSeF34ITlBq2WvgwAzDANFTF9XprpBX6UzwR+ROvbGo9bR+LKmFlPJvps/W3OzO tMZ4b6+/wWepFT+tkjR8FPeNuZDuwNA/Wx1NOJDs2/ljHXiQAR5053O9Odh4p9Bw0OOV6M on9+Fah/SAMNGW4VQ+G1NOSwetcJL9k5c5FGjLTXUJnoQpl/HenmQ8Gk0B6Tiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745603999; a=rsa-sha256; cv=none; b=ReOpFIGfNfO5kF+LjuI3m41ZAZ3lDE073FDtTcu50DpLiGBZsJsJiwNG9nMqc5jr07Oww2 k7EhOWLn0UeY7eVZzP82m7fG10OmsjeZwhZESaqvAAbrKO8lUk6QIm937w93SIR5TaBVSC OEKPkcxvi8iVZCWB5diJcf/PWlZzBq7MOA8/S08GKbF13Qsr7MbXYZ5LBbinOlUBy7ULN8 +3F0xhdo5HOpll72mBAkoA13m0FQb2hSV/JZVbhfJob2r/BzxJ/NtkckduVrB+vGzmPYy3 32TrIyGIQISgBP05bllOpEDbuOfWXpG6/sJkDss+FKcbctNKsQ+ryBAe8zVimg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745603999; 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=EDf0FGlYCUElPDsM8XW2YZG9YG3DXXQmr+s676wqmPA=; b=GXq4cJuSba5pnxjyEMFWfn1u/kupxSL+So9XoqDt55ss2r5aWpOVh6+YkIVNhqslMjyRhV oAvBVhH4c8yo+/VSEmoOCz98UWjn7F30JRm5Y6Cku4giv3vc4b5iFmgJ7VsQ5rPwwEx05w pfN+CP2PIhhYolFwieVVcKXFHMpXdXiQ/dg9HgOaMZv2Y80YfQSES02cyRR7lVy8FFXp3E 3YXWpSOCgC86/5UoSR1cHVnHMoIFR/H+8jAOzwL/bneAQDN8WFRkJS4rI58WEv8KVEvloC 7bzrTeG6PMxwa/pgimtJ5I0AsaZ+Bigc2R17y0lGwG9D46iYDkcUVWG4wPSRPQ== 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 4Zkgbg1xvkzmJ6; Fri, 25 Apr 2025 17:59:59 +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 53PHxxxf048396; Fri, 25 Apr 2025 17:59:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53PHxx7U048393; Fri, 25 Apr 2025 17:59:59 GMT (envelope-from git) Date: Fri, 25 Apr 2025 17:59:59 GMT Message-Id: <202504251759.53PHxx7U048393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 2e47f35be5dc - main - Convert libllvm, libclang and liblldb into private shared libraries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2e47f35be5dc61945afdbd1a70e8fd505c032c94 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2e47f35be5dc61945afdbd1a70e8fd505c032c94 commit 2e47f35be5dc61945afdbd1a70e8fd505c032c94 Author: Dimitry Andric AuthorDate: 2025-04-25 17:56:39 +0000 Commit: Dimitry Andric CommitDate: 2025-04-25 17:56:39 +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 --- 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 d7e1532d2a8c..dc9e0010e309 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -1,7 +1,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 @@ -70,7 +85,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 @@ -158,7 +173,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 @@ -424,27 +441,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 @@ -824,9 +841,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 @@ -844,6 +864,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 \ @@ -1299,6 +1334,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 26edeb966992..a3ff8e367864 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -1,7 +1,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 @@ -744,6 +750,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 @@ -779,8 +798,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 55bbc56eeb8f..e634a72b4f90 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1,8 +1,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 @@ -508,24 +522,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 @@ -539,7 +553,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 @@ -548,37 +562,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 @@ -866,7 +880,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 @@ -891,7 +905,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 @@ -1005,9 +1019,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 @@ -1017,31 +1031,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 @@ -1134,7 +1151,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 @@ -1160,7 +1177,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 @@ -1199,7 +1216,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 @@ -1694,21 +1711,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 b25f551d069b..bd0a0972500d 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -875,6 +875,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 @@ -3677,6 +3686,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 bf9fad4032e2..1e9998061cf6 100644 --- a/usr.bin/clang/Makefile.inc +++ b/usr.bin/clang/Makefile.inc @@ -1,6 +1,8 @@ .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 1c99bd716069..cbad6f2b3fcd 100644 --- a/usr.bin/clang/lld/Makefile +++ b/usr.bin/clang/lld/Makefile @@ -81,9 +81,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 b4d6131d81ab..5042fa1fdf04 100644 --- a/usr.bin/clang/lldb-server/Makefile +++ b/usr.bin/clang/lldb-server/Makefile @@ -22,9 +22,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 4f01b1d8f0e0..452bfd23bfa2 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -15,9 +15,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