From: Bjoern A. Zeeb Date: Sun, 3 Sep 2017 17:00:44 +0000 (+0000) Subject: sim: make compile on FreeBSD prior to 11 X-Git-Tag: v19.0.0.0~2616 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4c60aa0c1952ea0ee22bc122dcc4b83e6527ee1;p=gem5.git sim: make compile on FreeBSD prior to 11 FreeBSD before the early 11 development is expecting a char * for stack.ss_sp rather than the standards compliant void *. Catch that case and allow gem5 to compile on old FreeBSD versions. Change-Id: Ic0ae560b52bfe5b3905ae87df791d349e053ec97 Reviewed-on: https://gem5-review.googlesource.com/4660 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- diff --git a/src/sim/init_signals.cc b/src/sim/init_signals.cc index 5acfe45fd..c7960c516 100644 --- a/src/sim/init_signals.cc +++ b/src/sim/init_signals.cc @@ -50,6 +50,11 @@ #include #include +#if defined(__FreeBSD__) +#include + +#endif + #include "base/atomicio.hh" #include "base/cprintf.hh" #include "base/misc.hh" @@ -67,7 +72,11 @@ static bool setupAltStack() { stack_t stack; +#if defined(__FreeBSD__) && (__FreeBSD_version < 1100097) + stack.ss_sp = (char *)fatalSigStack; +#else stack.ss_sp = fatalSigStack; +#endif stack.ss_size = sizeof(fatalSigStack); stack.ss_flags = 0;