aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitrijs Ledkovs <dmitrijs.ledkovs@canonical.com>2013-07-08 22:25:54 +0100
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-07-23 17:39:32 +0000
commit83994198b5c0ef66616759249aa1840557008284 (patch)
tree89e82d199be042815f0d86ee768804e435bb29bd
parent9df8c473782968493bd4b71426e6e1bffadeaa79 (diff)
downloadsystem_core-83994198b5c0ef66616759249aa1840557008284.zip
system_core-83994198b5c0ef66616759249aa1840557008284.tar.gz
system_core-83994198b5c0ef66616759249aa1840557008284.tar.bz2
Fix failure to build from source with modern _host_ glibc/gcc.
One should not define __USE_GNU directly, and instead _GNU_SOURCE should be defined as early as possible, before first (indirect) inclusion of features.h Change-Id: I4d109d4fa0c3d266b873d2a0a66a52e1a4faa234 Signed-off-by: Dmitrijs Ledkovs <dmitrijs.ledkovs@canonical.com>
-rw-r--r--libcorkscrew/arch-x86/backtrace-x86.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libcorkscrew/arch-x86/backtrace-x86.c b/libcorkscrew/arch-x86/backtrace-x86.c
index fb79a0c..e275fa6 100644
--- a/libcorkscrew/arch-x86/backtrace-x86.c
+++ b/libcorkscrew/arch-x86/backtrace-x86.c
@@ -18,6 +18,12 @@
* Backtracing functions for x86.
*/
+#ifndef __BIONIC__
+// glibc has its own renaming of the Linux kernel's structures.
+#define _GNU_SOURCE // For REG_EBP, REG_ESP, and REG_EIP.
+#include <ucontext.h>
+#endif
+
#define LOG_TAG "Corkscrew"
//#define LOG_NDEBUG 0
@@ -72,12 +78,6 @@ typedef struct ucontext {
#endif /* __BIONIC_HAVE_UCONTEXT_T */
-#else /* __BIONIC__ */
-
-// glibc has its own renaming of the Linux kernel's structures.
-#define __USE_GNU // For REG_EBP, REG_ESP, and REG_EIP.
-#include <ucontext.h>
-
#endif /* __ BIONIC__ */
/* Unwind state. */