Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp640494pxb; Wed, 27 Jan 2021 17:43:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLCtbohFFxnUbzYK1/MQz72pqUhtDFb8NVtbcTLfv3jHiqhidZaXXbYrpVqfWKPn1jtSpj X-Received: by 2002:a17:906:c793:: with SMTP id cw19mr8686406ejb.246.1611798185606; Wed, 27 Jan 2021 17:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611798185; cv=none; d=google.com; s=arc-20160816; b=hEcAPGUYNJZZOgf3yqiIICmVyJ74R60zozhvI6k0gGJQIANV10cIrAsTRVWzCDzORU ubM2DuGh1tuz6kN2t8iglCqlK6+guZr+K/AYc7EWmUEFqsVeDRalj1dk4kBPbOL6VQ67 Uby9hBgMrXnetld+ttDWHPiNYeZVjxPSOPG+IUrvIL+UpsAyIVAEsv5IT/veVD3sQgzR oObsaSXSngVVgyDzmo9fnir9XWn4INdDADDTB/JagAOtzVn9Zq+zd4FmCckREK+Txpgr D7sYD46xKlq3014LZOfcgX7vyR8l9TDMb7HWwocz5nW4iIFNh1V4t3PrIOIjm50dLTQz oAow== 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=fPG3ZtOj2gQfse8nMNhqlz0mkZ3a1oBf9GMrWLJa6Uw=; b=WE5Ur4l3dFyAedPd9jzv+WQwR8em4FLHp/wDCS1BdiZha5A5jxjsEB/Va34uCDxS7O 7cFpsPqM4EnwzKCFOamZZaQbytQuF+/3Ifrad/zsBdxfN8YRviX6D0lXeNu7T9ZqmC1K BaXqHg7kiP7t48FbJ8YHokyX5jGfdHbSHtUGfdQtthtw7SUOFINO7s9RhdjaEdrdyrx9 h16KHdYmtobouU01Jhz4NMfWcUWCTm7V88IC/DyS9IJqot/k8bGLxg7PPzHROAaWzGLv V1WNlySpikuIHZl7ZT1byroZbN+JILzkXS8e2c0H2MGdZcl6NFHcbx0HKH2v/8LBXxA2 uOJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VEpiSbCf; 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 l3si1815777ejd.83.2021.01.27.17.42.41; Wed, 27 Jan 2021 17:43:05 -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=VEpiSbCf; 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 S231357AbhA1Bbe (ORCPT + 99 others); Wed, 27 Jan 2021 20:31:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbhA1BbX (ORCPT ); Wed, 27 Jan 2021 20:31:23 -0500 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4993C061574; Wed, 27 Jan 2021 17:30:42 -0800 (PST) Received: by mail-il1-x130.google.com with SMTP id d6so3767519ilo.6; Wed, 27 Jan 2021 17:30: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=fPG3ZtOj2gQfse8nMNhqlz0mkZ3a1oBf9GMrWLJa6Uw=; b=VEpiSbCfBHRjrYMXVDVzhvZaq3Fya3QXYX3Mnv16nS6eiz4QeRUhmYabQSu1s55uWW mv2qIFBTcWnahAyw57iv7H36EjT6r+DQcm3zu+JOxjmXwby1bJXDfci1OC3f32C0jgeA 4CuxyElvATsJN6/Nl0w08jLW/q3anrx6MWnFeFGuurqMN+YSYqjsN1mZDU3mdj10Yjge xBjTJm3Li37rT025VYsZR2gVSmQbkQWEWTed6oxSNZOiyYsSIluTEzATbO13BmTrTHY+ edUD+LSQMr3jzDy9mtKzSiLHo21O8dNFQqzoCv6Rnand7LKpygt8pbf3zSXFY8ZaurK5 DItg== 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=fPG3ZtOj2gQfse8nMNhqlz0mkZ3a1oBf9GMrWLJa6Uw=; b=MtvTT1Su8cc7roCZQumCvFTYxN/ifHeLcWfbvI1Y4XmWmVZkznOTpBIMzjpWjJGCUF OMWbQXoi8bWFXmVcuzJi1BotrS5adyAMKXB9AQpaw+T5BsNEc+JgrusjfN6tsaQNcBsC 0lqp/NMJDmauOpy4IgJhef2UyxoAD8F/DrpfFCV5IJi9KiGKVV1Gs+jKPoAeFbOXUb5D d2xO4IBgc7cjgxyiJxdZzHn6azdbXON8AEQiIrdCaLwTPiCdFAGwxhhZ6YJyMgnEDrBE zAjsGsZQmdcTsPhDSPYsaXakiSZgFHZNSO0RBm5n5wcfD/8Bifc4/yEFqOrFuqGJTwnq bCjg== X-Gm-Message-State: AOAM5339Vu8JVXaYvf61eRiZPcnK9VjOcYg5RaMVl8CIArNN9wynBSYk jajoteQQlE2O8tG+l+CSyrKHp1MfQ9VkAxJSJRA= X-Received: by 2002:a92:c80b:: with SMTP id v11mr10864577iln.215.1611797441911; Wed, 27 Jan 2021 17:30:41 -0800 (PST) MIME-Version: 1.0 References: <20210122003235.77246-1-sedat.dilek@gmail.com> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Thu, 28 Jan 2021 02:30:29 +0100 Message-ID: Subject: Re: [PATCH RFC v2] tools: Factor Clang, LLC and LLVM utils definitions To: Andrii Nakryiko 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 , Jiri Olsa , Namhyung Kim , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Quentin Monnet , Jean-Philippe Brucker , Tobias Klauser , Ilya Leoshkevich , Andrey Ignatov , Stephane Eranian , "Frank Ch. Eigler" , Thomas Hebb , Masami Hiramatsu , Briana Oursler , "David S. Miller" , Davide Caratti , 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 Thu, Jan 28, 2021 at 2:27 AM Andrii Nakryiko wrote: > > On Thu, Jan 21, 2021 at 4:32 PM 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-rc4. > > > > I hope to get some feedback from especially Linux-bpf folks. > > > > Acked-by: Jiri Olsa # tools/build and tools/perf > > Signed-off-by: Sedat Dilek > > --- > > Hi Sedat, > > If no one objects, we'll take this through bpf-next tree. Can you > please re-send this as a non-RFC patch against the bpf-next tree? Feel > free to add my ack. Thanks. > I am OK with that and will add your ACK. Is [1] bpf-next Git? - Sedat - [1] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/ > > Changelog RFC v1->v2: > > - Add Jiri's ACK > > - Adapt to fit Linux v5.11-rc4 > > > > [...]