Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp734314ima; Fri, 15 Mar 2019 12:55:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP98Lv56Zvws452jKjhhfE9PwuaLQVIWUBRkjDJUZfeKhjp/NDF0ZwFgBothrqmEZ8Q7V5 X-Received: by 2002:a17:902:2f43:: with SMTP id s61mr6175708plb.158.1552679743372; Fri, 15 Mar 2019 12:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552679743; cv=none; d=google.com; s=arc-20160816; b=IJoi1rgD7c1Oq0PqeejFchnhtVkl80UM/6ErGtP4ZTALjo4MdqW28oj61TaeCeYtWP WFuXieKTkN0sgZL6rvVo1+OBgdunigzWnTxUPFlXw6ekeuGN7cLR0mJZHsgz8FIUJpTw C9QXxDH1AfWTgk7GANRJYvhJsDkNMcuWmCVPFQJarCIn7QvITpLuxt8CHrZcts/qr2i9 rzs6h+CY+xkdYnl1AsYIy1MZsYaCfzy5b7As3CmwrDcnMatLxRvM7snxv15FUNhq8zfD OozmTrGCBf/iRICBGj3KUF+ok899+ToI8pfgujdH3WHcywcrpsbCISNeZrPB+Pz8OEWr o+DQ== 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 :mime-version:from:dkim-signature; bh=0RCX3Ltyuj+IFk9jI40YoK7mwfQtQVtvVQbx4Yv4YiM=; b=ymBKcR8YADhTBe+L+POgKH9k+wdvPiZVvHkB52KmZKqLGp+4+nVt3HMuAD0Fh++xkf et2/zwelb+mrZYe06Qic01iy3SG4bjNvY7nFBOaU7uEgm7m73iGy+wg77oVRWOY37j0z hqyjjs9l5D6WR9J9kXyTXw66tiCDSGNKleR5jujmY0+LBp10pgRlJI/R351zcUfinMBy 7q+xqpkMGDtzbgK8onR+5vBKrH8Ye7gnil1XF5gnbi36WSveQhEiJkzom0fNEhtHNBMU VutsUeg0xHb5mlWSsJFi7hb/sGiwov+0P/76huPP22KzIhbQmkoROMuWGVMKiiLxQRJf kTUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QCLYFU77; 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 y14si2425219pgl.274.2019.03.15.12.55.28; Fri, 15 Mar 2019 12:55:43 -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=QCLYFU77; 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 S1726730AbfCOTy1 (ORCPT + 99 others); Fri, 15 Mar 2019 15:54:27 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:39416 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbfCOTyP (ORCPT ); Fri, 15 Mar 2019 15:54:15 -0400 Received: by mail-yw1-f68.google.com with SMTP id z191so8215224ywa.6 for ; Fri, 15 Mar 2019 12:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:mime-version:date:message-id:subject:to:cc; bh=0RCX3Ltyuj+IFk9jI40YoK7mwfQtQVtvVQbx4Yv4YiM=; b=QCLYFU77ErSpHb/s1QV0ApuMMdOUn1ZDIR78tKYrg/jxn91lOdBBQ+oE/VJM0NxjLL u+TZMWXVvDi0kcw8XsAeksBL4X64PFW3MXy7fE6uHIRygZV2BDZAGOlqH5sVlMkiYRwD dTIDsxdhMIV0RSS2z4A6uyUaJQwSy5ti7W7ng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to:cc; bh=0RCX3Ltyuj+IFk9jI40YoK7mwfQtQVtvVQbx4Yv4YiM=; b=hlLZaWga2NabNQyrUOh1WYeo4NUCBx9Iau2pzZDmZVQbT4euGxARQ5U902yZFKAw2Q xST+gJaMd7Rrdka/lbGiETGbTQPIouR1MbpRZS+a/X97jACkd14RZvkQJfwc+6ldBDEz CSZo467y5Annnf/0N0LD58YBfmRiuP5KRNeO9oZVCew+LrhVfFFovhjUEwVcGT7oToOO i+3l3bdOSCvx1hdCJUyLzYxDFRPyMjQnnbib8NMp0PDT/oWnIli16OT2C12uV27W/zm6 hSU0uL8LCfhZjKkWdkf4zpnTK6G/NMF7/uDPN6RZZYXLvtBvWGBKkWgOuRRUlYd3FN/t F+FQ== X-Gm-Message-State: APjAAAW0GcaU4TzZdoG7I02QQ9NI61pRri+s1x+DDXcvntLzUmacEUH8 /oDoLoAD4ngdA4zT3A4vFxLYte24shLc3jqjyYBZnQ== X-Received: by 2002:a25:2f8e:: with SMTP id v136mr4646345ybv.200.1552679654879; Fri, 15 Mar 2019 12:54:14 -0700 (PDT) Received: from 764776645087 named unknown by gmailapi.google.com with HTTPREST; Fri, 15 Mar 2019 12:54:14 -0700 From: Matthias Kaehlcke X-Mailer: git-send-email 2.21.0.360.g471c308f928-goog MIME-Version: 1.0 Date: Fri, 15 Mar 2019 12:54:13 -0700 Message-ID: Subject: [PATCH] x86/vdso: include generic __lshrdi3 in 32-bit vDSO To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Manoj Gupta , Tiancong Wang , Stephen Hines , clang-built-linux@googlegroups.com, Matthias Kaehlcke 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 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 --- arch/x86/entry/vdso/Makefile | 7 ++++++- lib/lshrdi3.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 5bfe2243a08f..7517cd87e10b 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -144,6 +144,7 @@ KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector) KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls) KBUILD_CFLAGS_32 += -fno-omit-frame-pointer KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING +KBUILD_CFLAGS_32 += -DBUILD_VDSO ifdef CONFIG_RETPOLINE ifneq ($(RETPOLINE_VDSO_CFLAGS),) @@ -153,12 +154,16 @@ endif $(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32) +$(obj)/vdso32/lshrdi3.o: $(srctree)/lib/lshrdi3.c FORCE + $(call if_changed_rule,cc_o_c) + $(obj)/vdso32.so.dbg: FORCE \ $(obj)/vdso32/vdso32.lds \ $(obj)/vdso32/vclock_gettime.o \ $(obj)/vdso32/note.o \ $(obj)/vdso32/system_call.o \ - $(obj)/vdso32/sigreturn.o + $(obj)/vdso32/sigreturn.o \ + $(obj)/vdso32/lshrdi3.o $(call if_changed,vdso) # 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 -- 2.21.0.360.g471c308f928-goog