Skip to content

Commit adcd4e5

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 7efedba commit adcd4e5

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
@@ -3358,7 +3358,8 @@ llvm::CallBase *swift::irgen::emitCXXConstructorCall(
33583358

33593359
StackProtectorMode IRGenModule::shouldEmitStackProtector(SILFunction *f) {
33603360
const SILOptions &opts = IRGen.SIL.getOptions();
3361-
return (opts.EnableStackProtection && f->needsStackProtection()) ?
3361+
// FIXME(katei): stack protection support will be added by https://github.com/WebAssembly/wasi-libc/pull/351
3362+
return (opts.EnableStackProtection && f->needsStackProtection() && Triple.getObjectFormat() != llvm::Triple::Wasm) ?
33623363
StackProtectorMode::StackProtector : StackProtectorMode::NoStackProtector;
33633364
}
33643365

0 commit comments

Comments
 (0)