ASan part looks good to me (added some minor comments in the codereview tool).<div>Android toolchain-related stuff also _looks_ fine, but I think that CMake build system</div><div>authors should comment on this (at least during the post-commit review, since your</div>
<div>commit would hardly affect anyone).</div><div><br><div class="gmail_quote">On Thu, Sep 6, 2012 at 5:54 PM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com" target="_blank">eugeni.stepanov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
these patches simplify building asan runtime and tests for android. We<br>
remove all custom cflags and custom_command(s) out of individual<br>
CMakeLists (for now, this is done under if(ANDROID), but we'd like to<br>
do the same for x86 and x86_64 and the rest in the future). Instead,<br>
we add a CMake toolchain file in cmake/platforms that describes how to<br>
invoke a particular compiler.<br>
<br>
With this, asan tests can be compiled in a second build tree like this:<br>
mkdir build; cd build; cmake ..; make<br>
mkdir android; cd android<br>
cmake -DLLVM_ANDROID_TOOLCHAIN_DIR=/path/to/android/ndk<br>
-DCMAKE_TOOLCHAIN_FILE=../../cmake/platforms/Android.cmake ../..<br>
make AsanUnitTests<br>
<br>
Does this look like the right direction? Two build trees definitely<br>
add some complexity to the build process (which can be reduced<br>
eventually by auto-generating the second build tree depending on<br>
available toolchains/configurations). The alternative is forcing a<br>
custom compiler as we do in<br>
projects/compiler-rt/lib/asan/tests/CMakeLists.txt, but that's clearly<br>
an abuse of the build system.<br>
<br>
<a href="https://codereview.appspot.com/6506080" target="_blank">https://codereview.appspot.com/6506080</a><br>
<a href="https://codereview.appspot.com/6499083" target="_blank">https://codereview.appspot.com/6499083</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div><br>
</div>