1 From 65afab91444d4996a8e61d1e2d27d52e18417ef5 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Thu, 8 Dec 2016 23:45:55 +0100
4 Subject: [PATCH 2/2] tools/sepdebugcrcfix.c: fix build with recent binutils
6 Moderately recent binutils versions install a <bfd.h> header that
7 checks if config.h is included. While this makes sense in binutils
8 itself, it does not outside. So the binutils developers have added a
9 check: if PACKAGE or PACKAGE_VERSION are defined, they assume you're
10 re-using bfd.h outside of binutils, and therefore including it without
11 including config.h is legit.
13 So we take the same approch as numerous users of bfd.h: fake a PACKAGE
14 definition. See for example tools/perf/util/srcline.c in the Linux
17 This fixes the following build error:
19 In file included from tools/sepdebugcrcfix.c:31:0:
20 /home/test/autobuild/run/instance-0/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/bfd.h:35:2: error: #error config.h must be included before this header
21 #error config.h must be included before this header
23 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
25 tools/sepdebugcrcfix.c | 2 ++
26 1 file changed, 2 insertions(+)
28 diff --git a/tools/sepdebugcrcfix.c b/tools/sepdebugcrcfix.c
29 index cd7fa02..e7b480f 100644
30 --- a/tools/sepdebugcrcfix.c
31 +++ b/tools/sepdebugcrcfix.c
36 +/* Needed to please <bfd.h> */
37 +#define PACKAGE "rpm"