[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAT5JkoONtDzrG6Ft6xxdYUcc5-H2CSGO_9zGsbykbE7Eg@mail.gmail.com>
Date: Wed, 20 Mar 2019 23:06:20 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Matthias Kaehlcke <mka@...omium.org>,
Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Manoj Gupta <manojgupta@...omium.org>,
Tiancong Wang <tcwang@...omium.org>,
Stephen Hines <srhines@...gle.com>,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH] x86/vdso: include generic __lshrdi3 in 32-bit vDSO
On Sat, Mar 16, 2019 at 6:32 AM Nick Desaulniers
<ndesaulniers@...gle.com> wrote:
>
> On Fri, Mar 15, 2019 at 12:54 PM Matthias Kaehlcke <mka@...omium.org> 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.
>
> __lshrdi3 is used for "logical shift right double-word by int" (best
> guess), so anywhere there's a right shift of a u64. Looks like
> there's a few of these in arch/x86/entry/vdso/, so it's legal for the
> compiler to emit this libcall. Do you know which function
> specifically in the .so has a relocation referencing __lshrdi3
> specifically?
>
> Is there a config I can set to reproduce this, in order to help test?
>
> >
> > Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
> > ---
> > 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)
>
> + Masahiro to help look at this part (I don't understand this part of kbuild).
This is a copy from scripts/Makefile.build,
which is globally used to compile %.c -> %.o
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists