Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp812839pxj; Thu, 27 May 2021 12:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBs4Gkr5q/B636q76CbLXOv2eZH6+gZwuvgUH0WJyOHhkPBobcIX3uMjIThSEpSejzPsab X-Received: by 2002:a50:ed13:: with SMTP id j19mr5974272eds.190.1622142809186; Thu, 27 May 2021 12:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622142809; cv=none; d=google.com; s=arc-20160816; b=fRDU6csIbYE+9YPa5LEaC/bG5Iuv7hLEvCOA9CJP+6DJUmReSIcX6n3srj29F3nM5s v3+Zx9ma/PlPIykW5Gh1pgGX2SEp6GligIR3vVGFzYZyAVK1hgJVMAuoFshajke8n5Ua OvkVBPrPcKhaVMLZ2f1lY7hQu6oeS3Iz5c462fL/4NWr1eF9+DurtS164gJg9Pyrppwj jjSkrvHyXhqtEzqqmr4cS+ZzEhwsJ8AahSDrQdg2xqTu0MCFJzHyyNvBtxpZpcCqP4aZ l3yWoXLK66v+DLUSnEYj6kRFST/dQh/Z+xXLus6KFmMuka+UUtGmzqMsHnqjgyqFJfzo nemA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8n60UirrOu7zWtXoi//ILGQaJH0mhZHxjrkUjLqafa4=; b=yw1Y2FgKrev/hFLUg91IgL9XPEVRbTtC2/z5+pjXsN3eVs7EwIr5kjlTLaPydEWs3X lFYbyM45+C4W7pPVCzya7cgYDsitMon/QAiLTg2Kn+uy6N/i2FF1ngBfxFAfarxjkPtj tBBFSg4RhFhk1YepeaeS0jmaKH9H27w32G1zI50QL0bBW2D9EJWIf+h+2/jS9YkA0hv9 oNAintZCRj1zgkg3le7AHxJzOK1klouO86QfbZSQQ246CHwjkTiCs4t/R0Y5q1aRGSC9 QE0UUb8XFroq4wWgqqdQ5hpst2LFoF+Dfk3vPmgErfGoXXdMBYTFfXWNm/9QARxLD/UH aEYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MBOr37Vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl4si2595388ejb.17.2021.05.27.12.13.05; Thu, 27 May 2021 12:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MBOr37Vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234359AbhE0TAz (ORCPT + 99 others); Thu, 27 May 2021 15:00:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbhE0TAy (ORCPT ); Thu, 27 May 2021 15:00:54 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D4FC061574; Thu, 27 May 2021 11:59:20 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id z38so2125121ybh.5; Thu, 27 May 2021 11:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8n60UirrOu7zWtXoi//ILGQaJH0mhZHxjrkUjLqafa4=; b=MBOr37VjHcCA/2yTcayx4gKJoFF1y2Hn8H6Vx1S63gQ1mmgVdVmTvdsuCO5roiqAXR cggsRxzqhpl/9T8otLvCcD61P3Yh1IKYlW4esJLUs8+gipGMoWvH9BoFjQz18rDedrv4 gi0EOyeH7E/SW6drSTy/51TJner0qKFM9qKCoVZV1l15RGpQR+h6eDbnA+n8TVmcbZ02 b649b97frl2gfvisBAiK/x4kDEChVaY31VgBxacI/fo6iqkCY8gCyFMCCgxRnrndcLU3 DQeiOHFffkvjGgDKXDZpcgBMEl9b+mS7JbmhnjsPmOvhE/zMacJZ0RFJlhHchjf0G/Kk P4OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8n60UirrOu7zWtXoi//ILGQaJH0mhZHxjrkUjLqafa4=; b=m6M7LvApWLpe3AkXwPFTRIoE/36ss7VhHlQg5VjhWXx58xFryW4NftJ67PsKbd6gpC DRHy41ym1yYmkNLnGuZ8cR5bfr6DAwMt/MFDbh11VNJk9S+0rDBG9j7HWManzQtmrLbM OKmOnRJehuCkdbcqafdXZUu6/EVfYNxNgtmBDCWsurA7SHvkTzQ6AljghaxKfzomXV1P WX48cy6+OifBv2MDm5XzwoskLKWT95fPkTvx21rLVLXNMK6RAC6T9g5YCFcKz48TrEv1 Xh7J0xvtyf0omN5M6aPA/6K6GxW+KdCZuCxalPtwLi+bg43e5HBkxioGaFRMkyESNjXj aFNQ== X-Gm-Message-State: AOAM532VxQRXAltaGGJ0p/6onxhSv33uKaQ4BbKPD8xJHk7QcBip0w5M MR0fIWuLGjIGP+1U6raPQrsfPCSNKHH1nOGOEIeFCr9wzDLRKQ== X-Received: by 2002:a25:9942:: with SMTP id n2mr7261704ybo.230.1622141959752; Thu, 27 May 2021 11:59:19 -0700 (PDT) MIME-Version: 1.0 References: <20210526215228.3729875-1-javierm@redhat.com> In-Reply-To: <20210526215228.3729875-1-javierm@redhat.com> From: Andrii Nakryiko Date: Thu, 27 May 2021 11:59:08 -0700 Message-ID: Subject: Re: [PATCH v2] kbuild: quote OBJCOPY var to avoid a pahole call break the build To: Javier Martinez Canillas Cc: open list , Arnaldo Carvalho de Melo , bpf , Andrii Nakryiko , Arnaldo Carvalho de Melo , Alexei Starovoitov , Masahiro Yamada , Michal Marek , Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 26, 2021 at 2:52 PM Javier Martinez Canillas wrote: > > The ccache tool can be used to speed up cross-compilation, by calling the > compiler and binutils through ccache. For example, following should work: > > $ export ARCH=arm64 CROSS_COMPILE="ccache aarch64-linux-gnu-" > > $ make M=drivers/gpu/drm/rockchip/ > > but pahole fails to extract the BTF info from DWARF, breaking the build: > > CC [M] drivers/gpu/drm/rockchip//rockchipdrm.mod.o > LD [M] drivers/gpu/drm/rockchip//rockchipdrm.ko > BTF [M] drivers/gpu/drm/rockchip//rockchipdrm.ko > aarch64-linux-gnu-objcopy: invalid option -- 'J' > Usage: aarch64-linux-gnu-objcopy [option(s)] in-file [out-file] > Copies a binary file, possibly transforming it in the process > ... > make[1]: *** [scripts/Makefile.modpost:156: __modpost] Error 2 > make: *** [Makefile:1866: modules] Error 2 > > this fails because OBJCOPY is set to "ccache aarch64-linux-gnu-copy" and > later pahole is executed with the following command line: > > LLVM_OBJCOPY=$(OBJCOPY) $(PAHOLE) -J --btf_base vmlinux $@ > > which gets expanded to: > > LLVM_OBJCOPY=ccache aarch64-linux-gnu-objcopy pahole -J ... > > instead of: > > LLVM_OBJCOPY="ccache aarch64-linux-gnu-objcopy" pahole -J ... > > Fixes: 5f9ae91f7c0 ("kbuild: Build kernel module BTFs if BTF is enabled and pahole supports it") I replaced 5f9ae91f7c0 with 5f9ae91f7c0d to have a recommended 12 characters hash. Applied to bpf tree, thanks. > Signed-off-by: Javier Martinez Canillas > Acked-by: Andrii Nakryiko > Acked-by: Arnaldo Carvalho de Melo > --- > > Changes in v2: > - Add collected Acked-by tags. > - Also quote on a similar assignment in scripts/link-vmlinux.sh (masahiroy) > > scripts/Makefile.modfinal | 2 +- > scripts/link-vmlinux.sh | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal > index dd87cea9fba..a7883e45529 100644 > --- a/scripts/Makefile.modfinal > +++ b/scripts/Makefile.modfinal > @@ -59,7 +59,7 @@ quiet_cmd_ld_ko_o = LD [M] $@ > quiet_cmd_btf_ko = BTF [M] $@ > cmd_btf_ko = \ > if [ -f vmlinux ]; then \ > - LLVM_OBJCOPY=$(OBJCOPY) $(PAHOLE) -J --btf_base vmlinux $@; \ > + LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J --btf_base vmlinux $@; \ > else \ > printf "Skipping BTF generation for %s due to unavailability of vmlinux\n" $@ 1>&2; \ > fi; > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh > index f4de4c97015..0e0f6466b18 100755 > --- a/scripts/link-vmlinux.sh > +++ b/scripts/link-vmlinux.sh > @@ -240,7 +240,7 @@ gen_btf() > fi > > info "BTF" ${2} > - LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1} > + LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${extra_paholeopt} ${1} > > # Create ${2} which contains just .BTF section but no symbols. Add > # SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all > -- > 2.31.1 >