This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Move cxx-abi library earlier in link flags.
ClosedPublic

Authored by eugenis on Oct 3 2017, 4:25 PM.

Details

Summary

This change moves cxx-abi library in asan/ubsan/dd link command line
ahead of other libraries, such as pthread/rt/dl/c/gcc. Given that
cxx-abi may be the full libstdc++/libc++, it makes sense for it to be
ahead of libc and libgcc, at least.

The real motivation is Android, where in the arm32 NDK toolchain
libstdc++.a is actually a linker script that tries to sneak LLVM's
libunwind ahead of libgcc's. Wrong library order breaks unwinding.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis created this revision.Oct 3 2017, 4:25 PM
srhines accepted this revision.Oct 3 2017, 4:48 PM

Thank you for cleaning this up.

This revision is now accepted and ready to land.Oct 3 2017, 4:48 PM
This revision was automatically updated to reflect the committed changes.