From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD50BC433E0 for ; Thu, 21 Jan 2021 00:11:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C0A4238E4 for ; Thu, 21 Jan 2021 00:11:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392547AbhAUAKs (ORCPT ); Wed, 20 Jan 2021 19:10:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38082 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390766AbhATWye (ORCPT ); Wed, 20 Jan 2021 17:54:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611183187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LP0iiQuizg9LomNFlz79SVokUpxYY8lm5HUjpUc5rfc=; b=MG8tT2WdJ4OTMTVBc3knZE91TSWT984EozJjN9wCjK77V+IVZtf+dxF4uZat1fYkMicOHZ fQzwtt5ml90JtmwdzMBMDqE+6Nw+5XIRuFz4YEqZpB+4pkEfgNRJLVEEXalOrYtZ1YPshQ Jfke08VmFZWgh/Ij+TyvWX1GWouSe0E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-111-Ox147a_8MbCpG6Q2Jqcg1w-1; Wed, 20 Jan 2021 17:36:04 -0500 X-MC-Unique: Ox147a_8MbCpG6Q2Jqcg1w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9C51AFAA1; Wed, 20 Jan 2021 22:35:58 +0000 (UTC) Received: from krava (unknown [10.40.194.35]) by smtp.corp.redhat.com (Postfix) with SMTP id 351176A8E6; Wed, 20 Jan 2021 22:35:47 +0000 (UTC) Date: Wed, 20 Jan 2021 23:35:46 +0100 From: Jiri Olsa 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 , Namhyung Kim , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Quentin Monnet , Jean-Philippe Brucker , Tobias Klauser , Ilya Leoshkevich , Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , 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@googlegroups.com Subject: Re: [PATCH RFC] tools: Factor Clang, LLC and LLVM utils definitions Message-ID: <20210120223546.GF1798087@krava> References: <20210116095413.72820-1-sedat.dilek@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210116095413.72820-1-sedat.dilek@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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