Skip to content

Commit e6c5dd4

Browse files
committed
[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 ca4c1ee commit e6c5dd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/profile/InstrProfilingFile.c

+1-1
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
#pragma comment(linker, "/alternatename:" \
598598
INSTR_PROF_QUOTE(INSTR_PROF_PROFILE_COUNTER_BIAS_VAR) "=" \

0 commit comments

Comments
 (0)