[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <897bf622-0f89-14f2-d278-b22f640b78f4@arm.com>
Date: Wed, 26 Jun 2019 10:45:41 +0100
From: Vincenzo Frascino <vincenzo.frascino@....com>
To: Will Deacon <will@...nel.org>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Qian Cai <cai@....pw>, Thomas Gleixner <tglx@...utronix.de>,
Nathan Chancellor <natechancellor@...il.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: "arm64: vdso: Substitute gettimeofday() with C implementation"
breaks clang build
On 26/06/2019 10:38, Will Deacon wrote:
> On Tue, Jun 25, 2019 at 06:00:27PM +0100, Vincenzo Frascino wrote:
>> On 25/06/2019 17:26, Nick Desaulniers wrote:
>>> On Tue, Jun 25, 2019 at 7:54 AM Vincenzo Frascino
>>> <vincenzo.frascino@....com> wrote:
>>>>> but clang 7.0 is still use in many distros by default, so maybe this commit can
>>>>> be fixed by adding a conditional check to use "small" if clang version < 8.0.
>>>>>
>>>>
>>>> Could you please verify that the patch below works for you?
>>>
>>> Should it be checking against CONFIG_CLANG_VERSION, or better yet be
>>> using cc-option macro?
>>>
>>
>> This is what I did in my proposed patch, but I was surprised that clang-7
>> generates relocations that clang-8 does not.
>>
>> LD arch/arm64/kernel/vdso/vdso.so.dbg
>> VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
>> 00000000000009d0 R_AARCH64_JUMP_SLOT _mcount
>
> Hmm. It would be nice to understand where the reference to _mcount is coming
> from, since that sounds like ftrace is getting involved where it shouldn't
> be.
>
That's very true, it was a mistake in the Makefile change that I provided with
the original iteration of this patch, that had as a side effect of having ftrace
involved (_mcount is defined in entry-ftrace.c).
I was overriding:
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
with:
CFLAGS_REMOVE_vgettimeofday.o = -mcmodel=tiny (selected if clang is < 8)
that's why I said that I missed a "+" in my previous patch.
Having:
CFLAGS_REMOVE_vgettimeofday.o += -mcmodel=tiny
restores the wanted behavior.
Sorry for not being clear in my explanation.
> Will
>
--
Regards,
Vincenzo
Powered by blists - more mailing lists