From d6e574615c187152156664bc1ebae07b9a67c542 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 15 Mar 2017 16:28:36 +0100 Subject: [PATCH] llvm&clang: Update from 3.9.1 to 4.0.0 --- packages/libllvm/build.sh | 14 +++++++------ ...r-Checkers-ExprInspectionChecker.cpp.patch | 20 +++++++++++++++++++ .../tools-llvm-shlib-CMakeLists.txt.patch | 12 +++++------ .../tools-llvm-xray-xray-converter.cc.patch | 20 +++++++++++++++++++ packages/libllvm/tools-sancov-sancov.cc.patch | 15 -------------- 5 files changed, 54 insertions(+), 27 deletions(-) create mode 100644 packages/libllvm/tools-clang-lib-StaticAnalyzer-Checkers-ExprInspectionChecker.cpp.patch create mode 100644 packages/libllvm/tools-llvm-xray-xray-converter.cc.patch delete mode 100644 packages/libllvm/tools-sancov-sancov.cc.patch diff --git a/packages/libllvm/build.sh b/packages/libllvm/build.sh index dc3b9c1a7..b10f755d2 100644 --- a/packages/libllvm/build.sh +++ b/packages/libllvm/build.sh @@ -1,14 +1,15 @@ TERMUX_PKG_HOMEPAGE=http://clang.llvm.org/ TERMUX_PKG_DESCRIPTION="Modular compiler and toolchain technologies library" -_PKG_MAJOR_VERSION=3.9 -TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.1 -TERMUX_PKG_REVISION=3 +_PKG_MAJOR_VERSION=4.0 +TERMUX_PKG_VERSION=${_PKG_MAJOR_VERSION}.0 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_RM_AFTER_INSTALL=" bin/bugpoint bin/clang-check +bin/clang-import-test +bin/clang-offload-bundler bin/git-clang-format bin/llvm-tblgen bin/macho-dump @@ -44,9 +45,10 @@ TERMUX_PKG_FORCE_CMAKE=yes termux_step_post_extract_package () { 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 \ - e6c4cebb96dee827fa0470af313dff265af391cb6da8d429842ef208c8f25e63 + cea5f88ebddb30e296ca89130c83b9d46c2d833685e2912303c828054c4dc98a tar -xf $TERMUX_PKG_CACHEDIR/$CLANG_SRC_TAR -C tools mv tools/cfe-${TERMUX_PKG_VERSION}.src tools/clang diff --git a/packages/libllvm/tools-clang-lib-StaticAnalyzer-Checkers-ExprInspectionChecker.cpp.patch b/packages/libllvm/tools-clang-lib-StaticAnalyzer-Checkers-ExprInspectionChecker.cpp.patch new file mode 100644 index 000000000..fb6c1f1c1 --- /dev/null +++ b/packages/libllvm/tools-clang-lib-StaticAnalyzer-Checkers-ExprInspectionChecker.cpp.patch @@ -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); + } + } + diff --git a/packages/libllvm/tools-llvm-shlib-CMakeLists.txt.patch b/packages/libllvm/tools-llvm-shlib-CMakeLists.txt.patch index 586791adb..790230c53 100644 --- a/packages/libllvm/tools-llvm-shlib-CMakeLists.txt.patch +++ b/packages/libllvm/tools-llvm-shlib-CMakeLists.txt.patch @@ -1,12 +1,12 @@ -diff -u -r ../llvm-3.9.1.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 -+++ ./tools/llvm-shlib/CMakeLists.txt 2017-01-18 10:52:30.810184797 +0100 -@@ -39,7 +39,7 @@ +diff -u -r ../llvm-4.0.0.src/tools/llvm-shlib/CMakeLists.txt ./tools/llvm-shlib/CMakeLists.txt +--- ../llvm-4.0.0.src/tools/llvm-shlib/CMakeLists.txt 2016-11-01 21:19:33.000000000 +0100 ++++ ./tools/llvm-shlib/CMakeLists.txt 2017-03-14 17:08:19.394563777 +0100 +@@ -37,7 +37,7 @@ add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES}) list(REMOVE_DUPLICATES LIB_NAMES) --if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # 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}" STREQUAL "Linux" OR MINGW) # 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. set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") diff --git a/packages/libllvm/tools-llvm-xray-xray-converter.cc.patch b/packages/libllvm/tools-llvm-xray-xray-converter.cc.patch new file mode 100644 index 000000000..9d0d3308e --- /dev/null +++ b/packages/libllvm/tools-llvm-xray-xray-converter.cc.patch @@ -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); diff --git a/packages/libllvm/tools-sancov-sancov.cc.patch b/packages/libllvm/tools-sancov-sancov.cc.patch deleted file mode 100644 index 837b3eff6..000000000 --- a/packages/libllvm/tools-sancov-sancov.cc.patch +++ /dev/null @@ -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 = "" + Zeroes + "";