public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* AddressSanitizer on Windows
@ 2020-05-04 18:44 Lou Knauer
  2020-05-04 21:45 ` Dan Kegel
  0 siblings, 1 reply; 3+ messages in thread
From: Lou Knauer @ 2020-05-04 18:44 UTC (permalink / raw)
  To: gcc-help

Hi,


Is it possible to use the AddressSanitizer (-fsanitize=address) on
Windows (And if yes, how?)? I built gcc (master branch) from source
today, and it told me that the current configuration/target
(mingw/msys2, x86_64) would not work with the address sanitizer runtime
libraries. In fact, compiling binaries actually works, but when trying
to link with -fsanitize=address it fails (with pre-built gcc-9 as well).

Are there plans to bring gcc's AddressSanitizer to Windows in the near
feature if not? [1] says that LLVMs AddressSanitizer is "periodically"
merged to GCC, which does work on windows.


On Linux, i managed to link a binary built by gcc with clangs
`libclang_rt.asan-x86_64.so` and run it, but something similar with DLLs
on windows segfaults (and this seams like a very dirty hack too). Any ideas?


Thank you very much in advance,

Lou


[1]
https://github.com/google/sanitizers/wiki/AddressSanitizerClangVsGCC-(6.0-vs-8.1)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AddressSanitizer on Windows
  2020-05-04 18:44 AddressSanitizer on Windows Lou Knauer
@ 2020-05-04 21:45 ` Dan Kegel
  2020-05-05 10:05   ` Lou Knauer
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Kegel @ 2020-05-04 21:45 UTC (permalink / raw)
  To: Lou Knauer; +Cc: gcc-help

If you can use msvc, check the options for visual studio community
2019.  The version I downloaded yesterday mentioned it.

See also
https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/

On Mon, May 4, 2020 at 11:44 AM Lou Knauer via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi,
>
>
> Is it possible to use the AddressSanitizer (-fsanitize=address) on
> Windows (And if yes, how?)? I built gcc (master branch) from source
> today, and it told me that the current configuration/target
> (mingw/msys2, x86_64) would not work with the address sanitizer runtime
> libraries. In fact, compiling binaries actually works, but when trying
> to link with -fsanitize=address it fails (with pre-built gcc-9 as well).
>
> Are there plans to bring gcc's AddressSanitizer to Windows in the near
> feature if not? [1] says that LLVMs AddressSanitizer is "periodically"
> merged to GCC, which does work on windows.
>
>
> On Linux, i managed to link a binary built by gcc with clangs
> `libclang_rt.asan-x86_64.so` and run it, but something similar with DLLs
> on windows segfaults (and this seams like a very dirty hack too). Any ideas?
>
>
> Thank you very much in advance,
>
> Lou
>
>
> [1]
> https://github.com/google/sanitizers/wiki/AddressSanitizerClangVsGCC-(6.0-vs-8.1)
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AddressSanitizer on Windows
  2020-05-04 21:45 ` Dan Kegel
@ 2020-05-05 10:05   ` Lou Knauer
  0 siblings, 0 replies; 3+ messages in thread
From: Lou Knauer @ 2020-05-05 10:05 UTC (permalink / raw)
  To: Dan Kegel; +Cc: gcc-help

Switching compilers is sadly probably not a possibility. Neither is
using valgrind to archive what the AddressSanitizer can do.


On 04.05.20 23:45, Dan Kegel wrote:
> If you can use msvc, check the options for visual studio community
> 2019.  The version I downloaded yesterday mentioned it.
>
> See also
> https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/
>
> On Mon, May 4, 2020 at 11:44 AM Lou Knauer via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
>> Hi,
>>
>>
>> Is it possible to use the AddressSanitizer (-fsanitize=address) on
>> Windows (And if yes, how?)? I built gcc (master branch) from source
>> today, and it told me that the current configuration/target
>> (mingw/msys2, x86_64) would not work with the address sanitizer runtime
>> libraries. In fact, compiling binaries actually works, but when trying
>> to link with -fsanitize=address it fails (with pre-built gcc-9 as well).
>>
>> Are there plans to bring gcc's AddressSanitizer to Windows in the near
>> feature if not? [1] says that LLVMs AddressSanitizer is "periodically"
>> merged to GCC, which does work on windows.
>>
>>
>> On Linux, i managed to link a binary built by gcc with clangs
>> `libclang_rt.asan-x86_64.so` and run it, but something similar with DLLs
>> on windows segfaults (and this seams like a very dirty hack too). Any ideas?
>>
>>
>> Thank you very much in advance,
>>
>> Lou
>>
>>
>> [1]
>> https://github.com/google/sanitizers/wiki/AddressSanitizerClangVsGCC-(6.0-vs-8.1)
>>
>>
>>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-05 10:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 18:44 AddressSanitizer on Windows Lou Knauer
2020-05-04 21:45 ` Dan Kegel
2020-05-05 10:05   ` Lou Knauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).