Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp640984pxb; Wed, 27 Jan 2021 17:44:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQih1J15OOJrfOTn7jjDhX4ElHNfXmmZsjrIVJjW2X8wC7P72B+vMOuSrP10n5mH5iTDTB X-Received: by 2002:a17:906:1c17:: with SMTP id k23mr8731045ejg.255.1611798251289; Wed, 27 Jan 2021 17:44:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611798251; cv=none; d=google.com; s=arc-20160816; b=hdWfSY6pB31otfMDgSHRICpiXq36RIUSoLYKv2z8PYfNr3OYJbC4fEfRWQBa/skvBG 4vpSR38sXLfAD6WRwh/xwB5hVH6LZDT8/HBTQHHbJE58oBsY/fPQASIykNN1HLIvJT7N apSw9+LS8MoX9gU46+SlnGs1Rz2gqzFxE9ONN6wXBuClz/dhsi55j9TobcSagyc8o+ze 93TnCmZmgWM768UZHCt1YSBDRAgu1J9LsRglpgmU0WWIoB03DG9PUMse3qn6Id/elwdp /y+PIv7XosHm+PR2FCk/P8ypgS8etbOvl+Vges/VrNnnBlGJ2GVUpoSn1QujvFpeW1Lo 8v8A== 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:in-reply-to :references:mime-version:dkim-signature; bh=levWwdmNnK0CrUKkgeazFotHMRfPFFjLuGXoNcWWnk4=; b=rmpQuWLpkqUMEZCe8XYWZtOELnQqMosGaj/0wwewtQFB+lAqf+seYcwcBc+8ZvByhx NvdLQZFwpmi6OfrpWsw5pMxaArwVbh+R9nG9lF9xgEnLZvKGXbrIufJO5gN9oLHlsyFn Z1ibbq54TLF5hOBuOe9rfp8RCgANNm9nUfHA8eRAslbvzhyji0TouuFb/qaglS+gJVQI 4IRm1wyJQHZp71sUBKA6jH6Tl90PXwrdlXn/9ddxA3WCCujeW9VBLmwYD1oU189a136B BWmbXiqJbxmRgc1TP6mRr9nzvRiBwFhJeZ2BiTaeQlw5vpXHtpVTZCqryhXoXipqUeTu kW7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Kx6l4kSz; 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 gg14si1665097ejb.367.2021.01.27.17.43.47; Wed, 27 Jan 2021 17:44:11 -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=Kx6l4kSz; 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 S231151AbhA1BnG (ORCPT + 99 others); Wed, 27 Jan 2021 20:43:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbhA1Bmg (ORCPT ); Wed, 27 Jan 2021 20:42:36 -0500 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901FBC061573; Wed, 27 Jan 2021 17:41:54 -0800 (PST) Received: by mail-yb1-xb36.google.com with SMTP id b11so3929257ybj.9; Wed, 27 Jan 2021 17:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=levWwdmNnK0CrUKkgeazFotHMRfPFFjLuGXoNcWWnk4=; b=Kx6l4kSzTgkuB2jfC0liiJLrDkvg6j0aYZnI1FRXPwCB57JhTXm3++vc7L2IB+SdDE uFQE67X/0Qo6o/5aWXzNddJxoBe4QddNq4k7jqSUSBb22ywardf5+F0cKyiqq6RcG0LP YbT4kP4IHCrNuS08id6KFv6XnGRN6BdFHPnlk4HkAdE5G3X92ebeZNOO3S23pXEpUTyH feMD8aYSCBYYtLiJjBNLo9xF797s9pVENsLMt99bsOMRxB9H8hrU9Rhqt6N1mil9Kx+A kdhnb4XOzxjZKsu4UXaH6eSDjNEsD1SPbUSS043jxNGy/oba6LVnVjDY4NzJoHsrzQEY 2Xxg== 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:from:date :message-id:subject:to:cc; bh=levWwdmNnK0CrUKkgeazFotHMRfPFFjLuGXoNcWWnk4=; b=BEjX89qzk8ClfQ9cUiCs83Ogh63257613rgwUSgiqTvTqG4xitL7f6oOcioA5qhP2P ZMXyIvB8w3EDS8+AIvow+1BODiBqTqT9j/A8fSjv6UTdSrDEbitU7BYqc+tQnc/xAZ4/ Xj6UB1M/OD9u1Y6Nt7SgW1CQfKjTAbmjztxBRAfbFiKvewpLSQ2sPjnUl4bc79bwv/gv YuFl++RnHLsOjJKvM6QDu5MDTkds8IZ3422uRk+bxtFqGW3o9hZq532cqxqP6tJN//he cT8/K376DKbpqb0e/oyT43md85w9NruZoGM7Ri/++GGbsR+pOarEJg0ENhdF8cknG7U+ p7AA== X-Gm-Message-State: AOAM5316prbTDXfOTGsO91hrOYMIaibJUd5P5T1cMI8Ev6O4Qo1t4SgL FflvpJIzq4QSFQlu51pxl/m54ruE7oj+hbXhnUE= X-Received: by 2002:a25:4605:: with SMTP id t5mr7683661yba.260.1611798113726; Wed, 27 Jan 2021 17:41:53 -0800 (PST) MIME-Version: 1.0 References: <20210122003235.77246-1-sedat.dilek@gmail.com> In-Reply-To: From: Andrii Nakryiko Date: Wed, 27 Jan 2021 17:41:42 -0800 Message-ID: Subject: Re: [PATCH RFC v2] tools: Factor Clang, LLC and LLVM utils definitions To: Sedat Dilek 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 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. > > - 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 > > > > > > > [...]