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: 157784 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1201003jaa; Thu, 7 Feb 2019 14:02:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IZki8vFYWUc0izp24GobsSrXBkba4SFKXdGNwrwMkeEzqozzqVxPSgokoryOFFLjufDm236 X-Received: by 2002:a17:902:a5c3:: with SMTP id t3mr18657410plq.117.1549576969411; Thu, 07 Feb 2019 14:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549576969; cv=none; d=google.com; s=arc-20160816; b=0HXBcXSEI9E6rWQ0l+DkKoLLbdJEowEJCCzhB3qcEsFWnyDLWVqXC/2vVLoeKZw6XU w74GnDTzZn4kkN+JXgCmMhwD0zJnKQY9OneWbD7DBn0+E3Nz+Kb/FJjbaQrstj1z/Zql v6mwNZMS8T+2zOxmZqjlbLTD3+K3fdgfoO3H4L+kMGoBzlyhF77AYAkzry+W89lJRnVF iebxuQajecb8vqW3qhuJv0a30M1t2r/33voYfrmoU/24ZmBNNgyFxH5orgb9g5jTON0r 32Jngu7dTWih0UMqoKfaC3UVcyJonDK6lf62IagNgJsDdXV15zYhK9AFqiRjuDSzr0Oe Ibyg== 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=eegGQ+TDUvyP04r1vddWpgDCV6euPHpHx7dZx3qsf9g=; b=X6aRYtdQxSYbM0zJsstML88BUEwhWZOGyGBdETdwG4IXWzOWdCNYa+QbJA4zmtaPrP z5QbnV/7EeMxeAOAG1FW07Og+HvSgmTDPqBo/K0Bu7EY8MRTW9en24pna/5ChQgxJFeU 94Kkur19FxZ5BjgyUkoWpBJ/Fttv/WuWlg3EEqZZsMpClqiZJNvZ+1YTC63R1n/j16a2 kyhiMGjNK9unYijj9QaD5EI7x6NyZiL4Vs69oNWp4iQIjeatKJltT7Ha7HbV/h2DlvJO dmhoPEmHkLDoARVkj0muh/d+/v7smsaQpsdUToncaufUiPz7MClZ8CTagK79y53pa8RP bVOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=r70SoXyb; 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 y5si186044pgv.24.2019.02.07.14.02.49; Thu, 07 Feb 2019 14:02: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=r70SoXyb; 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 S1727141AbfBGWCr (ORCPT + 31 others); Thu, 7 Feb 2019 17:02:47 -0500 Received: from mail-it1-f202.google.com ([209.85.166.202]:59703 "EHLO mail-it1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbfBGWCq (ORCPT ); Thu, 7 Feb 2019 17:02:46 -0500 Received: by mail-it1-f202.google.com with SMTP id t143so2386708itc.9 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=rPd1k3eFXxb0gwE2BDuets0GyHXC6B067L4EHprnqZHU2emdwl+q4YyfPTR9Z34ndD xV/FSEf1ipcZdpheorcTXioTQAQnE5oOL1hS5eKkCxKGrCQGBkh5ocsdhZCHcFkANc9z MF9yPgwB1cmY8/a1aFpXIk/opKvMceP4yHBqHPME4p40i0U48c3gl8qtMcyJuG7ml81b zwQ/bJxvT3Wz4GI4uBprLP2INywc+9m4ONGgmuNMvIAMV9gVzmu38XHzHkoV6tFi1ypl s+lkq8Ydt+b4RvLiSJ5ZTgoNNT2d5Xa2GHAHE6jMChoMaY0wcnQAh5TGgFlZ3rxHBDXk 0fBA== X-Gm-Message-State: AHQUAuYXhAY5596ICKWS15/uhVldGp69bMfQSrbpY4mH3actZVDIOp2k 7mmWGcvCO4XPAHRl+w3YjBz4RdTerz3UTosQh/8= 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-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=$(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 --- Makefile | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1.791.gb4d0f1c61a-goog Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor 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