summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobie Basak <robie.basak@canonical.com>2014-10-14 13:07:59 +0100
committerRobie Basak <robie.basak@canonical.com>2014-10-14 17:52:42 +0100
commitc1437e3677b8f2489e9dab3215eedb58590443c8 (patch)
treec2b46c1a680113b338e4e62287b692607ffd28cd
parente31e76af477853d5e35418f60e2562ca94fdee0e (diff)
downloadgreenlet-c1437e3677b8f2489e9dab3215eedb58590443c8.tar.gz
arm32: make sure gcc uses a frame pointer
This code assumes that there is a frame pointer. When gcc doesn't use a frame pointer here and __thumb__ is defined, then the code clobbers r7 without declaring it to the compiler. If the compiler uses r7 for something else, then this causes arbitrary failures, depending on what the optimizer did. To work around this, tell gcc to always use a frame pointer.
-rw-r--r--platform/switch_arm32_gcc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/switch_arm32_gcc.h b/platform/switch_arm32_gcc.h
index c6e160d..f74b2bb 100644
--- a/platform/switch_arm32_gcc.h
+++ b/platform/switch_arm32_gcc.h
@@ -50,6 +50,9 @@
#endif
static int
+#ifdef __GNUC__
+__attribute__((optimize("no-omit-frame-pointer")))
+#endif
slp_switch(void)
{
void *fp;