diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c index 47fcc575c7dac..2553fbb5454b5 100644 --- a/compiler-rt/lib/profile/InstrProfilingFile.c +++ b/compiler-rt/lib/profile/InstrProfilingFile.c @@ -13,7 +13,9 @@ #include #include #include +#if !defined(__wasi__) #include +#endif #ifdef _MSC_VER /* For _alloca. */ #include diff --git a/compiler-rt/lib/profile/InstrProfilingUtil.c b/compiler-rt/lib/profile/InstrProfilingUtil.c index 95c308350b6d1..137b7f5d5643a 100644 --- a/compiler-rt/lib/profile/InstrProfilingUtil.c +++ b/compiler-rt/lib/profile/InstrProfilingUtil.c @@ -34,7 +34,9 @@ typedef uint_t uint; #include #endif +#if !defined(__wasi__) #include +#endif #include #include @@ -462,6 +464,8 @@ COMPILER_RT_VISIBILITY void lprofInstallSignalHandler(int sig, if (err == SIG_ERR) PROF_WARN("Unable to install an exit signal handler for %d (errno = %d).\n", sig, errno); +#elif defined(__wasi__) + // WASI doesn't support signal. #else struct sigaction sigact; memset(&sigact, 0, sizeof(sigact));