diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index e5e4af73cab0..c5afdd44ae02 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -38,6 +38,11 @@ extern "C" { #include #include #include + +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + #else #error "Platform not supported." #endif diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp index 8e6baf991978..3b6ddbe4db24 100644 --- a/src/rt/rust_kernel.cpp +++ b/src/rt/rust_kernel.cpp @@ -3,11 +3,12 @@ #define __STDC_LIMIT_MACROS 1 #endif -#include #include "rust_internal.h" #include "rust_util.h" #include "rust_scheduler.h" +#include + #define KLOG_(...) \ KLOG(this, kern, __VA_ARGS__) #define KLOG_ERR_(field, ...) \ diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index bc404ba9f1e6..647927d5c4b7 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -34,7 +34,8 @@ // the rust stack and happen frequently enough to catch most stack changes, // including at the beginning of all landing pads. // FIXME: Enable this for windows -#if defined __linux__ || defined __APPLE__ || defined __FreeBSD__ +#if (defined __linux__ || defined __APPLE__ || defined __FreeBSD__) \ + && (defined(GCC_VERSION) && GCC_VERSION > 40300) extern "C" void check_stack_alignment() __attribute__ ((aligned (16))); #else diff --git a/src/rt/util/indexed_list.h b/src/rt/util/indexed_list.h index feea4d5d0440..d58927156a6f 100644 --- a/src/rt/util/indexed_list.h +++ b/src/rt/util/indexed_list.h @@ -43,6 +43,7 @@ public: } virtual int32_t remove(T* value); virtual T * operator[](int32_t index); + virtual ~indexed_list() {} }; template int32_t