Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp646746pxb; Wed, 27 Jan 2021 17:56:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyot0lGxHDM2mFTklRBGTf4UyLEbpsBkx8Xu8RqRmkwQ46u6a5GTUY/ZlF3X7llXkBTMoyh X-Received: by 2002:aa7:ca51:: with SMTP id j17mr11902214edt.124.1611799002618; Wed, 27 Jan 2021 17:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611799002; cv=none; d=google.com; s=arc-20160816; b=XfuQ0lfB1oPdV3vJIM3yjWx7jnNoLsxMkVd8cY+qJzfkCI4g/9ZX6QjrTxu9nl+PNn +jMosiP9NOFXiDNrLvKhKymQ3I9gnSOtJF4JzI+elvuo0JmZ0ZT54+UZnwQJY5EsK5el LrPnGURylKU8yUKR9Vg3Yjnt9915RKum6bHCTESG9vLVQBX0mlw1z4tMJ+cwK3fLNzpf e8LITeTcadnTDgDX0syNKChxFscoKOjUKJ2akWV2B8eF2OqknZAJr0aRDNYea5esyvB8 hE8xco8Cbpqf0BpsWpZDFtvLiD8YeA2hqYOOLsPi0Eqne4dUXJn+mm/zPNziZNDkL1jO twhQ== 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=mPzE75sxLYfUlCv97bbvkWvx0ps9bQE/9kEnSkv6IXw=; b=BVyLJxM7qC3wQ+U5q3oalS04mB2oXxZC8NW87nAhF2b5iODTh0xP8N6jJeCxHaVCUW l7fRXCcGXUn7sM9l3C5Cb5bxmIAHp4zxxNIWrh1RDG0ejzNNCRAs5BnxjjtUiAp/2N6k Nbd6JJ/Bu2p4o9Uw3MPwxaq/AiThp2Yt2zmk+I6PrQ+FeFIsMAIbzwDVD0Btd17Dc1SP ixVix5h3lt9bwmuTiFbMXYL9daWSgrbzt8QR5NSFnqb3WP9JBEeR4pP6q4IlFe3HXHOX 2Jqsg6aFviRNidnuiX3Y/7aOshDBYRyrzNZokmDP6p+BcU/fjOuNByYFoe4JF3IKplPe 4B5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e8bFsEyM; 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 n2si1587693eji.120.2021.01.27.17.56.17; Wed, 27 Jan 2021 17:56:42 -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=e8bFsEyM; 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 S231159AbhA1BzK (ORCPT + 99 others); Wed, 27 Jan 2021 20:55:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231124AbhA1Byd (ORCPT ); Wed, 27 Jan 2021 20:54:33 -0500 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20730C061573; Wed, 27 Jan 2021 17:53:53 -0800 (PST) Received: by mail-il1-x131.google.com with SMTP id y17so3801045ili.12; Wed, 27 Jan 2021 17:53:53 -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=mPzE75sxLYfUlCv97bbvkWvx0ps9bQE/9kEnSkv6IXw=; b=e8bFsEyMgxtBL1zwRK8h6w7xJ2/pCdY9BVxmTTTqSIiRnTcc23zWzt9w2Wuc7HkYjZ DEv73+GfKPXGLuH9EX2lwYHdkMkBT1d4hiurVVMi8GjLwhzbq4zQg7aHLO27UnXgAlNW N36dg9f0JBH97sYPrQSYjPFv1hmMpc3l4585BM+lXupjEbwCMhGAoSrRsgeXz3GpKR1a QJuCsVWxTXVlTOoTb8WhE0tnCD0eH5qcUA0KLASu4ealWOcr39QP5Az5CSmdTTZgx8po gdaqzTPzL+X9KP2M8esz7nmF0JGVWf8G6g4ATE/EtrYSLa2AiMpkoMPsx9x+YR4LCw7C M4DA== 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=mPzE75sxLYfUlCv97bbvkWvx0ps9bQE/9kEnSkv6IXw=; b=M/+0Hxwl8I9uD3JloXt6Gl1QXQQMOV9ODKnFBFcD3MNgph6Ik5Q6cpJbZe+k25gcgC lPDBpW+uKew057EFjNCMXjAP262Guq+Mc5dbqt3DgHk1pZbTNs4UBORy12xByGMyHuxx BUlA9/v8tChIYvSAaGzqp6ACjUwJYsJ/ObKnnixLSm/kNJ/fdXjoXorkz34QwOE+AeJf uPzSZvisaTTFlDWu+9zHsb0sxBoki46iofw7xYtIgkP2bYme4bDaxn2acRhu0bfMUtO8 +nbNKhUQ1jPZwAXlVfbjXoUEjI5V1vo8MKLA3b0uEi1gCdXSkfgTihHX9gx14iITSdV0 cSSg== X-Gm-Message-State: AOAM531L2+6n2shdjetUZPAzPVRbQ4kC3okZwKwV7ArAEuoM13GbGXpX tBS9JEUD5f2sS66WEggyi1Q/b+GuRYl8elAUm78= X-Received: by 2002:a92:c80b:: with SMTP id v11mr10919105iln.215.1611798832520; Wed, 27 Jan 2021 17:53:52 -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:53:41 +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:41 AM Andrii Nakryiko wrote: > > On Wed, Jan 27, 2021 at 5:30 PM Sedat Dilek wrote: > > > > 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? > > Yes, please use [PATCH bpf-next] subject prefix and cc > bpf@vger.kernel.org as well. > Please see link: https://lore.kernel.org/r/20210128015117.20515-1-sedat.dilek@gmail.com - Sedat - > > > > - 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 > > > > > > > > > > [...]