* "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
@ 2019-06-25 12:16 Qian Cai
2019-06-25 12:47 ` Vincenzo Frascino
0 siblings, 1 reply; 16+ messages in thread
From: Qian Cai @ 2019-06-25 12:16 UTC (permalink / raw)
To: Vincenzo Frascino
Cc: Catalin Marinas, Thomas Gleixner, Will Deacon, linux-kernel,
linux-arm-kernel
The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
implementation" [1] breaks clang build.
error: invalid value 'tiny' in '-mcode-model tiny'
make[1]: *** [scripts/Makefile.build:279:
arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
[1] https://patchwork.kernel.org/patch/11009663/
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 12:16 "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build Qian Cai
@ 2019-06-25 12:47 ` Vincenzo Frascino
2019-06-25 12:56 ` Qian Cai
0 siblings, 1 reply; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-25 12:47 UTC (permalink / raw)
To: Qian Cai
Cc: Catalin Marinas, Thomas Gleixner, Will Deacon, linux-kernel,
linux-arm-kernel
Hi Qian,
On 25/06/2019 13:16, Qian Cai wrote:
> The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
> implementation" [1] breaks clang build.
>
> error: invalid value 'tiny' in '-mcode-model tiny'
> make[1]: *** [scripts/Makefile.build:279:
> arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
>
> [1] https://patchwork.kernel.org/patch/11009663/
>
I am not sure what does exactly break from your report. Could you please provide
more details?
On my env:
$ make mrproper && make defconfig && make CC=clang HOSTCC=clang -j$(nproc)
...
arch/arm64/Makefile:56: CROSS_COMPILE_COMPAT is clang, the compat vDSO will not
be built
...
LDS arch/arm64/kernel/vdso/vdso.lds
AS arch/arm64/kernel/vdso/note.o
AS arch/arm64/kernel/vdso/sigreturn.o
CC arch/arm64/kernel/vdso/vgettimeofday.o
LD arch/arm64/kernel/vdso/vdso.so.dbg
VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
VDSOSYM include/generated/vdso-offsets.h
...
LD vmlinux.o
MODPOST vmlinux.o
MODINFO modules.builtin.modinfo
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
SORTEX vmlinux
SYSMAP System.map
Building modules, stage 2.
OBJCOPY arch/arm64/boot/Image
MODPOST 483 modules
--
Regards,
Vincenzo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 12:47 ` Vincenzo Frascino
@ 2019-06-25 12:56 ` Qian Cai
2019-06-25 13:40 ` Vincenzo Frascino
0 siblings, 1 reply; 16+ messages in thread
From: Qian Cai @ 2019-06-25 12:56 UTC (permalink / raw)
To: Vincenzo Frascino
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
On Tue, 2019-06-25 at 13:47 +0100, Vincenzo Frascino wrote:
> Hi Qian,
>
> On 25/06/2019 13:16, Qian Cai wrote:
> > The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
> > implementation" [1] breaks clang build.
> >
> > error: invalid value 'tiny' in '-mcode-model tiny'
> > make[1]: *** [scripts/Makefile.build:279:
> > arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
> >
> > [1] https://patchwork.kernel.org/patch/11009663/
> >
>
> I am not sure what does exactly break from your report. Could you please
> provide
> more details?
Here is the config to reproduce.
https://raw.githubusercontent.com/cailca/linux-mm/master/arm64.config
# make CC=clang -j $(nr_cpus)
I can get it working again by removing "-mcmodel=tiny" in
arch/arm64/kernel/vdso/Makefile
>
> On my env:
>
> $ make mrproper && make defconfig && make CC=clang HOSTCC=clang -j$(nproc)
>
> ...
>
> arch/arm64/Makefile:56: CROSS_COMPILE_COMPAT is clang, the compat vDSO will
> not
> be built
>
> ...
>
> LDS arch/arm64/kernel/vdso/vdso.lds
> AS arch/arm64/kernel/vdso/note.o
> AS arch/arm64/kernel/vdso/sigreturn.o
> CC arch/arm64/kernel/vdso/vgettimeofday.o
> LD arch/arm64/kernel/vdso/vdso.so.dbg
> VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
> VDSOSYM include/generated/vdso-offsets.h
>
> ...
>
> LD vmlinux.o
> MODPOST vmlinux.o
> MODINFO modules.builtin.modinfo
> KSYM .tmp_kallsyms1.o
> KSYM .tmp_kallsyms2.o
> LD vmlinux
> SORTEX vmlinux
> SYSMAP System.map
> Building modules, stage 2.
> OBJCOPY arch/arm64/boot/Image
> MODPOST 483 modules
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 12:56 ` Qian Cai
@ 2019-06-25 13:40 ` Vincenzo Frascino
2019-06-25 13:51 ` Qian Cai
0 siblings, 1 reply; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-25 13:40 UTC (permalink / raw)
To: Qian Cai
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
Hi Qin,
On 25/06/2019 13:56, Qian Cai wrote:
> On Tue, 2019-06-25 at 13:47 +0100, Vincenzo Frascino wrote:
>> Hi Qian,
>>
>> On 25/06/2019 13:16, Qian Cai wrote:
>>> The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
>>> implementation" [1] breaks clang build.
>>>
>>> error: invalid value 'tiny' in '-mcode-model tiny'
>>> make[1]: *** [scripts/Makefile.build:279:
>>> arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
>>> make[1]: *** Waiting for unfinished jobs....
>>> make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
>>>
>>> [1] https://patchwork.kernel.org/patch/11009663/
>>>
>>
>> I am not sure what does exactly break from your report. Could you please
>> provide
>> more details?
>
> Here is the config to reproduce.
>
> https://raw.githubusercontent.com/cailca/linux-mm/master/arm64.config
>
> # make CC=clang -j $(nr_cpus)
>
> I can get it working again by removing "-mcmodel=tiny" in
> arch/arm64/kernel/vdso/Makefile
>
With your defconfig I can't still reproduce the problem. Which version of clang
are you using?
>>
>> On my env:
>>
>> $ make mrproper && make defconfig && make CC=clang HOSTCC=clang -j$(nproc)
>>
>> ...
>>
>> arch/arm64/Makefile:56: CROSS_COMPILE_COMPAT is clang, the compat vDSO will
>> not
>> be built
>>
>> ...
>>
>> LDS arch/arm64/kernel/vdso/vdso.lds
>> AS arch/arm64/kernel/vdso/note.o
>> AS arch/arm64/kernel/vdso/sigreturn.o
>> CC arch/arm64/kernel/vdso/vgettimeofday.o
>> LD arch/arm64/kernel/vdso/vdso.so.dbg
>> VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
>> VDSOSYM include/generated/vdso-offsets.h
>>
>> ...
>>
>> LD vmlinux.o
>> MODPOST vmlinux.o
>> MODINFO modules.builtin.modinfo
>> KSYM .tmp_kallsyms1.o
>> KSYM .tmp_kallsyms2.o
>> LD vmlinux
>> SORTEX vmlinux
>> SYSMAP System.map
>> Building modules, stage 2.
>> OBJCOPY arch/arm64/boot/Image
>> MODPOST 483 modules
>>
--
Regards,
Vincenzo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 13:40 ` Vincenzo Frascino
@ 2019-06-25 13:51 ` Qian Cai
2019-06-25 14:11 ` Vincenzo Frascino
0 siblings, 1 reply; 16+ messages in thread
From: Qian Cai @ 2019-06-25 13:51 UTC (permalink / raw)
To: Vincenzo Frascino
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
On Tue, 2019-06-25 at 14:40 +0100, Vincenzo Frascino wrote:
> On 25/06/2019 13:56, Qian Cai wrote:
> > On Tue, 2019-06-25 at 13:47 +0100, Vincenzo Frascino wrote:
> > > Hi Qian,
> > >
> > > On 25/06/2019 13:16, Qian Cai wrote:
> > > > The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
> > > > implementation" [1] breaks clang build.
> > > >
> > > > error: invalid value 'tiny' in '-mcode-model tiny'
> > > > make[1]: *** [scripts/Makefile.build:279:
> > > > arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
> > > > make[1]: *** Waiting for unfinished jobs....
> > > > make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
> > > >
> > > > [1] https://patchwork.kernel.org/patch/11009663/
> > > >
> > >
> > > I am not sure what does exactly break from your report. Could you please
> > > provide
> > > more details?
> >
> > Here is the config to reproduce.
> >
> > https://raw.githubusercontent.com/cailca/linux-mm/master/arm64.config
> >
> > # make CC=clang -j $(nr_cpus)
> >
> > I can get it working again by removing "-mcmodel=tiny" in
> > arch/arm64/kernel/vdso/Makefile
> >
>
> With your defconfig I can't still reproduce the problem. Which version of
> clang
> are you using?
Compiler: clang version 7.0.1 (tags/RELEASE_701/final)
>
> > >
> > > On my env:
> > >
> > > $ make mrproper && make defconfig && make CC=clang HOSTCC=clang -j$(nproc)
> > >
> > > ...
> > >
> > > arch/arm64/Makefile:56: CROSS_COMPILE_COMPAT is clang, the compat vDSO
> > > will
> > > not
> > > be built
> > >
> > > ...
> > >
> > > LDS arch/arm64/kernel/vdso/vdso.lds
> > > AS arch/arm64/kernel/vdso/note.o
> > > AS arch/arm64/kernel/vdso/sigreturn.o
> > > CC arch/arm64/kernel/vdso/vgettimeofday.o
> > > LD arch/arm64/kernel/vdso/vdso.so.dbg
> > > VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
> > > VDSOSYM include/generated/vdso-offsets.h
> > >
> > > ...
> > >
> > > LD vmlinux.o
> > > MODPOST vmlinux.o
> > > MODINFO modules.builtin.modinfo
> > > KSYM .tmp_kallsyms1.o
> > > KSYM .tmp_kallsyms2.o
> > > LD vmlinux
> > > SORTEX vmlinux
> > > SYSMAP System.map
> > > Building modules, stage 2.
> > > OBJCOPY arch/arm64/boot/Image
> > > MODPOST 483 modules
> > >
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 13:51 ` Qian Cai
@ 2019-06-25 14:11 ` Vincenzo Frascino
2019-06-25 14:28 ` Qian Cai
0 siblings, 1 reply; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-25 14:11 UTC (permalink / raw)
To: Qian Cai
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
Hi Qian,
On 25/06/2019 14:51, Qian Cai wrote:
> On Tue, 2019-06-25 at 14:40 +0100, Vincenzo Frascino wrote:
>> On 25/06/2019 13:56, Qian Cai wrote:
>>> On Tue, 2019-06-25 at 13:47 +0100, Vincenzo Frascino wrote:
>>>> Hi Qian,
>>>>
>>>> On 25/06/2019 13:16, Qian Cai wrote:
>>>>> The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
>>>>> implementation" [1] breaks clang build.
>>>>>
>>>>> error: invalid value 'tiny' in '-mcode-model tiny'
>>>>> make[1]: *** [scripts/Makefile.build:279:
>>>>> arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
>>>>> make[1]: *** Waiting for unfinished jobs....
>>>>> make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
>>>>>
>>>>> [1] https://patchwork.kernel.org/patch/11009663/
>>>>>
>>>>
>>>> I am not sure what does exactly break from your report. Could you please
>>>> provide
>>>> more details?
>>>
>>> Here is the config to reproduce.
>>>
>>> https://raw.githubusercontent.com/cailca/linux-mm/master/arm64.config
>>>
>>> # make CC=clang -j $(nr_cpus)
>>>
>>> I can get it working again by removing "-mcmodel=tiny" in
>>> arch/arm64/kernel/vdso/Makefile
>>>
>>
>> With your defconfig I can't still reproduce the problem. Which version of
>> clang
>> are you using?
>
> Compiler: clang version 7.0.1 (tags/RELEASE_701/final)
>
I am using clang 8.0.0. Could you please try with it and see if the issue goes away?
Thanks,
Vincenzo
>>
>>>>
>>>> On my env:
>>>>
>>>> $ make mrproper && make defconfig && make CC=clang HOSTCC=clang -j$(nproc)
>>>>
>>>> ...
>>>>
>>>> arch/arm64/Makefile:56: CROSS_COMPILE_COMPAT is clang, the compat vDSO
>>>> will
>>>> not
>>>> be built
>>>>
>>>> ...
>>>>
>>>> LDS arch/arm64/kernel/vdso/vdso.lds
>>>> AS arch/arm64/kernel/vdso/note.o
>>>> AS arch/arm64/kernel/vdso/sigreturn.o
>>>> CC arch/arm64/kernel/vdso/vgettimeofday.o
>>>> LD arch/arm64/kernel/vdso/vdso.so.dbg
>>>> VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
>>>> VDSOSYM include/generated/vdso-offsets.h
>>>>
>>>> ...
>>>>
>>>> LD vmlinux.o
>>>> MODPOST vmlinux.o
>>>> MODINFO modules.builtin.modinfo
>>>> KSYM .tmp_kallsyms1.o
>>>> KSYM .tmp_kallsyms2.o
>>>> LD vmlinux
>>>> SORTEX vmlinux
>>>> SYSMAP System.map
>>>> Building modules, stage 2.
>>>> OBJCOPY arch/arm64/boot/Image
>>>> MODPOST 483 modules
>>>>
>>
>>
--
Regards,
Vincenzo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 14:11 ` Vincenzo Frascino
@ 2019-06-25 14:28 ` Qian Cai
2019-06-25 14:30 ` Vincenzo Frascino
2019-06-25 14:54 ` Vincenzo Frascino
0 siblings, 2 replies; 16+ messages in thread
From: Qian Cai @ 2019-06-25 14:28 UTC (permalink / raw)
To: Vincenzo Frascino
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
On Tue, 2019-06-25 at 15:11 +0100, Vincenzo Frascino wrote:
> Hi Qian,
>
> On 25/06/2019 14:51, Qian Cai wrote:
> > On Tue, 2019-06-25 at 14:40 +0100, Vincenzo Frascino wrote:
> > > On 25/06/2019 13:56, Qian Cai wrote:
> > > > On Tue, 2019-06-25 at 13:47 +0100, Vincenzo Frascino wrote:
> > > > > Hi Qian,
> > > > >
> > > > > On 25/06/2019 13:16, Qian Cai wrote:
> > > > > > The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
> > > > > > implementation" [1] breaks clang build.
> > > > > >
> > > > > > error: invalid value 'tiny' in '-mcode-model tiny'
> > > > > > make[1]: *** [scripts/Makefile.build:279:
> > > > > > arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
> > > > > > make[1]: *** Waiting for unfinished jobs....
> > > > > > make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
> > > > > >
> > > > > > [1] https://patchwork.kernel.org/patch/11009663/
> > > > > >
> > > > >
> > > > > I am not sure what does exactly break from your report. Could you
> > > > > please
> > > > > provide
> > > > > more details?
> > > >
> > > > Here is the config to reproduce.
> > > >
> > > > https://raw.githubusercontent.com/cailca/linux-mm/master/arm64.config
> > > >
> > > > # make CC=clang -j $(nr_cpus)
> > > >
> > > > I can get it working again by removing "-mcmodel=tiny" in
> > > > arch/arm64/kernel/vdso/Makefile
> > > >
> > >
> > > With your defconfig I can't still reproduce the problem. Which version of
> > > clang
> > > are you using?
> >
> > Compiler: clang version 7.0.1 (tags/RELEASE_701/final)
> >
>
> I am using clang 8.0.0. Could you please try with it and see if the issue goes
> away?
Looks like the "tiny" was added since clang 8.0.
https://reviews.llvm.org/D49674
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.
>
> Thanks,
> Vincenzo
>
> > >
> > > > >
> > > > > On my env:
> > > > >
> > > > > $ make mrproper && make defconfig && make CC=clang HOSTCC=clang
> > > > > -j$(nproc)
> > > > >
> > > > > ...
> > > > >
> > > > > arch/arm64/Makefile:56: CROSS_COMPILE_COMPAT is clang, the compat vDSO
> > > > > will
> > > > > not
> > > > > be built
> > > > >
> > > > > ...
> > > > >
> > > > > LDS arch/arm64/kernel/vdso/vdso.lds
> > > > > AS arch/arm64/kernel/vdso/note.o
> > > > > AS arch/arm64/kernel/vdso/sigreturn.o
> > > > > CC arch/arm64/kernel/vdso/vgettimeofday.o
> > > > > LD arch/arm64/kernel/vdso/vdso.so.dbg
> > > > > VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
> > > > > VDSOSYM include/generated/vdso-offsets.h
> > > > >
> > > > > ...
> > > > >
> > > > > LD vmlinux.o
> > > > > MODPOST vmlinux.o
> > > > > MODINFO modules.builtin.modinfo
> > > > > KSYM .tmp_kallsyms1.o
> > > > > KSYM .tmp_kallsyms2.o
> > > > > LD vmlinux
> > > > > SORTEX vmlinux
> > > > > SYSMAP System.map
> > > > > Building modules, stage 2.
> > > > > OBJCOPY arch/arm64/boot/Image
> > > > > MODPOST 483 modules
> > > > >
> > >
> > >
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 14:28 ` Qian Cai
@ 2019-06-25 14:30 ` Vincenzo Frascino
2019-06-25 14:54 ` Vincenzo Frascino
1 sibling, 0 replies; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-25 14:30 UTC (permalink / raw)
To: Qian Cai
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
Hi Qian,
On 25/06/2019 15:28, Qian Cai wrote:
> On Tue, 2019-06-25 at 15:11 +0100, Vincenzo Frascino wrote:
>> Hi Qian,
>>
>> On 25/06/2019 14:51, Qian Cai wrote:
>>> On Tue, 2019-06-25 at 14:40 +0100, Vincenzo Frascino wrote:
>>>> On 25/06/2019 13:56, Qian Cai wrote:
>>>>> On Tue, 2019-06-25 at 13:47 +0100, Vincenzo Frascino wrote:
>>>>>> Hi Qian,
>>>>>>
>>>>>> On 25/06/2019 13:16, Qian Cai wrote:
>>>>>>> The linux-next commit "arm64: vdso: Substitute gettimeofday() with C
>>>>>>> implementation" [1] breaks clang build.
>>>>>>>
>>>>>>> error: invalid value 'tiny' in '-mcode-model tiny'
>>>>>>> make[1]: *** [scripts/Makefile.build:279:
>>>>>>> arch/arm64/kernel/vdso/vgettimeofday.o] Error 1
>>>>>>> make[1]: *** Waiting for unfinished jobs....
>>>>>>> make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
>>>>>>>
>>>>>>> [1] https://patchwork.kernel.org/patch/11009663/
>>>>>>>
>>>>>>
>>>>>> I am not sure what does exactly break from your report. Could you
>>>>>> please
>>>>>> provide
>>>>>> more details?
>>>>>
>>>>> Here is the config to reproduce.
>>>>>
>>>>> https://raw.githubusercontent.com/cailca/linux-mm/master/arm64.config
>>>>>
>>>>> # make CC=clang -j $(nr_cpus)
>>>>>
>>>>> I can get it working again by removing "-mcmodel=tiny" in
>>>>> arch/arm64/kernel/vdso/Makefile
>>>>>
>>>>
>>>> With your defconfig I can't still reproduce the problem. Which version of
>>>> clang
>>>> are you using?
>>>
>>> Compiler: clang version 7.0.1 (tags/RELEASE_701/final)
>>>
>>
>> I am using clang 8.0.0. Could you please try with it and see if the issue goes
>> away?
>
> Looks like the "tiny" was added since clang 8.0.
>
> https://reviews.llvm.org/D49674
>
> 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.
>
It is what I thought that's why I asked to cross-check. I did not want to remove
tiny.
Thanks for your support, I will post a patch adding your tag as reported-by if
you are ok with that.
>>
>> Thanks,
>> Vincenzo
>>
>>>>
>>>>>>
>>>>>> On my env:
>>>>>>
>>>>>> $ make mrproper && make defconfig && make CC=clang HOSTCC=clang
>>>>>> -j$(nproc)
>>>>>>
>>>>>> ...
>>>>>>
>>>>>> arch/arm64/Makefile:56: CROSS_COMPILE_COMPAT is clang, the compat vDSO
>>>>>> will
>>>>>> not
>>>>>> be built
>>>>>>
>>>>>> ...
>>>>>>
>>>>>> LDS arch/arm64/kernel/vdso/vdso.lds
>>>>>> AS arch/arm64/kernel/vdso/note.o
>>>>>> AS arch/arm64/kernel/vdso/sigreturn.o
>>>>>> CC arch/arm64/kernel/vdso/vgettimeofday.o
>>>>>> LD arch/arm64/kernel/vdso/vdso.so.dbg
>>>>>> VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
>>>>>> VDSOSYM include/generated/vdso-offsets.h
>>>>>>
>>>>>> ...
>>>>>>
>>>>>> LD vmlinux.o
>>>>>> MODPOST vmlinux.o
>>>>>> MODINFO modules.builtin.modinfo
>>>>>> KSYM .tmp_kallsyms1.o
>>>>>> KSYM .tmp_kallsyms2.o
>>>>>> LD vmlinux
>>>>>> SORTEX vmlinux
>>>>>> SYSMAP System.map
>>>>>> Building modules, stage 2.
>>>>>> OBJCOPY arch/arm64/boot/Image
>>>>>> MODPOST 483 modules
>>>>>>
>>>>
>>>>
>>
>>
--
Regards,
Vincenzo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 14:28 ` Qian Cai
2019-06-25 14:30 ` Vincenzo Frascino
@ 2019-06-25 14:54 ` Vincenzo Frascino
2019-06-25 15:16 ` Qian Cai
2019-06-25 16:26 ` Nick Desaulniers
1 sibling, 2 replies; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-25 14:54 UTC (permalink / raw)
To: Qian Cai
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 274 bytes --]
Hi Qian,
...
>
> 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?
Thanks,
Vincenzo
--->8----
[-- Attachment #2: 0001-arm64-vdso-Fix-compilation-with-clang-8.patch --]
[-- Type: text/x-patch, Size: 1130 bytes --]
From 0546f3bbea910cd26df8c2ff9ed1a59945bb1bec Mon Sep 17 00:00:00 2001
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
Date: Tue, 25 Jun 2019 15:49:37 +0100
Subject: [PATCH] arm64: vdso: Fix compilation with clang < 8
clang versions previous to 8 do not support -mcmodel=tiny.
Add a check to the vDSO Makefile for arm64 to remove the flag when these
versions of the compiler are detected.
Reported-by: Qian Cai <cai@lca.pw>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
arch/arm64/kernel/vdso/Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index ec81d28aeb5d..c11cbf71073f 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -38,6 +38,11 @@ else
CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -include $(c-gettimeofday-y)
endif
+# Clang versions less than 8 do not support -mcmodel=tiny
+ifeq ($(shell test $(CONFIG_CLANG_VERSION) -lt 80000; echo $$?),0)
+CFLAGS_REMOVE_vgettimeofday.o = -mcmodel=tiny
+endif
+
# Disable gcov profiling for VDSO code
GCOV_PROFILE := n
--
2.22.0
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 14:54 ` Vincenzo Frascino
@ 2019-06-25 15:16 ` Qian Cai
2019-06-25 16:26 ` Nick Desaulniers
1 sibling, 0 replies; 16+ messages in thread
From: Qian Cai @ 2019-06-25 15:16 UTC (permalink / raw)
To: Vincenzo Frascino
Cc: ndesaulniers, Catalin Marinas, Will Deacon, linux-kernel,
natechancellor, Thomas Gleixner, linux-arm-kernel
On Tue, 2019-06-25 at 15:54 +0100, Vincenzo Frascino wrote:
> Hi Qian,
>
> ...
>
> >
> > 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?
>
> Thanks,
> Vincenzo
>
> --->8----
>
It does not work unfortunately.
# make CC=clang -j 256 2>/tmp/warn3.txt
HOSTCC scripts/basic/fixdep
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
LEX scripts/dtc/dtc-lexer.lex.c
YACC scripts/dtc/dtc-parser.tab.h
YACC scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTLD scripts/dtc/dtc
HOSTCC scripts/kallsyms
HOSTCC scripts/recordmcount
HOSTCC scripts/sortextable
DTC arch/arm64/boot/dts/arm/foundation-v8.dtb
DTC arch/arm64/boot/dts/arm/foundation-v8-psci.dtb
DTC arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtb
DTC arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb
DTC arch/arm64/boot/dts/arm/juno.dtb
DTC arch/arm64/boot/dts/arm/juno-r1.dtb
DTC arch/arm64/boot/dts/arm/juno-r2.dtb
DTC arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dtb
DTC arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dtb
DTC arch/arm64/boot/dts/arm/fvp-base-revc.dtb
DTC arch/arm64/boot/dts/cavium/thunder2-99xx.dtb
DTC arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb
DTC arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dtb
DTC arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dtb
DTC arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb
DTC arch/arm64/boot/dts/hisilicon/hip05-d02.dtb
DTC arch/arm64/boot/dts/hisilicon/hip06-d03.dtb
DTC arch/arm64/boot/dts/hisilicon/hip07-d05.dtb
HOSTCC scripts/mod/mk_elfconfig
CC scripts/mod/devicetable-offsets.s
CC scripts/mod/empty.o
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
CC kernel/bounds.s
CALL scripts/atomic/check-atomics.sh
CC arch/arm64/kernel/asm-offsets.s
CALL scripts/checksyscalls.sh
LDS arch/arm64/kernel/vdso/vdso.lds
AS arch/arm64/kernel/vdso/note.o
AS arch/arm64/kernel/vdso/sigreturn.o
CC arch/arm64/kernel/vdso/vgettimeofday.o
LD arch/arm64/kernel/vdso/vdso.so.dbg
VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
00000000000009d0 R_AARCH64_JUMP_SLOT _mcount
arch/arm64/kernel/vdso/vdso.so.dbg: dynamic relocations are not supported
make[1]: *** [arch/arm64/kernel/vdso/Makefile:59:
arch/arm64/kernel/vdso/vdso.so.dbg] Error 1
make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 14:54 ` Vincenzo Frascino
2019-06-25 15:16 ` Qian Cai
@ 2019-06-25 16:26 ` Nick Desaulniers
2019-06-25 17:00 ` Vincenzo Frascino
1 sibling, 1 reply; 16+ messages in thread
From: Nick Desaulniers @ 2019-06-25 16:26 UTC (permalink / raw)
To: Vincenzo Frascino
Cc: Catalin Marinas, Will Deacon, linux-kernel, Qian Cai,
Thomas Gleixner, Nathan Chancellor, Linux ARM
On Tue, Jun 25, 2019 at 7:54 AM Vincenzo Frascino
<vincenzo.frascino@arm.com> wrote:
>
> Hi Qian,
>
> ...
>
> >
> > 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?
--
Thanks,
~Nick Desaulniers
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 16:26 ` Nick Desaulniers
@ 2019-06-25 17:00 ` Vincenzo Frascino
2019-06-25 17:31 ` Qian Cai
2019-06-26 9:38 ` Will Deacon
0 siblings, 2 replies; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-25 17:00 UTC (permalink / raw)
To: Nick Desaulniers
Cc: Catalin Marinas, Will Deacon, linux-kernel, Qian Cai,
Thomas Gleixner, Nathan Chancellor, Linux ARM
[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]
Hi Nick,
On 25/06/2019 17:26, Nick Desaulniers wrote:
> On Tue, Jun 25, 2019 at 7:54 AM Vincenzo Frascino
> <vincenzo.frascino@arm.com> wrote:
>>
>> Hi Qian,
>>
>> ...
>>
>>>
>>> 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
arch/arm64/kernel/vdso/vdso.so.dbg: dynamic relocations are not supported
make[1]: *** [arch/arm64/kernel/vdso/Makefile:59:
arch/arm64/kernel/vdso/vdso.so.dbg] Error 1
make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
This is the the result of the macro I introduced in lib/vdso/Makefile.
And I just found out why. I forgot to add a "+" in the patch provided :)
@Qian: Could you please retry with the one provided below?
--
Regards,
Vincenzo
--->8----
[-- Attachment #2: 0001-arm64-vdso-Fix-compilation-with-clang-8.patch --]
[-- Type: text/x-patch, Size: 1131 bytes --]
From eed9ea23cf999d31b87db4b98a8e9de209706132 Mon Sep 17 00:00:00 2001
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
Date: Tue, 25 Jun 2019 15:49:37 +0100
Subject: [PATCH] arm64: vdso: Fix compilation with clang < 8
clang versions previous to 8 do not support -mcmodel=tiny.
Add a check to the vDSO Makefile for arm64 to remove the flag when these
versions of the compiler are detected.
Reported-by: Qian Cai <cai@lca.pw>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
arch/arm64/kernel/vdso/Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index ec81d28aeb5d..5154f50aff2d 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -38,6 +38,11 @@ else
CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -include $(c-gettimeofday-y)
endif
+# Clang versions less than 8 do not support -mcmodel=tiny
+ifeq ($(shell test $(CONFIG_CLANG_VERSION) -lt 80000; echo $$?),0)
+CFLAGS_REMOVE_vgettimeofday.o += -mcmodel=tiny
+endif
+
# Disable gcov profiling for VDSO code
GCOV_PROFILE := n
--
2.22.0
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 17:00 ` Vincenzo Frascino
@ 2019-06-25 17:31 ` Qian Cai
2019-06-25 17:33 ` Vincenzo Frascino
2019-06-26 9:38 ` Will Deacon
1 sibling, 1 reply; 16+ messages in thread
From: Qian Cai @ 2019-06-25 17:31 UTC (permalink / raw)
To: Vincenzo Frascino, Nick Desaulniers
Cc: Catalin Marinas, Will Deacon, linux-kernel, Nathan Chancellor,
Thomas Gleixner, Linux ARM
On Tue, 2019-06-25 at 18:00 +0100, Vincenzo Frascino wrote:
> Hi Nick,
>
> On 25/06/2019 17:26, Nick Desaulniers wrote:
> > On Tue, Jun 25, 2019 at 7:54 AM Vincenzo Frascino
> > <vincenzo.frascino@arm.com> wrote:
> > >
> > > Hi Qian,
> > >
> > > ...
> > >
> > > >
> > > > 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
>
> arch/arm64/kernel/vdso/vdso.so.dbg: dynamic relocations are not supported
> make[1]: *** [arch/arm64/kernel/vdso/Makefile:59:
> arch/arm64/kernel/vdso/vdso.so.dbg] Error 1
> make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
>
> This is the the result of the macro I introduced in lib/vdso/Makefile.
>
> And I just found out why. I forgot to add a "+" in the patch provided :)
>
> @Qian: Could you please retry with the one provided below?
>
It works fine.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 17:31 ` Qian Cai
@ 2019-06-25 17:33 ` Vincenzo Frascino
0 siblings, 0 replies; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-25 17:33 UTC (permalink / raw)
To: Qian Cai, Nick Desaulniers
Cc: Catalin Marinas, Will Deacon, linux-kernel, Nathan Chancellor,
Thomas Gleixner, Linux ARM
Hi Qian,
On 25/06/2019 18:31, Qian Cai wrote:
> On Tue, 2019-06-25 at 18:00 +0100, Vincenzo Frascino wrote:
>> Hi Nick,
>>
>> On 25/06/2019 17:26, Nick Desaulniers wrote:
>>> On Tue, Jun 25, 2019 at 7:54 AM Vincenzo Frascino
>>> <vincenzo.frascino@arm.com> wrote:
>>>>
>>>> Hi Qian,
>>>>
>>>> ...
>>>>
>>>>>
>>>>> 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
>>
>> arch/arm64/kernel/vdso/vdso.so.dbg: dynamic relocations are not supported
>> make[1]: *** [arch/arm64/kernel/vdso/Makefile:59:
>> arch/arm64/kernel/vdso/vdso.so.dbg] Error 1
>> make: *** [arch/arm64/Makefile:180: vdso_prepare] Error 2
>>
>> This is the the result of the macro I introduced in lib/vdso/Makefile.
>>
>> And I just found out why. I forgot to add a "+" in the patch provided :)
>>
>> @Qian: Could you please retry with the one provided below?
>>
>
> It works fine.
>
Thanks for the confirmation, I will push the patch in a short while.
--
Regards,
Vincenzo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-25 17:00 ` Vincenzo Frascino
2019-06-25 17:31 ` Qian Cai
@ 2019-06-26 9:38 ` Will Deacon
2019-06-26 9:45 ` Vincenzo Frascino
1 sibling, 1 reply; 16+ messages in thread
From: Will Deacon @ 2019-06-26 9:38 UTC (permalink / raw)
To: Vincenzo Frascino
Cc: Catalin Marinas, Nick Desaulniers, linux-kernel, Will Deacon,
Qian Cai, Thomas Gleixner, Nathan Chancellor, Linux ARM
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@arm.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.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build
2019-06-26 9:38 ` Will Deacon
@ 2019-06-26 9:45 ` Vincenzo Frascino
0 siblings, 0 replies; 16+ messages in thread
From: Vincenzo Frascino @ 2019-06-26 9:45 UTC (permalink / raw)
To: Will Deacon
Cc: Catalin Marinas, Nick Desaulniers, linux-kernel, Will Deacon,
Qian Cai, Thomas Gleixner, Nathan Chancellor, Linux ARM
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@arm.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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2019-06-26 9:45 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25 12:16 "arm64: vdso: Substitute gettimeofday() with C implementation" breaks clang build Qian Cai
2019-06-25 12:47 ` Vincenzo Frascino
2019-06-25 12:56 ` Qian Cai
2019-06-25 13:40 ` Vincenzo Frascino
2019-06-25 13:51 ` Qian Cai
2019-06-25 14:11 ` Vincenzo Frascino
2019-06-25 14:28 ` Qian Cai
2019-06-25 14:30 ` Vincenzo Frascino
2019-06-25 14:54 ` Vincenzo Frascino
2019-06-25 15:16 ` Qian Cai
2019-06-25 16:26 ` Nick Desaulniers
2019-06-25 17:00 ` Vincenzo Frascino
2019-06-25 17:31 ` Qian Cai
2019-06-25 17:33 ` Vincenzo Frascino
2019-06-26 9:38 ` Will Deacon
2019-06-26 9:45 ` Vincenzo Frascino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).