lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251126134519.1760889-1-alexandre.chartre@oracle.com>
Date: Wed, 26 Nov 2025 14:45:19 +0100
From: Alexandre Chartre <alexandre.chartre@...cle.com>
To: linux-kernel@...r.kernel.org, mingo@...nel.org, jpoimboe@...nel.org,
        peterz@...radead.org, david.laight.linux@...il.com, nathan@...nel.org
Cc: alexandre.chartre@...cle.com
Subject: [PATCH objtool/core] objtool: Build with disassembly can fail when including bdf.h

Building objtool with disassembly support can fail when including
the bdf.h file:

  In file included from tools/objtool/include/objtool/arch.h:108,
                   from check.c:14:
  /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
        |  ^~~~~

This check is present in the bfd.h file generated from the binutils
source code, but it is not necessarily present in the bfd.h file
provided in a binutil package (for example, it is not present in
the binutil RPM).

The solution to this issue is to define the PACKAGE macro before
including bfd.h. This is the solution suggested by the binutil
developer in bug 14243, and it is used by other kernel tools
which also use bfd.h (perf and bpf).

Fixes: 59953303827ec ("objtool: Disassemble code with libopcodes instead of running objdump")
Reported-by: Nathan Chancellor <nathan@...nel.org>
Closes: https://lore.kernel.org/all/3fa261fd-3b46-4cbe-b48d-7503aabc96cb@oracle.com/
Suggested-by: Nathan Chancellor <nathan@...nel.org>
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=14243
Signed-off-by: Alexandre Chartre <alexandre.chartre@...cle.com>
---
 tools/objtool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 66397d755fe4b..ad6e1ec706ce0 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -87,7 +87,7 @@ BUILD_DISAS := n
 
 ifeq ($(feature-libbfd),1)
 	BUILD_DISAS := y
-	OBJTOOL_CFLAGS += -DDISAS
+	OBJTOOL_CFLAGS += -DDISAS -DPACKAGE="objtool"
 	OBJTOOL_LDFLAGS += -lopcodes
 endif
 
-- 
2.43.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ