llvm&clang: Update from 3.9.1 to 4.0.0

This commit is contained in:
Fredrik Fornwall 2017-03-15 16:28:36 +01:00
parent 489ad7089a
commit d6e574615c
5 changed files with 54 additions and 27 deletions

View File

@ -1,14 +1,15 @@
TERMUX_PKG_HOMEPAGE=http://clang.llvm.org/ TERMUX_PKG_HOMEPAGE=http://clang.llvm.org/
TERMUX_PKG_DESCRIPTION="Modular compiler and toolchain technologies library" TERMUX_PKG_DESCRIPTION="Modular compiler and toolchain technologies library"
_PKG_MAJOR_VERSION=3.9 _PKG_MAJOR_VERSION=4.0
TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.1 TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.0
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL=http://llvm.org/releases/${TERMUX_PKG_VERSION}/llvm-${TERMUX_PKG_VERSION}.src.tar.xz TERMUX_PKG_SRCURL=http://llvm.org/releases/${TERMUX_PKG_VERSION}/llvm-${TERMUX_PKG_VERSION}.src.tar.xz
TERMUX_PKG_SHA256=1fd90354b9cf19232e8f168faf2220e79be555df3aa743242700879e8fd329ee TERMUX_PKG_SHA256=8d10511df96e73b8ff9e7abbfb4d4d432edbdbe965f1f4f07afaf370b8a533be
TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_RM_AFTER_INSTALL=" TERMUX_PKG_RM_AFTER_INSTALL="
bin/bugpoint bin/bugpoint
bin/clang-check bin/clang-check
bin/clang-import-test
bin/clang-offload-bundler
bin/git-clang-format bin/git-clang-format
bin/llvm-tblgen bin/llvm-tblgen
bin/macho-dump bin/macho-dump
@ -44,9 +45,10 @@ TERMUX_PKG_FORCE_CMAKE=yes
termux_step_post_extract_package () { termux_step_post_extract_package () {
CLANG_SRC_TAR=cfe-${TERMUX_PKG_VERSION}.src.tar.xz CLANG_SRC_TAR=cfe-${TERMUX_PKG_VERSION}.src.tar.xz
test ! -f $TERMUX_PKG_CACHEDIR/$CLANG_SRC_TAR && termux_download http://llvm.org/releases/${TERMUX_PKG_VERSION}/$CLANG_SRC_TAR \ termux_download \
http://llvm.org/releases/${TERMUX_PKG_VERSION}/$CLANG_SRC_TAR \
$TERMUX_PKG_CACHEDIR/$CLANG_SRC_TAR \ $TERMUX_PKG_CACHEDIR/$CLANG_SRC_TAR \
e6c4cebb96dee827fa0470af313dff265af391cb6da8d429842ef208c8f25e63 cea5f88ebddb30e296ca89130c83b9d46c2d833685e2912303c828054c4dc98a
tar -xf $TERMUX_PKG_CACHEDIR/$CLANG_SRC_TAR -C tools tar -xf $TERMUX_PKG_CACHEDIR/$CLANG_SRC_TAR -C tools
mv tools/cfe-${TERMUX_PKG_VERSION}.src tools/clang mv tools/cfe-${TERMUX_PKG_VERSION}.src tools/clang

View File

@ -0,0 +1,20 @@
diff -u -r ../llvm-4.0.0.src/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp ./tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
--- ../llvm-4.0.0.src/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp 2016-11-30 18:57:18.000000000 +0100
+++ ./tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp 2017-03-14 18:11:26.984865292 +0100
@@ -12,6 +12,7 @@
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Checkers/SValExplainer.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
using namespace clang;
@@ -269,7 +270,7 @@
unsigned NumTimesReached = Item.second.NumTimesReached;
ExplodedNode *N = Item.second.ExampleNode;
- reportBug(std::to_string(NumTimesReached), BR, N);
+ reportBug(llvm::utostr(NumTimesReached), BR, N);
}
}

View File

@ -1,12 +1,12 @@
diff -u -r ../llvm-3.9.1.src/tools/llvm-shlib/CMakeLists.txt ./tools/llvm-shlib/CMakeLists.txt diff -u -r ../llvm-4.0.0.src/tools/llvm-shlib/CMakeLists.txt ./tools/llvm-shlib/CMakeLists.txt
--- ../llvm-3.9.1.src/tools/llvm-shlib/CMakeLists.txt 2016-05-26 06:35:35.000000000 +0200 --- ../llvm-4.0.0.src/tools/llvm-shlib/CMakeLists.txt 2016-11-01 21:19:33.000000000 +0100
+++ ./tools/llvm-shlib/CMakeLists.txt 2017-01-18 10:52:30.810184797 +0100 +++ ./tools/llvm-shlib/CMakeLists.txt 2017-03-14 17:08:19.394563777 +0100
@@ -39,7 +39,7 @@ @@ -37,7 +37,7 @@
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES}) add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
list(REMOVE_DUPLICATES LIB_NAMES) list(REMOVE_DUPLICATES LIB_NAMES)
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf" -if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf"
+if("${CMAKE_SYSTEM_NAME}" MATCHES "^(Linux|Android)$") # FIXME: It should be "GNU ld for elf" +if("${CMAKE_SYSTEM_NAME}" MATCHES "^(Linux|Android)$" OR MINGW) # FIXME: It should be "GNU ld for elf"
# GNU ld doesn't resolve symbols in the version script. # GNU ld doesn't resolve symbols in the version script.
set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")

View File

@ -0,0 +1,20 @@
diff -u -r ../llvm-4.0.0.src/tools/llvm-xray/xray-converter.cc ./tools/llvm-xray/xray-converter.cc
--- ../llvm-4.0.0.src/tools/llvm-xray/xray-converter.cc 2017-02-27 18:01:04.000000000 +0100
+++ ./tools/llvm-xray/xray-converter.cc 2017-03-14 18:30:35.979011376 +0100
@@ -14,6 +14,7 @@
#include "xray-extract.h"
#include "xray-registry.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/FileSystem.h"
@@ -95,7 +96,7 @@
for (const auto &R : Records) {
Trace.Records.push_back({R.RecordType, R.CPU, R.Type, R.FuncId,
Symbolize ? FuncIdHelper.SymbolOrNumber(R.FuncId)
- : std::to_string(R.FuncId),
+ : llvm::utostr(R.FuncId),
R.TSC, R.TId});
}
Output Out(OS, nullptr, 0);

View File

@ -1,15 +0,0 @@
Workaround bug https://github.com/android-ndk/ndk/issues/82 where std::to_string
is not available yet.
diff -u -r ../llvm-3.9.0.src/tools/sancov/sancov.cc ./tools/sancov/sancov.cc
--- ../llvm-3.9.0.src/tools/sancov/sancov.cc 2016-07-13 22:24:01.000000000 -0400
+++ ./tools/sancov/sancov.cc 2016-09-04 11:48:19.647813216 -0400
@@ -512,7 +512,7 @@
static std::string formatHtmlPct(size_t Pct) {
Pct = std::max(std::size_t{0}, std::min(std::size_t{100}, Pct));
- std::string Num = std::to_string(Pct);
+ std::string Num = llvm::utostr(Pct);
std::string Zeroes(3 - Num.size(), '0');
if (!Zeroes.empty())
Zeroes = "<span class='lz'>" + Zeroes + "</span>";