[compiler-rt] 94c001d - [profile] Build with -fms-extensions in MinGW mode

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 9 01:39:24 PDT 2021


Author: Martin Storsjö
Date: 2021-08-09T11:39:11+03:00
New Revision: 94c001d6465857459617e9858e5128a784400e54

URL: https://github.com/llvm/llvm-project/commit/94c001d6465857459617e9858e5128a784400e54
DIFF: https://github.com/llvm/llvm-project/commit/94c001d6465857459617e9858e5128a784400e54.diff

LOG: [profile] Build with -fms-extensions in MinGW mode

54902e00d1280785042e2c7ec71b25a949ade92c added a use of
/alternatename via a #pragma comment(linker); in MinGW mode, this
requires building with -fms-extensions. (This flag is added to
SANITIZER_COMMON_CFLAGS in the toplevel CMakeLists.txt.)

This avoids a warning when building in MinGW mode (about an unknown
pragma being ignored), and presumably also makes the code work as
intended.

Differential Revision: https://reviews.llvm.org/D107620

Added: 
    

Modified: 
    compiler-rt/lib/profile/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/CMakeLists.txt b/compiler-rt/lib/profile/CMakeLists.txt
index f5e13574b7ce..9688236c52ea 100644
--- a/compiler-rt/lib/profile/CMakeLists.txt
+++ b/compiler-rt/lib/profile/CMakeLists.txt
@@ -114,6 +114,9 @@ endif()
 append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ EXTRA_FLAGS)
 # XRay uses C++ standard library headers.
 string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+# The Windows specific code uses a #pragma comment(linker, ...) which requires
+# -fms-extensions on MinGW targets.
+append_list_if(MINGW -fms-extensions EXTRA_FLAGS)
 
 # This appears to be a C-only warning banning the use of locals in aggregate
 # initializers. All other compilers accept this, though.


        


More information about the llvm-commits mailing list