Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2529828imu; Thu, 29 Nov 2018 06:28:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZGP2q5RZK1hAI0h83y0lLsMZR/5zoFNtI6zT1r2T8WWEw4MgZadNH+akxBUoaaXMMstyk X-Received: by 2002:a63:193:: with SMTP id 141mr1438449pgb.136.1543501695681; Thu, 29 Nov 2018 06:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501695; cv=none; d=google.com; s=arc-20160816; b=i25IqDOb4kEtX9Ug+gPFe6x18HZxC4rOHj+mHzv7SKe4ZXTgwA1h77htJM3+aMUWIq Y3SVTU6Ys2s1r4nwT06DKha3qNfD2bM1hSB1ybAxB7tdRvseTxaldWihfxjmbnmyhB7m nt6J0tp6yisWEgwu30xyEocKgzEvYiOGWESr+Oal3pJwk1xS20vku70QP/mNma+AQZg/ WO5ZJihghuJp+axubYtPAdcC8+Lpsl5fyf4k8tSkl2Apq42vC4IZbfnqTAHHgD5+XGOT M/E0IYcF9YUbPTxQYBQ890TNIiC+BWUGYlv8uairtAvhgV6aa5USB1UgkbAkVgLV+eFC wmiA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nGcAmq5A3MrNvslNq/1c6sTVsAiDYSV9Bt+zhnBj9rg=; b=U/K2m0XzQb2Re9xEdg4KUO/eMwGln/SpccRt+y4h2s71ie61nnQG2kzCn0qPbHSDUG ViIjSpxH/pN/1V2IxK+pdo1hYsofWVkXAfrxPJQFnSlJHkm9gfn5vGoIdZZecgh2UOlp ZFuLKI9BKe3C/z/AzT3U4fwCSgTK+S9beuAnTtABJ01q2GBRzKlly1gUeh2O2pHMn8T/ O6jmTHUZGliMwRwjd0MbGZ8RdBTEJNfw/LpX2oB6xVcfBDmD8TWTRyrWyUs8SSsZZfhI 81x/SK6VwDhHxKbRMi7/ukAqzT5xCN2lRGXnY7KFq2cSelq+tvqoHBgZbqlAzmBfAjIY 8++Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rRmhD5f6; 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 u6si2499150pfb.92.2018.11.29.06.27.59; Thu, 29 Nov 2018 06:28:15 -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=@kernel.org header.s=default header.b=rRmhD5f6; 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 S2387687AbeK3Bcz (ORCPT + 99 others); Thu, 29 Nov 2018 20:32:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:33170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731824AbeK3Bcz (ORCPT ); Thu, 29 Nov 2018 20:32:55 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25E532133F; Thu, 29 Nov 2018 14:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501642; bh=Sk9m1W+PXvR+pjDj3kTiOj1IzI+2TLqN4LY/Bhty1qQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rRmhD5f6BDxdgxPJs2FUYJitHQYfKplB3rO/+NK8/VDzmJoLFljpHrq/t2DscAPti PLkTpoabsr6Cfov9QBD5+HGRR3cHMe6Wn19RsIqWNxug43KMoC8tuu2SOI3EG1pR+a fsn+Mb4Rw5Rlo6L6hzHQj9KLRJYCllWGUq4OA8bA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Agner , Masahiro Yamada , Nathan Chancellor Subject: [PATCH 4.14 080/100] kbuild: allow to use GCC toolchain not in Clang search path Date: Thu, 29 Nov 2018 15:12:50 +0100 Message-Id: <20181129140105.659412006@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Agner commit ef8c4ed9db80261f397f0c0bf723684601ae3b52 upstream. When using a GCC cross toolchain which is not in a compiled in Clang search path, Clang reverts to the system assembler and linker. This leads to assembler or linker errors, depending on which tool is first used for a given architecture. It seems that Clang is not searching $PATH for a matching assembler or linker. Make sure that Clang picks up the correct assembler or linker by passing the cross compilers bin directory as search path. This allows to use Clang provided by distributions with GCC toolchains not in /usr/bin. Link: https://github.com/ClangBuiltLinux/linux/issues/78 Signed-off-by: Stefan Agner Reviewed-and-tested-by: Nick Desaulniers Signed-off-by: Masahiro Yamada [nc: Adjust context] Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/Makefile +++ b/Makefile @@ -480,13 +480,15 @@ endif ifeq ($(cc-name),clang) ifneq ($(CROSS_COMPILE),) CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) -GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..) +GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) +CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) +GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) endif ifneq ($(GCC_TOOLCHAIN),) CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) endif -KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) -KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) +KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) +KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) endif