This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add linker flag "wholearchive" for asan_cxx.
ClosedPublic

Authored by mpividori on Feb 9 2017, 1:30 AM.

Details

Summary

We need -wholearchive for asan_cxx, the same than for asan.
Clang Driver will add asan_cxx at the beginning of the arg list that we pass to the linker.
To ensure that all the static libraries are linked to asan_cxx, we force the linker to include the object files in asan_cxx.

This fixes some linker errors when compiling with address sanitizer for MT and passing the static library libFuzzer.

Diff Detail

Repository
rL LLVM

Event Timeline

mpividori created this revision.Feb 9 2017, 1:30 AM
rnk accepted this revision.Feb 9 2017, 8:32 AM

Looks good with suggested changes

lib/Driver/Tools.cpp
11010 ↗(On Diff #87773)

Make these part of the for loop above.

This revision is now accepted and ready to land.Feb 9 2017, 8:32 AM
This revision was automatically updated to reflect the committed changes.