Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1969884ybb; Thu, 2 Apr 2020 10:37:26 -0700 (PDT) X-Google-Smtp-Source: APiQypLeE06W3/0o8wk51lD41DzX6wxF5rbctqxgbQoMFE/uxJQV7tnk65NByCMKMd1+EwB5nPiD X-Received: by 2002:aca:2209:: with SMTP id b9mr94118oic.103.1585849045982; Thu, 02 Apr 2020 10:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585849045; cv=none; d=google.com; s=arc-20160816; b=ip9osrTgeUlyYumGICLdxS87xuR4RNJcEt7L+hfM22V+1DPdGeueNgJoNbclgy9m61 e39Q42GxzZ0gUWiT8fJ69hc3iC/zM9BW0KMzkEEn4QN+7/AEZvWtyjh+ZtaOLRTCeJWY 7u43UDx83xwdxK88No+Zobc7ivaWj/XFzexz9bdOmPWNreNgaRWSuqHChJpQosX7a8zI f/axLvnurjI51+zoKBsMq/pzHUJRmXUSSZp5Zhg+1wH+mtMjkeoPsQGgDo/c2Et3vmHc b2IszTolxml92aCqq9kzN3jzG4mZrYgAB3Qb89Q1z4Od+X/IGijxs9FrqfULnVyscUyx WtFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=guC1fZiSgEL3S0epJpXk9N5uLkHmIuEzGe6F9jNE+kA=; b=RSDc5k2w8EJYUw4JTpGV9N2D6TIJlemuG0CZv4ZpLiLXO3fItOX8ZJbH9O1sZqCLcn dZh3+DyLc3jzkPpwHmqcC1nPC6amXacDSG7E7tCgj2ZgDkdpu+b7G4nE6kQwaUZolSEL Rz1TPSEH0hk/SS8XzSzxyFGoXEZO2PvxrVGtI/or19gmLLh3qkoPlVK8Lw0YzTXJ8vbV 7PvP3RaPuLLnEDSsIyYD2bwhG505f+Oiyy+u4Q1GfYLX7oTb50gMx5zE03+HxI9ywxng c/PLN7PucrZfictMeN8dzMgZnls4y4HN1FdC1RHVAxmCgAw/HNw78m9WMUSnKJ1nzM6x fBEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DIJgguHk; 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 w5si2495291ote.129.2020.04.02.10.37.11; Thu, 02 Apr 2020 10:37:25 -0700 (PDT) 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=DIJgguHk; 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 S2389967AbgDBRf2 (ORCPT + 99 others); Thu, 2 Apr 2020 13:35:28 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:36127 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389520AbgDBRf2 (ORCPT ); Thu, 2 Apr 2020 13:35:28 -0400 Received: by mail-pj1-f68.google.com with SMTP id nu11so1783244pjb.1 for ; Thu, 02 Apr 2020 10:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=guC1fZiSgEL3S0epJpXk9N5uLkHmIuEzGe6F9jNE+kA=; b=DIJgguHk3AE09VWT3DJ0sns+lyhLL5Fek9BYoWxSc5CAyxUPHF+0d3SAzh2aoCH+g/ tdzWagcY2wv1NyirdNP1ougSZVhHIAU3nf+C+k9UAE5QrzKkhWUXY5jaA8WFTh8TXVro KmMngX6pdwvGHDuEsGFv+J/XtSwp6DVcObvu7eWpDXubSTbezSR2uwW64ePCmA5lJ5aj pNBzC24v4klZBN5zPkGmA4bQsDW/d0iAYlz0j22OcMq8+W5tW90FUxMK6bkblWHlQ46H pyiR/AVnm3nJp+REdEuSr+biVXtMYfN3SXd9IZRqOjaxFXnfy/F28VYBjOsjnXPQmoqG MrLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=guC1fZiSgEL3S0epJpXk9N5uLkHmIuEzGe6F9jNE+kA=; b=gLAo/O5/7kSOEQnynkZp1UYj60mB/h9k7ScSmVvd8GBlDV+XhFTW0Clol3mryZAjRw zHzWYUDRqzo4Yc1LQbyKMT/SldxGfWEIQ1K+EKVxAJgyUgQHDbU/NMnKCoEbSFN9Fziq aF1J60/lpTkXoSGOojrtPsjgzB0FNGToYZuZ3lFtU/6vuDejx9x1qdtrFgjHA1j2lQ6M 6uiPLtpeH9bSRfPbtaw59odKXjOQGuvi0KFheQitl3AZvPXMRzoUrVUlKr/ZIP+e0Rbi CCkeM+LHJbcpgithVTYV355FCVqMKfK8QkgdxwszL1RsM+oYAz1ag6GxfO/622qw0Aqq Z0rA== X-Gm-Message-State: AGi0PuaTkhwoz6INA7iyY4ejb8tRe9+Mqx3SCDXccfJ/MUSNGnYq69tx +wbOY7hbFCyuWfY16e9zd7Zkz/hpaJpdyWSY4t/+yA== X-Received: by 2002:a17:90a:8085:: with SMTP id c5mr4543968pjn.186.1585848925816; Thu, 02 Apr 2020 10:35:25 -0700 (PDT) MIME-Version: 1.0 References: <20200402085559.24865-1-ilie.halip@gmail.com> In-Reply-To: <20200402085559.24865-1-ilie.halip@gmail.com> From: Nick Desaulniers Date: Thu, 2 Apr 2020 10:35:14 -0700 Message-ID: Subject: Re: [PATCH] riscv: fix vdso build with lld To: Ilie Halip Cc: linux-riscv@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Greg Kroah-Hartman , Mao Han , Thomas Gleixner , LKML , clang-built-linux , Jordan Rupprecht , Fangrui Song Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Jordan, Fangrui On Thu, Apr 2, 2020 at 1:56 AM Ilie Halip wrote: > > When building with the LLVM linker this error occurrs: > LD arch/riscv/kernel/vdso/vdso-syms.o > ld.lld: error: no input files > > This happens because the lld treats -R as an alias to -rpath, as opposed > to ld where -R means --just-symbols. > > Use the long option name for compatibility between the two. > > Link: https://github.com/ClangBuiltLinux/linux/issues/805 > Reported-by: Dmitry Golovin > Signed-off-by: Ilie Halip > --- > arch/riscv/kernel/vdso/Makefile | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile > index 33b16f4212f7..19f7b9ea10ab 100644 > --- a/arch/riscv/kernel/vdso/Makefile > +++ b/arch/riscv/kernel/vdso/Makefile > @@ -41,7 +41,8 @@ SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \ > $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE > $(call if_changed,vdsold) > > -LDFLAGS_vdso-syms.o := -r -R > +# lld aliases -R to -rpath; use the longer option name Thanks for the patch. Maybe the comment can be dropped? It doesn't make sense if there's no -R in the source file you're touching. If someone cares about why `--just-symbols` is spelled out, that's what `git log` or vim fugitive is for. Maybe the maintainer would be kind enough to just drop that line for you when merging? Reviewed-by: Nick Desaulniers Jordan, Fangrui, thoughts on this? Sounds like something other users of LLD might run into porting their codebase to LLVM's linker. $ ld.lld --help | grep \\-R -R Alias for --rpath $ ld.bfd --help | grep \\-R -R FILE, --just-symbols FILE > +LDFLAGS_vdso-syms.o := -r --just-symbols > $(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE > $(call if_changed,ld) > > -- > 2.17.1 > -- Thanks, ~Nick Desaulniers