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

54902e00d1 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
This commit is contained in:
Martin Storsjö 2021-08-06 09:22:11 +03:00
parent 743f78ef7f
commit 94c001d646
1 changed files with 3 additions and 0 deletions

View File

@ -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.