Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7171055ybi; Wed, 5 Jun 2019 12:29:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8D9yM3Ivwgpuv79LQsnZomgL5J8yzcFigzLLfmivVi9uDNWxAvNaDBo2+QPsi0Z+LCFdf X-Received: by 2002:a17:90a:20c4:: with SMTP id f62mr46196951pjg.16.1559762957454; Wed, 05 Jun 2019 12:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559762957; cv=none; d=google.com; s=arc-20160816; b=v3sEC/9AjGtU8d6+rEhHGzIQl2f8MuR/Y61hqL0ggX3Pf792SwbwSpGnTi8jM74jex DW7bKYeY0Tag8mYZK6mBL2qoXerOGYENis13UylrHMoODKJarp+RsEjMzi8yUCvPHz/N 5UH1HORwHwF0Do7qxFbeJJqQ1FXaHU9xlNN4y05b6mqIuK8vEM4KYlVDk7aZ7uq0aEFR TesyRtQpFxld0Azinfi1JqFH5rxdPeB1z+eq0WWQxbP101MSv0jeUjNGmxBRS1prVthE hGomNY+yB0lgy5vlSrdtcsaoZiDiTQsf8blh0gqJ68VGvaRFpZVu1cZyp+KXZA59vH9t I6wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=x8t7JsObNjYWWTd5IFzGwR6jNrBjALxBIXleHOoy3ag=; b=pEb/x0G1/xlcsLmIG7EW+4xn2G+8rsBGP/MFKUI2J38K+plXj38x/Dfi0XFDQH58WD SJkoT1IlJhCZ3DcXjfSwBs7ZNqu4CDdtPeV/Zy9uievA9b+x2Jb8gKT1ndzfkMcTA84f EKUgOZAIfvdNbClx0Q601JEnR5/Q4YCT+Gzgrsw4ID6LK45G1w73QKT//TUfhLdPFa2a kfsjmUY+8R3nZgi8YC3nBubrUCo5si1XOq5iR1M3DeEL6ZxH6tw1FC5PTAYWCabrNzZ1 IK9LjY9s3t714//XQXo3YTGhhAftmc53AR2dystaezrX8o6miI3AAMFisupl6fYd9US5 bHzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NSRbGiwe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i195si33026729pfe.20.2019.06.05.12.29.00; Wed, 05 Jun 2019 12:29:17 -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=@kernel.org header.s=default header.b=NSRbGiwe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbfFET0J (ORCPT + 99 others); Wed, 5 Jun 2019 15:26:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:37304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbfFET0J (ORCPT ); Wed, 5 Jun 2019 15:26:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 05DD0206BB; Wed, 5 Jun 2019 19:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559762768; bh=qjRJSmh3TXbUFkpRu9OH/tnhcBCLS0C7KuQKagjLra8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NSRbGiweAyNiIowFSuyaPZv9m6fEh0QethOFuHIgzVSyCrQe0/jGoxSIwANwjHP9m XE9MOjLOKpnxaXEb4pp/Yv65Q8EPuMLVkFWFTNwLSPYEmGgMCWqrf+DRFnl8qsuxl9 JlBdrR5oFCvoby93Y3PJ+Q4yCoc4lkjbfBUmAVmk= Date: Wed, 5 Jun 2019 21:26:06 +0200 From: Greg KH To: Ard Biesheuvel Cc: Rolf Eike Beer , Nick Desaulniers , Linus Torvalds , Matt Fleming , Peter Zijlstra , Thomas Gleixner , linux-efi , Linux Kernel Developers List , stable Subject: Re: Building arm64 EFI stub with -fpie breaks build of 4.9.x (undefined reference to `__efistub__GLOBAL_OFFSET_TABLE_') Message-ID: <20190605192606.GA9483@kroah.com> References: <779905244.a0lJJiZRjM@devpool35> <20190605162626.GA31164@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 05, 2019 at 08:42:32PM +0200, Ard Biesheuvel wrote: > On Wed, 5 Jun 2019 at 18:26, Greg KH wrote: > > > > On Wed, Jun 05, 2019 at 05:19:40PM +0200, Rolf Eike Beer wrote: > > > I decided to dig out a toy project which uses a DragonBoard 410c. This has > > > been "running" with kernel 4.9, which I would keep this way for unrelated > > > reasons. The vanilla 4.9 kernel wasn't bootable back then, but it was > > > buildable, which was good enough. > > > > > > Upgrading the kernel to 4.9.180 caused the boot to suddenly fail: > > > > > > aarch64-unknown-linux-gnueabi-ld: ./drivers/firmware/efi/libstub/lib.a(arm64- > > > stub.stub.o): in function `handle_kernel_image': > > > /tmp/e2/build/linux-4.9.139/drivers/firmware/efi/libstub/arm64-stub.c:63: > > > undefined reference to `__efistub__GLOBAL_OFFSET_TABLE_' > > > aarch64-unknown-linux-gnueabi-ld: ./drivers/firmware/efi/libstub/lib.a(arm64- > > > stub.stub.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol > > > `__efistub__GLOBAL_OFFSET_TABLE_' which may bind externally can not be used > > > when making a shared object; recompile with -fPIC > > > /tmp/e2/build/linux-4.9.139/drivers/firmware/efi/libstub/arm64-stub.c:63: > > > (.init.text+0xc): dangerous relocation: unsupported relocation > > > /tmp/e2/build/linux-4.9.139/Makefile:1001: recipe for target 'vmlinux' failed > > > -make[1]: *** [vmlinux] Error 1 > > > > > > This is caused by commit 27b5ebf61818749b3568354c64a8ec2d9cd5ecca from > > > linux-4.9.y (which is 91ee5b21ee026c49e4e7483de69b55b8b47042be), reverting > > > this commit fixes the build. > > > > > > This happens with vanilla binutils 2.32 and gcc 8.3.0 as well as 9.1.0. See > > > the attached .config for reference. > > > > > > If you have questions or patches just ping me. > > > > Does Linus's latest tree also fail for you (or 5.1)? > > > > Nick, do we need to add another fix that is in mainline for this to work > > properly? > > > > For the record, this is an example of why I think backporting those > clang enablement patches is a bad idea. We can't actually build those > kernels with clang, can we? So what is the point? Yes "we" can. I do. Why can't you? And lots of devices rely on clang support for their kernels, as much as I would like to ignore them, I can't :( thanks, greg k-h