[PATCH] clang-cl: Store the linker options for the ASAN runtime libraries in the obj files as opposed to pass it to the linker on the command line

Timur Iskhodzhanov timurrrr at google.com
Fri Jul 11 05:34:59 PDT 2014


Re: handling of DLL when linked with MT, see
https://code.google.com/p/address-sanitizer/issues/detail?id=209

Feel free to file a bug in that tracker if you have better ideas on
how to do that without significant ASan RTL rewrite.

2014-07-11 0:27 GMT+04:00 Ehsan Akhgari <ehsan.akhgari at gmail.com>:
> On Thu, Jul 10, 2014 at 4:20 PM, Reid Kleckner <rnk at google.com> wrote:
>>
>> On Thu, Jul 10, 2014 at 7:04 AM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
>> wrote:
>>>
>>> Hmm, thinking more about this patch, this requires you to know whether a
>>> given object file is going to be linked into a DLL when building the C++
>>> source so that you can pass -LD to clang-cl.  That may be not easy to get
>>> right depending on the build system, and when things go wrong you might need
>>> nasty -nodefaultlib arguments to the linker.  Maybe this is not the right
>>> approach after all?
>>
>>
>> Oh, true.  I forgot about the DLL thunk library.
>
>
> OK, I think I'll drop this patch then.  Sorry for wasting your time!
>
>>
>> Honestly, I think we need to completely revisit our CRT interceptor
>> approach so we can support MD, maybe MDd, and avoid the extra DLL thunk
>> stuff.  I don't have brilliant ideas for fixing this at the moment, though.
>> :(
>
>
> Do you know where I should look to figure out why the existing strategy has
> been employed?  If I understand the reasons things were done this way
> better, perhaps I can figure out a way to reuse Firefox's malloc replacement
> techniques with -MD/MDd in the ASAN runtime...
>
> Thanks!
> --
> Ehsan
> <http://ehsanakhgari.org/>
>



More information about the cfe-commits mailing list