Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5387805pxj; Wed, 26 May 2021 09:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe1anw4SDrbfj/l7RA0uB2oU5+k+sNWZZmKF57XvDTfKvMwnXiKt3g1kYbnhfyDu0hOfM1 X-Received: by 2002:a17:906:16d2:: with SMTP id t18mr34409784ejd.277.1622046065142; Wed, 26 May 2021 09:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622046065; cv=none; d=google.com; s=arc-20160816; b=QYcDDDPWQF6qzIWuFYYPxJG2Ed4zetM4uWajp0JX5DLKujq5Mwop5v9PJI0xMgWPTf d7ewoZf+Pqs8iRxpO2dBK8ZoypIVtPRNTEuF5TZ7L76qlfxmohl/qg8pPpF1oLLj/6NW YxsxeNGg+7HjgO4/Edd0hsXSobCbT/5RkWtZPIwsSl8GJ2T3V4NSc5vZBezHat2arUIG LV90FVnKF3VvMqbiSoyZy8YwjTskhu6vEHzOiueIu/uBEwdcz06LhtXAEG89TTpXlQiA m34CMOK76i3ZfoQ46qx/k5f59EvkmBuDY5ilpkhng8rIgDyjzI8NrMC7uF274hu6iGPm RWvw== 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=j9+U4zzMSY1RadPEggsDzC3pcoNOFBiHJ55OHUPkriQ=; b=cO4TXjHC9tAMGBmasU631C9Y4zTrizt8TyEtlXrt0LTxRiL9KR5lNcmb3jGFRY9gRi /iYP3GGa6X40kWBY4cCs/RqXt2Ev1hZF96IzHTiWnU5yquH6Q8TtARyN8WxjDgPfsTJY WJouP0iQHgASPfetHDBjE0VTEsaisMrK+9eZlfyc3JGs3oZbip+khImn/dFbvzC5KB/p bywjn/liHxIY9VBOtNLlq/xJklR+YBqvvMxoxYPH4pKkIM/xgBXnpNhIuikx7h8Zu9wy tqAPpoKx0tERZrT3UvKinb9L9HhBLB56rdKDDXextGcShgsKPlvdtphScQXs8lM8MdRq YvSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i7OhssDa; 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 e12si18839833ejk.225.2021.05.26.09.20.41; Wed, 26 May 2021 09:21:05 -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=i7OhssDa; 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 S233685AbhEZQUO (ORCPT + 99 others); Wed, 26 May 2021 12:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233109AbhEZQUM (ORCPT ); Wed, 26 May 2021 12:20:12 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E6EC061574; Wed, 26 May 2021 09:18:39 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id z38so2833191ybh.5; Wed, 26 May 2021 09:18:39 -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=j9+U4zzMSY1RadPEggsDzC3pcoNOFBiHJ55OHUPkriQ=; b=i7OhssDathCe8u+V0I0yR8otfcJYCr85x+G3AEnOHWilKWzUSOFd2VJDAZGexdrmpu QgdRuuXrjB5H/Q5IBfoPjn8f21wkFLHRSG84vlBefRM5zE42hpRB48KbVqUhiztot5O6 QnaKwRszjEZCvfpSNKuNmIKScWeyuoP8D96MaYavHmJ4iMqMyNYF1DLqF5Vra9rAu5VG LONef8o3WhHpRvLnIp3iPs8citf+1L5Oi5GQ426ZLS1hvMvGr8aEyVDZnd54+847vcjF AvHkW7IlT3cyB/jiq7daD8iYMNe18EFcaqcXtM4dsz0Wr3eyfnO8Kl+QI1bVxyQEskIa M2Ew== 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=j9+U4zzMSY1RadPEggsDzC3pcoNOFBiHJ55OHUPkriQ=; b=nBiKv40+9TnRA048pvzR7Vj4q29BucdvbdagDC1eHooCuyenB4rNpUjR7Hx8ILM9+h vUw02LRdoHR4U7UzlDcwAM6MYrfedKCIVZ5jjOon6Ubi7GnggTiA6tERKZsBI5KoN3X4 YmjAtRy0sAzgqlaRarfSpNENFjXgQPxNrU7eu3DwE4kbfTQ/CmGfxdgKB6MOZopUZLRA 6toOoWnItRypSYNnL9dnN2VWDBj+2IsH0BJJLEz3xG/EIKw8ei+XC3wRtzAxlSg8zhzL U0uKoM61gIlk/zl6U7kbwF/Z7xwD3W4lQ/Hj+dMQpmzoRMu/Xros5/9+5g1tMt28FlD4 0+eg== X-Gm-Message-State: AOAM532i3SY+fQZYRTM95fr4AqbbO1SjRSfhOpGEqt9Gyn4yIDsJKLrh Tcow6ZwdlbpXO2VvKT+KV6So1EWvHRYpBPg/KrU= X-Received: by 2002:a25:7246:: with SMTP id n67mr51162695ybc.510.1622045918363; Wed, 26 May 2021 09:18:38 -0700 (PDT) MIME-Version: 1.0 References: <20210518142302.1046718-1-javierm@redhat.com> In-Reply-To: <20210518142302.1046718-1-javierm@redhat.com> From: Andrii Nakryiko Date: Wed, 26 May 2021 09:18:27 -0700 Message-ID: Subject: Re: [PATCH] kbuild: quote OBJCOPY var to avoid a pahole call break the build To: Javier Martinez Canillas Cc: open list , Arnaldo Carvalho de Melo , Alexei Starovoitov , Andrii Nakryiko , 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 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-" > > $ 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 >