diff mbox series

riscv: compat: make __ARCH_WANT_COMPAT_FADVISE64_64 conditional

Message ID 20220807172839.12359-1-rdunlap@infradead.org (mailing list archive)
State New, archived
Headers show
Series riscv: compat: make __ARCH_WANT_COMPAT_FADVISE64_64 conditional | expand

Commit Message

Randy Dunlap Aug. 7, 2022, 5:28 p.m. UTC
When CONFIG_ADVISE_SYSCALLS is not set/enabled and CONFIG_COMPAT is
set/enabled, the riscv compat_syscall_table references
'compat_sys_fadvise64_64', which is not defined:

riscv64-linux-ld: arch/riscv/kernel/compat_syscall_table.o:(.rodata+0x6f8):
undefined reference to `compat_sys_fadvise64_64'

Only set __ARCH_WANT_COMPAT_FADVISE64_64 when CONFIG_ADVISE_SYSCALLS
is set.

Fixes: 59c10c52f573 ("riscv: compat: syscall: Add compat_sys_call_table implementation")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
Cc: Guo Ren <guoren@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/riscv/include/asm/unistd.h |    2 ++
 1 file changed, 2 insertions(+)

Comments

Arnd Bergmann Aug. 7, 2022, 7:40 p.m. UTC | #1
On Sun, Aug 7, 2022 at 7:28 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> When CONFIG_ADVISE_SYSCALLS is not set/enabled and CONFIG_COMPAT is
> set/enabled, the riscv compat_syscall_table references
> 'compat_sys_fadvise64_64', which is not defined:
>
> riscv64-linux-ld: arch/riscv/kernel/compat_syscall_table.o:(.rodata+0x6f8):
> undefined reference to `compat_sys_fadvise64_64'
>
> Only set __ARCH_WANT_COMPAT_FADVISE64_64 when CONFIG_ADVISE_SYSCALLS
> is set.
>
> Fixes: 59c10c52f573 ("riscv: compat: syscall: Add compat_sys_call_table implementation")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Paul Walmsley <paul.walmsley@sifive.com>
> Cc: Palmer Dabbelt <palmer@dabbelt.com>
> Cc: Albert Ou <aou@eecs.berkeley.edu>
> Cc: linux-riscv@lists.infradead.org
> Cc: Guo Ren <guoren@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/riscv/include/asm/unistd.h |    2 ++
>  1 file changed, 2 insertions(+)
>
> --- a/arch/riscv/include/asm/unistd.h
> +++ b/arch/riscv/include/asm/unistd.h
> @@ -18,8 +18,10 @@
>  #define __ARCH_WANT_COMPAT_PWRITE64
>  #define __ARCH_WANT_COMPAT_SYNC_FILE_RANGE
>  #define __ARCH_WANT_COMPAT_READAHEAD
> +#ifdef CONFIG_ADVISE_SYSCALLS
>  #define __ARCH_WANT_COMPAT_FADVISE64_64
>  #endif
> +#endif

I think it's better to add this to kernel/sys_ni.c next to
COND_SYSCALL(fadvise64_64), to make it more consistent
with the other conditionally enabled syscalls.

        Arnd
diff mbox series

Patch

--- a/arch/riscv/include/asm/unistd.h
+++ b/arch/riscv/include/asm/unistd.h
@@ -18,8 +18,10 @@ 
 #define __ARCH_WANT_COMPAT_PWRITE64
 #define __ARCH_WANT_COMPAT_SYNC_FILE_RANGE
 #define __ARCH_WANT_COMPAT_READAHEAD
+#ifdef CONFIG_ADVISE_SYSCALLS
 #define __ARCH_WANT_COMPAT_FADVISE64_64
 #endif
+#endif
 
 #include <uapi/asm/unistd.h>