From patchwork Tue Nov 10 16:43:05 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: 322840 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp376891ils; Tue, 10 Nov 2020 08:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8rxXiiZM0GfozLx6uPZ7xyFHCXGyIOiEpcULiXjYtwyWbBFFPnk3NjYd8elbx/I+kOdks X-Received: by 2002:a17:906:1458:: with SMTP id q24mr21864468ejc.541.1605026625578; Tue, 10 Nov 2020 08:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605026625; cv=none; d=google.com; s=arc-20160816; b=IyAM3RgNcc0cZsysYjRMWYPm1gfWObYhILnW+zsFl+Q2KaOEB2xgqHfUIsTnlSgvCR F8Ym8dFl4x6Um9S4UZ5oTqZERLO0Vlswcz9RV4tfmGPksQcJWAEz1LyNsCUbIj8YJOag nMnZdEmp/fN5YdFh3VntTdv+fmJ6X4TKMnSMqWOgyjgirPLKeR+42/yOU3OtKA2jwJ1R N5TtbTDdcAfTFxj1SHg2o5xrQHnQKUOc92rSGM1dzR0TivBcxd4W27NaGgbatWeig+NH K+3zJc7TJqr8YYo5RO3oN3/vWbUem/JF+2mCEslXnoZUjoidc5gqMW4M3lSZWkMeMrSz qN9g== 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=VjwgR6IegN0z1NgSz9sFMF8qxZSIVhoD/xcsqEVjbjk=; b=fthOrnvY0MEIjboflQ1ootsPmXnnPlvcB958H5Xj6PgIXkf2DXhHlIc3+JtQQs1LAD 9HPDGyaHClEkDUhufCxitmRD25t4/NEQuWtZUICudR0c81vQDSuC7IA5xjgRn564Ppzq JJ2sov9SRlaqKQkyN5lZKNcygIADNvI0GQ1qq4fybwn80QW0B/mjG93Mq5GOZ1VElfBX vyFo/kJN0NX4CzxwmqVTnHYh5ussMX7dlAHLz5yiAM85WsYau4rQhbCiELG2znhZyHvA a5yK8sa2KYeLGf/vSUIQPmoXBxrnBznkt/2qHb0WbCRCXsaElKiB4b1qiFo5qxAcT2Ow ORJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hRDbxVtP; 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 a9si3756878edt.530.2020.11.10.08.43.45; Tue, 10 Nov 2020 08:43:45 -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=hRDbxVtP; 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 S1730232AbgKJQno (ORCPT + 7 others); Tue, 10 Nov 2020 11:43:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730108AbgKJQno (ORCPT ); Tue, 10 Nov 2020 11:43:44 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 046D1C0613CF for ; Tue, 10 Nov 2020 08:43:44 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id 33so13385474wrl.7 for ; Tue, 10 Nov 2020 08:43:43 -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=VjwgR6IegN0z1NgSz9sFMF8qxZSIVhoD/xcsqEVjbjk=; b=hRDbxVtP8Bios4GvyB/JdFEuyInSAcr/KlNtotz6w15n8CkE/fDJLM5f8Hz0dwJc+W C20pXtLJNa5m/C4yl2wP44s4TWAX60FeWMtnzVfobdd4hy5BjulDIcn7+sNLGMPyOATH OFVK9Diwgd1OWNWx3wE3KFK1ywp/Owqf23SWIIn2wuwzJV30ljm+FJwIVfF/gPKkk+sC ghynYm/HCo7Kjf67Fv7vgwMWYXqqKzFlfllcDivrEPqDng/lH7nJE/FpxtwLYhKIMvd0 sTGllGmbLr3xhBijPQsL7SRbLveBFwNvZclLiW9k4hrpmDq9IFcmY8cAYOTeIxiVqxGs PrDQ== 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=VjwgR6IegN0z1NgSz9sFMF8qxZSIVhoD/xcsqEVjbjk=; b=Epx/U/VMLmwy5KVXWTp5NVeEKEkmBfbz9uUyu9FiPZA8fpsyPXztsuOkViJXMyM5E9 6smoj08i6PfFHktOt5yWziiPgPy3LmsL/Ax+/wPtCtsfu9F8LLc5vlfVVwhRFVdjl42s tu22zy/YT9ym3YuaCzhPlhZ7Xkb4Vqu0yBvJezHamcFwdRMxDs2nU1KqWgGpilTajPfz kZfyh0OPXCQLgofvH9QiU54juqFLPbhoUARX1Tg0TTbdU5hDC0geHoXQJAhtVaNjDg41 YsSOfvb77iuPUCthTEMmfc7UC+JMcxODFmlrtR0iVcmY1x6oqlfdvX9WuujY1J2MaCsS BP2Q== X-Gm-Message-State: AOAM531EFG89smsHqHCT1VjglKetdOgu7m6AGuJwCMbJxML3J3QzyWoh FfXPB8t81qBt8dD5fEs6stwScw== X-Received: by 2002:a5d:5752:: with SMTP id q18mr23918165wrw.176.1605026622750; Tue, 10 Nov 2020 08:43:42 -0800 (PST) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n123sm3272268wmn.38.2020.11.10.08.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 08:43:42 -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 v3 1/7] tools: Factor HOSTCC, HOSTLD, HOSTAR definitions Date: Tue, 10 Nov 2020 17:43:05 +0100 Message-Id: <20201110164310.2600671-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201110164310.2600671-1-jean-philippe@linaro.org> References: <20201110164310.2600671-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/ v2: https://lore.kernel.org/bpf/20201109110929.1223538-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