[PATCH] D51883: [Sanitizers] [MinGW] Check for __i386__ in addition to _M_IX86 for i386 specific details
    Martin Storsjö via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Sep 10 12:34:03 PDT 2018
    
    
  
mstorsjo created this revision.
mstorsjo added reviewers: rnk, timurrrr.
Herald added subscribers: Sanitizers, kubamracek.
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.
Repository:
  rCRT Compiler Runtime
https://reviews.llvm.org/D51883
Files:
  lib/sanitizer_common/sanitizer_win_defs.h
Index: lib/sanitizer_common/sanitizer_win_defs.h
===================================================================
--- lib/sanitizer_common/sanitizer_win_defs.h
+++ lib/sanitizer_common/sanitizer_win_defs.h
@@ -17,17 +17,17 @@
 #if SANITIZER_WINDOWS
 
 #ifndef WINAPI
-#ifdef _M_IX86
+#if defined(_M_IX86) || defined(__i386__)
 #define WINAPI __stdcall
 #else
 #define WINAPI
 #endif
 #endif
 
-#if defined(_WIN64)
-#define WIN_SYM_PREFIX
-#else
+#if defined(_M_IX86) || defined(__i386__)
 #define WIN_SYM_PREFIX "_"
+#else
+#define WIN_SYM_PREFIX
 #endif
 
 // For MinGW, the /export: directives contain undecorated symbols, contrary to
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51883.164725.patch
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180910/c37863bc/attachment.bin>
    
    
More information about the llvm-commits
mailing list