powerpc/cell: Fix compilation with CONFIG_COREDUMP=n
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 8 Jul 2014 06:00:09 +0000 (16:00 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 11 Jul 2014 02:55:05 +0000 (12:55 +1000)
Commit 046d662f4818 "coredump: make core dump functionality optional"
made the coredump optional, but didn't update the spufs code that
depends on it. That leads to build errors such as:

  arch/powerpc/platforms/built-in.o: In function `.spufs_arch_write_note':
  coredump.c:(.text+0x22cd4): undefined reference to `.dump_emit'
  coredump.c:(.text+0x22cf4): undefined reference to `.dump_emit'
  coredump.c:(.text+0x22d0c): undefined reference to `.dump_align'
  coredump.c:(.text+0x22d48): undefined reference to `.dump_emit'
  coredump.c:(.text+0x22e7c): undefined reference to `.dump_skip'

Fix it by adding some ifdefs in the cell code.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/cell/spu_syscalls.c
arch/powerpc/platforms/cell/spufs/Makefile
arch/powerpc/platforms/cell/spufs/syscalls.c

index 38e0a1a..5e6e0ba 100644 (file)
@@ -111,6 +111,7 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
        return ret;
 }
 
+#ifdef CONFIG_COREDUMP
 int elf_coredump_extra_notes_size(void)
 {
        struct spufs_calls *calls;
@@ -142,6 +143,7 @@ int elf_coredump_extra_notes_write(struct coredump_params *cprm)
 
        return ret;
 }
+#endif
 
 void notify_spus_active(void)
 {
index b9d5d67..52a7d25 100644 (file)
@@ -1,8 +1,9 @@
 
 obj-$(CONFIG_SPU_FS) += spufs.o
-spufs-y += inode.o file.o context.o syscalls.o coredump.o
+spufs-y += inode.o file.o context.o syscalls.o
 spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
 spufs-y += switch.o fault.o lscsa_alloc.o
+spufs-$(CONFIG_COREDUMP) += coredump.o
 
 # magic for the trace events
 CFLAGS_sched.o := -I$(src)
index b045fdd..a87200a 100644 (file)
@@ -79,8 +79,10 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
 struct spufs_calls spufs_calls = {
        .create_thread = do_spu_create,
        .spu_run = do_spu_run,
-       .coredump_extra_notes_size = spufs_coredump_extra_notes_size,
-       .coredump_extra_notes_write = spufs_coredump_extra_notes_write,
        .notify_spus_active = do_notify_spus_active,
        .owner = THIS_MODULE,
+#ifdef CONFIG_COREDUMP
+       .coredump_extra_notes_size = spufs_coredump_extra_notes_size,
+       .coredump_extra_notes_write = spufs_coredump_extra_notes_write,
+#endif
 };