This is an archive of the discontinued LLVM Phabricator instance.

[ASan] [MinGW] Only try to export MSVC specific C++ symbols if building with a MSVC like compiler
ClosedPublic

Authored by mstorsjo on Sep 10 2018, 12:21 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Sep 10 2018, 12:21 PM
Herald added subscribers: Restricted Project, kubamracek. · View Herald TranscriptSep 10 2018, 12:21 PM
timurrrr added a subscriber: timurrrr.

I'm now working on ASan for Windows anymore, Reid (rnk) should be the reviewer instead.

This patch in itself is rather straightforward. But should we do something similar for e.g. the itanium ABI's corresponding functions? Would we in that case need to know whether libcxx will be linked statically or dynamically?

In mingw setups, not even the compiler driver knows which one it will be, only the linker knows once it sees whether e.g. libc++.dll.a or libc++.a is available.

timurrrr removed a subscriber: timurrrr.Sep 12 2018, 1:53 PM

Bump. This one in itself is straightforward, but I'm wondering if we need to export the corresponding itanium abi symbols.

I tested asan with c++ allocated memory with this patch as is though, and that seemed to work as it should.

rnk accepted this revision.Sep 25 2018, 2:41 PM

lgtm

This revision is now accepted and ready to land.Sep 25 2018, 2:41 PM

but I'm wondering if we need to export the corresponding itanium abi symbols.

Actually, looking closer at it, the #else case that this hits already sets dllexport attributes, which seem to work just fine on the new/delete operators in itanium ABI mode. So then there's indeed no need for anything else than this.

This revision was automatically updated to reflect the committed changes.