From nobody Mon Dec 1 22:35:40 2025 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C5DE1E0B86 for ; Wed, 26 Nov 2025 13:45:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764164735; cv=none; b=j/FETbVUStmgm3vhdJ0FSYIDOTiNpjXMRkNZ/1jxQlMMu9Eilp75XasqF3Wi4vf8tV6vJYpF9I6iLKASNr6WqtZahhg9XgoA0MBY65t47+sztIejO+Z1PzQiR4beh+u1xBidXpllrSEqWx8yrCODKgtfbUhbml9+uxnSeJstumU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764164735; c=relaxed/simple; bh=fx11vdrXLctf8OpQnwpuPel0N82ffKN9K22lmdNI9JU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WAtKyt/GJbp8PuARDK1/gS1DWhxwwdQ1oK1cI9HvKAuEpvzwzqmikhb9e4v/TpxmgYDqEQh6Dpx1oydK5IOnim4PuGLMue2CY4KZigWgNWGXjhgpup/d9BXkM1q8kXjbOMSyNn1Uk6VACKpGniOpOlikm/lH3em5EErp45L8xmg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Bfr4yvF6; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Bfr4yvF6" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AQDY6ZJ2328908; Wed, 26 Nov 2025 13:45:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=corp-2025-04-25; bh=jkgplQv4OLfln3KHx38Hi3W+j0iPG 2XXQOjx7DyWvpU=; b=Bfr4yvF6EFyRN8e7KDwM2+P+Jcj+z1+BN4IYOxKNnrBZV EGpfxUTENUyHYd/QER3tSBTC9WuiHjznSjiEMqUL2wBf0BEV0hK6lwrcXZCZPHPf pv4r/MMviPZVejVqUyPiJ5Ilu8G39zDOUD3IuoA4My6w/X6LIonFjp2zoXwPYZGF oX1xiEwiYgBtTq+YElUiKeqt5+k7QG8BF+sbpPObqIW1UEd9MrdLJfZGMXioOpd6 y86rltv4gqk5DHPdqDm7r+aVFUTwTZn2fht6garFF/YEFgdRkMz3MnP5mhfG/v9N ntrOhswaHDwh2gK6askUcNoNOaDXsOLODcljkNeHg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4ak8d33w71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Nov 2025 13:45:22 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 5AQDRWpe022628; Wed, 26 Nov 2025 13:45:21 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4ak3mn2ats-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Nov 2025 13:45:21 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 5AQDjL88007637; Wed, 26 Nov 2025 13:45:21 GMT Received: from laptop-dell-latitude7430.nl.oracle.com (dhcp-10-154-160-235.vpn.oracle.com [10.154.160.235]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 4ak3mn2asv-1; Wed, 26 Nov 2025 13:45:21 +0000 From: Alexandre Chartre To: linux-kernel@vger.kernel.org, mingo@kernel.org, jpoimboe@kernel.org, peterz@infradead.org, david.laight.linux@gmail.com, nathan@kernel.org Cc: alexandre.chartre@oracle.com Subject: [PATCH objtool/core] objtool: Build with disassembly can fail when including bdf.h Date: Wed, 26 Nov 2025 14:45:19 +0100 Message-ID: <20251126134519.1760889-1-alexandre.chartre@oracle.com> X-Mailer: git-send-email 2.43.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-25_02,2025-11-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2510240000 definitions=main-2511260113 X-Authority-Analysis: v=2.4 cv=QPJlhwLL c=1 sm=1 tr=0 ts=69270473 b=1 cx=c_pps a=e1sVV491RgrpLwSTMOnk8w==:117 a=e1sVV491RgrpLwSTMOnk8w==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=yPCof4ZbAAAA:8 a=CCpqsmhAAAAA:8 a=QASPjExJB0MJYOd7g2wA:9 a=ul9cdbp4aOFLsgKbc677:22 cc=ntf awl=host:13642 X-Proofpoint-GUID: qyYfOoe8kENQQbs24m7nnMcsjR2EK1Bp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTI2MDExMSBTYWx0ZWRfX3KGqI1UulYLR q3lisZ851qKLgar/Lyrm2HSvUCLlbv6E2yn20GPnatP36rfNrnlBnK+5iykM2aARqPaKCtyooAl jISygWhy+315KnclRRq6cw9v8L9d7p3yUcJO5KM7PIjSMcoI8+1BVxtZ2/2TunKQS16nE4snlvi rkUnNc1L8YTWqmmfW0nrTrRAEDdF9nOpBWgVLnpC+nYLNj8GIdAyKWVZVjkrotpAyUHKzHHUF90 fkqdqH2jLZOoq5qnimPXzxT2t2zL3cFvo9cLz79foF1dmVq7n9Y0dVkVy56R5aI6zumkPt/mjak 22HJMvsLKXWlNTx2hMhEMyWmHwDqyf6ScRKvfkh/REkKGW0ZpSitcr7xED/5SRLKrtA39uaVmrk hNydJRoVBk9Os3jvIHOg9t6bywgpJ/IZqwgkrFXb/zXlHYzmc8Q= X-Proofpoint-ORIG-GUID: qyYfOoe8kENQQbs24m7nnMcsjR2EK1Bp Content-Type: text/plain; charset="utf-8" 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 t= his 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 Closes: https://lore.kernel.org/all/3fa261fd-3b46-4cbe-b48d-7503aabc96cb@or= acle.com/ Suggested-by: Nathan Chancellor Link: https://sourceware.org/bugzilla/show_bug.cgi?id=3D14243 Signed-off-by: Alexandre Chartre --- 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 :=3D n =20 ifeq ($(feature-libbfd),1) BUILD_DISAS :=3D y - OBJTOOL_CFLAGS +=3D -DDISAS + OBJTOOL_CFLAGS +=3D -DDISAS -DPACKAGE=3D"objtool" OBJTOOL_LDFLAGS +=3D -lopcodes endif =20 --=20 2.43.5