From patchwork Mon Nov 9 11:09:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 320906 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1644476ilc; Mon, 9 Nov 2020 03:10:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAJFPDnC1sevCY3i/1aUVG+jT5AlKF63NBAYPY1we1lFLfuE2ULHxB+tz9M7RoH+F1lEB6 X-Received: by 2002:a50:9fe6:: with SMTP id c93mr14664945edf.30.1604920235158; Mon, 09 Nov 2020 03:10:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604920235; cv=none; d=google.com; s=arc-20160816; b=g+VAO9cRAPXgxZeeHm3JHIKGYfQWoD3Tsyq4syxD2LHlaDna8epe42t8dhqRoHlcTM bI+mmHRGYdWUn2epbx4NTi/Dm5n9rJqXJpCyPYkRWcWomcf1Wy1vHC/YEG8p3R5skN2Z 8g1qKw/+7n13i/ZfzKVFrb3CNGJFvreX28x6eGYo0u30DpKnVc8NQhFHjhE4P9ZQgOdW lI7XmbdU1YuKrAEMdOsuNLcF0oT50YYJ3W6WHF1iP1F445uyM327B2JtRiOmslOF5C/a A1r0va5PliI14lcVWppzSX07nOMTR9cJexIwSP8BIuJwr3x+uUvTGATDP3cyT3Goq4eW csEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H2Cfn+qf6dsBYRmwxFqKcDe9TIG0CW1IWpnyFZWW40U=; b=UpHbBxIBe6Rxtq35d9rxDW/8R6pklRRVpEjp/3gy0sWr2Cqkre0R3KceJRxK70fqSO IibaqBLwpko0kXlM2/3zytwcOqfYQfkEf2DtkjXmgTAKKGBdFDOhzG6fwzcaMaFlqHQT Ti5WDQNKUzHCGUjVZ7QQkPqIDWQaZnQb3WlKcqPa0eQ6/5UNIrkoIJEgC7fcua85zM6E BmZtz4bNBxcaxI11y3d7A4NURtuhN85P0A6sFWjDRvlAbYJjckM7ja9GxxnqKBgPn523 dgofynBE/+4oJ+mEtPb/dpSOtBSPBeAci3hTtjVzBqpm5YRbnspYjknoegCtfgFF3EpV Z7Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hncWSr8J; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id no2si6741008ejb.422.2020.11.09.03.10.34; Mon, 09 Nov 2020 03:10:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-acpi-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=@linaro.org header.s=google header.b=hncWSr8J; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728927AbgKILKe (ORCPT + 7 others); Mon, 9 Nov 2020 06:10:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgKILKd (ORCPT ); Mon, 9 Nov 2020 06:10:33 -0500 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FEDFC0613CF for ; Mon, 9 Nov 2020 03:10:33 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id b9so8281404edu.10 for ; Mon, 09 Nov 2020 03:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H2Cfn+qf6dsBYRmwxFqKcDe9TIG0CW1IWpnyFZWW40U=; b=hncWSr8JjQJMv9mJOaj63v3xtItKykUmLbKxu68NLYLCb+LH6JF2NhL6WFKtUsXKry VLo8DxUY00CCVbOZ1927avwa1yM4KtZlIy4YBMnTSjD0veGXAvezK7t5fkcoUBp0P1Gj xgCEgOjGCYZR88K8gd6tFc19a38aObX3Wz3WcdT4geKBNHF69YemSgqWNfAoYDLublIK kIUZTToYoMbOTEJF/Go5H3sEdVEpFJ+5aAdNKUWU0cVz5zrthvkQ0zMod4dXK8sKECB2 Nsk36jsgtjVSsCClWEv5en3PP/A6ZglwILEQ094or2v+e+Cd4WBZ1DNfipk6W+BoD5LU NR5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H2Cfn+qf6dsBYRmwxFqKcDe9TIG0CW1IWpnyFZWW40U=; b=ZWnhoVvaXU23G7p9Z5va+4wCv1QpyHvKmENxn6siJBUS23UoYVTADw5m+jtdXoubyS VDL8d2ly/Bpymbwzs5s5/DR1Jdu/crSBfXOLKN50tvauLj5Z+lDX/KAUHF/BXtFb0XUP KrUnv8ygLw3Xtl88KaLW6RfZ0nLo/YIm0s5Ikfq7W4ogSGm5gjR415oPlPwJ+NoYnzDM lQ58RK/9nWL/QWTOZjARQzkyJHFdrLolI+jO1EPESiYUvBbtOJPYqcHKfhk8zmywvtdb CfNJ8uEssI3lN5tWwn+NGHuBRGV7g8p7/moX1VwJK/RebeIi2Sn/ObQ7WTtFeienQ2/D y0dA== X-Gm-Message-State: AOAM532vUs5DcxDP9AS3xo2/Ocu9O3I8zR2nB0rLxbA9ZFFkYbVo/XaN 9Qj16pArp6ZqIILgbDaKvnP/Lw== X-Received: by 2002:a05:6402:16d6:: with SMTP id r22mr15325414edx.246.1604920232260; Mon, 09 Nov 2020 03:10:32 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id s21sm8768064edc.42.2020.11.09.03.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 03:10:31 -0800 (PST) From: Jean-Philippe Brucker To: ast@kernel.org, daniel@iogearbox.net Cc: bpf@vger.kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, john.fastabend@gmail.com, kpsingh@chromium.org, Jean-Philippe Brucker , Jiri Olsa , "Rafael J . Wysocki" , Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Robert Moore , Erik Kaneda , Len Brown , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH bpf-next v2 1/6] tools: Factor HOSTCC, HOSTLD, HOSTAR definitions Date: Mon, 9 Nov 2020 12:09:25 +0100 Message-Id: <20201109110929.1223538-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201109110929.1223538-1-jean-philippe@linaro.org> References: <20201109110929.1223538-1-jean-philippe@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Several Makefiles in tools/ need to define the host toolchain variables. Move their definition to tools/scripts/Makefile.include Acked-by: Jiri Olsa Acked-by: Rafael J. Wysocki Signed-off-by: Jean-Philippe Brucker --- v1: https://lore.kernel.org/bpf/20200827153629.3820891-2-jean-philippe@linaro.org/ Cc: Josh Poimboeuf Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Robert Moore Cc: Erik Kaneda Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Cc: devel@acpica.org --- tools/bpf/resolve_btfids/Makefile | 9 --------- tools/build/Makefile | 4 ---- tools/objtool/Makefile | 9 --------- tools/perf/Makefile.perf | 4 ---- tools/power/acpi/Makefile.config | 1 - tools/scripts/Makefile.include | 10 ++++++++++ 6 files changed, 10 insertions(+), 27 deletions(-) -- 2.29.1 diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile index 66cb92136de4..bf656432ad73 100644 --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -18,15 +18,6 @@ else endif # always use the host compiler -ifneq ($(LLVM),) -HOSTAR ?= llvm-ar -HOSTCC ?= clang -HOSTLD ?= ld.lld -else -HOSTAR ?= ar -HOSTCC ?= gcc -HOSTLD ?= ld -endif AR = $(HOSTAR) CC = $(HOSTCC) LD = $(HOSTLD) diff --git a/tools/build/Makefile b/tools/build/Makefile index 722f1700d96a..bae48e6fa995 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -15,10 +15,6 @@ endef $(call allow-override,CC,$(CROSS_COMPILE)gcc) $(call allow-override,LD,$(CROSS_COMPILE)ld) -HOSTCC ?= gcc -HOSTLD ?= ld -HOSTAR ?= ar - export HOSTCC HOSTLD HOSTAR ifeq ($(V),1) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 4ea9a833dde7..5cdb19036d7f 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -3,15 +3,6 @@ include ../scripts/Makefile.include include ../scripts/Makefile.arch # always use the host compiler -ifneq ($(LLVM),) -HOSTAR ?= llvm-ar -HOSTCC ?= clang -HOSTLD ?= ld.lld -else -HOSTAR ?= ar -HOSTCC ?= gcc -HOSTLD ?= ld -endif AR = $(HOSTAR) CC = $(HOSTCC) LD = $(HOSTLD) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 7ce3f2e8b9c7..62f3deb1d3a8 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -175,10 +175,6 @@ endef LD += $(EXTRA_LDFLAGS) -HOSTCC ?= gcc -HOSTLD ?= ld -HOSTAR ?= ar - PKG_CONFIG = $(CROSS_COMPILE)pkg-config LLVM_CONFIG ?= llvm-config diff --git a/tools/power/acpi/Makefile.config b/tools/power/acpi/Makefile.config index 54a2857c2510..331f6d30f472 100644 --- a/tools/power/acpi/Makefile.config +++ b/tools/power/acpi/Makefile.config @@ -54,7 +54,6 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM} CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- CROSS_COMPILE ?= $(CROSS) LD = $(CC) -HOSTCC = gcc # check if compiler option is supported cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;} diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index a7974638561c..1358e89cdf7d 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -59,6 +59,16 @@ $(call allow-override,LD,$(CROSS_COMPILE)ld) $(call allow-override,CXX,$(CROSS_COMPILE)g++) $(call allow-override,STRIP,$(CROSS_COMPILE)strip) +ifneq ($(LLVM),) +HOSTAR ?= llvm-ar +HOSTCC ?= clang +HOSTLD ?= ld.lld +else +HOSTAR ?= ar +HOSTCC ?= gcc +HOSTLD ?= ld +endif + ifeq ($(CC_NO_CLANG), 1) EXTRA_WARNINGS += -Wstrict-aliasing=3 endif