Skip to content

Commit bc8b17a

Browse files
authored
Undefine FORTIFY_SOURCE for longjmp (bytecodealliance#9224)
See the comment in the source file, we can't have FORTIFY_SOURCE enabled for longjmp code, so undefine it. See the source for longjmp_chk in glibc, this assertion is fired: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/____longjmp_chk.c;hb=HEAD#l54 Here is a similar commit in glibc tests: https://sourceware.org/git/?p=glibc.git;a=commit;h=46432be2f1d4de962b51ca6b9f80fc37744be9f7
1 parent d29b280 commit bc8b17a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crates/wasmtime/src/runtime/vm/helpers.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// When using _FORTIFY_SOURCE with `longjmp` causes longjmp_chk to be used
2+
// instead. longjmp_chk ensures that the jump target is on the existing stack.
3+
// For our use case of jumping between stacks we need to disable it.
4+
#undef _FORTIFY_SOURCE
5+
16
#include <setjmp.h>
27
#include <stdint.h>
38
#include <stdlib.h>

0 commit comments

Comments
 (0)