Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5565025pxj; Wed, 26 May 2021 13:45:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6Tcib9zSmj9EGVZhTEdqVktvQP4RGUO0nt5lFQNvj0+HiMwvc95p1BUywqpAwgr6Km6Gd X-Received: by 2002:a05:6e02:1154:: with SMTP id o20mr178645ill.248.1622061954913; Wed, 26 May 2021 13:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622061954; cv=none; d=google.com; s=arc-20160816; b=XMbuJkVLF36Xu5wyuDhd1DEgePHNIBIPMBrGrcs3npRYTQRJ2sg/OC5XrlN0y++GbQ XaHCiBOEZync/Fgxg250BHP80lSNkzGgBchtLsIER+dZuVZ6zN3mycRqeeSTflNHTjyK hm0krcqZL/UZOm6AtebGLfDYd4El022TAmZxJVwesUf9tOJ+9eL2A/twRp2p82rmrHxC RnMso3CBdguCgpgzzfiR/GMRYQ6hz65MtCjFSE8iufu1MojDsmoYXyKa2xKoDHdJG93v ft+4d1kAtOQY3EscHvjdn3HVuqQH1DYzfUe5ZtU/QUEfRbw9dcUPmrabpLgUPJcreBG9 dMWQ== 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:dkim-filter; bh=tVRT+PcjR97t4IuJpi2X0n+OU2xQfbFz9htkRteh/Zw=; b=Zf7LmQD24QbFgbgJ2euuIGn+dGZ00Rr9PIXxKF+m580AUvaoQTA5J+4fjWu0rLrgsb AkCOoT1ZXiSmphozgt9d8mU8W/3cuZ3PM21FNeya3/Sx15BC7sd07hSE8S0830pLSFU7 azqgc3kJRusG54uOr0175CG+FKv6R7jVNZDwSM0HpSbwmaYRQCOOCfCB6eOt1ouCm5R2 KGgICmeShGgjPJ4fwFOXlVHp4yvW6mynr2LsnWV6W1xOAQqxtxP+YJLkCZH/eu/1ns0f RxHhEZYGf8xPaVsAP1KMJQxp+alraKKXlJ7VTwFFw2WFlX6myJV/rCfnmRP0w3An16uz fXTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rzRsso6f; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x3si91344ilm.17.2021.05.26.13.45.41; Wed, 26 May 2021 13:45:54 -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=@nifty.com header.s=dec2015msa header.b=rzRsso6f; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234419AbhEZTz1 (ORCPT + 99 others); Wed, 26 May 2021 15:55:27 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:61001 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234388AbhEZTz0 (ORCPT ); Wed, 26 May 2021 15:55:26 -0400 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 14QJrgrY029737; Thu, 27 May 2021 04:53:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 14QJrgrY029737 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1622058822; bh=tVRT+PcjR97t4IuJpi2X0n+OU2xQfbFz9htkRteh/Zw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rzRsso6fu75kwKTYRS4m0zqZDQHJb8SksKZxd6HVkE+fRVlQL2K7Qc/Jc5AOzAIZo RtH2oPK5zWP/4Q/9G5F+eoFnTNvD0MnbEHGQdf5PAmBO1ePZo/jlFDp7ZUJ6lFPKkn dwRXxObx/3jUBuF05E5RJh4lEYWjjNL6mnLkZXAVKRCQWyKhaS/h8hKGTZrP6B2cHg z2cCb0yJC9rBwIdNdZ403UP3bL82DX8U6D+LCjV77E45dWWlFCYJvm6JeMvuVsj5qE GohV1tBzu2GU5RxNYxOWZs/r0vZoN0yAC5LmiBVVvo1ckkR12yNUZFUHsN3CoZyFrA nKWVy0XuEISvw== X-Nifty-SrcIP: [209.85.210.174] Received: by mail-pf1-f174.google.com with SMTP id x18so1762271pfi.9; Wed, 26 May 2021 12:53:42 -0700 (PDT) X-Gm-Message-State: AOAM5317NzMstCcINa/5tFsj8X4Dvvg8P8x0nqlWYK5K0pbfcREnWYDa FqQDj294NYod4W9HiRJu3/hvcLPLcjSlMV2Mfug= X-Received: by 2002:a63:164f:: with SMTP id 15mr86651pgw.175.1622058821401; Wed, 26 May 2021 12:53:41 -0700 (PDT) MIME-Version: 1.0 References: <20210518142302.1046718-1-javierm@redhat.com> In-Reply-To: From: Masahiro Yamada Date: Thu, 27 May 2021 04:53:04 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: quote OBJCOPY var to avoid a pahole call break the build To: Andrii Nakryiko Cc: Javier Martinez Canillas , open list , Arnaldo Carvalho de Melo , Alexei Starovoitov , Andrii Nakryiko , 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 Thu, May 27, 2021 at 1:18 AM Andrii Nakryiko wrote: > > On Tue, May 18, 2021 at 7:23 AM 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-" Actually, I did not know this... > > > > $ 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") > > Signed-off-by: Javier Martinez Canillas > > --- > > > > LGTM. Masahiro, would you like us to take this through bpf tree or > you'll apply this to kbuild one? > > Acked-by: Andrii Nakryiko > > > scripts/Makefile.modfinal | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > 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; > > -- > > 2.31.1 > > Please feel free to pick it up. I do not know 5f9ae91f7c0. BTW, I see similar code in scripts/link-vmlinux.sh too. LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1} Is it OK to leave it unquoted? -- Best Regards Masahiro Yamada