From: Ben Pfaff <blp@nicira.com>
Date: Fri, 6 Nov 2009 18:25:50 +0000 (-0800)
Subject: backtrace: Avoid GCC warning on x86-64.
X-Git-Tag: v0.90.7~16
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=cc56746aed6d53046b17b01756362e566734241c;p=sliver-openvswitch.git

backtrace: Avoid GCC warning on x86-64.

The portable implementation of stack_low(), which before this commit is
used on x86-64, provokes a warning from GCC that cannot be disabled.  We
already have an i386-specific implementation that does not warn; this
commit adds a corresponding implementation for x86-64 to avoid the warning
there too.
---

diff --git a/lib/backtrace.c b/lib/backtrace.c
index 42ab8c48b..2f4780932 100644
--- a/lib/backtrace.c
+++ b/lib/backtrace.c
@@ -73,6 +73,10 @@ stack_low(void)
     uintptr_t low;
     asm("movl %%esp,%0" : "=g" (low));
     return low;
+#elif __x86_64__
+    uintptr_t low;
+    asm("movq %%rsp,%0" : "=g" (low));
+    return low;
 #else
     /* This causes a warning in GCC that cannot be disabled, so use it only on
      * non-x86. */