From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07D98C433E0 for ; Fri, 22 Jan 2021 00:23:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C953623A3A for ; Fri, 22 Jan 2021 00:23:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726117AbhAVAWy (ORCPT ); Thu, 21 Jan 2021 19:22:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbhAVAWu (ORCPT ); Thu, 21 Jan 2021 19:22:50 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E2E4C06174A; Thu, 21 Jan 2021 16:22:10 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id x21so7770041iog.10; Thu, 21 Jan 2021 16:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=7RDHBNB2FCL5JuAW2qahbN/lnntexdCOoPo1QguxefU=; b=eDT0qNtacOrdxbrPGG0XkfzVrqFE24Q6gH9jrkD1qXTNSRO5dn5Ejqk8QK6hCoFkHx sem98ZgjA/3x1DZMkWdIvpRR5QnOjPu0+pbvmVrzW1DttSAM3ouQLRdd9g2v+l7M7ue5 mnADw3WkEd2T1VQhgZ+6ThltJmyr5eoLgSvpgaXJPeNTjTi42DLw+hn9BKMHjXkPSeUX Jv2Pe28RSpiYNFZvQazg5evmtvjpUKs4DCX9XC8gBjriMpByHuxft4HUf30/ySwoOfH5 TQ9EVAjzauxXcgM7nNH0sFo/dYivDFbkpGkW2EF/9o6hG/BDF5SGkUYLSxLi6kEhuyPM PvoQ== 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:reply-to :from:date:message-id:subject:to:cc; bh=7RDHBNB2FCL5JuAW2qahbN/lnntexdCOoPo1QguxefU=; b=EQ5CKk5yRL9jnPATs9bMDKc448H9a8rUy66a8J9odhD0kW55oL8+dWw9zgOP5Luwqt In6ehcoagfWYeWS9lGcG4J+U57et/4luxXqrC9HliJN1ZSLZVZhZrUKzQdG4kcNqIggi kP9VZ6AMM58pEIj3XawNjKBJPS7peV0IOJ5msyLGgXYzgwQt/R8cU/u25DCxDAfsOdWD z+NdAONekLCgrFiQxTe5s6AKT8UhGtQWXrC+cPoWfJi+QEoG8X0CjHilstOwkycrgDfY 4+qlxtGwlfKEZVicHlpK5fzxlZfziTqOXNDLE8w9WCWKzkkW3xOT3OlOqMB4O8/sH6eX x1sw== X-Gm-Message-State: AOAM533X4UobBysaZqplqjv/asCH94Hq9Zc3l24gk0HbluZxua4k5iKv UbuRa4mRv3b6ck65lWPqhpF0EIi1DGTauvqga2w= X-Google-Smtp-Source: ABdhPJwZsGaW5FNkegmgQF+y1eHlUJloKOHavkOK1D8ZuQKjrItgylmq22jE8YsMlEGbyFWX3WJVRrmQxB8VM2GcAzc= X-Received: by 2002:a05:6602:2b01:: with SMTP id p1mr1585423iov.156.1611274929572; Thu, 21 Jan 2021 16:22:09 -0800 (PST) MIME-Version: 1.0 References: <20210116095413.72820-1-sedat.dilek@gmail.com> <20210120223546.GF1798087@krava> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Fri, 22 Jan 2021 01:21:58 +0100 Message-ID: Subject: Re: [PATCH RFC] tools: Factor Clang, LLC and LLVM utils definitions To: Andrii Nakryiko Cc: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Quentin Monnet , Jean-Philippe Brucker , Tobias Klauser , Ilya Leoshkevich , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Yulia Kartseva , Andrey Ignatov , Thomas Hebb , Stephane Eranian , "Frank Ch. Eigler" , Masami Hiramatsu , "David S. Miller" , Davide Caratti , Briana Oursler , Networking , bpf , open list , "open list:KERNEL SELFTEST FRAMEWORK" , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 1:12 AM Sedat Dilek wrote: > > On Fri, Jan 22, 2021 at 1:04 AM Andrii Nakryiko > wrote: > > > > On Wed, Jan 20, 2021 at 2:36 PM Jiri Olsa wrote: > > > > > > On Sat, Jan 16, 2021 at 10:54:04AM +0100, Sedat Dilek wrote: > > > > When dealing with BPF/BTF/pahole and DWARF v5 I wanted to build bpftool. > > > > > > > > While looking into the source code I found duplicate assignments > > > > in misc tools for the LLVM eco system, e.g. clang and llvm-objcopy. > > > > > > > > Move the Clang, LLC and/or LLVM utils definitions to > > > > tools/scripts/Makefile.include file and add missing > > > > includes where needed. > > > > Honestly, I was inspired by commit c8a950d0d3b9 > > > > ("tools: Factor HOSTCC, HOSTLD, HOSTAR definitions"). > > > > > > > > I tested with bpftool and perf on Debian/testing AMD64 and > > > > LLVM/Clang v11.1.0-rc1. > > > > > > > > Build instructions: > > > > > > > > [ make and make-options ] > > > > MAKE="make V=1" > > > > MAKE_OPTS="HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld CC=clang LD=ld.lld LLVM=1 LLVM_IAS=1" > > > > MAKE_OPTS="$MAKE_OPTS PAHOLE=/opt/pahole/bin/pahole" > > > > > > > > [ clean-up ] > > > > $MAKE $MAKE_OPTS -C tools/ clean > > > > > > > > [ bpftool ] > > > > $MAKE $MAKE_OPTS -C tools/bpf/bpftool/ > > > > > > > > [ perf ] > > > > PYTHON=python3 $MAKE $MAKE_OPTS -C tools/perf/ > > > > > > > > I was careful with respecting the user's wish to override custom compiler, > > > > linker, GNU/binutils and/or LLVM utils settings. > > > > > > > > Some personal notes: > > > > 1. I have NOT tested with cross-toolchain for other archs (cross compiler/linker etc.). > > > > 2. This patch is on top of Linux v5.11-rc3. > > > > > > > > I hope to get some feedback from especially Linux-bpf folks. > > > > > > > > Signed-off-by: Sedat Dilek > > > > --- > > > > tools/bpf/bpftool/Makefile | 2 -- > > > > tools/bpf/runqslower/Makefile | 3 --- > > > > tools/build/feature/Makefile | 4 ++-- > > > > tools/perf/Makefile.perf | 1 - > > > > > > for tools/build and tools/perf > > > > > > Acked-by: Jiri Olsa > > > > > > > It's pretty straightforward and looks good for bpftool and runqslower, > > but I couldn't apply directly to test due to merge conflicts. > > > > Also, which tree this should go through, given it touches multiple > > parts under tools/? > > > > Sorry, for the conflicts. > AFAICS I should do this again against Linux v5.11-rc4 vanilla? > Is this OK to you? > I re-checked: This patch was on top of Linux v5.11-rc3 and applies cleanly against Linux v5.11-rc. Please let me know if I should adapt to a different Git tree. - Sedat - > Good hint, cannot say through which tree this should go through. > > - Sedat - > > > > jirka > > > > > > > tools/scripts/Makefile.include | 7 +++++++ > > > > tools/testing/selftests/bpf/Makefile | 3 +-- > > > > tools/testing/selftests/tc-testing/Makefile | 3 +-- > > > > 7 files changed, 11 insertions(+), 12 deletions(-) > > > > > > > > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile > > > > index f897cb5fb12d..71c14efa6e91 100644 > > > > --- a/tools/bpf/bpftool/Makefile > > > > +++ b/tools/bpf/bpftool/Makefile > > > > > > SNIP > > >