summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Try to fix cosmetics to keep lines below 80 chars. NFC.Martin Storsjo2018-09-251-1/+1
| | | | | | | This should fix following buildbot errors: http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/20371 llvm-svn: 343031
* [Sanitizers] [MinGW] Produce undecorated symbols for /export: directives ↵Martin Storsjo2018-09-251-2/+12
| | | | | | | | | | | | | | | when in MinGW mode In MinGW mode, the /export: directives in object files are interpreted differently; the symbols are not assumed to be decorated. Since the GNU linker doesn't support the /alternatename and /include directives, there's no such distinction for them in lld. This assumes that the resulting sanitizer libraries will be linked by lld. Differential Revision: https://reviews.llvm.org/D51882 llvm-svn: 343015
* [Sanitizers] [MinGW] Check for __i386__ in addition to _M_IX86 for i386 ↵Martin Storsjo2018-09-251-4/+4
| | | | | | | | | | | | | | | specific details The MinGW headers do define _M_IX86 (contrary to clang-cl and MSVC where it is a compiler predefined macro), but the headers that define it aren't included here. Also check these defines for setting the symbol prefix, instead of inconsistently using _WIN64 for that. Differential Revision: https://reviews.llvm.org/D51883 llvm-svn: 343013
* [sanitizer] if WINAPI is already defined, do not redefine itBob Haarman2017-02-081-0/+2
| | | | | | | | | | | | | | Summary: lib/sanitizer_common/sanitizer_win_defs.h defineds WINAPI, which is also defined by standard Windows headers. Redefining it causes warnings during compilation. This change causes us to only define WINAPI if it is not already defined, which avoids the warnings. Reviewers: rnk, zturner, mpividori Reviewed By: rnk, mpividori Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D29683 llvm-svn: 294497
* [sanitizer] Split dll_thunks into different sanitizers.Marcos Pividori2017-02-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the sanitizer is implemented as a static library and is included in the main executable, we need an auxiliary static library dll_thunk that will be linked to the dlls that have instrumentation, so they can refer to the runtime in the main executable. Basically, it uses interception to get a pointer the function in the main executable and override its function with that pointer. Before this diff, all of the implementation for dll_thunks was included in asan. In this diff I split it into different sanitizers, so we can use other sanitizers regardless of whether we include asan or not. All the sanitizers include a file sanitizer_win_dll_thunk.cc that register functions to be intercepted in the binary section: DLLTH When the dll including dll_thunk is initialized, it will execute __dll_thunk_init() implemented in: sanitizer_common/sanitizer_win_dll_thunk.cc, which will consider all the CB registered in the section DLLTH. So, all the functions registered will be intercepted, and redirected to the implementation in the main executable. All the files "sanitizer_win_dll_thunk.cc" are independent, so we don't need to include a specific list of sanitizers. Now, we compile: asan_win_dll_thunk.cc ubsan_win_dll_thunk.cc, sanitizer_coverage_win_dll_thunk.cc and sanitizer_win_dll_thunk.cc, to generate asan_dll_thunk, because we include asan, ubsan and sanitizer coverage in the address sanitizer library. Differential Revision: https://reviews.llvm.org/D29154 llvm-svn: 293951
* [sanitizer] Ensure macro parameters are expanded before stringifying.Marcos Pividori2017-01-311-5/+3
| | | | | | | | Add auxiliary macro to ensure parameters are expanded before stringifying. Differential Revision: https://reviews.llvm.org/D29312 llvm-svn: 293671
* General definition for weak functionsMarcos Pividori2017-01-291-7/+95
| | | | | | | | | | | | | | | | | | In this diff, I define a general macro for defining weak functions with a default implementation: "SANITIZER_INTERFACE_WEAK_DEF()". This way, we simplify the implementation for different platforms. For example, we cannot define weak functions on Windows, but we can use linker pragmas to create an alias to a default implementation. All of these implementation details are hidden in the new macro. Also, as I modify the name for exported weak symbols on Windows, I needed to temporarily disable "dll_host" test for asan, which checks the list of functions included in asan_win_dll_thunk. Differential Revision: https://reviews.llvm.org/D28596 llvm-svn: 293419
* [sanitizer] [asan] Use macros to simplify weak aliases on Windows.Marcos Pividori2017-01-201-0/+59
This patch adds some useful macros for dealing with pragma directives on Windows. Also, I add appropriate documentation for future users. Differential Revision: https://reviews.llvm.org/D28525 llvm-svn: 292650
OpenPOWER on IntegriCloud