From patchwork Thu Aug 27 15:36: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: 248453 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp295119ilg; Thu, 27 Aug 2020 08:38:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsBGM40P1QypjzBKgUjPVqpc+fz9Epgygd18ojKX7C6ttYH6yarZkzsdbrG/qTNtDs8AUe X-Received: by 2002:a05:6402:796:: with SMTP id d22mr5377298edy.80.1598542692431; Thu, 27 Aug 2020 08:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598542692; cv=none; d=google.com; s=arc-20160816; b=khqMif/ZEd+uXEby468iX8zvZaztbY2rG/ywub8eUbAmyii2/mwlfQtd1DOqTdbLuI z7Tm+l/SJoUKiTRX0W08LKI1Rj8QVKiJOIqHrE518nwmDMY++1cPLdU8Mofy3ztch0x3 xaPPThzWH02By01F8hm8+q5KKWDmE8OSwd/UlfVZUe5fnfgRSjita+y0wQseRTh927nD 412a/9NNHjMaxpSvxLOIp2SoSfCY6Qc80Wswks2IBRx64yaTAFaNOknKtmoQVGWC3rrP 9igbjRu8bWLqCYSWH9SYlxJDc1BuAhLi8k8WgslKX7/+5sZ0+hdI1B3Y8KRQZqaJM2xe Pq9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UFxVwUfpG0o5V6jeiag7wunJy3oc0V523MxaV/EfYOE=; b=INLGruxzKF1ep9qC0+WRfOJSyrGpdSLGQKSn9I83Tn6/udnW77kcpkPf/9oDWQjSUc FbHQkNB+1jPEbUnsyQNB4ZlYRlOH+sXZY3jIMb4+iHMUdJTY9Z4oicLdJTanSynCBB5i Lhe3Iyx8TesoFe/zWiRXhcEhD13oKACEEh3CFZDKYY49Ojwa2T+sgfRTsqP8DU/qX2Hk GvfkX7Hz3wM7WnHE7T068P4IF2m6/l+Yv4RkOIhm/6HuWQMWQQhVM/Mh3XbmfQpOfa8h rIXZgVX++zylChCnOA3P3FqNWpq7fBN39ONW4Zorjni40eJIO02JvGssSpIZaxz0Ky0E IRYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rj9btxGK; 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 w5si1528592eja.645.2020.08.27.08.38.11; Thu, 27 Aug 2020 08:38:12 -0700 (PDT) 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=Rj9btxGK; 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 S1726120AbgH0PiJ (ORCPT + 7 others); Thu, 27 Aug 2020 11:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbgH0PiH (ORCPT ); Thu, 27 Aug 2020 11:38:07 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8212CC06121B for ; Thu, 27 Aug 2020 08:38:07 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id l2so8274541eji.3 for ; Thu, 27 Aug 2020 08:38:07 -0700 (PDT) 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=UFxVwUfpG0o5V6jeiag7wunJy3oc0V523MxaV/EfYOE=; b=Rj9btxGKFSBBPU2CIN2lx7OyG9Tdl8pOH+jm5tgq1Lclt3kaXTWDDOYV7u8wwG//Ii rMvSFIljHCUicLonsC4NhUez3RRAgjjqfYY2e5jApfbBKhmC09LeSkqxYSUUV5zqgZN8 xywT38iEaCdwuNNWkxE5E1qh2A73wONit/WVOP1v2MwP/K/N57F0TVhxyc/RwlUwffQc u2u3qBWddHDwZR0w1tzqx3aUajUp0nyl9OuVUi6fGYRN6XR4rJXsStLnb+I2hGLodiYt kYAz2dT1hiSAw0ruT1kb0aQBfydhP/Xf5aPav8lsJ8Jz1ks5NCUkK8XUmP/grrrEjsB1 28TQ== 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=UFxVwUfpG0o5V6jeiag7wunJy3oc0V523MxaV/EfYOE=; b=UdqV7C8r16Soa2IES3rQi2RnrXazR2r60/IfhwdyBZoi2EL3ryGLa3VCslh9FWdM/J +lxOLgwv9MeG0UmUPQ+5WHJE7Df5Yv9DrAOOvwAr0KNYNCRy3ONsJrYnohZnrdIdwfyS ZWxPT/wnKw/s24TUFa8qirElyWdDA3P4nIzi7MLzcF/B/TBI152tM/GIY3APsFeWFRRi GPWUr7UZ+dP+P+Z0QgB4SBMZbRrzwtAqiHN0sbVYfN8bqTrubErsw/TekMMUwFo2t21u Eg4uMYOLsHmFIvh5otp4ftraWkts0m4CHDs/VVCsboGFiqQjZ27aFxnUonPVQqt/vCC4 JZUA== X-Gm-Message-State: AOAM530FBqOeBwkdaa8j46MCmQOLh8VM8GpWmkG50VNSx06J9Z9pTxFC qWmU/G9MCtGByURvKMsvVFqH3w== X-Received: by 2002:a17:906:a89a:: with SMTP id ha26mr18614188ejb.391.1598542686220; Thu, 27 Aug 2020 08:38:06 -0700 (PDT) Received: from localhost.localdomain ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id i25sm1765616edt.1.2020.08.27.08.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 08:38:05 -0700 (PDT) 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 , Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Robert Moore , Erik Kaneda , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH bpf-next 1/6] tools: Factor HOSTCC, HOSTLD, HOSTAR definitions Date: Thu, 27 Aug 2020 17:36:25 +0200 Message-Id: <20200827153629.3820891-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200827153629.3820891-1-jean-philippe@linaro.org> References: <20200827153629.3820891-1-jean-philippe@linaro.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org 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 Signed-off-by: Jean-Philippe Brucker --- 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.28.0 Acked-by: Rafael J. Wysocki Acked-by: Jiri Olsa diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile index a88cd4426398..b06935578a96 100644 --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -17,15 +17,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 727050c40f09..8a55378e8b7c 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 7770edcda3a0..b7cb4f26ccde 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 6031167939ae..43e90334a54e 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