Commit 49449f37 authored by brooks's avatar brooks
Browse files

Welcome LLVM 12 (12.0.0rc2) to the tree

Notable *port* changes (vs devel/llvm11):
 - Switch to single llvm-project distfile.  This simplifies the port
   and support for the old style build process is rotting upstream
   after the mono-repo conversion.
 - Disable libedit dependency in libLLVM (still used by LLDB).  This
   is one small step toward a dependency-less clang.
 - LLDB docs are disabled due to issues finding python includes when
   autogenerating API docs.

Sponsored by:	 DARPA
parent 65dcbfe1
...@@ -1421,6 +1421,7 @@ ...@@ -1421,6 +1421,7 @@
SUBDIR += llvm-devel SUBDIR += llvm-devel
SUBDIR += llvm10 SUBDIR += llvm10
SUBDIR += llvm11 SUBDIR += llvm11
SUBDIR += llvm12
SUBDIR += llvm60 SUBDIR += llvm60
SUBDIR += llvm70 SUBDIR += llvm70
SUBDIR += llvm80 SUBDIR += llvm80
......
This diff is collapsed.
# $FreeBSD$
LLVM_COMMANDS= \
bugpoint \
dsymutil \
llc \
lli \
llvm-addr2line \
llvm-ar \
llvm-as \
llvm-bcanalyzer \
llvm-bitcode-strip \
llvm-cat \
llvm-cfi-verify \
llvm-config \
llvm-cov \
llvm-cvtres \
llvm-cxxmap \
llvm-diff \
llvm-dis \
llvm-dlltool \
llvm-dwarfdump \
llvm-dwp \
llvm-elfabi \
llvm-exegesis \
llvm-extract \
llvm-gsymutil \
llvm-ifs \
llvm-install-name-tool \
llvm-jitlink \
llvm-libtool-darwin \
llvm-link \
llvm-lipo \
llvm-mc \
llvm-mca \
llvm-ml \
llvm-modextract \
llvm-mt \
llvm-nm \
llvm-objcopy \
llvm-objdump \
llvm-opt-report \
llvm-pdbutil \
llvm-profdata \
llvm-profgen \
llvm-ranlib \
llvm-rc \
llvm-readelf \
llvm-readobj \
llvm-reduce \
llvm-rtdyld \
llvm-size \
llvm-split \
llvm-stress \
llvm-strings \
llvm-strip \
llvm-symbolizer \
llvm-tblgen \
llvm-undname \
llvm-xray \
opt \
sancov \
split-file
CLANG_COMMANDS= \
c-index-test \
clang \
clang++ \
clang-check \
clang-cpp \
clang-extdef-mapping \
clang-format \
clang-offload-bundler \
clang-offload-wrapper \
clang-rename \
clang-scan-deps \
diagtool \
hmaptool \
scan-build \
scan-view
EXTRAS_COMMANDS= \
clangd \
clang-apply-replacements \
clang-change-namespace \
clang-doc \
clang-include-fixer \
clang-move \
clang-query \
clang-reorder-fields \
clang-tidy \
find-all-symbols \
modularize \
pp-trace
LIT_COMMANDS= \
FileCheck \
lit \
llvm-lit
LLD_COMMANDS= \
ld.lld \
ld64.lld \
ld64.lld.darwinnew \
lld \
lld-link \
wasm-ld
LLDB_COMMANDS= \
lldb \
lldb-argdumper \
lldb-instr \
lldb-server \
lldb-vscode
TIMESTAMP = 1614877783
SHA256 (llvm-project-12.0.0rc2.src.tar.xz) = 5cda94b2cf58ac516519c248625bee5fa145ab1dc527fcac7d6ab3316ffb0c3b
SIZE (llvm-project-12.0.0rc2.src.tar.xz) = 90882304
#!/bin/sh
# $FreeBSD$
LLVM_PREFIX="%%LLVM_PREFIX%%"
LLVM_SUFFIX="%%LLVM_SUFFIX%%"
tool=$0
[ -L "$tool" ] && tool=$(/bin/realpath $tool)
tool=${tool##*/}
tool="${LLVM_PREFIX}/bin/${tool%${LLVM_SUFFIX}}"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${LLVM_PREFIX}/lib" \
exec "${tool}" "${@}"
[Driver] Default to libc++ on FreeBSD
Downstream may naively translate between DSL and LLVM target
triple. If OS version is lost in the process then Clang would
default to a version that's no longer supported by OS vendor.
https://reviews.llvm.org/D77776
--- clang/lib/Driver/ToolChains/FreeBSD.cpp.orig 2019-12-11 19:15:30 UTC
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -351,7 +351,8 @@ FreeBSD::FreeBSD(const Driver &D, const llvm::Triple &
}
ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibType() const {
- if (getTriple().getOSMajorVersion() >= 10)
+ unsigned Major = getTriple().getOSMajorVersion();
+ if (Major >= 10 || Major == 0)
return ToolChain::CST_Libcxx;
return ToolChain::CST_Libstdcxx;
}
--- clang/lib/Headers/CMakeLists.txt.orig
+++ clang/lib/Headers/CMakeLists.txt
@@ -76,7 +76,6 @@
invpcidintrin.h
iso646.h
keylockerintrin.h
- limits.h
lwpintrin.h
lzcntintrin.h
mm3dnow.h
@@ -102,13 +101,7 @@
s390intrin.h
shaintrin.h
smmintrin.h
- stdalign.h
- stdarg.h
- stdatomic.h
- stdbool.h
- stddef.h
__stddef_max_align_t.h
- stdint.h
stdnoreturn.h
tbmintrin.h
tgmath.h
@@ -118,7 +111,6 @@
unwind.h
vadefs.h
vaesintrin.h
- varargs.h
vecintrin.h
vpclmulqdqintrin.h
waitpkgintrin.h
$FreeBSD$
--- clang/tools/clang-format/clang-format-sublime.py.orig
+++ clang/tools/clang-format/clang-format-sublime.py
@@ -18,7 +18,7 @@
import subprocess
# Change this to the full path if clang-format is not on the path.
-binary = 'clang-format'
+binary = 'clang-format%%LLVM_SUFFIX%%'
# Change this to format according to other formatting styles. See the output of
# 'clang-format --help' for a list of supported styles. The default looks for
--- clang/tools/clang-format/clang-format.py.orig 2015-09-08 20:44:00 UTC
+++ clang/tools/clang-format/clang-format.py
@@ -34,7 +34,7 @@ import vim
# set g:clang_format_path to the path to clang-format if it is not on the path
# Change this to the full path if clang-format is not on the path.
-binary = 'clang-format'
+binary = 'clang-format%%LLVM_SUFFIX%%'
if vim.eval('exists("g:clang_format_path")') == "1":
binary = vim.eval('g:clang_format_path')
$FreeBSD$
--- clang/tools/clang-format/git-clang-format.orig
+++ clang/tools/clang-format/git-clang-format
@@ -90,7 +90,7 @@
usage=usage, formatter_class=argparse.RawDescriptionHelpFormatter,
description=desc)
p.add_argument('--binary',
- default=config.get('clangformat.binary', 'clang-format'),
+ default=config.get('clangformat.binary', 'clang-format%%LLVM_SUFFIX%%'),
help='path to clang-format'),
p.add_argument('--commit',
default=config.get('clangformat.commit', 'HEAD'),
@@ -344,7 +344,7 @@
def run_clang_format_and_save_to_tree(changed_lines, revision=None,
- binary='clang-format', style=None):
+ binary='clang-format%%LLVM_SUFFIX%%', style=None):
"""Run clang-format on each file and save the result to a git tree.
Returns the object ID (SHA-1) of the created tree."""
@@ -397,7 +397,7 @@
def clang_format_to_blob(filename, line_ranges, revision=None,
- binary='clang-format', style=None):
+ binary='clang-format%%LLVM_SUFFIX%%', style=None):
"""Run clang-format on the given file and save the result to a git blob.
Runs on the file in `revision` if not None, or on the file in the working
--- clang-tools-extra/clang-doc/tool/CMakeLists.txt.orig 2020-01-30 15:29:37 UTC
+++ clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -18,6 +18,7 @@ target_link_libraries(clang-doc
clangDoc
)
+install(TARGETS clang-doc RUNTIME DESTINATION bin)
install(FILES ../assets/clang-doc-default-stylesheet.css
DESTINATION share/clang
COMPONENT clang-doc)
--- clang/tools/scan-build/libexec/ccc-analyzer.orig
+++ clang/tools/scan-build/libexec/ccc-analyzer
@@ -81,6 +81,9 @@
if (-x "/usr/bin/xcrun") {
$UseXCRUN = 1;
}
+} elsif (`uname -s` eq "FreeBSD\n") {
+ $DefaultCCompiler = 'cc';
+ $DefaultCXXCompiler = 'c++';
} else {
$DefaultCCompiler = 'gcc';
$DefaultCXXCompiler = 'g++';
--- llvm/cmake/modules/AddSphinxTarget.cmake.orig
+++ llvm/cmake/modules/AddSphinxTarget.cmake
@@ -39,6 +39,8 @@
endif()
add_custom_target(${SPHINX_TARGET_NAME}
+ COMMAND ${CMAKE_COMMAND}
+ -E make_directory ${SPHINX_BUILD_DIR}
COMMAND ${CMAKE_COMMAND} -E env ${ARG_ENV_VARS}
${SPHINX_EXECUTABLE}
-b ${builder}
--- clang/include/clang/Driver/Options.td.orig 2019-10-21 21:45:02.000000000 +0100
+++ clang/include/clang/Driver/Options.td 2019-10-22 00:00:39.833390000 +0100
@@ -1186,6 +1186,8 @@
Flags<[CC1Option]>;
def fno_use_line_directives : Flag<["-"], "fno-use-line-directives">, Group<f_Group>;
+def fformat_extensions: Flag<["-"], "fformat-extensions">, Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Enable FreeBSD kernel specific format string extensions">;
def ffreestanding : Flag<["-"], "ffreestanding">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Assert that the compilation takes place in a freestanding environment">;
def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group<f_Group>,
--- clang/lib/Driver/ToolChains/CommonArgs.cpp.orig 2017-05-10 17:18:56.000000000 +0000
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp 2017-05-10 23:01:17.087686000 +0000
@@ -441,7 +441,10 @@
switch (TC.getDriver().getOpenMPRuntime(Args)) {
case Driver::OMPRT_OMP:
- CmdArgs.push_back("-lomp");
+ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so"))
+ CmdArgs.push_back("-lomp");
+ else
+ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libomp.so");
break;
case Driver::OMPRT_GOMP:
CmdArgs.push_back("-lgomp");
commit 24b1a5b926832f68fa0a008b2484d4b44f58ee8e
Author: dim <dim@FreeBSD.org>
Date: Sat Sep 14 10:55:33 2019 +0000
Revert commit from upstream llvm trunk (by Hans Wennborg):
Re-commit r357452 (take 3): "SimplifyCFG
SinkCommonCodeFromPredecessors: Also sink function calls without used
results (PR41259)"
Third time's the charm.
This was reverted in r363220 due to being suspected of an internal
benchmark regression and a test failure, none of which turned out to
be caused by this.
As reported in https://bugs.llvm.org/show_bug.cgi?id=43269, this causes
UNREACHABLE errors when compiling if_malo_pci.c for arm and aarch64.
Notes:
svn path=/projects/clang900-import/; revision=352318
diff --git lib/Transforms/Utils/SimplifyCFG.cpp lib/Transforms/Utils/SimplifyCFG.cpp
index 11651d040dc0..6e2ef67408d9 100644
--- llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1428,10 +1428,9 @@ static bool HoistThenElseCodeToIf(BranchInst *BI,
static bool canSinkInstructions(
ArrayRef<Instruction *> Insts,
DenseMap<Instruction *, SmallVector<Value *, 4>> &PHIOperands) {
- // Prune out obviously bad instructions to move. Each instruction must have
- // exactly zero or one use, and we check later that use is by a single, common
- // PHI instruction in the successor.
- bool HasUse = !Insts.front()->user_empty();
+ // Prune out obviously bad instructions to move. Any non-store instruction
+ // must have exactly one use, and we check later that use is by a single,
+ // common PHI instruction in the successor.
for (auto *I : Insts) {
// These instructions may change or break semantics if moved.
if (isa<PHINode>(I) || I->isEHPad() || isa<AllocaInst>(I) ||
@@ -1445,10 +1444,9 @@ static bool canSinkInstructions(
if (C->isInlineAsm())
return false;
- // Each instruction must have zero or one use.
- if (HasUse && !I->hasOneUse())
- return false;
- if (!HasUse && !I->user_empty())
+ // Everything must have only one use too, apart from stores which
+ // have no uses.
+ if (!isa<StoreInst>(I) && !I->hasOneUse())
return false;
}
@@ -1457,11 +1455,11 @@ static bool canSinkInstructions(
if (!I->isSameOperationAs(I0))
return false;
- // All instructions in Insts are known to be the same opcode. If they have a
- // use, check that the only user is a PHI or in the same block as the
- // instruction, because if a user is in the same block as an instruction we're
- // contemplating sinking, it must already be determined to be sinkable.
- if (HasUse) {
+ // All instructions in Insts are known to be the same opcode. If they aren't
+ // stores, check the only user of each is a PHI or in the same block as the
+ // instruction, because if a user is in the same block as an instruction
+ // we're contemplating sinking, it must already be determined to be sinkable.
+ if (!isa<StoreInst>(I0)) {
auto *PNUse = dyn_cast<PHINode>(*I0->user_begin());
auto *Succ = I0->getParent()->getTerminator()->getSuccessor(0);
if (!all_of(Insts, [&PNUse,&Succ](const Instruction *I) -> bool {
@@ -1539,7 +1537,7 @@ static bool sinkLastInstruction(ArrayRef<BasicBlock*> Blocks) {
// it is slightly over-aggressive - it gets confused by commutative instructions
// so double-check it here.
Instruction *I0 = Insts.front();
- if (!I0->user_empty()) {
+ if (!isa<StoreInst>(I0)) {
auto *PNUse = dyn_cast<PHINode>(*I0->user_begin());
if (!all_of(Insts, [&PNUse](const Instruction *I) -> bool {
auto *U = cast<Instruction>(*I->user_begin());
@@ -1597,10 +1595,11 @@ static bool sinkLastInstruction(ArrayRef<BasicBlock*> Blocks) {
I0->andIRFlags(I);
}
- if (!I0->user_empty()) {
+ if (!isa<StoreInst>(I0)) {
// canSinkLastInstruction checked that all instructions were used by
// one and only one PHI node. Find that now, RAUW it to our common
// instruction and nuke it.
+ assert(I0->hasOneUse());
auto *PN = cast<PHINode>(*I0->user_begin());
PN->replaceAllUsesWith(I0);
PN->eraseFromParent();
r332965 | emaste | 2018-04-24 21:26:58 +0200 (Tue, 24 Apr 2018) | 8 lines
lldb: remove assertion that target_arch is FreeBSD
The target is not necessarily a FreeBSD binary - for example, it may be
a Linux binary running under the linuxulator. Basic ptrace (live)
debugging already worked in this case, except for the assertion.
Sponsored by: Turing Robotic Industries Inc.
Index: tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
===================================================================
--- lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (revision 332964)
+++ lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (revision 332965)
@@ -169,7 +169,6 @@ lldb::RegisterContextSP FreeBSDThread::GetRegister
RegisterInfoInterface *reg_interface = nullptr;
const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
- assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
switch (target_arch.GetMachine()) {
case llvm::Triple::aarch64:
reg_interface = new RegisterInfoPOSIX_arm64(target_arch);
--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp.orig 2019-07-04 07:43:51 UTC
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -209,6 +209,20 @@ static PPCTargetMachine::PPCABI computeTargetABI(const
if (TT.isMacOSX())
return PPCTargetMachine::PPC_ABI_UNKNOWN;
+ if (TT.isOSFreeBSD()) {
+ switch (TT.getArch()) {
+ case Triple::ppc64le:
+ case Triple::ppc64:
+ if (TT.getOSMajorVersion() >= 13)
+ return PPCTargetMachine::PPC_ABI_ELFv2;
+ else
+ return PPCTargetMachine::PPC_ABI_ELFv1;
+ case Triple::ppc:
+ default:
+ return PPCTargetMachine::PPC_ABI_UNKNOWN;
+ }
+ }
+
switch (TT.getArch()) {
case Triple::ppc64le:
return PPCTargetMachine::PPC_ABI_ELFv2;
--- compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h.orig
+++ compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -576,7 +576,7 @@
#define SANITIZER_INTERCEPT_PTHREAD_ATFORK SI_NETBSD
#define SANITIZER_INTERCEPT_GETENTROPY SI_FREEBSD
#define SANITIZER_INTERCEPT_QSORT \
- (SI_POSIX && !SI_IOSSIM && !SI_WATCHOS && !SI_TVOS && !SI_ANDROID)
+ (SI_POSIX && !SI_IOSSIM && !SI_WATCHOS && !SI_TVOS && !SI_ANDROID && !SI_FREEBSD)
#define SANITIZER_INTERCEPT_QSORT_R SI_GLIBC
// sigaltstack on i386 macOS cannot be intercepted due to setjmp()
// calling it and assuming that it does not clobber registers.
Disable docs due to issues with auto-generated API docs
--- lldb/CMakeLists.txt.orig
+++ lldb/CMakeLists.txt
@@ -73,7 +73,6 @@
add_subdirectory(source)
add_subdirectory(tools)
-add_subdirectory(docs)
if (LLDB_ENABLE_PYTHON)
if(LLDB_BUILD_FRAMEWORK)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment