Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1021308ybl; Wed, 4 Dec 2019 15:19:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzQpLnB2ukrwNLvnm3SFkGKBrCXLW9UIEiPERPGMf+EHRJ2PPwK405DPEPUoMoIbnbGfZ6i X-Received: by 2002:aca:1103:: with SMTP id 3mr4916479oir.171.1575501543686; Wed, 04 Dec 2019 15:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575501543; cv=none; d=google.com; s=arc-20160816; b=wJn99OVUAgUGFVRaFRW0IP4P/pmQCiKDMdR/lFtHXr/sCUt6PpIvnnLhiGUrGVj0oR JIMFv5pKr3sccyYQ6HRqzyLAvBdRLsMQwFhUvMqYgwChwZfLJ1w2q+F5QVtjTK2CHRpm zlCO69YYyjYL7CMc1xHharwWMUmE16AXyw94gP6XPFNcWbKAeaW+w2/B+m2cPrjBwnvC 4RlKTvyIznIM/SjUMt8ooKuCwlXCc9j336EwcfLEc/R5/Y0lFEVx5RSbE7PGtSPzjjHU 9wNAcv2InTwEUK7GWc7e0oBbtUlOW5ZVl3soFoX41PxcQAQ6UaVy0O+wuSd9TDHOlcem zcNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bMFgfwVDLyNfP+n9tPTAj8QY4bC2HsMSOAGKRA9gakw=; b=lmKoN7ypWt4lUpNlP/co7Dcke4Uxk8mElZ9gkfJl8NKQj2Qjzguso+skvAhaXpkBRL do5oGf7SZ25GW0CefTjCZsOsyUE11xdZa4EbQp7xvc2T8iLAFQiigfnssd3e5t0uvMDd CAHRwHtT7BOw+EepKOB4fR2695IXqHDt5v5w3BaABwfSOEaBgkCvcTXDYMw7EwpMeUvQ tX0TvzOnkZeNXD4ymEh6u3usUyYw/x+OtEEWCtRgDTz/2sTqIOqogwAbJSsj5BRLxs+J +STaXvkb28M4IJMG3AlN94saDgWaif9dbrItEbn+Jxbfh8IzMhHPgmo86hllNSSdC15j cBdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="MtSlA/Og"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l64si3974074oih.2.2019.12.04.15.18.50; Wed, 04 Dec 2019 15:19:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="MtSlA/Og"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728213AbfLDXST (ORCPT + 99 others); Wed, 4 Dec 2019 18:18:19 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:36316 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbfLDXSS (ORCPT ); Wed, 4 Dec 2019 18:18:18 -0500 Received: by mail-pj1-f66.google.com with SMTP id n96so451809pjc.3 for ; Wed, 04 Dec 2019 15:18:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bMFgfwVDLyNfP+n9tPTAj8QY4bC2HsMSOAGKRA9gakw=; b=MtSlA/OgS15E0uba3TIek4yo6Dv72Ih5Vz8TtayNLcYj9ko9Y5pcJja4pXlDi+U5B2 OzrIhaayNaSUVeiGvMc3+qo1sSa3EgJ+AupbHkkOI9WA9YMvGRb8L6EbA1y0nROXEUzq DLekXMbit5LGIAikGGF/a6V21GXdqB1vVViqVj9DWbn3bDTmE1RQTdmSpi3ceBVwG8X4 +RdlDSRJZH67fNHiUDPIpFR2b9qTJvdcCugWSM4lang0P7FFhrNPfmnNSsvwOGYMAa/t Da8KmVghIDsNP9WG/dmjuj/U+HPlXUbXm2G7PwKgGY8EAOc1R7+MLdFwE4WaevwUll23 YYAA== 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=bMFgfwVDLyNfP+n9tPTAj8QY4bC2HsMSOAGKRA9gakw=; b=H5ay/DtGp1YZVIVFeTbSJdsJp+faTsaXTMuQcV3TFjuK4XVtJsuf5ZgVFkZWflUgqi WqJmvoU2BroIn2WiNkJmBF/LFQED7DHSUTgF4CoTqzoedhImUj87Gb5MtklMOmwVrLYL LbdFjK0JoM4bTMemdzvm0hq9Yny8KxAe5c7kMcc0AjDrjXf+K2SPLeO6cGyXigAWzVuy Q2qjQ/QQITTySGRC0KMm1XIHVQNd4ULGPPGXsXN9UqhcW361PLPZCK5SoSx58/BOiMIX 1nj82UdwtjCxn578+gjk0FXvJ30js8mPEol1EBeT/CaJVSE1Bq85GBJy1PQyk8ArFo2u QUrA== X-Gm-Message-State: APjAAAW0PgRFwjXuvydxSoa2G0PuXPuQqxiGOBYifSdHTyy3aUiM2/Ft SFpzSTpO9Cu5bw+zukXSxpZdhsrJI4FrYBPQD6cTyg== X-Received: by 2002:a17:902:8216:: with SMTP id x22mr5812405pln.179.1575501497559; Wed, 04 Dec 2019 15:18:17 -0800 (PST) MIME-Version: 1.0 References: <20191204225446.202981-1-dima@golovin.in> In-Reply-To: <20191204225446.202981-1-dima@golovin.in> From: Nick Desaulniers Date: Wed, 4 Dec 2019 15:18:05 -0800 Message-ID: Subject: Re: [PATCH] x86/boot: kbuild: allow readelf executable to be specified To: Dmitry Golovin Cc: Masahiro Yamada , Michal Marek , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Bruce Ashfield , Ross Philipson , Ross Burton , Chao Fan , Daniel Kiper , Linux Kbuild mailing list , LKML , clang-built-linux , tony.luck@intel.com, fenghua.yu@intel.com, linux-ia64@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 4, 2019 at 2:55 PM Dmitry Golovin wrote: > > Introduce a new READELF variable to top-level Makefile, so the name of > readelf binary can be specified. Thanks for the patch! This is a general cleanup that should improve cross compilation (readelf should be treated as ever binary in the list like objcopy/objdump/etc), and allow us to use binutils substitutes for readelf that aren't called `readelf` (ie. `llvm-readelf`). > > Before this change the name of the binary was hardcoded to > "$(CROSS_COMPILE)readelf" which might not be present for every > toolchain. > > This allows to build with LLVM Object Reader by using make parameter > READELF=llvm-readelf. > > Link: https://github.com/ClangBuiltLinux/linux/issues/771 > Signed-off-by: Dmitry Golovin > Cc: Nick Desaulniers No need to explicitly CC me; I monitor our list like a hawk. > --- > Makefile | 3 ++- > arch/x86/boot/compressed/Makefile | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 999a197d67d2..612a55d25442 100644 > --- a/Makefile > +++ b/Makefile > @@ -414,6 +414,7 @@ STRIP = $(CROSS_COMPILE)strip > OBJCOPY = $(CROSS_COMPILE)objcopy > OBJDUMP = $(CROSS_COMPILE)objdump > OBJSIZE = $(CROSS_COMPILE)size > +READELF = $(CROSS_COMPILE)readelf > PAHOLE = pahole > LEX = flex > YACC = bison > @@ -472,7 +473,7 @@ GCC_PLUGINS_CFLAGS := > CLANG_FLAGS := > > export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC > -export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK INSTALLKERNEL > +export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL > export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX > export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE > > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile > index aa976adb7094..1dac210f7d44 100644 > --- a/arch/x86/boot/compressed/Makefile > +++ b/arch/x86/boot/compressed/Makefile > @@ -103,7 +103,7 @@ vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o > quiet_cmd_check_data_rel = DATAREL $@ > define cmd_check_data_rel > for obj in $(filter %.o,$^); do \ > - ${CROSS_COMPILE}readelf -S $$obj | grep -qF .rel.local && { \ > + $(READELF) -S $$obj | grep -qF .rel.local && { \ Grepping the kernel sources for `READELF`, it looks like arch/ia64/Makefile makes the same mistake. Would you mind fixing both cases in the same patch (v2)? I'm also curious about it's use in arch/ia64/scripts/unwcheck.py, and scripts/faddr2line. +ia64 maintainers and list. I think if you simply remove the assignment on line 17 of arch/ia64/Makefile you should be fine. > echo "error: $$obj has data relocations!" >&2; \ > exit 1; \ > } || true; \ > -- > 2.23.0 > -- Thanks, ~Nick Desaulniers