Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp640182pxb; Wed, 27 Jan 2021 17:42:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz/aOZEEu8ySV1eZNImWS+I5CfSnwx4OXylHpGE2yB9+9T4em1X8ITSZnAsJTsoQRis77s X-Received: by 2002:a17:906:7f98:: with SMTP id f24mr8790947ejr.75.1611798142495; Wed, 27 Jan 2021 17:42:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611798142; cv=none; d=google.com; s=arc-20160816; b=ZjdQFDGqnOuHdIp5b5umjddxS85pI0x9nyO9ZOpoC1DXhhB1jmO/tSuke5nAqR1wxr nfVjARuO0KtbzyyU+LQ4hMOLhJhC7Bzk7UKSZ7y4L92HW7ldc0QTky+IEOEwoTKfK00K puhQ9GhWja7Rl0YWnkqnq02eE3WEdkdtqFx71gZrTO1f7EmIg0bE+tXyWW1t4QTU7WP1 2Jd1R/vqyb51Ox+ifP9jI0Mzbdl3iKeZMXooT6ec9WC6MRb10YANCZNihBPVnpxS7ptr dBcfcWQCZ4Jt54zRxa/pVHI20zCxgdmoY3gWg66xX7xssSeD/CDZoWdFSEG00inHfWzZ WMIw== 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=5oabX9d0jpF1qIOlWbNO/kMyuSTCKbx/P4GY6FSPWA4=; b=p8eMhhfIW5RGbicWfZWNpHrJ+GbnwTQIpp4qDCUT0dzgc2FEXjZBstNmELcMZNTv7s ie8JE4SZZxDi10erKxb2z23qn+1ITYUt6LCz2CICj22YhNx3fmPQbCMTA2/ahIS/msXz MKABBcBUCHeveA+2XyEoAx9vJWB/NQIS/aRXrG0Zrtvw6EdPdfWreeyK9CW5WEh8oUM2 QDbRJI8qGbMIOThPeZRm5b24xLPaW7waOw7B61Wv4hQ0/Cjc8DchePRfdBi7tIoaygn1 BL3U9NaWiMBMNOAi0ptTwcjsZ6dIMH9FGJuMVzGH7aicbQIRUA2QVZbQfVurm28FyX68 NOyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PkD0nc+w; 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 s19si1645708ejr.511.2021.01.27.17.41.58; Wed, 27 Jan 2021 17:42:22 -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=PkD0nc+w; 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 S231203AbhA1B2J (ORCPT + 99 others); Wed, 27 Jan 2021 20:28:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbhA1B2B (ORCPT ); Wed, 27 Jan 2021 20:28:01 -0500 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8112C061573; Wed, 27 Jan 2021 17:27:21 -0800 (PST) Received: by mail-yb1-xb32.google.com with SMTP id k4so3920900ybp.6; Wed, 27 Jan 2021 17:27:21 -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=5oabX9d0jpF1qIOlWbNO/kMyuSTCKbx/P4GY6FSPWA4=; b=PkD0nc+wc41Kw8XtSBDTOstEjO9r6RU/RYCrxnnRLovFmU3E8qLWsFJyS3qBVQkHf5 W0ZGWcTpfq9wWTBGA1HRxgSLvITs8LwhrP6PE7GY1dHl4R7xf/2KE/4ViEHKb5rCxcjv ocJVsrlUhPri/1Hgs4+7z1aswAR91Pc4WTXBmJpIFyczbtjbcmF2XXCjz0eYcCDZiEyI ve8e//LujQT8m0dBmD2K4HljjNpvgVKCnTiBuHCxgmC1KhRlLkw2ZFNP3mW9IX/WWdmD V+jDJl8jtrS2/hWo/Y5Ub5YxPUtJlPyffeWJaM03ZhYyW4xptYGwRZ/6YPftym+Zw+PG X0hQ== 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=5oabX9d0jpF1qIOlWbNO/kMyuSTCKbx/P4GY6FSPWA4=; b=DMKMalo36Gf8G66wf748IqlL7PCRF65B84OPtavhFwoWJCepkufQ1NA+1xAApwRgM4 KNyTbcUFcLRlvJPsOCXQZJok+ZfF8ArznL0zhHFxNRm/27rfBWmcftbSTFXnjWIfr4zy wJOaB7CRisZoQ7xBqk1zY6IT+VlMcAqKci7jjpkBu++EXH5us1Jw2u5RKj4yxlH+5fF6 LzrIk5EYZTduYRbBy2Q7BLRSGfFIZLRoqaHIu7bbGqJfbDCn97eq/hj8rSpSwowvlixq pY83nR/DL2GEUfa3pHs8G355XtawY2Xxc8YbJ1MCUNFzdkSSMnTTApxk6JlQv5yLDSUv wjUA== X-Gm-Message-State: AOAM531s+O/4UGXjFClJmdAOBop9t5Qcq8dr0V43QMfUcxuTB0BxJNXG kPICrWC1GfV+JsJmLlEEBfG/NFz5zj5l+GDxY5U= X-Received: by 2002:a25:1287:: with SMTP id 129mr19516582ybs.27.1611797240604; Wed, 27 Jan 2021 17:27:20 -0800 (PST) MIME-Version: 1.0 References: <20210122003235.77246-1-sedat.dilek@gmail.com> In-Reply-To: <20210122003235.77246-1-sedat.dilek@gmail.com> From: Andrii Nakryiko Date: Wed, 27 Jan 2021 17:27:09 -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 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. > Changelog RFC v1->v2: > - Add Jiri's ACK > - Adapt to fit Linux v5.11-rc4 > [...]