Re: 2.6.15-rc5-rt1 will not compile (was Re: 2.6.14-rt15: cannot build with !PREEMPT_RT)

Lee Revell
2005-12-12T22:12:41Z

On Mon, 2005-12-12 at 16:49 -0500, Steven Rostedt wrote:
> On Mon, 2005-12-12 at 12:44 -0500, Lee Revell wrote:
> > On Fri, 2005-12-09 at 19:25 -0500, Lee Revell wrote:
> > > > We are unable to build a similar .config (PREEMPT_DESKTOP with soft and
> > > > hardirq preemption disabled) on x86-64:
> > >
> > > Here is the build output, .config attached.
> >
> > Similar problem with 2.6.15-rc5-rt1:
> >
> > $ make
> > CHK include/linux/version.h
> > UPD include/linux/version.h
> > SYMLINK include/asm -> include/asm-x86_64
> > SPLIT include/linux/autoconf.h -> include/config/*
> > CC arch/x86_64/kernel/asm-offsets.s
> > In file included from include/asm/semaphore.h:48,
> > from include/linux/sched.h:20,
> > from arch/x86_64/kernel/asm-offsets.c:7:
> > include/linux/rwsem.h:43:66: error: asm/rwsem.h: No such file or
> > directory
> > In file included from include/asm/semaphore.h:48,
> > from include/linux/sched.h:20,
> > from arch/x86_64/kernel/asm-offsets.c:7:
>
> Looks like Ingo has a generic rwsem to work with, but if your arch turns
> on CONFIG_RWSEM_XCHGADD_ALGORITHM, it will compile lib/rwsem.c which
> won't compile as you've seen.
>
> Try out this patch: I changed the Makefile, instead of going to each
> and every arch and change its Kconfig to do it properly.

The patch had no effect.

In fact x86-64 does not set CONFIG_RWSEM_XCHGADD_ALGORITHM so this test
in include/linux/rwsem.h causes asm/rwsem.h to be included which does
not exist on x86-64:

36 #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK
37 # include <linux/rwsem-spinlock.h> /* use a generic implementation */
38 # ifndef CONFIG_PREEMPT_RT
39 # define __RWSEM_INITIALIZER __COMPAT_RWSEM_INITIALIZER
40 # define DECLARE_RWSEM COMPAT_DECLARE_RWSEM
41 # endif
42 #else
43 # include <asm/rwsem.h> /* use an arch-specific implementation */
44 #endif

If I change that code to always include <linux/rwsem-spinlock.h>, I get
the exact same failures I did with 2.6.14-rt22:

$ make
CHK include/linux/version.h
CC arch/x86_64/kernel/asm-offsets.s
GEN include/asm-x86_64/asm-offsets.h
CC init/main.o
In file included from include/linux/proc_fs.h:6,
from init/main.c:17:
include/linux/fs.h: In function 'lock_super':
include/linux/fs.h:867: warning: implicit declaration of function 'down'
include/linux/fs.h: In function 'unlock_super':
include/linux/fs.h:873: warning: implicit declaration of function 'up'
CHK include/linux/compile.h
CC init/version.o
CC init/do_mounts.o
In file included from include/linux/tty.h:20,
from init/do_mounts.c:5:
include/linux/fs.h: In function 'lock_super':
include/linux/fs.h:867: warning: implicit declaration of function 'down'
include/linux/fs.h: In function 'unlock_super':
include/linux/fs.h:873: warning: implicit declaration of function 'up'

etc.

Lee