Page MenuHomePhabricator

[msan][test] Unset LD_LIBRARY_PATH to avoid un-sanitized libc++
AbandonedPublic

Authored by Hahnfeld on Feb 10 2019, 3:58 AM.

Details

Summary

This is another attempt to solve the issues mentioned in D42390: If there is
a libc++.so in LD_LIBRARY_PATH, it will be preferred over rpath set by lld
which uses DT_RUNPATH instead of DT_RPATH (called "new-dtags"). That causes
problems because the libc++ from LD_LIBRARY_PATH is not instrumented for use
with msan which breaks the unit tests.

There are two solutions:

  1. Pass --disable-new-dtags but that's not really great, especially going forward.
  2. Unset LD_LIBRARY_PATH when executing the tests. This needs to be done with some care to make sure that the compiled unit tests can indeed run without the need for any external library.

Diff Detail

Event Timeline

Hahnfeld created this revision.Feb 10 2019, 3:58 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added subscribers: llvm-commits, Restricted Project, mgorny. · View Herald Transcript

Wouldn't it be easiest to link the instrumented libc++ statically and avoid the rpath issues altogether?

Hahnfeld abandoned this revision.Feb 13 2019, 11:00 AM

Wouldn't it be easiest to link the instrumented libc++ statically and avoid the rpath issues altogether?

Yep, closing this in favor of D58013 that I'll update in a second ;-)