Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp872798pxm; Fri, 25 Feb 2022 23:26:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjwaL9bS0B8xobcoQTkMK4Pi75zkAA0Kn0Crhe84s/G5qB5osfjlJ43wAgcCsaL9Ghi8LW X-Received: by 2002:a05:6402:35c8:b0:410:dd43:3c09 with SMTP id z8-20020a05640235c800b00410dd433c09mr10366856edc.256.1645860407449; Fri, 25 Feb 2022 23:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645860407; cv=none; d=google.com; s=arc-20160816; b=pylHIQFR8a6BuOODJBTMC/G6Fp5CXoFOJVTKlUyvH9HOfzZcH36Q3nGpdZVfF78297 LDwtS4wB0gVK+7sF8otl0ORnYvo8I7J68neDO8ahLoXis+VfCuu8y0FCRdC0NVLGOaO+ wAP5p3Dl2Ayh65AiJ9RuPIYZGZSeybgLQj5+8YQ73OGNuHDAN32KR/IX6CP5K/1GYbrt /bnmJkU49uk/5zvRXFxxRcPdjCYiXjrHRhear/wFF4k11YFqSsxTvkKn3MxHoTTJwlPF 1p5JXiD3C1C93S5tFoEXVnS72N4GG7wMGAoitppfJHKDmAYpRDTZF1SiQDLWy11T2I+D mgbA== 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=mHVU3BXTpzNNcl+GYmq5eg/qd16r4r5gzv+KapxuYXQ=; b=uajXk4ELoY6HI9qgEgxKVsyn21iuegfFu1EqMfrsWtmJzpKnOaC/xMBiV6OjD3uVOa qRNQvlzE+RVxNYwTOGqxEO2KYVXlAP+nAfNoIs7YjsgFSKLB19xj4WhL2oI2Tfr86X8G v8eMYbJJ0kXJrQlXM3G8X7Q13ejr+mnk5E57mQ8F2b8gTkiqSG1fA0a988sXxNfH2+K4 e7wAVX7uXZ59V5TWCpQ9WRgVKIEan6zQwZ6rtATvJmkAxnTK3QsmyjYGPkolDwr3cZgK /7k++eOMBl8CaNRu04ASs4TfJy5dE3rtX9/tEmX1euWuS0MSe1gHyCxoTxo2bnwIpuuP Kvqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pUfEb1A+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q29-20020a50cc9d000000b00410bb13c4d0si2568545edi.503.2022.02.25.23.25.55; Fri, 25 Feb 2022 23:26:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pUfEb1A+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229825AbiBZGJ6 (ORCPT + 99 others); Sat, 26 Feb 2022 01:09:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbiBZGJ5 (ORCPT ); Sat, 26 Feb 2022 01:09:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0786D114FD2; Fri, 25 Feb 2022 22:09:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 96E8160C11; Sat, 26 Feb 2022 06:09:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF5C1C340F2; Sat, 26 Feb 2022 06:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645855763; bh=heJPHUn7XfYzu7DFZYuil9Qqj8KTMzMdMdnl3ERx3n0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=pUfEb1A++U1BmqJ2LV6MbiUF0ATv17WQnB/udPZJCSqnaSR50nbMeURXuqJySyR2X +ei5GXwJDYt2K2SMs0ve81dq5UF0RtDhFDhK8miihluN6x5w11fxmTeICmXy7uNW+j rbv1PEpdyD1FOZlPVGqGOa5estNLUvpuh/RzprNDqehAqTeMa5285LHrp3FSnZXILV WtLvUNO1hs0r+kXIv/PS4W+9Abll/TU4wEpNHuVQA9mTjWC+C5dZX0U9rfuwkDHzKl W0bdsl9lqDOTHpCUFz2XMkfNRa4B8+NwV1uOhmcVTHEPDRrCed5SLINbj8ewGlTRKG WAUPsATln/FxQ== Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-2d07ae0b1c0so55394387b3.2; Fri, 25 Feb 2022 22:09:22 -0800 (PST) X-Gm-Message-State: AOAM5309VeP4oxyvlOIKcSoPwjM84SFNUn3wnRVrdbl01eIr8SgQaKlt NB3GmshSqVYXzTN2diSasHLoIZecTc3SYOLDG9E= X-Received: by 2002:a81:83d6:0:b0:2ca:93ad:e4d6 with SMTP id t205-20020a8183d6000000b002ca93ade4d6mr10756915ywf.472.1645855761917; Fri, 25 Feb 2022 22:09:21 -0800 (PST) MIME-Version: 1.0 References: <20220225161507.470763-1-ytcoode@gmail.com> In-Reply-To: <20220225161507.470763-1-ytcoode@gmail.com> From: Song Liu Date: Fri, 25 Feb 2022 22:09:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next] bpftool: Remove redundant slashes To: Yuntao Wang Cc: bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Quentin Monnet , Jean-Philippe Brucker , =?UTF-8?Q?Mauricio_V=C3=A1squez?= , Networking , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UPPERCASE_50_75 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 On Fri, Feb 25, 2022 at 8:15 AM Yuntao Wang wrote: > > Since the _OUTPUT variable holds a value ending with a trailing slash, While the change makes sense, I think the description here is not accurate. Currently, we require OUTPUT to end with trailing slash. However, if OUTPUT is not defined, _OUTPUT will not hold a trailing slash. Adding trailing slash to _OUTPUT is one part of this patch, so I think we should not say that's the reason of this change. Thanks, Song > there is no need to add another one when defining BOOTSTRAP_OUTPUT and > LIBBPF_OUTPUT variables. > > When defining LIBBPF_INCLUDE and LIBBPF_BOOTSTRAP_INCLUDE, we shouldn't > add an extra slash either for the same reason. > > When building libbpf, the value of the DESTDIR argument should also not > end with a trailing slash. > > Signed-off-by: Yuntao Wang > --- > tools/bpf/bpftool/Makefile | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile > index ba647aede0d6..9800f966fd51 100644 > --- a/tools/bpf/bpftool/Makefile > +++ b/tools/bpf/bpftool/Makefile > @@ -18,19 +18,19 @@ BPF_DIR = $(srctree)/tools/lib/bpf > ifneq ($(OUTPUT),) > _OUTPUT := $(OUTPUT) > else > - _OUTPUT := $(CURDIR) > + _OUTPUT := $(CURDIR)/ > endif > -BOOTSTRAP_OUTPUT := $(_OUTPUT)/bootstrap/ > +BOOTSTRAP_OUTPUT := $(_OUTPUT)bootstrap/ > > -LIBBPF_OUTPUT := $(_OUTPUT)/libbpf/ > +LIBBPF_OUTPUT := $(_OUTPUT)libbpf/ > LIBBPF_DESTDIR := $(LIBBPF_OUTPUT) > -LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)/include > +LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)include > LIBBPF_HDRS_DIR := $(LIBBPF_INCLUDE)/bpf > LIBBPF := $(LIBBPF_OUTPUT)libbpf.a > > LIBBPF_BOOTSTRAP_OUTPUT := $(BOOTSTRAP_OUTPUT)libbpf/ > LIBBPF_BOOTSTRAP_DESTDIR := $(LIBBPF_BOOTSTRAP_OUTPUT) > -LIBBPF_BOOTSTRAP_INCLUDE := $(LIBBPF_BOOTSTRAP_DESTDIR)/include > +LIBBPF_BOOTSTRAP_INCLUDE := $(LIBBPF_BOOTSTRAP_DESTDIR)include > LIBBPF_BOOTSTRAP_HDRS_DIR := $(LIBBPF_BOOTSTRAP_INCLUDE)/bpf > LIBBPF_BOOTSTRAP := $(LIBBPF_BOOTSTRAP_OUTPUT)libbpf.a > > @@ -44,7 +44,7 @@ $(LIBBPF_OUTPUT) $(BOOTSTRAP_OUTPUT) $(LIBBPF_BOOTSTRAP_OUTPUT) $(LIBBPF_HDRS_DI > > $(LIBBPF): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_OUTPUT) > $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_OUTPUT) \ > - DESTDIR=$(LIBBPF_DESTDIR) prefix= $(LIBBPF) install_headers > + DESTDIR=$(LIBBPF_DESTDIR:/=) prefix= $(LIBBPF) install_headers > > $(LIBBPF_INTERNAL_HDRS): $(LIBBPF_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_HDRS_DIR) > $(call QUIET_INSTALL, $@) > @@ -52,7 +52,7 @@ $(LIBBPF_INTERNAL_HDRS): $(LIBBPF_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_HDRS_ > > $(LIBBPF_BOOTSTRAP): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_BOOTSTRAP_OUTPUT) > $(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(LIBBPF_BOOTSTRAP_OUTPUT) \ > - DESTDIR=$(LIBBPF_BOOTSTRAP_DESTDIR) prefix= \ > + DESTDIR=$(LIBBPF_BOOTSTRAP_DESTDIR:/=) prefix= \ > ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) $@ install_headers > > $(LIBBPF_BOOTSTRAP_INTERNAL_HDRS): $(LIBBPF_BOOTSTRAP_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_BOOTSTRAP_HDRS_DIR) > -- > 2.35.1 >