This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Android build support
ClosedPublic

Authored by cryptoad on Sep 15 2017, 9:58 AM.

Details

Summary

Mark Android as supported in the cmake configuration for Scudo.

Scudo is not added yet in the Android build bots, but code builds and tests
pass locally. It is for a later CL. I also checked that Scudo builds as part
of the Android toolchain.

A few modifications had to be made:

  • Android defaults to abort_on_error=1, which doesn't work well with the current tests. So change the default way to pass SCUDO_OPTIONS to the tests to account for this, setting it to 0 by default;
  • Disable the valloc.cpp & random_shuffle.cpp tests on Android;
  • There is a bit of gymnatic to be done with the SCUDO_TEST_TARGET_ARCH string, due to android using the -android suffix, and i686 instead of i386;
  • Android doesn't need -lrt.

Event Timeline

cryptoad created this revision.Sep 15 2017, 9:58 AM
alekseyshl accepted this revision.Sep 15 2017, 10:44 AM
This revision is now accepted and ready to land.Sep 15 2017, 10:44 AM
cryptoad closed this revision.Sep 18 2017, 8:42 AM
vitalybuka added inline comments.
test/scudo/CMakeLists.txt
20

Why do you need this?
I don't see you use it it tests or cfg files.
In tests you can achieve the same with:
// XFAIL: android && i386-target-arch

test/scudo/lit.site.cfg.in
6

You don't need this. Its already in the compiler-rt/test/lit.common.configured.in

cryptoad added inline comments.Sep 18 2017, 10:51 AM
test/scudo/CMakeLists.txt
20

So that came from my local tests.
The generated library is libclang_rt.scudo-i686-android.a for i386.
While with ${arch} being i386, when attempting to whole-archive link the library, it attempts to find libclang_rt.scudo-i386.a.
Hence me adding the -android and swapping i386 for i686.
As far as I can tell it doesn't try i386 & i686 but only i386.

test/scudo/lit.site.cfg.in
6

I just noticed your patches.
I am updating things on my side.