]> www.infradead.org Git - users/hch/misc.git/commit
powerpc/vdso: Fix build of VDSO32 with pcrel
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 12 May 2025 18:14:55 +0000 (20:14 +0200)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Fri, 13 Jun 2025 07:00:15 +0000 (12:30 +0530)
commitb93755f408325170edb2156c6a894ed1cae5f4f6
tree5b16fcba4ce8c8ca8c3f0ba4bd30d57d2d32a27d
parent0d67f0dee6c9176bc09a5482dd7346e3a0f14d0b
powerpc/vdso: Fix build of VDSO32 with pcrel

Building vdso32 on power10 with pcrel leads to following errors:

  VDSO32A arch/powerpc/kernel/vdso/gettimeofday-32.o
arch/powerpc/kernel/vdso/gettimeofday.S: Assembler messages:
arch/powerpc/kernel/vdso/gettimeofday.S:40: Error: syntax error; found `@', expected `,'
arch/powerpc/kernel/vdso/gettimeofday.S:71:  Info: macro invoked from here
arch/powerpc/kernel/vdso/gettimeofday.S:40: Error: junk at end of line: `@notoc'
arch/powerpc/kernel/vdso/gettimeofday.S:71:  Info: macro invoked from here
 ...
make[2]: *** [arch/powerpc/kernel/vdso/Makefile:85: arch/powerpc/kernel/vdso/gettimeofday-32.o] Error 1
make[1]: *** [arch/powerpc/Makefile:388: vdso_prepare] Error 2

Once the above is fixed, the following happens:

  VDSO32C arch/powerpc/kernel/vdso/vgettimeofday-32.o
cc1: error: '-mpcrel' requires '-mcmodel=medium'
make[2]: *** [arch/powerpc/kernel/vdso/Makefile:89: arch/powerpc/kernel/vdso/vgettimeofday-32.o] Error 1
make[1]: *** [arch/powerpc/Makefile:388: vdso_prepare] Error 2
make: *** [Makefile:251: __sub-make] Error 2

Make sure pcrel version of CFUNC() macro is used only for powerpc64
builds and remove -mpcrel for powerpc32 builds.

Fixes: 7e3a68be42e1 ("powerpc/64: vmlinux support building with PCREL addresing")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/1fa3453f07d42a50a70114da9905bf7b73304fca.1747073669.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/ppc_asm.h
arch/powerpc/kernel/vdso/Makefile