From patchwork Mon Feb 11 19:30:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 158030 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2984060jaa; Mon, 11 Feb 2019 11:30:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IZjwHV4RQ0rfCusBR3fcq7sqMTXta+en2hd44HYQ/dSPx6dkWwoZrEXSDlUEKLACpFiTEo/ X-Received: by 2002:a17:902:8641:: with SMTP id y1mr38984616plt.159.1549913449055; Mon, 11 Feb 2019 11:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549913449; cv=none; d=google.com; s=arc-20160816; b=tSJZKisytAiuaVq+ruHkmilErDbMutdT3jWN6dxuI0XYFxZQMvJ9UKcB3ILuApyDXf wNbgMbpo0h1+Zec9JZM/fsc0qWXLdBpzDaT+fzSAgI83GUMruiThOnQQuhPfq5arms6K 8s+af0nBgGzGxwL4L2FWjqqtjf1Qm3MonyrKjKmLHi5uDZUzwyNS1zxMJCy+UyMzraqb nSm1ch0p4pGBfRKZztmFkOZZb+Sqd/1V9gHPtfxA0Q3ONxgPEyueoRK0AZtMMSgZIPBf KtwXDD3QV2YqWkiA+Su76NQYTa5pLGwrrFUPnNnh+iXl9m8+KysKBPoCvpJUUQhBrKQf 1voQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=A+p5CcPbc67CNJ+HtkbKBMLEqE5iK/BxBkcy0srR2f4=; b=oFQ8T6iVuax/j62B2XdbesJwJSy6cHp9QHwMJNUJJYIuXGifu8IrHokw8fiFubL4f7 RJN162QO8GSNySGI0rFoez2/QVDlkJJhX2C3YqSagNfrWh+Br8BIpU0OVYVuLzOhl88R fNaHkl8u9Jt97XxfxZbZG1o/2H1ZVv0CNf7oRFv7tnHEWgRc6NH6cdeNabjg/xkQVXb+ DwRkdl6TJRiJwAC4aKwqMcQrYQRafgrd9EgyV5RdlkWkp40oEGu+IQW6kFY+fQjsH6dw NSayroA8DDd5ArfCA5I8g10GMVAI7sxFQlJVhO5h2E7ZwiIId5F+wRj9KHs9aGq65Ojx maUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EUfDjdob; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si9026562pll.284.2019.02.11.11.30.48; Mon, 11 Feb 2019 11:30:49 -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=@google.com header.s=20161025 header.b=EUfDjdob; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388285AbfBKTar (ORCPT + 31 others); Mon, 11 Feb 2019 14:30:47 -0500 Received: from mail-it1-f201.google.com ([209.85.166.201]:39705 "EHLO mail-it1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388241AbfBKTaq (ORCPT ); Mon, 11 Feb 2019 14:30:46 -0500 Received: by mail-it1-f201.google.com with SMTP id k133so16344ite.4 for ; Mon, 11 Feb 2019 11:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=A+p5CcPbc67CNJ+HtkbKBMLEqE5iK/BxBkcy0srR2f4=; b=EUfDjdobRLMV2Tk3lGBtNvj9QujsHoJi9ZqtEcH+YVtBCw0t/FCOOKOLjYPLz2olUE +TKRIo6Qkhd4/yl5EoeB93P6IDHZzfNjrzFK7iELdrQbe/FgB6/rqt0ScvP0xuzVt8hB z3fEBdPiKZndqh/aWqmvhVbI4J2B7eYEVxxuxU9Axu+akFPva/9Qj60M9PMrdYG72vSq Gubv63+gi2EzkY3wnIv2NYmvI/aEm0HnzTlhgrrxsVzTrjldQ24LgR14yr2G4DK4e8hr yPFkN2CogT0A25zsQf9ZCs9OjpRlwz3HR/KZ4hDpMclFW4EC5h+L1Va45mhPLcZKJY2J lLGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=A+p5CcPbc67CNJ+HtkbKBMLEqE5iK/BxBkcy0srR2f4=; b=TfYv2Iel5R29UNe5jfMHAEhuu3XDISufMYE3miPc22kAmC/MOX1rU6Cv/q4o6wPhQv gAh+aWF/9JapQxJSlUkUf3TObRculUmt0z+/zYupSwqtSVCnofdIVWjDVU3vKPWEymkt jfWoFd+H3BQ0i0RULfxmIpIW4v8NckFXU4JPc2kTx59os/HQMgklodZctuRLvRzrWg71 zfi8lQjRKV+i5/F37rLh+jy/8reuTVPiwL+1O+0hMMpCSIvcBo64YrCDL1mgbSbGxWIv fjO6pwhIAg3EDTxmV0lv7anHJ8CwQboyL1NwIFagEVigjq9H2hIF7IvgUpi3UAO7g87E vXYg== X-Gm-Message-State: AHQUAubHMbdwMGw4mdTcjvnsT0j+FacqmoWxTPCt8cUzJfVRau9/NYbO ciWiWHP4LKFUn6q2UBHKNPc+Sq3FovsqcZzjCZU= X-Received: by 2002:a24:d82:: with SMTP id 124mr794567itx.10.1549913443054; Mon, 11 Feb 2019 11:30:43 -0800 (PST) Date: Mon, 11 Feb 2019 11:30:05 -0800 In-Reply-To: <20190211193008.24101-1-ndesaulniers@google.com> Message-Id: <20190211193008.24101-3-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190211193008.24101-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH v2 3/4] Makefile: lld: tell clang to use lld From: ndesaulniers@google.com To: yamada.masahiro@socionext.com Cc: natechancellor@gmail.com, sedat.dilek@gmail.com, keescook@chromium.org, samitolvanen@google.com, michal.lkml@markovi.net, akpm@linux-foundation.org, hannes@cmpxchg.org, peterz@infradead.org, linux@dominikbrodowski.net, npiggin@gmail.com, mathieu.desnoyers@efficios.com, gor@linux.ibm.com, adrian@lisas.de, rgb@redhat.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=lld. This is problematic especially for cc-ldoption, which checks for linker flag support via invoking the compiler, rather than the linker. Link: https://github.com/ClangBuiltLinux/linux/issues/342 Suggested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Changes V1->V2: * add reviewed and tested by tags. * move this addition up 2 statments so that it's properly added to KBUILD_*FLAGS as per Nathan. Makefile | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1.791.gb4d0f1c61a-goog diff --git a/Makefile b/Makefile index d3b65e96d183..00e8e01d23fc 100644 --- a/Makefile +++ b/Makefile @@ -500,6 +500,9 @@ ifneq ($(GCC_TOOLCHAIN),) CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) endif CLANG_FLAGS += -no-integrated-as +ifneq ($(shell $(LD) --version 2>&1 | head -n 1 | grep LLD),) +CLANG_FLAGS += -fuse-ld=lld +endif KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_AFLAGS += $(CLANG_FLAGS) export CLANG_FLAGS