Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable stack checks by default #2404

Merged
merged 18 commits into from
May 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make the build fail if stack checks are disabled but POSIX signals ar…
…e not available.
  • Loading branch information
xclerc committed May 7, 2024
commit d09153c0f9fc28f381bd6d280924dc74ea32aae7
8 changes: 6 additions & 2 deletions ocaml/runtime/signals_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,19 @@ void caml_garbage_collection(void)
}
}

#if defined(NATIVE_CODE) && !defined(STACK_CHECKS_ENABLED)

#if !defined(POSIX_SIGNALS)
#error "stack checks cannot be disabled if POSIX signals are not available"
#endif

#define DECLARE_SIGNAL_HANDLER(name) \
static void name(int sig, siginfo_t * info, ucontext_t * context)

#define SET_SIGACT(sigact,name) \
sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \
sigact.sa_flags = SA_SIGINFO

#if defined(NATIVE_CODE) && !defined(STACK_CHECKS_ENABLED)

CAMLextern void caml_raise_stack_overflow_nat(void);

DECLARE_SIGNAL_HANDLER(segv_handler)
Expand Down