Skip to content

Commit b5c9bf5

Browse files
kateinoigakukunrunner
authored andcommitted
[wasm][IRGen] HACK: Disable stack protection
This is a temporary workaround until we can update wasi-sdk to version 17 or later, which includes stack protection support in wasi-libc. WebAssembly/wasi-libc@8b7148f
1 parent bf56620 commit b5c9bf5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3323,7 +3323,8 @@ llvm::CallBase *swift::irgen::emitCXXConstructorCall(
33233323

33243324
StackProtectorMode IRGenModule::shouldEmitStackProtector(SILFunction *f) {
33253325
const SILOptions &opts = IRGen.SIL.getOptions();
3326-
return (opts.EnableStackProtection && f->needsStackProtection()) ?
3326+
// FIXME(katei): stack protection support will be added by https://github.com/WebAssembly/wasi-libc/pull/351
3327+
return (opts.EnableStackProtection && f->needsStackProtection() && Triple.getObjectFormat() != llvm::Triple::Wasm) ?
33273328
StackProtectorMode::StackProtector : StackProtectorMode::NoStackProtector;
33283329
}
33293330

0 commit comments

Comments
 (0)