Skip to content

Commit a3a03fd

Browse files
Merge pull request #11295 from kateinoigakukun/yt/cherry-pick-wasi-compiler-rt-profile
🍒[stable/21.x][compiler-rt][profile] Exclude signal.h on WASI
2 parents a7eadc7 + b44508c commit a3a03fd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler-rt/lib/profile/InstrProfilingFile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#include <stdio.h>
1414
#include <stdlib.h>
1515
#include <string.h>
16+
#if !defined(__wasi__)
1617
#include <signal.h>
18+
#endif
1719
#ifdef _MSC_VER
1820
/* For _alloca. */
1921
#include <malloc.h>

compiler-rt/lib/profile/InstrProfilingUtil.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ typedef uint_t uint;
3434
#include <sys/utsname.h>
3535
#endif
3636

37+
#if !defined(__wasi__)
3738
#include <signal.h>
39+
#endif
3840
#include <stdlib.h>
3941
#include <string.h>
4042

@@ -462,6 +464,8 @@ COMPILER_RT_VISIBILITY void lprofInstallSignalHandler(int sig,
462464
if (err == SIG_ERR)
463465
PROF_WARN("Unable to install an exit signal handler for %d (errno = %d).\n",
464466
sig, errno);
467+
#elif defined(__wasi__)
468+
// WASI doesn't support signal.
465469
#else
466470
struct sigaction sigact;
467471
memset(&sigact, 0, sizeof(sigact));

0 commit comments

Comments
 (0)