From patchwork Thu Aug 20 22:09:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 248041 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1734417ils; Thu, 20 Aug 2020 15:10:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEgFE0uvKBzItiiZ57T87ZGIppK2alyUhOso/NTYPKlU/h6pXa+WqPyRPsdzMf4kHdjxim X-Received: by 2002:aa7:d1c6:: with SMTP id g6mr35023edp.232.1597961410165; Thu, 20 Aug 2020 15:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597961410; cv=none; d=google.com; s=arc-20160816; b=GRUG3VHAzY1gks28KKcG3W9US8zaVbrWg1P4q31jQBrP+2EXJY1IWOHRNwmiMagx4K BDYQn7LOLGGztFso7ECDXn5xtnNbV535RgmyUkOtKzH2OGrh7lajjlaCX30qdmlPYZLB 9MZcZ4Ay+sVEybAGsTLHIcyQ8D+96iLdO352JOnw69J3qAlxoVEVXcXCvOtMmavGnCfy 30kBIMPyxB1BRE/mi/mkt4yM4trB53NCS0ARV4SvD9TB+p59bJlUEnc+I1uB+JSQSehV SFR0PeVkF9jdvISEQeWhxKk50+uPedUNBt4SC9ncSUFmPTft0LG7okkGQbZwFWUO9wzl Jj/A== 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:mime-version :message-id:date:dkim-signature; bh=yJwAau26hmxXDK7LYJ3raaNV0n3CHaFw9SQbcJH8sEA=; b=nIrLnhu9+MzJp455gq31H6C/pp7a0SE1xWT3UPF/TxSG0G5hbFV5tcFw0Gse2QxKnk YhyUzdzvaxXPRJ7IsmD+LwP+FsfSuTssuOZOD0qZbjJsj8Zaii9KtlywkYJESgOAr+fz J+WUhQHu8JvNavqBCb/tU35keSHJU1a/hxe8+mQvR8PGrZcW8nU/GnCjX2KtEGnBPl2F 8njDfeCeNp5sgfsSQJUAR8j8D9QZKFaqsYlPeqVDm3wR1PMIJLc6As0GPdk83tfxdiRs v3Til+IiDCMo7XAW833dzkVyOzov/+JFezdIlPRw9rTxMUGpoO0DUDMpoGDfhJnrB8g7 l52Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=jp0ZPR0F; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si2415077ejl.221.2020.08.20.15.10.09; Thu, 20 Aug 2020 15:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=jp0ZPR0F; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725819AbgHTWKJ (ORCPT + 15 others); Thu, 20 Aug 2020 18:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725852AbgHTWKF (ORCPT ); Thu, 20 Aug 2020 18:10:05 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B768AC061385 for ; Thu, 20 Aug 2020 15:10:04 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id k11so61360ybp.1 for ; Thu, 20 Aug 2020 15:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=yJwAau26hmxXDK7LYJ3raaNV0n3CHaFw9SQbcJH8sEA=; b=jp0ZPR0FxAheFL9TaDHJpLBdkF8RMdsuqogh+TQsc9O5logL4ZbPUmQXt4iFAVsdPt t0UFCsaxtebtbQEIpwLN2OHQ5vGZsaiZEaq2rdf8iL05k1zGifwMycxpvfUA4aZSNLn9 InR5iNt0Gz7hK9ENo46ajMKo+wMsmjep/Mhb6o1rpxtHftfrEcU2ZhPiki61DOBVgbLq NbGrKmZT/TrgsZqgo+lGWiy/85ElcfQYu9/O/UALRL7Cgo2b1thGr9vBRbMPBGFbHr/X hPUtkCfENG9wxazhmpR0QLpIzsWGzMUxm+uvG/QcI97aHX8Jpv+6S5K6dLDCfAyilJON 4Mlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=yJwAau26hmxXDK7LYJ3raaNV0n3CHaFw9SQbcJH8sEA=; b=pLqx7VETJR/0Vqq6/tsNk+yRYo+nq8hHNA6R03H01r9PnB6jk5akkl67IGe73fK71H k7rtNGEqA3cTSn4dGRZsIrZ5UN1prhiT3k/lq2tQCMfQpuVMjTuKZdiNloJNGQ2hmRdk IH7neKKE+uKdVDkCRSp8gMnOFpIrLEeOxDzayCpWS3Uk2PjXtgo/d9bXjDttZYWcbzqt ZWVkq7LYI9lPCEou7HZfn11shuyotCcASI68s2ahdY7J3ds2yDnt9UsY/MGmByD2iWvO bM6fzvEtTxUvz4pDSwZvpg2jUZIRrZZuDPPduN8sf00tTXspZVFdcvx2u+u1fbRexMVt SeFg== X-Gm-Message-State: AOAM531pwzPppfDt/pux+uvnEAaTKsffaKnwv49cCrIbvpRYXj3i+QW2 eIfwEGrwxNIa2yLUGXpgM5lWPrWMMwURYtcrgr8= X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:a25:d812:: with SMTP id p18mr462820ybg.460.1597961401739; Thu, 20 Aug 2020 15:10:01 -0700 (PDT) Date: Thu, 20 Aug 2020 15:09:55 -0700 Message-Id: <20200820220955.3325555-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d-goog Subject: [PATCH] Makefile: add -fuse-ld=lld to KBUILD_HOSTLDFLAGS when LLVM=1 From: Nick Desaulniers To: Masahiro Yamada Cc: Nick Desaulniers , stable@vger.kernel.org, Matthias Maennich , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org While moving Android kernels over to use LLVM=1, we observe the failure when building in a hermetic docker image: HOSTCC scripts/basic/fixdep clang: error: unable to execute command: Executable "ld" doesn't exist! The is because the build of the host utility fixdep builds the fixdep executable in one step by invoking the compiler as the driver, rather than individual compile then link steps. Clang when configured from source defaults to use the system's linker, and not LLVM's own LLD, unless the CMake config -DCLANG_DEFAULT_LINKER='lld' is set when configuring a build of clang itself. Don't rely on the compiler's implicit default linker; be explicit. Cc: stable@vger.kernel.org Fixes: commit a0d1c951ef08 ("kbuild: support LLVM=1 to switch the default tools to Clang/LLVM") Reported-by: Matthias Maennich Signed-off-by: Nick Desaulniers --- Makefile | 1 + 1 file changed, 1 insertion(+) -- 2.28.0.297.g1956fa8f8d-goog Reviewed-by: Nathan Chancellor diff --git a/Makefile b/Makefile index def590b743a9..b4e93b228a26 100644 --- a/Makefile +++ b/Makefile @@ -436,6 +436,7 @@ OBJDUMP = llvm-objdump READELF = llvm-readelf OBJSIZE = llvm-size STRIP = llvm-strip +KBUILD_HOSTLDFLAGS += -fuse-ld=lld else CC = $(CROSS_COMPILE)gcc LD = $(CROSS_COMPILE)ld