Skip to content

Commit e8ce80e

Browse files
nikictstellar
authored andcommitted
[profile] Don't use pragma comment linker on mingw
At least when compiling with gcc, this is not supported and will result in errors when linking against the profiler runtime. Only use the pragma comment linker based code with MSVC, but not with a mingw toolchain. This also undoes D107620, which shouldn't be relevant anymore. Differential Revision: https://reviews.llvm.org/D108095 (cherry picked from commit 4cfb047)
1 parent 4f857ea commit e8ce80e

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

compiler-rt/lib/profile/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ 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)
120117

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

compiler-rt/lib/profile/InstrProfilingFile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ intptr_t INSTR_PROF_PROFILE_COUNTER_BIAS_DEFAULT_VAR = 0;
592592

593593
/* This variable is a weak external reference which could be used to detect
594594
* whether or not the compiler defined this symbol. */
595-
#if defined(_WIN32)
595+
#if defined(_MSC_VER)
596596
COMPILER_RT_VISIBILITY extern intptr_t INSTR_PROF_PROFILE_COUNTER_BIAS_VAR;
597597
#if defined(_M_IX86) || defined(__i386__)
598598
#define WIN_SYM_PREFIX "_"

0 commit comments

Comments
 (0)