From patchwork Mon Jul 6 13:41:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Lynch X-Patchwork-Id: 6724491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A0047C05AC for ; Mon, 6 Jul 2015 13:43:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB44E20430 for ; Mon, 6 Jul 2015 13:43:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA0072040F for ; Mon, 6 Jul 2015 13:43:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC6eL-00086s-WB; Mon, 06 Jul 2015 13:41:34 +0000 Received: from relay1.mentorg.com ([192.94.38.131]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC6eJ-00081c-Bd for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 13:41:32 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1ZC6du-00035U-5J from Nathan_Lynch@mentor.com ; Mon, 06 Jul 2015 06:41:06 -0700 Received: from [127.0.0.1] (147.34.91.1) by SVR-ORW-FEM-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Mon, 6 Jul 2015 06:41:05 -0700 Message-ID: <559A8570.6080602@mentor.com> Date: Mon, 6 Jul 2015 08:41:04 -0500 From: Nathan Lynch User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Baruch Siach Subject: Re: VDSO build failure: collect2: fatal error: cannot find 'ld' References: <20150706065408.GI3139@tarshish> In-Reply-To: <20150706065408.GI3139@tarshish> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_064131_428999_DBAFF3F8 X-CRM114-Status: GOOD ( 18.13 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , Stefan Agner , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 07/06/2015 01:54 AM, Baruch Siach wrote: > In commit log d2b30cd4b722 (ARM: 8384/1: VDSO: force use of BFD linker, > 2015-06-03) you said: > > Note: one limitation of this is that if the toolchain is configured > to use gold by default, and the bfd linker is not in $PATH, the VDSO > build will fail: > > VDSO arch/arm/vdso/vdso.so.raw > collect2: fatal error: cannot find 'ld' > > This will happen if CROSS_COMPILE begins with a path such as > /opt/bin/arm-linux-gnu- but /opt/bin is not in $PATH. This is > considered an acceptable corner-case limitation and is easily worked > around. > > I see this build failure here with Sourcery CodeBench Lite 2014.05 even > though: > > 1. This toolchain doesn't include the gold linker at all > > 2. I have the arm-2014.05/bin/ directory in my $PATH > > 3. My CROSS_COMPILE is set to 'arm-none-linux-gnueabi-' > > Reverting d2b30cd4b722 on v4.2-rc1 fixes the build failure. Thanks for the detailed report; I have been able to recreate this. This seems to be happening because the compiler supports -fuse-ld=bfd, but the toolchain does not contain a "arm-none-linux-gnueabi-ld.bfd" executable: creating a symlink arm-none-linux-gnueabi-ld.bfd => arm-none-linux-gnueabi-ld in arm-2014.05/bin/ allows the build to succeed. I'm not sure whether this is a toolchain bug or incorrect expectations on my part, but I'm not eager to break a toolchain that used to work. I think the least bad resolution is to use cc-ldoption for detecting whether -fuse-ld=bfd will work. The tradeoff is that if the vdso link is attempted with gold we'll get a marginally less user-friendly error message. Baruch, can you confirm the patch below fixes it for you? Tested-by: Baruch Siach diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile index 9d259d94e429..1160434eece0 100644 --- a/arch/arm/vdso/Makefile +++ b/arch/arm/vdso/Makefile @@ -14,7 +14,7 @@ VDSO_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 VDSO_LDFLAGS += -nostdlib -shared VDSO_LDFLAGS += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) VDSO_LDFLAGS += $(call cc-ldoption, -Wl$(comma)--build-id) -VDSO_LDFLAGS += $(call cc-option, -fuse-ld=bfd) +VDSO_LDFLAGS += $(call cc-ldoption, -fuse-ld=bfd) obj-$(CONFIG_VDSO) += vdso.o extra-$(CONFIG_VDSO) += vdso.lds