Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1000497ybl; Wed, 4 Dec 2019 14:56:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyHNzpjeUXlVM6fA7/q5hoMS8tvT0VbiVlIqRWhO8kwMDDWa/x9JyMKafbMM8fmuN8z7HRo X-Received: by 2002:a05:6808:6ce:: with SMTP id m14mr4709871oih.27.1575500199062; Wed, 04 Dec 2019 14:56:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575500199; cv=none; d=google.com; s=arc-20160816; b=s0pvkN7m0+gQeKjWs5aQBtzt1jAxBPM8EGjUg9+9CksJmZiSmfUkq3Hr3cEN+SHzs9 9RI8Z+c3f+q3B5qzTnkEZgz9KwzpCMCUCpNpPMffxZoXSfKV4QBgRqsRRZnpUE3EY3VI tDzj60WBLpdUDA6HyR+DA9favU1rUFOEbtzkrtigI3xMyPJusvBhjiF4t3ktGl6QtxYw aLAvx5t4ua3JaMulz7p1KPqwkbBjz5DWHV32pETHq69RhrbRK6JKa39R+aVaw8HgtLFt NojSMnFXLON4SCl5/fvLH0Awcsnw2F7/HHzD4wYvMNGXO+XumPemCZop+WQj30RyUIZY Jlig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=A0Ogu7gZHOBeP65sd0xtu2h11UWTeto1NUvcxcTaNio=; b=C+fp0/0YE5YOpD0rxNBCcSvX+YVrWYbh25D+hNPEtMU2CXYR4K1QuQyjyVLqjahTCQ UkTUlDw581tHUTn8h1Ws62PzE1jeApURZtp701ox5bVPoiISxubuP2wcFDjv5LJEZEin 5nDyy/5bLia3obSeLwe43x9eqfdkRlDAf/GyQlRiIuUrKOVhZ5ZTlk1q/vGX/3D4a1aB mfQGrAIpn/KShrM7feGYXKIxAa2ppJkId+rKSkRiG0zpHlfpYOtk+LlInj2O+aAJE6hR AIVMf/uTTvKw1gQ8ZQJ4LLcan744RK/Jq4/VEwMCV2BELd0ViYz/wjKeG61ZbvAsG0D8 AFvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@golovin.in header.s=mail header.b="jE0Xif/F"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si4072197otq.42.2019.12.04.14.56.26; Wed, 04 Dec 2019 14:56:39 -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=fail header.i=@golovin.in header.s=mail header.b="jE0Xif/F"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728379AbfLDWzc (ORCPT + 99 others); Wed, 4 Dec 2019 17:55:32 -0500 Received: from forward104j.mail.yandex.net ([5.45.198.247]:58843 "EHLO forward104j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728284AbfLDWzb (ORCPT ); Wed, 4 Dec 2019 17:55:31 -0500 Received: from mxback26o.mail.yandex.net (mxback26o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::77]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 100914A0BFF; Thu, 5 Dec 2019 01:55:27 +0300 (MSK) Received: from myt2-416899e1d7e0.qloud-c.yandex.net (myt2-416899e1d7e0.qloud-c.yandex.net [2a02:6b8:c00:1caf:0:640:4168:99e1]) by mxback26o.mail.yandex.net (mxback/Yandex) with ESMTP id CiCpCrHJu0-tQXeZx5L; Thu, 05 Dec 2019 01:55:27 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golovin.in; s=mail; t=1575500127; bh=A0Ogu7gZHOBeP65sd0xtu2h11UWTeto1NUvcxcTaNio=; h=Subject:To:From:Cc:Date:Message-Id; b=jE0Xif/Fuj4dQpqsnEzIGuJnf00yVfKn/AwRBBClcsTLclfG67clFYiNlw4uGFxUz UrJD01D870ksmiuhUS7sNWx59LOmwf5ywibSBqWUF+Pv9NeRGVi4Cq2Kvfx+o5AM8j 6etU6pOBx1cRhpNOfFkV/QXjuHZonbXPVLWh1btk= Authentication-Results: mxback26o.mail.yandex.net; dkim=pass header.i=@golovin.in Received: by myt2-416899e1d7e0.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id QEcSBchbvx-tOVumEJ1; Thu, 05 Dec 2019 01:55:25 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Dmitry Golovin Cc: Dmitry Golovin , Nick Desaulniers , Masahiro Yamada , Michal Marek , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Bruce Ashfield , Ross Philipson , Ross Burton , Chao Fan , Daniel Kiper , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] x86/boot: kbuild: allow readelf executable to be specified Date: Thu, 5 Dec 2019 00:54:41 +0200 Message-Id: <20191204225446.202981-1-dima@golovin.in> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a new READELF variable to top-level Makefile, so the name of readelf binary can be specified. 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 --- 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 && { \ echo "error: $$obj has data relocations!" >&2; \ exit 1; \ } || true; \ -- 2.23.0