Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp687465pxb; Wed, 20 Jan 2021 18:36:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmZUaE88HP3T35gJl6oWu5hZvyY++GScHncuVugMn+X8CtFWkJE1HOg/HoZxh8GdSmXJw4 X-Received: by 2002:aa7:cc18:: with SMTP id q24mr9261223edt.82.1611196562633; Wed, 20 Jan 2021 18:36:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611196562; cv=none; d=google.com; s=arc-20160816; b=PZfS+5AWGzzdfj1jqlY3ClpkKYTSrmVyWddCfUbzhkiyG9+wTWdys61dcvjgdsZQD+ m74VC3+PAJDcbICAzDsNVmDOGrdrUKvIrZj1cvHk7wBOd3zghqYynzxrnkwUCDIqE5mW F5UJI4LtsLR88K5RtNGdCt7TO02AZatn813K+RuSwy3HdT5wQFh39O3owVCMtLzbEOD1 RbY7DNr4h0NT1i5mAJgdBArKNkNJMsWWKhLbUcqnf3xg9VynFih2H5e4o3bsnDfXGlce 2mBmF6tKEkurHpSPKqUg62iVLuDammXO55WX7KbPxoMpOMHAPgxU7CUMyByuhdj4PVWi 7SRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LP0iiQuizg9LomNFlz79SVokUpxYY8lm5HUjpUc5rfc=; b=XHLhugJ2+SY0JvAMFZSB7nWb5hAU1xuzuPPXkL/Nvz35bZ+2XPYFPZWUSvxziJ8xNJ mYYT+K75BHaYmlLktVFOO/RR0yM1FbnnCgu5OSGklomvWpJCmNvB/iIcnBFFc32IU5w3 NTocaWQaTzyIIRhRA+mJ2KkLhqbRN+vsZM+IzTPTVQmq8MPoj8vURH+i7tC2UzJ30LtP AYwY3J+JeYGRU4Gd1bHHjAvVEN1qur7H7HNTmTVY+ErOVvSn1D27Dih5f66xnciqrtlA TIgcK5l4eQxFonFIEXqB2BZCvKhN8bq8bwB8rLupGjISqhW0EUqB+BHB+t+SbBHXLKPX vo2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MG8tT2Wd; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zk17si1253197ejb.268.2021.01.20.18.35.38; Wed, 20 Jan 2021 18:36:02 -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=@redhat.com header.s=mimecast20190719 header.b=MG8tT2Wd; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392492AbhAUAKo (ORCPT + 99 others); Wed, 20 Jan 2021 19:10:44 -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