From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83290C433DF for ; Wed, 17 Jun 2020 02:42:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 54DEC208C3 for ; Wed, 17 Jun 2020 02:42:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OLJD3WdD"; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bSDfu19M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54DEC208C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jvrWt2KbkHmTuAZbcrxVNHOk/guIipx7rSp4yoc8Zdo=; b=OLJD3WdDP4VzVSL1FfThtRXaF hydUNBhwZigI3g9VkE3Vp53hTI87G0xD/qQydxSocMwbxwJmutVKXKSIOxFmVJINtLYHvHn2vo9aJ 734KoF9rNjhAURFnPwSqRW7nZJSHcqbOxYrurOZ3FQBrpbk2LTXFV7Hfk2B3DFJ71eGnME8cIdWhq CTqsq+AuJUfeOxN3cH4L0egf5LsLQdCv/czo7ulKjm0bo9FEl6TuzMedzr3kXqrcPeDejqPV1FmJu jmNC0p9NiNsQP+UX5tktT+2Fi5Ym+DjyxFoYwI+FFJdn+qcCo2u0vIolCG2bHtQMiU5lJ0KrAW7Nc mrnlWp/bQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlO27-00067m-Ht; Wed, 17 Jun 2020 02:42:35 +0000 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlO24-00067K-LE for linux-riscv@lists.infradead.org; Wed, 17 Jun 2020 02:42:34 +0000 Received: by mail-oi1-x244.google.com with SMTP id 25so422805oiy.13 for ; Tue, 16 Jun 2020 19:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=jvrWt2KbkHmTuAZbcrxVNHOk/guIipx7rSp4yoc8Zdo=; b=bSDfu19MUyXzUkW6cA9hwnMCjpPa4bTGL6Fv9v5NjYczTGTRdynnoIf1OjAa9A4ADy al4wgPI2oP0702nxCEeSFaS88fhGHv1MuUzeD2CfS5pBDe/d3L+jNXLWLEm2HrpUU+iQ LLTLC4aTurLfclFYlPjfX53gPFexn737ACIWanqZIWz9BfZW/DXZFAcR210YpHNHbaZx GrWSeNpQM9NY3lzzpEiymon2QJx9+2lG4/mD8ettbZa/HB05iRnrC5+xyLHiX0F1LF4x dDBkKizymyoljCA2dCxfVCd3rRr+aKXgERYOOC3wGwvOSRnt9vUR3yu6thWezFPmIeGH oYlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=jvrWt2KbkHmTuAZbcrxVNHOk/guIipx7rSp4yoc8Zdo=; b=Je0Neoty0u/iVspG3HBytbGZ5GKyYP4/ucb8Kr4H2DJVj1cGcroEi5Dnkd6nr0prBl G+HwLEjtir4+3Vcu2WsglAnJmO7nyN6Je4KhpWf03Iu4T2u4fB1WmfitNFcHMn/RgEBH 2GQ3apf8DN5XIAvLUoJx3T7SqEPvcgYUIB9rrt+iY6IK+eJ/xZuyu+aFzLCPD8pyVcSV 02OEdk8g+NLQIOTLzQ0NO/Sv0Yr0c0JvBeLc9TrzIOzm0HpDRXz00MACGdO3w+zhw93H UwRIvUJzwq9FNdVObgpA8JdBA53EtruFX0CjaA2+IYjj9mmIy77llujaItTk4yUjCjmY 9C6w== X-Gm-Message-State: AOAM5320jBKebxL4c2JrbXIDk5Ve5XSy/RMTGLgCPgtRdZVUtVQPY77+ Ug6NZB7izUGjCtOigzQCTo8= X-Google-Smtp-Source: ABdhPJzLCv5YIQr9L5vxpHlBBzZkUr1WL5oMnwm4wGTI6IkHtAnmYZ0R0/vszIcht6lNrjb7LoLruQ== X-Received: by 2002:aca:51ca:: with SMTP id f193mr5941352oib.170.1592361751462; Tue, 16 Jun 2020 19:42:31 -0700 (PDT) Received: from ubuntu-n2-xlarge-x86 ([2604:1380:4111:8b00::3]) by smtp.gmail.com with ESMTPSA id b2sm4600537ooe.13.2020.06.16.19.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 19:42:30 -0700 (PDT) Date: Tue, 16 Jun 2020 19:42:28 -0700 From: Nathan Chancellor To: =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Subject: Re: Upstream binutils commit a87e1817a435dab6c6c042f9306497c9f13d4236 breaks building the RISC-V vDSO Message-ID: <20200617024228.GA2330477@ubuntu-n2-xlarge-x86> References: <20200612084350.GA1108986@ubuntu-n2-xlarge-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_194232_696701_46ED7F2C X-CRM114-Status: GOOD ( 17.18 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-riscv@lists.infradead.org, Albert Ou , Palmer Dabbelt , Paul Walmsley Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org Hi Fangrui, On Fri, Jun 12, 2020 at 08:41:56AM -0700, Fāng-ruì Sòng wrote: > On Fri, Jun 12, 2020 at 1:43 AM Nathan Chancellor > wrote: > > > > Hi all, > > > > Upstream binutils commit a87e1817a4 ("Have the linker fail if any attempt > > to link in an executable is made.") causes the RISC-V vDSO to fail to > > build properly (it is fixing this bug report: > > https://sourceware.org/bugzilla/show_bug.cgi?id=26047): > > > > $ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux- O=out/riscv distclean defconfig arch/riscv/kernel/vdso/ > > riscv64-linux-ld: cannot use executable file 'arch/riscv/kernel/vdso/vdso-dummy.o' as input to a link > > > > I do not really understand what the whole point of the vDSO rule is but > > it seems like it should be fixed due to this change. Additionally, the > > kernel has generally been getting rid of using $(CC) as a linker, > > instead preferring to use $(LD) directly; it would be nice if the RISC-V > > vDSO's Makefile could be rewritten to do that. > > > > See > > > > fe00e50b2db8 ("ARM: 8858/1: vdso: use $(LD) instead of $(CC) to link VDSO") > > 691efbedc60d ("arm64: vdso: use $(LD) instead of $(CC) to link VDSO") > > 2ff906994b6c ("MIPS: VDSO: Use $(LD) instead of $(CC) to link VDSO") > > > > for more examples of that. I would take a stab at it myself but this > > does not seem like a straight conversion due to the way the VDSOLD rule > > is set up. > > > > Cheers, > > Nathan > > I suggested that GNU ld from 2.35 onwards disallows accepting ET_EXEC > as input (https://sourceware.org/bugzilla/show_bug.cgi?id=26047 ). The > error message is from the patch. > Taking ET_EXEC files as input are usually errors. > > If we do need to take ET_EXEC as input, we can change e_type in the > ELF header to make the file an ET_REL > > printf '\1' | dd of=${2} conv=notrunc bs=1 seek=16 status=none > (See http://git.kernel.org/linus/90ceddcb495008ac8ba7a3dce297841efcd7d584 ) Is there a convenient way to do this in a Makefile? The relevant rule is: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/kernel/vdso/Makefile#n63 I am not sure if that is strictly necessary, hence the initial email. Cheers, Nathan