Skip to content

Commit d3d9dc5

Browse files
mstorsjotstellar
authored andcommitted
[profile] Build with -fms-extensions in MinGW mode
54902e0 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 94c001d)
1 parent cf035ca commit d3d9dc5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler-rt/lib/profile/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ endif()
114114
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ EXTRA_FLAGS)
115115
# XRay uses C++ standard library headers.
116116
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
117+
# The Windows specific code uses a #pragma comment(linker, ...) which requires
118+
# -fms-extensions on MinGW targets.
119+
append_list_if(MINGW -fms-extensions EXTRA_FLAGS)
117120

118121
# This appears to be a C-only warning banning the use of locals in aggregate
119122
# initializers. All other compilers accept this, though.

0 commit comments

Comments
 (0)