[llvm-branch-commits] [compiler-rt] d3d9dc5 - [profile] Build with -fms-extensions in MinGW mode

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 23 13:44:59 PDT 2021


Author: Martin Storsjö
Date: 2021-08-23T13:44:26-07:00
New Revision: d3d9dc5869333b6ed2dd8a7a6cfaadf40455e44d

URL: https://github.com/llvm/llvm-project/commit/d3d9dc5869333b6ed2dd8a7a6cfaadf40455e44d
DIFF: https://github.com/llvm/llvm-project/commit/d3d9dc5869333b6ed2dd8a7a6cfaadf40455e44d.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

(cherry picked from commit 94c001d6465857459617e9858e5128a784400e54)

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 f5e13574b7ce8..9688236c52ea8 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-branch-commits mailing list