* [Xenomai] Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt @ 2015-03-06 9:28 Helder Daniel 2015-03-06 9:38 ` Philippe Gerum 0 siblings, 1 reply; 11+ messages in thread From: Helder Daniel @ 2015-03-06 9:28 UTC (permalink / raw) To: Xenomai@xenomai.org Hi, I am trying to compile a simple RTDM driver that rtdm_printks a message when IRQ 12 (PS2 mouse) is up. It's a Debian 32 bit system on top of a 64 bit core 2 duo P8600 processor, however I already installed g++multilib package which get me rid of other related errors with missing libc versions. I am using a Makefile that works for Xenomai 2.5.x series, but I get an error: "boilerplate/wrappers.h: No such file or directory" and lot's of other. (Complete list of errors is at the end). The make file I am using is this: obj-m += intr.o EXTRA_CFLAGS := -I/usr/xenomai/include -I/usr/include all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean Maybe I have the wrong dirs in the compiler include path? If I just set include path as (removing /usr/include): EXTRA_CFLAGS := -I/usr/xenomai/include I get just an error: /usr/xenomai/include/rtdm/rtdm.h:23:19: fatal error: fcntl.h: No such file or directory but fcntl.h shouldn't be required only on userland? May I am including an rtdm.h for user land? I've found some rtdm.h files in xenomai install dir: /usr/xenomai/include/trank/rtdm/rtdm.h /usr/xenomai/include/rtdm/uapi/rtdm.h /usr/xenomai/include/rtdm/rtdm.h If so there is one just for kernel space? I guess for user space is: /usr/xenomai/include/rtdm/uapi/rtdm.h for kernel: /usr/xenomai/include/rtdm/rtdm.h I am not sure why there is a version in trank? /usr/xenomai/include/trank/rtdm/rtdm.h I am including in the module <rtdm/rtdm.h>, so: /usr/xenomai/include/rtdm/rtdm.h My Xenomai version is: $> /usr/xenomai/sbin/version -a Xenomai/cobalt v3.0-rc3 -- Target: i686-pc-linux-gnu Compiler: gcc version 4.7.2 (Debian 4.7.2-5) Build args: '--with-core=cobalt' '--enable-registry' '--enable-smp' '--enable-pshared' '--prefix=/usr/xenomai' Module source code is: #include <linux/module.h> // Needed by all modules #include <rtdm/rtdm.h> #define IRQ 12 #define "PS2MouseIntRT" rtdm_irq_t; int irq_handler (rtdm_irq_t *irq_handle) { rtdm_printk ("IQR12 occurred (RTDM handler)\n"); return RTDM_IRQ_HANDLED; } static int __init start(void) { //Requets IRQ return rtdm_irq_request(&intr, IRQ, irq_handler, 0, name, NULL); } static void __exit stop(void) { //frees IRQ rtdm_irq_free (&intr); } module_init(start); module_exit(stop); Complete output of make file: make echo -I/usr/xenomai/include -I/usr/include -I/usr/xenomai/include -I/usr/include make -C /lib/modules/3.18.7-rt2/build M=/root/prg/01-rtdm_interrupt modules make[1]: Entering directory `/usr/src/linux-headers-3.18.7-rt2' CC [M] /root/prg/01-rtdm_interrupt/intr.o In file included from /usr/include/features.h:356:0, from /usr/include/fcntl.h:27, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/sys/cdefs.h:287:0: warning: "__always_inline" redefined [enabled by default] In file included from include/linux/compiler.h:54:0, from include/uapi/linux/stddef.h:1, from include/linux/stddef.h:4, from ./include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/list.h:4, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/compiler-gcc.h:118:0: note: this is the location of the previous definition In file included from /usr/include/bits/fcntl.h:25:0, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/sys/types.h:61:17: error: conflicting types for ‘dev_t’ In file included from include/linux/list.h:4:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/types.h:15:25: note: previous declaration of ‘dev_t’ was here In file included from /usr/include/bits/fcntl.h:25:0, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/sys/types.h:71:18: error: conflicting types for ‘mode_t’ In file included from include/linux/list.h:4:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/types.h:17:26: note: previous declaration of ‘mode_t’ was here In file included from /usr/include/sys/types.h:133:0, from /usr/include/bits/fcntl.h:25, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/time.h:104:19: error: conflicting types for ‘timer_t’ In file included from include/linux/list.h:4:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/types.h:25:26: note: previous declaration of ‘timer_t’ was here In file included from /usr/include/bits/fcntl.h:25:0, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/sys/types.h:212:0: warning: "__BIT_TYPES_DEFINED__" redefined [enabled by default] In file included from include/linux/list.h:4:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/types.h:95:0: note: this is the location of the previous definition In file included from /usr/include/sys/select.h:44:0, from /usr/include/sys/types.h:220, from /usr/include/bits/fcntl.h:25, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/time.h:120:8: error: redefinition of ‘struct timespec’ In file included from ./arch/x86/include/asm/preempt.h:6:0, from include/linux/preempt.h:18, from include/linux/spinlock.h:50, from include/linux/seqlock.h:35, from include/linux/time.h:5, from include/linux/stat.h:18, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/thread_info.h:13:8: note: originally defined here In file included from /usr/include/sys/select.h:46:0, from /usr/include/sys/types.h:220, from /usr/include/bits/fcntl.h:25, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/bits/time.h:75:8: error: redefinition of ‘struct timeval’ In file included from include/linux/time64.h:4:0, from include/linux/time.h:7, from include/linux/stat.h:18, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/time.h:15:8: note: originally defined here In file included from /usr/include/sys/types.h:220:0, from /usr/include/bits/fcntl.h:25, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/sys/select.h:78:5: error: conflicting types for ‘fd_set’ In file included from include/linux/list.h:4:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/types.h:14:26: note: previous declaration of ‘fd_set’ was here In file included from /usr/include/bits/fcntl.h:25:0, from /usr/include/fcntl.h:34, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/sys/types.h:236:20: error: conflicting types for ‘blkcnt_t’ In file included from include/linux/list.h:4:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/types.h:131:13: note: previous declaration of ‘blkcnt_t’ was here In file included from /usr/include/fcntl.h:41:0, from /usr/xenomai/include/rtdm/rtdm.h:23, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/bits/stat.h:46:8: error: redefinition of ‘struct stat’ In file included from include/linux/stat.h:5:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: ./arch/x86/include/uapi/asm/stat.h:9:8: note: originally defined here In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:43:0: warning: "S_IFMT" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:7:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:44:0: warning: "S_IFDIR" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:12:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:45:0: warning: "S_IFCHR" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:13:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:46:0: warning: "S_IFBLK" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:11:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:47:0: warning: "S_IFREG" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:10:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:49:0: warning: "S_IFIFO" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:14:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:52:0: warning: "S_IFLNK" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:9:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:55:0: warning: "S_IFSOCK" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:8:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:60:0: warning: "S_ISUID" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:15:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:61:0: warning: "S_ISGID" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:16:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:65:0: warning: "S_ISVTX" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:17:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:68:0: warning: "S_IRUSR" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:28:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:69:0: warning: "S_IWUSR" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:29:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:70:0: warning: "S_IXUSR" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:30:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:72:0: warning: "S_IRWXU" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:27:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:74:0: warning: "S_IRGRP" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:33:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:75:0: warning: "S_IWGRP" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:34:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:76:0: warning: "S_IXGRP" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:35:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:78:0: warning: "S_IRWXG" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:32:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:80:0: warning: "S_IROTH" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:38:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:81:0: warning: "S_IWOTH" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:39:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:82:0: warning: "S_IXOTH" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:40:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:23:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/fcntl.h:84:0: warning: "S_IRWXO" redefined [enabled by default] In file included from include/linux/stat.h:6:0, from include/linux/module.h:10, from /root/prg/01-rtdm_interrupt/intr.c:1: include/uapi/linux/stat.h:37:0: note: this is the location of the previous definition In file included from /usr/xenomai/include/rtdm/rtdm.h:25:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/stdint.h:129:23: error: conflicting types for ‘uintptr_t’ In file included from include/linux/list.h:4:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/types.h:36:24: note: previous declaration of ‘uintptr_t’ was here In file included from /usr/xenomai/include/rtdm/rtdm.h:25:0, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/stdint.h:268:0: warning: "SIZE_MAX" redefined [enabled by default] In file included from include/linux/list.h:8:0, from include/linux/module.h:9, from /root/prg/01-rtdm_interrupt/intr.c:1: include/linux/kernel.h:30:0: note: this is the location of the previous definition In file included from /usr/include/sys/socket.h:40:0, from /usr/xenomai/include/rtdm/rtdm.h:29, from /root/prg/01-rtdm_interrupt/intr.c:3: /usr/include/bits/socket.h:431:23: warning: ‘struct mmsghdr’ declared inside parameter list [enabled by default] /usr/include/bits/socket.h:431:23: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] In file included from /root/prg/01-rtdm_interrupt/intr.c:3:0: /usr/xenomai/include/rtdm/rtdm.h:30:34: fatal error: boilerplate/wrappers.h: No such file or directory compilation terminated. make[2]: *** [/root/prg/01-rtdm_interrupt/intr.o] Error 1 make[1]: *** [_module_/root/prg/01-rtdm_interrupt] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-3.18.7-rt2' make: *** [all] Error 2 root@debian:~/prg/01-rtdm_interrupt# ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-06 9:28 [Xenomai] Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt Helder Daniel @ 2015-03-06 9:38 ` Philippe Gerum [not found] ` <CAKk99t1AGHj8sOf7Vgy_UZ_+rECP5Vx22cyup--FHsh=RuK2zA@mail.gmail.com> 0 siblings, 1 reply; 11+ messages in thread From: Philippe Gerum @ 2015-03-06 9:38 UTC (permalink / raw) To: Helder Daniel, Xenomai@xenomai.org On 03/06/2015 10:28 AM, Helder Daniel wrote: > Hi, > > I am trying to compile a simple RTDM driver that rtdm_printks a message > when IRQ 12 (PS2 mouse) is up. > > It's a Debian 32 bit system on top of a 64 bit core 2 duo P8600 processor, > however I already installed g++multilib package which get me rid of other > related errors with missing libc versions. > > I am using a Makefile that works for Xenomai 2.5.x series, but I get an > error: "boilerplate/wrappers.h: No such file or directory" > and lot's of other. (Complete list of errors is at the end). > > The make file I am using is this: > > obj-m += intr.o > > EXTRA_CFLAGS := -I/usr/xenomai/include -I/usr/include This is wrong, you are pulling userland headers. The CFLAGS required to build a kernel module using the RTDM API should be obtained by: $(shell xeno-config --kcflags) -- Philippe. ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CAKk99t1AGHj8sOf7Vgy_UZ_+rECP5Vx22cyup--FHsh=RuK2zA@mail.gmail.com>]
* Re: [Xenomai] Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt [not found] ` <CAKk99t1AGHj8sOf7Vgy_UZ_+rECP5Vx22cyup--FHsh=RuK2zA@mail.gmail.com> @ 2015-03-06 10:14 ` Philippe Gerum [not found] ` <CAKk99t3FfAff0X0nGzKD+YcVFQWm5aeSRFB4U6No1YSPuS_qpA@mail.gmail.com> 0 siblings, 1 reply; 11+ messages in thread From: Philippe Gerum @ 2015-03-06 10:14 UTC (permalink / raw) To: Helder Daniel; +Cc: Xenomai On 03/06/2015 11:03 AM, Helder Daniel wrote: > On 6 March 2015 at 09:38, Philippe Gerum <rpm@xenomai.org > <mailto:rpm@xenomai.org>> wrote: > > > > > obj-m += intr.o > > > > EXTRA_CFLAGS := -I/usr/xenomai/include -I/usr/include > > This is wrong, you are pulling userland headers. The CFLAGS required to > build a kernel module using the RTDM API should be obtained by: > > $(shell xeno-config --kcflags) > > > Ok I was suspecting that (even makefile worked with 2.5) . > I tried: > > EXTRA_CFLAGS := $(shell xeno-config --kcflags) > > but now it can not find rtdm.h: > rtdm.h provides the RTDM API definitions to userland applications. You want rtdm/driver.h for building a module implementing a RTDM driver. > /root/prg/01-rtdm_interrupt/intr.c:2:18: fatal error: rtdm.h: No such > file or directory > > Whether It is included as <rtdm/rtdm.h> > or just <rtdm.h> > > I run the command in a shell and the output is: > > root@debian:~/prg/01-rtdm_interrupt# xeno-config --kcflags > > -Iarch/$(SRCARCH)/xenomai/include -Iinclude/xenomai > > However complete output of make, tells SRCARCH not found: > > $> make > make -C /lib/modules/3.18.7-rt2/build M=/root/prg/01-rtdm_interrupt modules > make[1]: Entering directory `/usr/src/linux-headers-3.18.7-rt2' > CC [M] /root/prg/01-rtdm_interrupt/intr.o > /bin/sh: 1: SRCARCH: not found > /root/prg/01-rtdm_interrupt/intr.c:2:18: fatal error: rtdm.h: No such > file or directory > compilation terminated. > make[2]: *** [/root/prg/01-rtdm_interrupt/intr.o] Error 1 > make[1]: *** [_module_/root/prg/01-rtdm_interrupt] Error 2 > make[1]: Leaving directory `/usr/src/linux-headers-3.18.7-rt2' > make: *** [all] Error 2 > SRCARCH is defined by the standard Kbuild infrastructure, this is not a Xenomai-specific variable. You may want to look at xenomai3/kernel/drivers/ipc/Makefile for an illustration of its usage. -- Philippe. ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CAKk99t3FfAff0X0nGzKD+YcVFQWm5aeSRFB4U6No1YSPuS_qpA@mail.gmail.com>]
* [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt [not found] ` <CAKk99t3FfAff0X0nGzKD+YcVFQWm5aeSRFB4U6No1YSPuS_qpA@mail.gmail.com> @ 2015-03-09 18:57 ` Helder Daniel 2015-03-10 21:39 ` Philippe Gerum 0 siblings, 1 reply; 11+ messages in thread From: Helder Daniel @ 2015-03-09 18:57 UTC (permalink / raw) To: Xenomai@xenomai.org Hi again, I am sorry to ask help again about this point but I still am no able to compile a kernel module with Xenomai 3.x support. I made the changes pointed in the previous email: In the module is now being included just: <rtdm/driver.h> and the makefile is now: EXTRA_CFLAGS := $(shell xeno-config --kcflags) all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules but it did not work. The error make issued was: In file included from include/xenomai/cobalt/kernel/sched.h:24:0, from include/xenomai/rtdm/driver.h:36, from /root/prg/01-rtdm_interrupt/ps2auxint.c:4: include/xenomai/cobalt/kernel/thread.h:32:33: fatal error: asm/xenomai/machine.h: No such file or directory Then I ran xeno-config --kcflags in the cmd line and it returned: -Iarch/$(SRCARCH)/xenomai/include -Iinclude/xenomai So I tried to explicitly add it to the Makefile (according to my kernel): EXTRA_CFLAGS := -I/usr/src/linux-headers-3.16.0-ipipe/include/xenomai -Iinclude/xenomai Make returned asimilar error: In file included from /usr/src/linux-headers-3.16.0-ipipe/include/xenomai/cobalt/kernel/sched.h:24:0, from /usr/src/linux-headers-3.16.0-ipipe/include/xenomai/rtdm/driver.h:36, from /root/prg/01-rtdm_interrupt/ps2auxint.c:4: /usr/src/linux-headers-3.16.0-ipipe/include/xenomai/cobalt/kernel/thread.h:32:33: fatal error: asm/xenomai/machine.h: No such file or directory I am not sure what I am missing. Another header? The wrong path to Xenomai headers? My Xenomai install is cobalt on kernel 3.16. $> uname -r 3.16.0-ipipe $> /usr/xenomai/sbin/version -a Xenomai/cobalt v3.0-rc3 -- Target: x86_64-unknown-linux-gnu Compiler: gcc version 4.7.2 (Debian 4.7.2-5) Build args: '--with-core=cobalt' '--enable-registry' '--enable-smp' '--enable-pshared' '--prefix=/usr/xenomai' On 6 March 2015 at 10:14, Philippe Gerum <rpm@xenomai.org> wrote: > On 03/06/2015 11:03 AM, Helder Daniel wrote: > > On 6 March 2015 at 09:38, Philippe Gerum <rpm@xenomai.org > > <mailto:rpm@xenomai.org>> wrote: > > > > > > > > obj-m += intr.o > > > > > > EXTRA_CFLAGS := -I/usr/xenomai/include -I/usr/include > > > > This is wrong, you are pulling userland headers. The CFLAGS required > to > > build a kernel module using the RTDM API should be obtained by: > > > > $(shell xeno-config --kcflags) > > > > > > Ok I was suspecting that (even makefile worked with 2.5) . > > I tried: > > > > EXTRA_CFLAGS := $(shell xeno-config --kcflags) > > > > but now it can not find rtdm.h: > > > > rtdm.h provides the RTDM API definitions to userland applications. You > want rtdm/driver.h for building a module implementing a RTDM driver. > > > /root/prg/01-rtdm_interrupt/intr.c:2:18: fatal error: rtdm.h: No such > > file or directory > > > > Whether It is included as <rtdm/rtdm.h> > > or just <rtdm.h> > > > > I run the command in a shell and the output is: > > > > root@debian:~/prg/01-rtdm_interrupt# xeno-config --kcflags > > > > -Iarch/$(SRCARCH)/xenomai/include -Iinclude/xenomai > > > > However complete output of make, tells SRCARCH not found: > > > > $> make > > make -C /lib/modules/3.18.7-rt2/build M=/root/prg/01-rtdm_interrupt > modules > > make[1]: Entering directory `/usr/src/linux-headers-3.18.7-rt2' > > CC [M] /root/prg/01-rtdm_interrupt/intr.o > > /bin/sh: 1: SRCARCH: not found > > /root/prg/01-rtdm_interrupt/intr.c:2:18: fatal error: rtdm.h: No such > > file or directory > > compilation terminated. > > make[2]: *** [/root/prg/01-rtdm_interrupt/intr.o] Error 1 > > make[1]: *** [_module_/root/prg/01-rtdm_interrupt] Error 2 > > make[1]: Leaving directory `/usr/src/linux-headers-3.18.7-rt2' > > make: *** [all] Error 2 > > > > SRCARCH is defined by the standard Kbuild infrastructure, this is not a > Xenomai-specific variable. You may want to look at > xenomai3/kernel/drivers/ipc/Makefile for an illustration of its usage. > > -- > Philippe. > -- Helder Daniel UALG - FCT DEEI http://w3.ualg.pt/~hdaniel -- Helder Daniel UALG - FCT DEEI http://w3.ualg.pt/~hdaniel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-09 18:57 ` [Xenomai] Fwd: " Helder Daniel @ 2015-03-10 21:39 ` Philippe Gerum 2015-03-11 17:30 ` Helder Daniel 0 siblings, 1 reply; 11+ messages in thread From: Philippe Gerum @ 2015-03-10 21:39 UTC (permalink / raw) To: Helder Daniel, Xenomai@xenomai.org On 03/09/2015 07:57 PM, Helder Daniel wrote: > Hi again, > > I am sorry to ask help again about this point but I still am no able to > compile a kernel module with Xenomai 3.x support. > > I made the changes pointed in the previous email: > In the module is now being included just: > > <rtdm/driver.h> > > and the makefile is now: > > EXTRA_CFLAGS := $(shell xeno-config --kcflags) > all: > > make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules > You need /lib/modules/$(shell uname -r)/build to refer to a kernel tree prepared with the Xenomai kernel sources, i.e. scripts/prepare-kernel.sh should have run in this source tree at some point. The errors you get indicate that no Xenomai code can be found there. A basic Makefile for foo_module.ko composed of a single source foo.c, and pulling the extra CFLAGS from xeno-config, could look like: $(eval ccflags-y = $(shell xeno-config --kcflags)) obj-y += foo_module.o foo_module-y := foo.o -- Philippe. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-10 21:39 ` Philippe Gerum @ 2015-03-11 17:30 ` Helder Daniel 2015-03-11 20:21 ` Philippe Gerum 0 siblings, 1 reply; 11+ messages in thread From: Helder Daniel @ 2015-03-11 17:30 UTC (permalink / raw) To: Philippe Gerum; +Cc: Xenomai@xenomai.org > > You need /lib/modules/$(shell uname -r)/build to refer to a kernel tree > prepared with the Xenomai kernel sources, i.e. scripts/prepare-kernel.sh > should have run in this source tree at some point. The errors you get > indicate that no Xenomai code can be found there. > I had /lib/modules/$(shell uname -r)/build pointing to the kernel headers installed from a .deb package. This package was created when compiling the Cobalt kernel with: make-kpkg --initrd kernel_image kernel_headers so I assumed that all Xenomai code is included in that package. Now I pointed to the kernel source tree and I can compile the module. This is strange. I was expecting that the kernel headers package created with debian build to store all Xenomai info, so that I can install a cobalt kernel image + headers in another computer, from 2 debian packages (I did this before successfully with Xenomai 2.5.x) without having to copy all the kernel source tree. > A basic Makefile for foo_module.ko composed of a single source foo.c, > and pulling the extra CFLAGS from xeno-config, could look like: > > $(eval ccflags-y = $(shell xeno-config --kcflags)) > obj-y += foo_module.o > foo_module-y := foo.o After pointing to the right source tree I had to make yet a change in the makefile. I just add $(eval before EXTRA-CFLAGS ... The makefile that works is now: $eval(EXTRA_CFLAGS := $(shell xeno-config --kcflags)) all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-11 17:30 ` Helder Daniel @ 2015-03-11 20:21 ` Philippe Gerum 2015-03-11 21:01 ` Gilles Chanteperdrix 0 siblings, 1 reply; 11+ messages in thread From: Philippe Gerum @ 2015-03-11 20:21 UTC (permalink / raw) To: Helder Daniel; +Cc: Xenomai@xenomai.org On 03/11/2015 06:30 PM, Helder Daniel wrote: > You need /lib/modules/$(shell uname -r)/build to refer to a kernel tree > prepared with the Xenomai kernel sources, i.e. scripts/prepare-kernel.sh > should have run in this source tree at some point. The errors you get > indicate that no Xenomai code can be found there. > > > I had > > /lib/modules/$(shell uname -r)/build > > pointing to the kernel headers installed from a .deb package. > This package was created when compiling the Cobalt kernel with: > > make-kpkg --initrd kernel_image kernel_headers > > so I assumed that all Xenomai code is included in that package. > > Now I pointed to the kernel source tree and I can compile the module. > > This is strange. I was expecting that the kernel headers package created > with debian build to store all Xenomai info, so that I can install a > cobalt kernel image + headers in another computer, from 2 debian > packages (I did this before successfully with Xenomai 2.5.x) without > having to copy all the kernel source tree. > Following the current kernel standards, Xenomai 3 introduces a strict split between kernel headers and user-space ones, with a uapi/ section for the shared portion which exposes the ABI. Maybe debian/rules does not reflect that change. -- Philippe. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-11 20:21 ` Philippe Gerum @ 2015-03-11 21:01 ` Gilles Chanteperdrix 2015-03-13 13:50 ` Helder Daniel 0 siblings, 1 reply; 11+ messages in thread From: Gilles Chanteperdrix @ 2015-03-11 21:01 UTC (permalink / raw) To: Philippe Gerum; +Cc: Xenomai@xenomai.org Philippe Gerum wrote: > On 03/11/2015 06:30 PM, Helder Daniel wrote: >> You need /lib/modules/$(shell uname -r)/build to refer to a kernel >> tree >> prepared with the Xenomai kernel sources, i.e. >> scripts/prepare-kernel.sh >> should have run in this source tree at some point. The errors you >> get >> indicate that no Xenomai code can be found there. >> >> >> I had >> >> /lib/modules/$(shell uname -r)/build >> >> pointing to the kernel headers installed from a .deb package. >> This package was created when compiling the Cobalt kernel with: >> >> make-kpkg --initrd kernel_image kernel_headers >> >> so I assumed that all Xenomai code is included in that package. >> >> Now I pointed to the kernel source tree and I can compile the module. >> >> This is strange. I was expecting that the kernel headers package created >> with debian build to store all Xenomai info, so that I can install a >> cobalt kernel image + headers in another computer, from 2 debian >> packages (I did this before successfully with Xenomai 2.5.x) without >> having to copy all the kernel source tree. >> > > Following the current kernel standards, Xenomai 3 introduces a strict > split between kernel headers and user-space ones, with a uapi/ section > for the shared portion which exposes the ABI. Maybe debian/rules does > not reflect that change. > make-kpkg does not use the debian rules. It uses its own rules, and yes, you may have issues if you use an old version of make-pkkg (like for instance the one in debian stable) with a newer kernel. The solution is to install make-kpkg from debian unstable. Or maybe use a backport if it exists. Now, I do not know if make-kpkg will resolve the symbolic links in the kernel sources, or if it keeps them. If it keeps them, you need to keep the xenomai headers at the place they were when running prepare-kernel.sh. -- Gilles. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-11 21:01 ` Gilles Chanteperdrix @ 2015-03-13 13:50 ` Helder Daniel 2015-03-13 14:04 ` Gilles Chanteperdrix 0 siblings, 1 reply; 11+ messages in thread From: Helder Daniel @ 2015-03-13 13:50 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: Xenomai@xenomai.org I upgraded from kernel-package v 12.036+nmu3 of wheezy to the newer version 13.014+nmu1 included in jessie (and also in sid). I get the same errors when compiling a kernel module. Then I created a kernel_source debian package. Install it at /usr/src and make /lib/modules/3.16.0-ipipe/build points to it rather than to the full source tree. I didn't work either. It give me an error saying that it can not find configuration of kernel. The only way I can move the required headers to compile RTDM modules to another computer without copying all the 6.2 GBytes of the full kernel source tree after compiled was cleaning the compilation with. make clean and then pack the much smaller, around 660 MBytes, clean source tree This way installing a kernel_image package (with ipipe patch) unpacking the previously packed source tree, making /lib/modules/3.16.0-ipipe/build points to it and installing Xenomai 3.x-rc3 it is possible to compile kernel modules for the RTDM API without needing to compile the kernel in every computer you want to install Xenomai. PS: Just for a sanity check I installed Xenomai 2.6.4 and created kernel-headers-3.14.17 patched with ipipe-core them make /lib/modules/3.14.17-ipipe/build points to the kernel-headers and not the full kernel source. This allows to compiled a kernel module successfully for linux 3.14.17 without needing of the full kernel tree (xeno 2.6.4 of course). On 11 March 2015 at 21:01, Gilles Chanteperdrix < gilles.chanteperdrix@xenomai.org> wrote: > > Philippe Gerum wrote: > > On 03/11/2015 06:30 PM, Helder Daniel wrote: > >> You need /lib/modules/$(shell uname -r)/build to refer to a kernel > >> tree > >> prepared with the Xenomai kernel sources, i.e. > >> scripts/prepare-kernel.sh > >> should have run in this source tree at some point. The errors you > >> get > >> indicate that no Xenomai code can be found there. > >> > >> > >> I had > >> > >> /lib/modules/$(shell uname -r)/build > >> > >> pointing to the kernel headers installed from a .deb package. > >> This package was created when compiling the Cobalt kernel with: > >> > >> make-kpkg --initrd kernel_image kernel_headers > >> > >> so I assumed that all Xenomai code is included in that package. > >> > >> Now I pointed to the kernel source tree and I can compile the module. > >> > >> This is strange. I was expecting that the kernel headers package created > >> with debian build to store all Xenomai info, so that I can install a > >> cobalt kernel image + headers in another computer, from 2 debian > >> packages (I did this before successfully with Xenomai 2.5.x) without > >> having to copy all the kernel source tree. > >> > > > > Following the current kernel standards, Xenomai 3 introduces a strict > > split between kernel headers and user-space ones, with a uapi/ section > > for the shared portion which exposes the ABI. Maybe debian/rules does > > not reflect that change. > > > > make-kpkg does not use the debian rules. It uses its own rules, and yes, > you may have issues if you use an old version of make-pkkg (like for > instance the one in debian stable) with a newer kernel. The solution is to > install make-kpkg from debian unstable. Or maybe use a backport if it > exists. Now, I do not know if make-kpkg will resolve the symbolic links > in the kernel sources, or if it keeps them. If it keeps them, you need > to keep the xenomai headers at the place they were when running > prepare-kernel.sh. > > -- > Gilles. > > -- Helder Daniel UALG - FCT DEEI http://w3.ualg.pt/~hdaniel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-13 13:50 ` Helder Daniel @ 2015-03-13 14:04 ` Gilles Chanteperdrix 2015-03-13 16:27 ` Helder Daniel 0 siblings, 1 reply; 11+ messages in thread From: Gilles Chanteperdrix @ 2015-03-13 14:04 UTC (permalink / raw) To: Helder Daniel; +Cc: Xenomai@xenomai.org On Fri, Mar 13, 2015 at 01:50:07PM +0000, Helder Daniel wrote: > Just for a sanity check I installed Xenomai 2.6.4 > and created kernel-headers-3.14.17 patched with ipipe-core Well, once again: if the kernel-headers package contains symbolic link to xenomai sources, then you have to keep xenomai sources (or the reduced xenomai-kernel-sources package) around. How did you generate the kernel, with prepare-kernel.sh ? Does the kernel-header package contain the .config? > > them make /lib/modules/3.14.17-ipipe/build points to the kernel-headers and > not the full kernel source. Well, it is silly to touch that build symbolic link: 1- the debian packages are supposed to handle that 2- when building a kernel module you are supposed to pass the path to kernel source as a parameter to the make -C command. So, simply passing the path to the kernel headers location should avoid having to touch the symbolic link. as documented in Documentation/kbuild/modules.txt in the kernel sources. -- Gilles. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai] Fwd: Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt 2015-03-13 14:04 ` Gilles Chanteperdrix @ 2015-03-13 16:27 ` Helder Daniel 0 siblings, 0 replies; 11+ messages in thread From: Helder Daniel @ 2015-03-13 16:27 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: Xenomai@xenomai.org On 13 March 2015 at 14:04, Gilles Chanteperdrix < gilles.chanteperdrix@xenomai.org> wrote: > On Fri, Mar 13, 2015 at 01:50:07PM +0000, Helder Daniel wrote: > > Just for a sanity check I installed Xenomai 2.6.4 > > and created kernel-headers-3.14.17 patched with ipipe-core > > Well, once again: if the kernel-headers package contains symbolic > link to xenomai sources, then you have to keep xenomai sources (or > the reduced xenomai-kernel-sources package) around. The Xenomai sources are at: /usr/src/xenomai-3.0-rc3 > How did you > generate the kernel, with prepare-kernel.sh ? > yes: /usr/src/xenomai-3.0-rc3/scripts/prepare-kernel.sh --linux=/usr/src/linux-3.16 --ipipe=/usr/src/xenomai-3.0-rc3/kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-3.patch > Does the kernel-header package contain the .config? Yes. > > > > > them make /lib/modules/3.14.17-ipipe/build points to the kernel-headers > and > > not the full kernel source. > > Well, it is silly to touch that build symbolic link: > 1- the debian packages are supposed to handle that > Yes > 2- when building a kernel module you are supposed to pass the path > to kernel source as a parameter to the make -C command. So, simply > passing the path to the kernel headers location should avoid having > to touch the symbolic link. as documented in Documentation/kbuild/modules.txt in the kernel sources. > Yes, I could do that I was just testing. Instead I changed the symbolic link to test if with a standard Makefile, the problem is just info that is missing in the headers and are in the source tree. (But I could test the same modifying the path in the Makefile...) ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-03-13 16:27 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-03-06 9:28 [Xenomai] Error boilerplate/wrappers.h no found trying to compile RTDM module on 3.x-rc3 cobalt Helder Daniel 2015-03-06 9:38 ` Philippe Gerum [not found] ` <CAKk99t1AGHj8sOf7Vgy_UZ_+rECP5Vx22cyup--FHsh=RuK2zA@mail.gmail.com> 2015-03-06 10:14 ` Philippe Gerum [not found] ` <CAKk99t3FfAff0X0nGzKD+YcVFQWm5aeSRFB4U6No1YSPuS_qpA@mail.gmail.com> 2015-03-09 18:57 ` [Xenomai] Fwd: " Helder Daniel 2015-03-10 21:39 ` Philippe Gerum 2015-03-11 17:30 ` Helder Daniel 2015-03-11 20:21 ` Philippe Gerum 2015-03-11 21:01 ` Gilles Chanteperdrix 2015-03-13 13:50 ` Helder Daniel 2015-03-13 14:04 ` Gilles Chanteperdrix 2015-03-13 16:27 ` Helder Daniel
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.