[LLVMdev] Building sanitizers for Android (original) (raw)
Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Mar 27 01:14:39 PDT 2014
- Previous message: [LLVMdev] Building sanitizers for Android
- Next message: [LLVMdev] Building sanitizers for Android
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'd prefer something based on Alexey's approach with CMake sub-projects. I think it already copies compiler-rt build products to the parent build directory, right?
Requiring that llvm is installed complicates things.
On Thu, Mar 27, 2014 at 5:00 AM, Greg Fitzgerald <garious at gmail.com> wrote:
The build for the Android sanitizers is unique in that it needs to link against the Android system libraries to create a shared object and its test suites. The current solution to build ASan is to drop the compiler-rt repo into the llvm source tree and cross-compile the llvm build for Android. This is a bit awkward for few reasons:
1) Not all of llvm can be cross-compiled for Android. "ninja all" causes expected build errors.
This should not be too hard to fix.
2) The sanitizers don't depend on any LLVM libraries, only llvm-config for its build configuration. 3) No "install" rule. Instead, you cherry-pick files from the build directory.
Building against the LLVM install directory cleans this up nicely and as it turns out, this mostly works today (see CMake configuration below). The only missing pieces are that the shared object is not added to the install directory and the test suites are not built. Is this a build configuration you'd consider using? _$ cmake -G Ninja .. _ _-DCMAKEINSTALLPREFIX=ship _ _-DCMAKECCOMPILER=arm-linux-androideabi-gcc _ _-DCMAKECXXCOMPILER=arm-linux-androideabi-g++ _ _-DCMAKEPREFIXPATH=
pwd
/../../llvm/out/ship _ _-DANDROID=1 _ _-DCMAKESYSTEMNAME=Linux _ _-DCMAKECFLAGS=--sysroot=$(ndkDir)/platforms/android-19/arch-arm _ -DCMAKECXXFLAGS=--sysroot=$(ndkDir)/platforms/android-19/arch-arm ... $ ninja install ... [68/68] -- Install configuration: "Release" -- Installing: ship/include/sanitizer/asaninterface.h -- Installing: ship/include/sanitizer/commoninterfacedefs.h -- Installing: ship/include/sanitizer/dfsaninterface.h -- Installing: ship/include/sanitizer/linuxsyscallhooks.h -- Installing: ship/include/sanitizer/lsaninterface.h -- Installing: ship/include/sanitizer/msaninterface.h -- Installing: ship/include/sanitizer/tsaninterfaceatomic.h -- Installing: ship/asanblacklist.txt -- Installing: ship/bin/asandevicesetup Thanks, Greg
- Previous message: [LLVMdev] Building sanitizers for Android
- Next message: [LLVMdev] Building sanitizers for Android
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]