Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1748437rda; Tue, 24 Oct 2023 01:53:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExKVwthLGBZM62B0boXXI2JESpjguYB29Rq3aONjGA6l1EruW9pcGeqBlQ4IccwnmkI/tW X-Received: by 2002:a05:6a00:2d86:b0:68a:59c6:c0a6 with SMTP id fb6-20020a056a002d8600b0068a59c6c0a6mr13458805pfb.24.1698137609946; Tue, 24 Oct 2023 01:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698137609; cv=none; d=google.com; s=arc-20160816; b=pCSNXxOO4OfQit6/yPPid5FH4oP6gq/r4rHN/DwuyqrcJD9sU1NBCgcHIlqzux+Beu WjwP652YLdgFt6+DItdr89Bz+bY+MbiZjoKizXbsaRYmQEkLR1J2zqmNF+wBeWx4b/0g Yxl1ZMzshZEBYHZ3RLDhxBbcQRrStrWjXvpd8aZTwIDT/fkk6rKzl3wPYCx71UV1/Fto X4JfUfairXNg8VvQBbHAq6PpkXTu0E9gSMBP6KpXw6sKZIU0b1mW5nUluWPvnyTxldVn PWr9yqYD1tj5w1aSRpmROQHG05A85J08yK81MX98w0cqvucB+OVedmhPMTOt/msOEtCd htKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=q6DNQlv21ZTBidvA/QYgU9WUU2cKXO4898OI1eWG1zA=; fh=U6xOoS4yrKwokS92UnWWBZ6Bz5Mf5FIxoc6GYbAL22U=; b=PwP2QztKv8kks0T25ql9wd15+q/hP1qBl1XAvlUjA6Flut5OjiDzQEx6PfYGMygWNM N5D5qQH+O1whxxddN1dOc0tR+RZ59bvnQAcY5nX92hRa+uKkOkYry3PTHtBgyba/yLFV Ab2kyJ774FQYgUElg+4Me3kagh2onGgYVFmi6R2N1Ay1jNSpopbK3uvcQmTds5CaxNMH qKJs4wdPDw4JRKSTCDgq6ZXyfh5SbizeDVNNZqc4yC4zrYoJITSmRNHJ4E2UhegL4mLA p2W7NjnHNmDVarmOZ+3UHsFSy5SUA1YtxRwUG2taRILrh+JU8Afzauz0uet6V/0bdvDN zupw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=28Z87DFz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4Qd9j9rf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p22-20020a637f56000000b00577448019b5si7796680pgn.276.2023.10.24.01.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 01:53:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=28Z87DFz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4Qd9j9rf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 66CE78030B60; Tue, 24 Oct 2023 01:53:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234030AbjJXIxU (ORCPT + 99 others); Tue, 24 Oct 2023 04:53:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234044AbjJXIxE (ORCPT ); Tue, 24 Oct 2023 04:53:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EB4F172A; Tue, 24 Oct 2023 01:52:46 -0700 (PDT) Date: Tue, 24 Oct 2023 08:52:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698137564; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q6DNQlv21ZTBidvA/QYgU9WUU2cKXO4898OI1eWG1zA=; b=28Z87DFzxWilQQa8qKx7kVVRRXJFhUtjGyxM7ISHF/de62wuPPYmGfl8ZPCtCRTsaglFCH A4xmDoj3Obs4/FBcYCULeULhj0bqJQfiwqRNJB/jccEPZAW3uUujBnpOIzN69Xtyw5DyA4 NTWVh0H9QvlbGJsNjQPibimKcu3i2EwpuoRjlnB2u3mcwco+f8ptzAdHKode/uvcW7h1qX cY8zGiSYbvSizpNhOx9CB8J2hZYVW3SR1yPXTUb22Mey9nwFY8YS0iQYfrmVZwHroBcDrB COaxMqqAzBoxgwc8uGt9z3YFo54v6qm68PNMncTRC3oAbWbL5Q92uB4oc7lNpQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698137564; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q6DNQlv21ZTBidvA/QYgU9WUU2cKXO4898OI1eWG1zA=; b=4Qd9j9rfnmM0xUaCJjd4wrIJy31dn9R2J+NKereIX2+ImvlaAW7mZ52mlGcPjYoc4s5Et2 pZFfGFWV5doA/8BQ== From: "tip-bot2 for Will Deacon" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1 Cc: Masahiro Yamada , Will Deacon , Nick Desaulniers , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231002165750.1661-3-will@kernel.org> References: <20231002165750.1661-3-will@kernel.org> MIME-Version: 1.0 Message-ID: <169813756376.3135.14752334773537866641.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 01:53:28 -0700 (PDT) The following commit has been merged into the objtool/core branch of tip: Commit-ID: 86bf86e19d308a1dba41e5f1f7e8cc105a5efa49 Gitweb: https://git.kernel.org/tip/86bf86e19d308a1dba41e5f1f7e8cc105a5efa49 Author: Will Deacon AuthorDate: Mon, 02 Oct 2023 17:57:48 +01:00 Committer: Josh Poimboeuf CommitterDate: Mon, 23 Oct 2023 08:36:33 -07:00 scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1 GNU utilities cannot necessarily parse objects built by LLVM, which can result in confusing errors when using 'faddr2line': $ CROSS_COMPILE=aarch64-linux-gnu- ./scripts/faddr2line vmlinux do_one_initcall+0xf4/0x260 aarch64-linux-gnu-addr2line: vmlinux: unknown type [0x13] section `.relr.dyn' aarch64-linux-gnu-addr2line: DWARF error: invalid or unhandled FORM value: 0x25 do_one_initcall+0xf4/0x260: aarch64-linux-gnu-addr2line: vmlinux: unknown type [0x13] section `.relr.dyn' aarch64-linux-gnu-addr2line: DWARF error: invalid or unhandled FORM value: 0x25 $x.73 at main.c:? Although this can be worked around by setting CROSS_COMPILE to "llvm=-", it's cleaner to follow the same syntax as the top-level Makefile and accept LLVM= as an indication to use the llvm- tools, optionally specifying their location or specific version number. Suggested-by: Masahiro Yamada Signed-off-by: Will Deacon Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20231002165750.1661-3-will@kernel.org Signed-off-by: Josh Poimboeuf --- scripts/faddr2line | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/faddr2line b/scripts/faddr2line index a35a420..6b82068 100755 --- a/scripts/faddr2line +++ b/scripts/faddr2line @@ -58,8 +58,21 @@ die() { exit 1 } -READELF="${CROSS_COMPILE:-}readelf" -ADDR2LINE="${CROSS_COMPILE:-}addr2line" +UTIL_SUFFIX="" +if [[ "${LLVM:-}" == "" ]]; then + UTIL_PREFIX=${CROSS_COMPILE:-} +else + UTIL_PREFIX=llvm- + + if [[ "${LLVM}" == *"/" ]]; then + UTIL_PREFIX=${LLVM}${UTIL_PREFIX} + elif [[ "${LLVM}" == "-"* ]]; then + UTIL_SUFFIX=${LLVM} + fi +fi + +READELF="${UTIL_PREFIX}readelf${UTIL_SUFFIX}" +ADDR2LINE="${UTIL_PREFIX}addr2line${UTIL_SUFFIX}" AWK="awk" GREP="grep"