* Re: [PATCH] riscv: Add -fPIC option to CFLAGS_vgettimeofday.o
[not found] <1592874802-4242-1-git-send-email-vincent.chen@sifive.com>
@ 2020-06-25 22:02 ` Palmer Dabbelt
0 siblings, 0 replies; only message in thread
From: Palmer Dabbelt @ 2020-06-25 22:02 UTC (permalink / raw)
To: vincent.chen; +Cc: vincent.chen, linux-riscv, Paul Walmsley
On Mon, 22 Jun 2020 18:13:22 PDT (-0700), vincent.chen@sifive.com wrote:
> The time related vDSO functions use a variable, vdso_data, to access the
> vDSO data page to get the system time information. Because the vdso_data
> for CFLAGS_vgettimeofday.o is an external variable defined in vdso.o,
> the CFLAGS_vgettimeofday.o should be compiled with -fPIC to ensure
> that vdso_data is addressable.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
> ---
> arch/riscv/kernel/vdso/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
> index 38ba55b0eb9d..29cf052f6541 100644
> --- a/arch/riscv/kernel/vdso/Makefile
> +++ b/arch/riscv/kernel/vdso/Makefile
> @@ -17,7 +17,7 @@ vdso-syms += flush_icache
> obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
>
> ifneq ($(c-gettimeofday-y),)
> - CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
> + CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
> endif
>
> # Build rules
Presumably this should apply to all the C files compiled into the VDSO, but as
that's the only one this is fine for now. I don't know enough build system
wizardry to make that happen, so I guess we'll have to wait until we get a
second C file :)
This is on fixes.
Thanks!
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-26 11:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1592874802-4242-1-git-send-email-vincent.chen@sifive.com>
2020-06-25 22:02 ` [PATCH] riscv: Add -fPIC option to CFLAGS_vgettimeofday.o Palmer Dabbelt
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).