[Lldb-commits] [PATCH] D103127: lldb: Don't check for CMAKE_SYSTEM_NAME==Android.

Peter Collingbourne via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 8 13:12:15 PDT 2021


pcc added a comment.

In D103127#2985203 <https://reviews.llvm.org/D103127#2985203>, @labath wrote:

> How exactly are you building this? CMAKE_SYSTEM_NAME is set in the official android cmake toolchain file (https://android.googlesource.com/platform/ndk/+/refs/heads/ndk-release-r23/build/cmake/android.toolchain.cmake#213)

I configured cmake using a script that looks like this:

  #!/bin/sh
  
  target_flags='--target=aarch64-linux-android21 --sysroot=/path/to/android-ndk-r21-beta1/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/path/to/android-ndk-r21-beta1/toolchains/llvm/prebuilt/linux-x86_64 -mno-outline-atomics'
  
  cmake \
    -GNinja \
    -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DCMAKE_C_COMPILER=`pwd`/../ra/bin/clang \
    -DCMAKE_CXX_COMPILER=`pwd`/../ra/bin/clang++ \
    -DLLVM_ENABLE_THREADS=OFF \
    -DLLVM_CONFIG_PATH=`pwd`/../ra/bin/llvm-config \
    "-DCMAKE_C_FLAGS=$target_flags" \
    "-DCMAKE_CXX_FLAGS=$target_flags" \
    "-DCMAKE_ASM_FLAGS=$target_flags" \
    -DSANITIZER_CXX_ABI=none \
    -DSANITIZER_CXX_ABI_LIBRARY=c++abi \
    -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -Wl,-lstdc++ -static-libstdc++ --rtlib=libgcc" \
    -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-u__cxa_demangle \
    -DANDROID=1 \
    -DCOMPILER_RT_INCLUDE_TESTS=ON \
    "-DCOMPILER_RT_TEST_COMPILER_CFLAGS=$target_flags" \
    -DLLVM_TABLEGEN=`pwd`/../ra/bin/llvm-tblgen \
    -DLLDB_TABLEGEN=`pwd`/../ra/bin/lldb-tblgen \
    -DCLANG_TABLEGEN=`pwd`/../ra/bin/clang-tblgen \
    -DLLVM_ENABLE_PROJECTS='clang;lldb' \
    -DLLDB_ENABLE_LIBEDIT=0 \
    -DLLDB_ENABLE_LIBXML2=0 \
    -DLLVM_HOST_TRIPLE=aarch64-linux-android21 \
    -DCMAKE_SYSTEM_NAME=Android \
    -DLLVM_TARGETS_TO_BUILD='X86;AArch64' \
    ../../llvm

But now I'm switching to gn to build LLDB, so I don't need to worry about this any more.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103127/new/

https://reviews.llvm.org/D103127



More information about the lldb-commits mailing list