Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp641621pxb; Thu, 21 Jan 2021 16:31:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5vrW+pRa8RykSHH53mNpBivZVNS0X/ZZbFECVesB5qAR4LxhnrgFIsxVg9eJWs6d+5kfZ X-Received: by 2002:a05:6402:2211:: with SMTP id cq17mr1264253edb.167.1611275469895; Thu, 21 Jan 2021 16:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611275469; cv=none; d=google.com; s=arc-20160816; b=rRSDgwJaTFwZIUoZtGkoW6bq37YB4kOyUwzknhmNTi8Q/WRVsDpJ0PkxPpn7d5VZ69 +SwlKd4is0t8Q2szzJ3KPerChBNcvyBl+huuqyBNZGI1W4bnilGferUzwE2J7A4oBENF nZgUZlQStIhRu4dz/jmqhN/u1q4ef2n+M5ChaVW6XkTb+qhGK13zXGBYQvI8rNU49TVj HQorV6DFmK3jG/vM5C+CbWYkwPd8Npa+vcY7Q1ZYcWNHvWAV6xiou7lCQJ7xJ7F7qbRB y0uZ2q6O4ZufjM1eAtKZA7NFv4/p/VDUej4J7ntRN737uJPZ4Vru+RSSk5YILqV0HiMo ubUA== 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:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=ykOiitFyiN0YSC/lJm0MiGgBb0JXAdtJs/AnjN6QPxY=; b=oeala01/tzq9CuOaT/qA6wNS8KWcX90Ylp9y3T8mTw1/3wVPIeGh/+71F+UHDTPTrE 65pBeEPcjcpEz9w60MFzGfeZvB7ARrTy+45YeMpBQDiAjWSPRvUrZYeWXIEiY+X4YYkk NPK0wg3XoUIvU2Marvmt+dtUlQ1MeUMbfcU8KVAndLrO10e/hFxnB/bdEYwaYjMJOjHr 8U7oJAsFAhWCkkVoz8jGgeWD882Mk1qemWt1Ad4qFs5X1y8h0GZsIH2WMt3U0AdfotnO oBhO5vrMdAAHqA2TBeSgZSuhL6yxXaf/Sq8MnWvaQaXUb3agKfyy18Js/Ik9kvZ/lFAT c5UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QDG0JJpl; 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 o26si2315545eja.521.2021.01.21.16.30.46; Thu, 21 Jan 2021 16:31:09 -0800 (PST) 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=QDG0JJpl; 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 S1726491AbhAVA0b (ORCPT + 99 others); Thu, 21 Jan 2021 19:26:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbhAVA0W (ORCPT ); Thu, 21 Jan 2021 19:26:22 -0500 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79829C06174A; Thu, 21 Jan 2021 16:25:42 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id q129so7866099iod.0; Thu, 21 Jan 2021 16:25:42 -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=ykOiitFyiN0YSC/lJm0MiGgBb0JXAdtJs/AnjN6QPxY=; b=QDG0JJplOoNQz84k3mYR476kQh5U3VxQVzKvtt1e8CSfdDU8M8xdbIuGJjcZXrNbNC lcmBx6MWm8ACOAF38UaCM0rT4//qt8cBuoS1xm1X1P3lngLnpJkcvTBbZBrjhmYfhhvZ +DnawjDsJC0prF+exWXZexUH/WsmtUz9/xjVXxoO/XDC+sMpahwchcDb1nMJ2sLzWhN1 DHUDnHgm1p0HAexyYuRHLyzsQsfBt5ZpaqwkewmCA60fsHURrjAhbJPqcyJBBV0DDi24 sgSmuySVd8NFBRSNt3fRdKlZICvGbnyrgaamfofcoQm94m9dkgfBbHYmSc3ADcHm9TDl Fx0g== 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=ykOiitFyiN0YSC/lJm0MiGgBb0JXAdtJs/AnjN6QPxY=; b=CBqDKjjDjEQnfzFc7R6V9TvJXPEo6IYppZjEB7JbM9DcdXzlVZ8tXwcZXBPwQ0tzd4 UIwccIR4GgvKdsdPzPZTw5syOjQ30Ka3FfgyrURDIyjRSF5Wv3JwD6W+mATGHUu7z6I6 rHhhW3It/sRhyjfdfUJCzJla3cmSYUNMYczEPM4Z5Sjp+MeIuPHFJvJmatE0RWBU6LWh tdDlITWQfwuBvLAPdLZA7IQNiSrNPlxVG984JScnvQvNh1KUiiZEUxbGKq3w2XjadggS aTPcmvp8w47fLfUQkOPiNN/kJvAj6QvCV0Re5dRPnZSumj+8y4sFNS2ek77h+3DEIX+b CSnQ== X-Gm-Message-State: AOAM532Q62iHmFyoiXfHCdyNK15u4mo9B64rxAAcgQooNcrC8vIqQUxP kWMWzb4gbugtmThMfD5POUFKitK9DL9gDZ5MGmw= X-Received: by 2002:a6b:6a0e:: with SMTP id x14mr1540463iog.57.1611275141850; Thu, 21 Jan 2021 16:25:41 -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:25:30 +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:21 AM Sedat Dilek wrote: > > 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. > Bullshit. I will send out a v2 against Linux v5.11-rc4 - was on the wrong local Git branch. - Sedat - > 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 > > > >