Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp686548img; Wed, 20 Mar 2019 08:46:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyQ0lX2Oto98uNAamP3mqiGzT5Oq4mVwETDjRidNXr/0IRvSWjfRVrkHSYCOGdDRN9TCDG X-Received: by 2002:a17:902:b60c:: with SMTP id b12mr31726039pls.261.1553096810719; Wed, 20 Mar 2019 08:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553096810; cv=none; d=google.com; s=arc-20160816; b=WCrkqEEEqY+5FWiYbESSeoy85H+ujKmjNx1LPUJ18Zloec+J/xSD4CXclyaEdRDA8/ hLLy0pbCrn7fw4QcP5sfh7o2WqjPUWR6Le5Xre80y1gLX120StOtIqpiK+TqerEd/DRY PcKfCAZnxmdoM7m8s+WKjzFEZpuhI2v879/nJZUgk8jf7rZvwTiO3+lvIiXuO8SG1Vkg bAcgrSDBmZh8iQcGyPpd7lmeE1Ng45i5912RIlEMxxLNLfZOh+XCtkUqEJ5eYuZnsYlK 27mzEg6XnZxu1uqahbxaVk5g0D9ehvFyZGaRZLiX/7gPDW2mnjPETVy48OAEsPtQFzUC eR5w== 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=UVDXc+lEJ2QHVXWNhubXjC/FHnN1snDnwLNu2MjSfE4=; b=tsg/IAm/HM9+zC+9hggV/1gkHNWYsa5GLk6bV9PhDZn5Rtyv7rpUWKSO6Ivx9ijQ9f Reoq7/3JSs1t6JWbGCaBkJTlkX72wIBxAiHFGVaimgOYgxBAFantdpqV6Yl8YepMpDVJ P/l9fEWGP1CbWJQh2nqL0g0FsTOkYhvvdGXikzyjYm9w8gj6r/OXWR1Da1pxODfu2MXh O+QsoChfhAXy6RQFZ4YrO49DeEunl9J4L3Zp2gYWX1SXgrv9GJ7N2Nc0lvdqQPNurC6x /TO9No8+1NhUgp4iNd1i6NHV5oaepHab/NgSA+7CWOtO9VhaqEw69V3aS8EipVq5O+kQ GLSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d2y7Zmg3; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si2158988pla.399.2019.03.20.08.46.35; Wed, 20 Mar 2019 08:46:50 -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=@chromium.org header.s=google header.b=d2y7Zmg3; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727268AbfCTPpE (ORCPT + 99 others); Wed, 20 Mar 2019 11:45:04 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43008 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbfCTPpE (ORCPT ); Wed, 20 Mar 2019 11:45:04 -0400 Received: by mail-pf1-f195.google.com with SMTP id c8so2200264pfd.10 for ; Wed, 20 Mar 2019 08:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UVDXc+lEJ2QHVXWNhubXjC/FHnN1snDnwLNu2MjSfE4=; b=d2y7Zmg3IHoZNub0XfK61x/FGMtEBZcLgjUq/kBNHEwbAznfhRIJwp69KEHqxNTc4/ 7MPPgVv4fHYaoscMHNR6GvUNEScZ4qfEwhvTriDEl1GZglK0HX42pmMeQhhihIWGZANB +Vu9Rbiht+hYnNYJqDDaUy7z94FhHf8UR6tZc= 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:in-reply-to:user-agent; bh=UVDXc+lEJ2QHVXWNhubXjC/FHnN1snDnwLNu2MjSfE4=; b=nabYwE0C0opROtWZbBpDTijim4IS1wF71Twm8Rexks1rTIAiHIC2p8OBWgCLUf/gla VioNnC7qBxgsisWWj7OrX/rlAvPvblagFC2mnXAzyc3wY4BWlsNF6mihkQhcF9yF51s+ yl4O0CbgGSITjvFQo1XDr1WoymZbx1jXuOfC/6MHndHcAqhTFIl95ATnf+Y8kdWFceLP 3i1MNyDVUDP6ABF12LIsbHQhGCcY1L00RQYFy1ELj0omGvUoYEtKDZ17sRGtO4TxFQqq t8uDnYcDCx6NU7EDXfNxHxW3xwDybcHJ0jlAkQ3ArculSNHtuK5NYQOOwdMIklf1BSe+ aX7A== X-Gm-Message-State: APjAAAXk5knJUsehg4+4NFSYtS8UdzmJpokhCh3++Qu/2ZfTX5YLv6F5 BxTWQ7g8qEpAeoI/ArNnDENDfA== X-Received: by 2002:a17:902:15a8:: with SMTP id m37mr8985589pla.178.1553096703442; Wed, 20 Mar 2019 08:45:03 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id y68sm3074633pgy.67.2019.03.20.08.45.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 08:45:01 -0700 (PDT) Date: Wed, 20 Mar 2019 08:45:01 -0700 From: Matthias Kaehlcke To: Masahiro Yamada Cc: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , X86 ML , Linux Kernel Mailing List , Nick Desaulniers , Manoj Gupta , Tiancong Wang , Stephen Hines , clang-built-linux@googlegroups.com Subject: Re: [PATCH] x86/vdso: include generic __lshrdi3 in 32-bit vDSO Message-ID: <20190320154501.GO112750@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 20, 2019 at 10:55:06PM +0900, Masahiro Yamada wrote: > On Sat, Mar 16, 2019 at 4:55 AM Matthias Kaehlcke wrote: > > > > Building the 32-bit vDSO with a recent clang version fails due > > to undefined symbols: > > > > arch/x86/entry/vdso/vdso32.so.dbg: undefined symbols found > > > > The undefined symbol in this case is __lshrdi3, which is part of > > the compiler runtime library, however the vDSO isn't linked against > > this library. > > > > Include the kernel version of __lshrdi3 in the 32-bit vDSO build. > > > > Signed-off-by: Matthias Kaehlcke > > --- > > diff --git a/lib/lshrdi3.c b/lib/lshrdi3.c > > index 99cfa5721f2d..8a4fc6bcf3a4 100644 > > --- a/lib/lshrdi3.c > > +++ b/lib/lshrdi3.c > > @@ -16,7 +16,7 @@ > > * to the Free Software Foundation, Inc. > > */ > > > > -#include > > +#include > > #include > > > > long long notrace __lshrdi3(long long u, word_type b) > > @@ -42,4 +42,6 @@ long long notrace __lshrdi3(long long u, word_type b) > > > > return w.ll; > > } > > +#ifndef BUILD_VDSO > > EXPORT_SYMBOL(__lshrdi3); > > +#endif > > > I picked up > https://patchwork.kernel.org/patch/10858565/ Great, thanks! > I do not know if this patch is still needed. no, with the change to -Os the patch isn't needed anymore. > FYI, just a tip to turn EXPORT_SYMBOL into no-op cleanly. > > You can use __DISABLE_EXPORTS > as drivers/firmware/efi/libstub/Makefile does. > > See commit f922c4abdf76. Good to know, thanks for the pointer!