This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix tests for the exported interface on Windows.
AbandonedPublic

Authored by mpividori on Jan 27 2017, 12:48 PM.

Details

Summary

In this diff I fix the test in dll_host, and update it to work with the new "sanitizer_interface.inc" files.
I check the interfaces for MD and MT.

For MT, the sanitizer rt is included in a static library, which exports the main interface. Other dlls use interception to access to the sanitizer rt that resides in the main executable (implemented in dll_thunk).


To ensure that the main executable exports ALL the sanitizers's functions, we need to make sure that all object files from the static library are linked to the main executable, so we need to add the flag -wholearchive to clang driver, when including the static version of asan. I will add these changes in a new diff.

If we don't include -wholearchive , the linker could omit some object files when they don't resolve any symbol for the main executable.
But instrumented dlls will try to access to all the interface exposed by the main executable. If we omit part of it, the initialization in dll_thunk will fail.

Diff Detail

Event Timeline

mpividori created this revision.Jan 27 2017, 12:48 PM
rnk accepted this revision.Jan 30 2017, 9:56 AM

lgtm

This revision is now accepted and ready to land.Jan 30 2017, 9:56 AM
mpividori abandoned this revision.Jan 31 2017, 3:23 PM

This is not necessary anymore. Because I added tests for Windows in: https://reviews.llvm.org/D29148