Skip to content

Commit 44586d1

Browse files
committed
instrument functions: Satisfy bfd inclusion guard
In 2012 [0] [1] binutils added an inclusion guard to bfd.h, requiring to include the autoconf config.h beforehand. This guard is triggered when enabling instrumentation and development mode: ``` % git clone https://github.com/the-tcpdump-group/tcpdump.git % cd tcpdump % touch .devel % ./autogen.sh % ./configure --enable-instrument-functions --enable-smb --quiet ./mkdep -c gcc -m -M -s . -DHAVE_CONFIG_H -I. fptype.c tcpdump.c print-smb.c smbutil.c instrument-functions.c <libnetdissect src list> In file included from ./instrument-functions.c:18: /usr/include/bfd.h:35:2: error: #error config.h must be included before this header 35 | #error config.h must be included before this header | ^~~~~ ``` Note than this does *not* happen on Debian-based systems, because they remove [2] that guard since 2012 [3]. That's also why the Ubuntu-based Linux CI is not affected. [0] https://sourceware.org/bugzilla/show_bug.cgi?id=14072 [1] https://sourceware.org/git/?p=binutils-gdb.git;a=blobdiff;f=bfd/bfd-in.h;h=ae8149a2;hp=d88bcb6c;hb=df7b86aa;hpb=134fa82e [2] https://salsa.debian.org/toolchain-team/binutils/-/blob/38415eb8/debian/rules#L1045-1048 [3] https://code.launchpad.net/~doko/binutils/pkg-2.23-debian
1 parent 40ac38a commit 44586d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

instrument-functions.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
* FOR A PARTICULAR PURPOSE.
1212
*/
1313

14+
/* required for bfd.h inclusion guard */
15+
#include <config.h>
16+
1417
#include <stdio.h>
1518
#include <string.h>
1619
#include <stdlib.h>

0 commit comments

Comments
 (0)