This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Support aarch64 for Android.
AbandonedPublic

Authored by yabinc on Dec 7 2015, 2:24 PM.

Details

Diff Detail

Event Timeline

yabinc updated this revision to Diff 42109.Dec 7 2015, 2:24 PM
yabinc retitled this revision from to [tsan] Support aarch64 for Android..
yabinc updated this object.
yabinc added a subscriber: llvm-commits.
eugenis added inline comments.Dec 8 2015, 11:00 AM
lib/tsan/rtl/tsan_platform.h
129

Is there a reason you are not using the generic aarch64/linux mappings below?
For ASan/aarch64/android, I've noticed that ART requires a first 4GB mapping, which seems incompatible with this layout.

yabinc added inline comments.Dec 9 2015, 3:50 PM
lib/tsan/rtl/tsan_platform.h
129

The Android mapping is different from Mapping39 in kLoAppMemBeg-kLoAppMemEnd. Because
android links all executables as shared libraries.
Thanks for reminding. I didn't notice that. I will check it out after my vacation.

eugenis added inline comments.Dec 9 2015, 4:02 PM
lib/tsan/rtl/tsan_platform.h
129

You mean PIE?
That linux mapping does not support PIE!
Well it could be a kernel version thing - at some point they moved PIE executable mappings from 0x7f.. to 0x55...

I've added a comment to http://reviews.llvm.org/D14199.

I don't mind going ahead with this one and figuring out if we want to unify the mappings later.

yabinc added inline comments.Dec 9 2015, 4:31 PM
lib/tsan/rtl/tsan_platform.h
129

Yes, I mean PIE. It might be related to kernel version, or architecture. I am not sure.

zatrazz added inline comments.Dec 10 2015, 9:05 AM
lib/tsan/rtl/tsan_platform.h
129

As I commented on the aarch64-linux TSAN mapping unification discussion [1] I did check the tests with -fpic -pie build and I saw no issue. I checked on a recent kernel (3.19) and on this configuration the PIE addresses for TSAN builds are se on 0x7f.. range.

I will check for 42-bits if TSAN tests fail with PIE build.

[1] http://reviews.llvm.org/D14199

zatrazz added inline comments.Dec 11 2015, 5:30 AM
lib/tsan/rtl/tsan_platform.h
129

My first analysis was flawed and PIE flags was not really being used when building the binaries. I rechecked on both 39 and 42 bits VMA and indeed current mapping scheme for aarch64-linux does not support PIE configurations. I have created the revision [1] to fix this issue.

I am not sure if this will work for aarch64-android.

[1] http://reviews.llvm.org/D15447

yabinc abandoned this revision.Jan 14 2016, 6:34 PM

It works. Thanks!