lldb: update from 9.0.1 to 10.0.0

This commit is contained in:
Butta 2020-04-12 12:43:15 +05:30 committed by Henrik Grimler
parent fe6b72da02
commit 5be5f78362
3 changed files with 92 additions and 36 deletions

View File

@ -1,16 +0,0 @@
--- cmake/modules/LLDBStandalone.cmake.orig 2019-10-28 03:16:27.880770642 +0000
+++ ./cmake/modules/LLDBStandalone.cmake 2019-10-28 03:16:53.936718250 +0000
@@ -32,12 +32,7 @@
set(LLVM_DEFAULT_EXTERNAL_LIT ${lit_full_path} CACHE PATH "Path to llvm-lit")
if(CMAKE_CROSSCOMPILING)
- set(LLVM_NATIVE_BUILD "${LLVM_BINARY_DIR}/NATIVE")
- if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
- message(FATAL_ERROR
- "Attempting to cross-compile LLDB standalone but no native LLVM build
- found. Please cross-compile LLVM as well.")
- endif()
+ set(LLVM_NATIVE_BUILD "${LLVM_BINARY_DIR}/")
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
set(HOST_EXECUTABLE_SUFFIX ".exe")

View File

@ -1,39 +1,59 @@
TERMUX_PKG_HOMEPAGE=https://lldb.llvm.org
TERMUX_PKG_DESCRIPTION="LLVM based debugger"
TERMUX_PKG_LICENSE="NCSA"
TERMUX_PKG_VERSION=9.0.1
TERMUX_PKG_SRCURL=https://github.com/llvm/llvm-project/releases/download/llvmorg-$TERMUX_PKG_VERSION/lldb-$TERMUX_PKG_VERSION.src.tar.xz
TERMUX_PKG_SHA256=8a7b9fd795c31a3e3cba6ce1377a2ae5c67376d92888702ce27e26f0971beb09
TERMUX_PKG_VERSION=10.0.0
TERMUX_PKG_SRCURL=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$TERMUX_PKG_VERSION/lldb-$TERMUX_PKG_VERSION.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-$TERMUX_PKG_VERSION/llvm-$TERMUX_PKG_VERSION.src.tar.xz)
TERMUX_PKG_SHA256=(dd1ffcb42ed033f5167089ec4c6ebe84fbca1db4a9eaebf5c614af09d89eb135
df83a44b3a9a71029049ec101fb0077ecbbdf5fe41e395215025779099a98fdf)
TERMUX_PKG_DEPENDS="libc++, libedit, libllvm, libxml2, ncurses-ui-libs"
TERMUX_PKG_BUILD_DEPENDS="libllvm-static"
TERMUX_PKG_BREAKS="lldb-dev, lldb-static"
TERMUX_PKG_REPLACES="lldb-dev, lldb-static"
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_HAS_DEBUG=false
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DLLDB_DISABLE_CURSES=0
-DLLDB_DISABLE_LIBEDIT=0
-DLLDB_DISABLE_PYTHON=1
-DLLVM_CONFIG=$TERMUX_PREFIX/bin/llvm-config
-DLLDB_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/lldb-tblgen
-DLLVM_ENABLE_SPHINX=ON
-DLLVM_ENABLE_TERMINFO=1
-DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_DIR=$TERMUX_PREFIX/lib/cmake/llvm
-DClang_DIR=$TERMUX_PREFIX/lib/cmake/clang
-DLLVM_NATIVE_BUILD=$TERMUX_PREFIX/bin
-DLLVM_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/llvm/bin/llvm-tblgen
"
termux_step_host_build() {
termux_setup_cmake
termux_setup_ninja
mkdir llvm
cd llvm
cmake -G Ninja $TERMUX_PKG_SRCDIR/llvm-${TERMUX_PKG_VERSION}.src
ninja -j $TERMUX_MAKE_PROCESSES llvm-tblgen
cd ..
cmake -G Ninja $TERMUX_PKG_SRCDIR -DLLDB_INCLUDE_TESTS=OFF \
-DLLVM_DIR=$TERMUX_PKG_HOSTBUILD_DIR/llvm/lib/cmake/llvm
ninja -j $TERMUX_MAKE_PROCESSES lldb-tblgen
}
termux_step_pre_configure() {
cd $TERMUX_PKG_TMPDIR
termux_download https://its-pointless.github.io/tblgen-llvm-lldb-9.0.1.tar.xz tblgen-llvm-lldb-9.0.1.tar.xz \
9cfd0aa3d9988e66838d4390ea9b2f701d1d8c87c44e226e10b8afd42c004622
tar xvf tblgen-llvm-lldb-9.0.1.tar.xz
mv llvm-tblgen $TERMUX_PREFIX/bin
PATH=$PATH:$TERMUX_PKG_TMPDIR
if [ $TERMUX_ARCH = "x86_64" ]; then
export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/
# This will be there if libllvm was built from scratch, but not if the pre-built
# package was extracted. Not really needed but the stupid clang CMake config makes
# sure it's there.
if [ ! -f "$TERMUX_PREFIX/bin/clang-import-test" ]; then
touch $TERMUX_PREFIX/bin/clang-import-test
touch $TERMUX_PKG_BUILDDIR/rm-fake-ci-test
fi
touch $TERMUX_PREFIX/bin/clang-import-test
}
termux_step_make() {
ninja -w dupbuild=warn -j $TERMUX_MAKE_PROCESSES all docs-lldb-man
}
termux_step_post_make_install() {
cp $TERMUX_PKG_SRCDIR/docs/lldb.1 $TERMUX_PREFIX/share/man/man1
rm -f $TERMUX_PREFIX/bin/llvm-tblgen $TERMUX_PREFIX/bin/clang-import-test
cp $TERMUX_PKG_BUILDDIR/docs/man/lldb.1 $TERMUX_PREFIX/share/man/man1
if [ -f "$TERMUX_PKG_BUILDDIR/rm-fake-ci-test" ]; then
rm $TERMUX_PREFIX/bin/clang-import-test
fi
}

View File

@ -0,0 +1,52 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 26cefbf3758b..78cd146aee7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,7 +103,9 @@ endif()
# TableGen
add_subdirectory(utils/TableGen)
+if(CMAKE_CROSSCOMPILING)
add_subdirectory(source)
+endif()
add_subdirectory(tools)
add_subdirectory(docs)
diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
index 1079a1636fa7..1049303b1242 100644
--- a/cmake/modules/LLDBStandalone.cmake
+++ b/cmake/modules/LLDBStandalone.cmake
@@ -1,7 +1,9 @@
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
find_package(LLVM REQUIRED CONFIG HINTS ${LLVM_DIR} NO_CMAKE_FIND_ROOT_PATH)
-find_package(Clang REQUIRED CONFIG HINTS ${Clang_DIR} ${LLVM_DIR}/../clang NO_CMAKE_FIND_ROOT_PATH)
+if(CMAKE_CROSSCOMPILING)
+ find_package(Clang REQUIRED CONFIG HINTS ${Clang_DIR} ${LLVM_DIR}/../clang NO_CMAKE_FIND_ROOT_PATH)
+endif()
# We set LLVM_CMAKE_PATH so that GetSVN.cmake is found correctly when building SVNVersion.inc
set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules")
@@ -87,14 +90,22 @@
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
+if(CMAKE_CROSSCOMPILING)
set_target_properties(clang-tablegen-targets PROPERTIES FOLDER "lldb misc")
+endif()
set_target_properties(intrinsics_gen PROPERTIES FOLDER "lldb misc")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+if(CMAKE_CROSSCOMPILING)
include_directories(
"${CMAKE_BINARY_DIR}/include"
"${LLVM_INCLUDE_DIRS}"
"${CLANG_INCLUDE_DIRS}")
+else()
+include_directories(
+ "${CMAKE_BINARY_DIR}/include"
+ "${LLVM_INCLUDE_DIRS}")
+endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})