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 <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
#include <iostream>
#include <string>
+#if defined(__FreeBSD__)
+#include <sys/param.h>
+
+#endif
+
#include "base/atomicio.hh"
#include "base/cprintf.hh"
#include "base/misc.hh"
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;