This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Support libc++abi in addition to libstdc++
ClosedPublic

Authored by phosek on Jun 21 2017, 11:52 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Jun 21 2017, 11:52 PM
phosek updated this revision to Diff 104007.Jun 26 2017, 12:18 PM
phosek updated this revision to Diff 104227.Jun 27 2017, 11:49 AM
phosek added reviewers: eugenis, kcc.
eugenis added inline comments.Jun 28 2017, 3:40 PM
CMakeLists.txt
262 ↗(On Diff #104227)

SANITIZER_USE_COMPILER_RT - is that a user-facing option? then it should be declared as such.
Could you just use the regular cmake link flags instead?

This nodefaultlibs / rtlib change looks unrelated to the rest of this patch, could you upload it separately?

cmake/Modules/HandleCompilerRT.cmake
14 ↗(On Diff #104227)

This looks fragile, plus you only call this function with "builtins" as the first argument. Remove the argument?

16 ↗(On Diff #104227)

Should this say Found ${name} library ?

phosek updated this revision to Diff 106377.Jul 12 2017, 9:50 PM
phosek marked 3 inline comments as done.

Split the -nodefaultlibs support into D35165.

mcgrathr accepted this revision.Jul 21 2017, 11:54 AM

This is working well for me.

This revision is now accepted and ready to land.Jul 21 2017, 11:54 AM
alekseyshl accepted this revision.Jul 21 2017, 3:39 PM
phosek updated this revision to Diff 108198.Jul 25 2017, 6:34 PM
This revision was automatically updated to reflect the committed changes.
phosek reopened this revision.Jul 25 2017, 11:47 PM
This revision is now accepted and ready to land.Jul 25 2017, 11:47 PM
This revision was automatically updated to reflect the committed changes.
eugenis edited edge metadata.Jul 28 2017, 12:04 PM

Something is not right with the android build after this change:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/1138

Something is not right with the android build after this change:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/1138

This is strange, according to build log, CMake succeeds when looking for liblog.so:

-- Looking for __android_log_write in log - found

However, later fails when trying to link it:

warning: liblog.so, needed by /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/lib/clang/6.0.0/lib/linux/libclang_rt.asan-aarch64-android.so, not found (try using -rpath or -rpath-link)

This is likely the reason why the link fails with a missing symbol. I'll continue investigating.

liblog warning could be a red herring - it's been happening before with aarch64 android toolchain.