From 83994198b5c0ef66616759249aa1840557008284 Mon Sep 17 00:00:00 2001 From: Dmitrijs Ledkovs Date: Mon, 8 Jul 2013 22:25:54 +0100 Subject: 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 --- libcorkscrew/arch-x86/backtrace-x86.c | 12 ++++++------ 1 file 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 +#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 - #endif /* __ BIONIC__ */ /* Unwind state. */ -- cgit v1.1