Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp710732pxb; Wed, 20 Jan 2021 19:32:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdc9z15vz9fMHOdFE5oQAqbpabF3UZzc9JfKjEC1yTdOARyTyHL+NeqUZbhmwvwrEBXmms X-Received: by 2002:a05:6402:60a:: with SMTP id n10mr9297991edv.230.1611199943244; Wed, 20 Jan 2021 19:32:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611199943; cv=none; d=google.com; s=arc-20160816; b=XgORJA011UeqPxS/PMUw8v8McS5RAi/E5lOxkraKBmHtTnwVtgnU1Nwb+PcKMLWw0o 0g4LxLK9QelF7rfHn+E282Z/I2+vD8W/jx49n35niCLce4f1eU83RocZOJwFVPwj1UDZ HKbJ5xW9CaCl3l/bt3GS8Nwx0x6JHgXFdLVbOpH3KATWGyIcDCA/ITOf7DJmsRgpLYS1 xUDKlOulgyrjy70gSaZ2l9WbVVnyelNdWYRpsERhoUwD8Ec+2/5dUTzxeJfcyvAF5WVw 3KAj/W7AbiSLsEv3GlAhD+ExaLwl1h4aeiuvjZKJXqg+ciLZ79PJ/gwpWaNEqsLBfmh7 Z0gg== 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=g72wU/e2+tUMN8rrYgJKmfgNJZa+U65gluRGUeFny/w=; b=xFlkRJtRsw/UStA5X8Nr3tn/cQBlxZS39tujN4SV1cknc6j24PUu60T5gHmfxDqCT7 5CIs3mDRjEU2NZWZWhVwc6KEj5gIvv8jMUlIy1E6spXMgTMZkws3fFFRJSd9yCcSgCbi u5CNiA56ySKiQ9jnxuxluRPn/4K9NnvuxkDo76EjVE0ne80dqpwcmOUKqHfWGKllS07y aUplhqQiJC8LNEidbOhWBz7t0L/U/SKB7sTdVrHQ6DJvAWZTb4W0P5N2mlCO1dsDaUbe K8Fv2Obg3AkheIyfw+MHdyJ9eWGKNz6zQrAGw+f7MTlrTNUBlrCL+G3Nt22WBVz8pYYs pHUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NnQsZ32a; 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 s11si1552176edy.18.2021.01.20.19.31.59; Wed, 20 Jan 2021 19:32:23 -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=NnQsZ32a; 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 S2393386AbhAUCyI (ORCPT + 99 others); Wed, 20 Jan 2021 21:54:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728833AbhAUCjW (ORCPT ); Wed, 20 Jan 2021 21:39:22 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E66A7C061795; Wed, 20 Jan 2021 18:36:39 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id y19so1196351iov.2; Wed, 20 Jan 2021 18:36:39 -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=g72wU/e2+tUMN8rrYgJKmfgNJZa+U65gluRGUeFny/w=; b=NnQsZ32aK4Wsq9BJ1UAOChepviWpvo0EVt8Is3i8V+zU2wHuYXhkRKVqTDkqtvYAcX irS/zZgFuI37mfKLJvazJCnWyePPqkztbleSxE0MHV8UNHpeJy45JYdT1NONTAGrUWZ3 PmvopvnlEXIauSzpGxEYJC50R79rLhHpyvTgRrYvTcFum6wY6n3Kp4liA0C6m13z1obA QGLJETolj3MKF18oBaGUcsqZ1AuwXyaKpKzYK2FwLEBxt3mAcvg3/OOtLvWZh7o44XKP TB39za4cRBzPp5hKNBeueMWfgwJQpoKgooP90up4umA/w3bRib6hlD41BUA2hN+RlhRj h65Q== 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=g72wU/e2+tUMN8rrYgJKmfgNJZa+U65gluRGUeFny/w=; b=qPtuSUHjn1Vk9WD4K13w0anJlsUI8/joC/xV0JDZ66Q+ZUynwiThW7/g1atxOEktvH aXn7Ifl8jQtIM20gMJCFpiiqF3QYicvNsHsYTCpCtWKD9FXcjTK0t7lrUV6iMlTFIofx tbWbv/0cFg+XrJl9JteexLnJpfx6jWJJFBLN2uXeu3OcceshVwHds2zyTavNe/GVUNmx xSNi8vXA2k97cQdvpsZ2zubFssNIroAmtSW2zsPHJTETXOB+igOGYm0amW9s/QEvjMEO llBhFTeiLIJd+Qqx6QBeBhUJT7Rw3U9YS4jIhz9O2wkIrotPIHYtlFqNvI+OmL3BZ7gN umKA== X-Gm-Message-State: AOAM530+yfNrGeyXcQXoenNQ0XXnvYlfZjGCriulSd5vtiOnDqaD2J77 b7e7udqqjrWKtHVtadQD2XxHSmeDI3j7tKcE098= X-Received: by 2002:a6b:90c4:: with SMTP id s187mr8980048iod.75.1611196599235; Wed, 20 Jan 2021 18:36:39 -0800 (PST) MIME-Version: 1.0 References: <20210116095413.72820-1-sedat.dilek@gmail.com> <20210120223546.GF1798087@krava> In-Reply-To: <20210120223546.GF1798087@krava> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Thu, 21 Jan 2021 03:36:28 +0100 Message-ID: Subject: Re: [PATCH RFC] tools: Factor Clang, LLC and LLVM utils definitions To: Jiri Olsa Cc: 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 , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Clang-Built-Linux ML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 11: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 > Thanks Jiri for your feedback and ACK. - 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 >