From patchwork Thu Feb 7 22:01:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 10802187 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B57F6C2 for ; Thu, 7 Feb 2019 22:02:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CB7F2E71A for ; Thu, 7 Feb 2019 22:02:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B2772E731; Thu, 7 Feb 2019 22:02:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35BDF2E71A for ; Thu, 7 Feb 2019 22:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726974AbfBGWCq (ORCPT ); Thu, 7 Feb 2019 17:02:46 -0500 Received: from mail-it1-f202.google.com ([209.85.166.202]:41083 "EHLO mail-it1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbfBGWCq (ORCPT ); Thu, 7 Feb 2019 17:02:46 -0500 Received: by mail-it1-f202.google.com with SMTP id 71so2302718ita.6 for ; Thu, 07 Feb 2019 14:02:46 -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=eegGQ+TDUvyP04r1vddWpgDCV6euPHpHx7dZx3qsf9g=; b=r70SoXybzoOCIkWu2j8mHZU8g0T5YQAGdrIRivO7Fturw9VJMugfsd1neIGkdH7Er1 dyAjuZyQputIMHrZBXJ29KnbhRagGBiey30mdOvY4OMmAuZMQvjYODVqZeO8iF48xIzG rBhUba+pAiojFj7gUgxP41P3WBpF/SfwrlP+RksQ0LyoidZEBUZQApvdpSMGATUEtewi B65bDNa5b53iEYCsysInHQAOb6b2bDc9Pong9Gm1o6rFjz/K1yWrV+98YVsTsRkTs3Dl jYASom8/BBGx3ldWHLZOPusu71rPUZrStAB4tVtTsAEP9rZW8oOcA4et2Jp8YpV3DUjh XNQA== 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=eegGQ+TDUvyP04r1vddWpgDCV6euPHpHx7dZx3qsf9g=; b=WaqN24xUCBwpi74Qdak1iyCnlCBAahxifJ+H5g4OoUSpN/FOWbFE7x9NNTDjDyxSTZ Ug+EehuNfOrneVePe7YYeK6DNkdnNBXDV9+oLvi1NoRjBa23scB5l/Bd6NxhMQBTNRGi xaySNU+n+v8a5sLA4OfGByYwgAgsaO6SG3cBtn4EiXsjPV4lF0xoAHY7Ho44hC6lQBEa sV2GjLNj3b7Ku2tlL0+TE/igVHRsCVLDhMMHXr96/W4WGS/MnumYgGrbxe/qI58VXIrc ipXZwxfAwIQBIoF7NVDVeOyHx/jMqOwvUMk5rN28GdBw5bHbL6BEGjhSGrq3JetuHUw6 WLkQ== X-Gm-Message-State: AHQUAuarIG51icTXpreK296JWiVpH2d6dAamEuBVGuOz0IfpXuXvbCRA 97UclfowmW+EtNl7zDNQqWUlQ1z7bYESToudjMU= X-Google-Smtp-Source: AHgI3Ibav9Uf6gMTGf3azbmCskscwy0sOHZk3WccVi7eZymU8SgkUiG9YtamdMiJLkL0IGdpQs53SbSMD6CCMIMpxKA= X-Received: by 2002:a24:248d:: with SMTP id f135mr7815646ita.36.1549576965962; Thu, 07 Feb 2019 14:02:45 -0800 (PST) Date: Thu, 7 Feb 2019 14:01:51 -0800 In-Reply-To: <20190207220155.81351-1-ndesaulniers@google.com> Message-Id: <20190207220155.81351-3-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190207220155.81351-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH 3/4] Makefile: lld: tell clang to use lld From: ndesaulniers@google.com To: yamada.masahiro@socionext.com Cc: Nick Desaulniers , Nathan Chancellor , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is needed because clang doesn't select which linker to use based on $LD but rather -fuse-ld=$(LD). 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 Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 0eae4277206e..6307c17259ea 100644 --- a/Makefile +++ b/Makefile @@ -502,6 +502,9 @@ endif CLANG_FLAGS += -no-integrated-as KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_AFLAGS += $(CLANG_FLAGS) +ifneq ($(shell $(LD) --version 2>&1 | head -n 1 | grep LLD),) +CLANG_FLAGS += -fuse-ld=lld +endif export CLANG_FLAGS endif