* [Xenomai-core] Problems with satch.c under Linux 2.4 @ 2008-03-11 10:10 Wolfgang Grandegger 2008-03-11 10:25 ` Gilles Chanteperdrix 2008-03-11 22:59 ` Gilles Chanteperdrix 0 siblings, 2 replies; 8+ messages in thread From: Wolfgang Grandegger @ 2008-03-11 10:10 UTC (permalink / raw) To: xenomai-core [-- Attachment #1: Type: text/plain, Size: 1213 bytes --] Hello, I tried to test the POSIX example program satch.c under Linux 2.4.25 for PPC. I was able to fix a few issues but the module does still not load. I have attached a patch for Xenomai 2.4.2 fixing: - User-space satch: It was necessary to move time.h and signal.h to the end of the include block to get it compiled (otherwise clockid_t is defined, etc.) - User-space satch: It was necessary to move "#define xnprintf printf" behind the include block, otherwise the linker complains about missing symbols. I wonder how this can work with 2.6. And what is the status of xnprintf? - Makefile: to avoid a mixup of CFLAG definitions for compiling the user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. (see patch). Note sure if this is an issue for 2.6 as well. - Makefile: I added -DPRODUCER to the module build with Linux 2.4. - I got the module build, but insmod fails with: bash-2.05b# insmod satch.o satch.o: unresolved symbol shm_unlink satch.o: unresolved symbol ftruncate satch.o: unresolved symbol shm_open satch.o: unresolved symbol munmap satch.o: unresolved symbol mmap satch.o: unresolved symbol pse51_shm_close Any idea why? Thanks, Wolfgang. [-- Attachment #2: xenomai-satch.patch --] [-- Type: text/x-patch, Size: 2267 bytes --] + diff -u xenomai-2.4.2/examples/posix/Makefile.ORIG xenomai-2.4.2/examples/posix/Makefile --- xenomai-2.4.2/examples/posix/Makefile.ORIG 2007-12-09 11:47:24.000000000 +0100 +++ xenomai-2.4.2/examples/posix/Makefile 2008-03-11 10:51:19.000000000 +0100 @@ -35,16 +35,19 @@ CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --posix-cflags) +UCFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --posix-cflags) -LDFLAGS=$(shell $(XENOCONFIG) --posix-ldflags) +ULDFLAGS=$(shell $(XENOCONFIG) --posix-ldflags) # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. -LDFLAGS+=-Xlinker -rpath -Xlinker $(shell $(XENOCONFIG) --libdir) +ULDFLAGS+=-Xlinker -rpath -Xlinker $(shell $(XENOCONFIG) --libdir) all:: $(APPLICATIONS) +$(APPLICATIONS): % : %.c + $(CC) $(UCFLAGS) -o $@ $< $(ULDFLAGS) + clean:: $(RM) $(APPLICATIONS) *.o @@ -56,6 +59,8 @@ ###### KERNEL MODULE BUILD (no change required normally) ###### ifneq ($(MODULES),) +CC=$(CROSS_COMPILE)gcc + ### Default to sources of currently running kernel KSRC ?= /lib/modules/$(shell uname -r)/build @@ -77,7 +82,7 @@ else ARCH ?= $(shell uname -i) -INCLUDE := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/compat -I$(KSRC)/include/xenomai/posix +INCLUDE := -DPRODUCER -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/compat -I$(KSRC)/include/xenomai/posix CFLAGS += $(shell $(MAKE) -s -C $(KSRC) CC=$(CC) ARCH=$(ARCH) SUBDIRS=$(PWD) modules) $(INCLUDE) all:: $(OBJS) + diff -u xenomai-2.4.2/examples/posix/satch.c.ORIG xenomai-2.4.2/examples/posix/satch.c --- xenomai-2.4.2/examples/posix/satch.c.ORIG 2007-12-09 11:47:24.000000000 +0100 +++ xenomai-2.4.2/examples/posix/satch.c 2008-03-11 10:04:54.000000000 +0100 @@ -1,16 +1,18 @@ #ifndef __XENO_SIM__ #ifndef __KERNEL__ #include <stdio.h> -#define xnprintf printf #endif - -#include <time.h> #include <errno.h> #include <unistd.h> -#include <signal.h> #include <sys/mman.h> #include <pthread.h> #include <mqueue.h> +#include <signal.h> +#include <time.h> +#ifndef __KERNEL__ +#undef xnprintf +#define xnprintf printf +#endif #else /* __XENO_SIM */ #include <posix/posix.h> #endif /* __XENO_SIM */ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] Problems with satch.c under Linux 2.4 2008-03-11 10:10 [Xenomai-core] Problems with satch.c under Linux 2.4 Wolfgang Grandegger @ 2008-03-11 10:25 ` Gilles Chanteperdrix 2008-03-11 11:43 ` Wolfgang Grandegger 2008-03-11 22:59 ` Gilles Chanteperdrix 1 sibling, 1 reply; 8+ messages in thread From: Gilles Chanteperdrix @ 2008-03-11 10:25 UTC (permalink / raw) To: Wolfgang Grandegger; +Cc: xenomai-core On Tue, Mar 11, 2008 at 11:10 AM, Wolfgang Grandegger <wg@domain.hid> wrote: > Hello, > > I tried to test the POSIX example program satch.c under Linux 2.4.25 for > PPC. I was able to fix a few issues but the module does still not load. > I have attached a patch for Xenomai 2.4.2 fixing: > > - User-space satch: It was necessary to move time.h and signal.h to the > end of the include block to get it compiled (otherwise clockid_t is > defined, etc.) This should not happen, header file should not depend on the inclusion order. > > - User-space satch: It was necessary to move "#define xnprintf printf" > behind the include block, otherwise the linker complains about missing > symbols. I wonder how this can work with 2.6. And what is the status > of xnprintf? > > - Makefile: to avoid a mixup of CFLAG definitions for compiling the > user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. > (see patch). Note sure if this is an issue for 2.6 as well. > > - Makefile: I added -DPRODUCER to the module build with Linux 2.4. I tested satch recently on trunk. I had to make the printf change (xnprintf is now defined in xenomai include files to xnarch_printf, but xnarch_printf is not defined when compiling in user space, so I replaced #define xnprintf printf with #define xnarch_printf printf) to make it work again, but I saw no problem with include file order. > > - I got the module build, but insmod fails with: > > bash-2.05b# insmod satch.o > satch.o: unresolved symbol shm_unlink > satch.o: unresolved symbol ftruncate > satch.o: unresolved symbol shm_open > satch.o: unresolved symbol munmap > satch.o: unresolved symbol mmap > satch.o: unresolved symbol pse51_shm_close > > Any idea why? Because satch uses xenomai posix shared memories, so you have to enable support for shared memories in the posix module configuration. > > Thanks, > > Wolfgang. > > > > _______________________________________________ > Xenomai-core mailing list > Xenomai-core@domain.hid > https://mail.gna.org/listinfo/xenomai-core > > -- Gilles Chanteperdrix ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] Problems with satch.c under Linux 2.4 2008-03-11 10:25 ` Gilles Chanteperdrix @ 2008-03-11 11:43 ` Wolfgang Grandegger 2008-03-11 13:37 ` Gilles Chanteperdrix 0 siblings, 1 reply; 8+ messages in thread From: Wolfgang Grandegger @ 2008-03-11 11:43 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: xenomai-core [-- Attachment #1: Type: text/plain, Size: 2266 bytes --] Gilles Chanteperdrix wrote: > On Tue, Mar 11, 2008 at 11:10 AM, Wolfgang Grandegger <wg@domain.hid> wrote: >> Hello, >> >> I tried to test the POSIX example program satch.c under Linux 2.4.25 for >> PPC. I was able to fix a few issues but the module does still not load. >> I have attached a patch for Xenomai 2.4.2 fixing: >> >> - User-space satch: It was necessary to move time.h and signal.h to the >> end of the include block to get it compiled (otherwise clockid_t is >> defined, etc.) > > This should not happen, header file should not depend on the inclusion order. True, but it happens quite often :-(. > >> - User-space satch: It was necessary to move "#define xnprintf printf" >> behind the include block, otherwise the linker complains about missing >> symbols. I wonder how this can work with 2.6. And what is the status >> of xnprintf? >> >> - Makefile: to avoid a mixup of CFLAG definitions for compiling the >> user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. >> (see patch). Note sure if this is an issue for 2.6 as well. >> >> - Makefile: I added -DPRODUCER to the module build with Linux 2.4. > > I tested satch recently on trunk. I had to make the printf change > (xnprintf is now defined in xenomai include files to xnarch_printf, > but xnarch_printf is not defined when compiling in user space, so I > replaced #define xnprintf printf with #define xnarch_printf printf) to > make it work again, but I saw no problem with include file order. The problem with xnprintf goes away with "#define xnarch_printf printf". I have attached the make log showing the errors with the original include file order. >> - I got the module build, but insmod fails with: >> >> bash-2.05b# insmod satch.o >> satch.o: unresolved symbol shm_unlink >> satch.o: unresolved symbol ftruncate >> satch.o: unresolved symbol shm_open >> satch.o: unresolved symbol munmap >> satch.o: unresolved symbol mmap >> satch.o: unresolved symbol pse51_shm_close >> >> Any idea why? > > Because satch uses xenomai posix shared memories, so you have to > enable support for shared memories in the posix module configuration. OK, that fixed the problem. A hint in the README would be useful, though. Thanks. Wolfgang. [-- Attachment #2: make1.log --] [-- Type: text/x-log, Size: 3750 bytes --] ppc_6xx-gcc -D__KERNEL__ -I/temp/test/linuxppc_2_4_devel/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I/temp/test/linuxppc_2_4_devel/arch/ppc -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring -g -ggdb -DMODULE -DPRODUCER -I/temp/test/linuxppc_2_4_devel/include/xenomai -I/temp/test/linuxppc_2_4_devel/include/xenomai/compat -I/temp/test/linuxppc_2_4_devel/include/xenomai/posix -c -o satch.o satch.c In file included from satch.c:7: /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:61: error: parse error before "clock_id" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:62: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:64: error: parse error before "clock_id" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:65: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:67: error: parse error before "clock_id" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:68: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:70: error: parse error before "clock_id" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:73: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:78: error: parse error before "clockid" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:80: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:82: error: parse error before "timerid" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:82: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:84: error: parse error before "timerid" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:87: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:89: error: parse error before "timerid" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:89: warning: function declaration isn't a prototype /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:91: error: parse error before "timerid" /temp/test/linuxppc_2_4_devel/include/xenomai/posix/time.h:91: warning: function declaration isn't a prototype In file included from /temp/test/linuxppc_2_4_devel/include/asm/xenomai/wrappers.h:27, from /temp/test/linuxppc_2_4_devel/include/asm-generic/xenomai/hal.h:40, from /temp/test/linuxppc_2_4_devel/include/asm/xenomai/hal.h:32, from /temp/test/linuxppc_2_4_devel/include/asm-generic/xenomai/system.h:39, from /temp/test/linuxppc_2_4_devel/include/asm/xenomai/system.h:29, from /temp/test/linuxppc_2_4_devel/include/xenomai/nucleus/types.h:39, from /temp/test/linuxppc_2_4_devel/include/xenomai/nucleus/queue.h:24, from /temp/test/linuxppc_2_4_devel/include/xenomai/nucleus/timebase.h:29, from /temp/test/linuxppc_2_4_devel/include/xenomai/nucleus/timer.h:26, from /temp/test/linuxppc_2_4_devel/include/xenomai/nucleus/thread.h:25, from /temp/test/linuxppc_2_4_devel/include/xenomai/nucleus/pod.h:34, from /temp/test/linuxppc_2_4_devel/include/xenomai/nucleus/xenomai.h:23, from /temp/test/linuxppc_2_4_devel/include/xenomai/posix/pthread.h:24, from satch.c:12: /temp/test/linuxppc_2_4_devel/include/asm-generic/xenomai/wrappers.h:169: error: parse error before numeric constant make: *** [satch.o] Error 1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] Problems with satch.c under Linux 2.4 2008-03-11 11:43 ` Wolfgang Grandegger @ 2008-03-11 13:37 ` Gilles Chanteperdrix 0 siblings, 0 replies; 8+ messages in thread From: Gilles Chanteperdrix @ 2008-03-11 13:37 UTC (permalink / raw) To: Wolfgang Grandegger; +Cc: xenomai-core On Tue, Mar 11, 2008 at 12:43 PM, Wolfgang Grandegger <wg@domain.hid> wrote: > Gilles Chanteperdrix wrote: > > On Tue, Mar 11, 2008 at 11:10 AM, Wolfgang Grandegger <wg@domain.hid> wrote: > >> Hello, > >> > >> I tried to test the POSIX example program satch.c under Linux 2.4.25 for > >> PPC. I was able to fix a few issues but the module does still not load. > >> I have attached a patch for Xenomai 2.4.2 fixing: > >> > >> - User-space satch: It was necessary to move time.h and signal.h to the > >> end of the include block to get it compiled (otherwise clockid_t is > >> defined, etc.) > > > > This should not happen, header file should not depend on the inclusion order. > > True, but it happens quite often :-(. > > > > > > >> - User-space satch: It was necessary to move "#define xnprintf printf" > >> behind the include block, otherwise the linker complains about missing > >> symbols. I wonder how this can work with 2.6. And what is the status > >> of xnprintf? > >> > >> - Makefile: to avoid a mixup of CFLAG definitions for compiling the > >> user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. > >> (see patch). Note sure if this is an issue for 2.6 as well. > >> > >> - Makefile: I added -DPRODUCER to the module build with Linux 2.4. > > > > I tested satch recently on trunk. I had to make the printf change > > (xnprintf is now defined in xenomai include files to xnarch_printf, > > but xnarch_printf is not defined when compiling in user space, so I > > replaced #define xnprintf printf with #define xnarch_printf printf) to > > make it work again, but I saw no problem with include file order. > > The problem with xnprintf goes away with "#define xnarch_printf printf". > I have attached the make log showing the errors with the original > > include file order. Ok. I will check this tonight. -- Gilles Chanteperdrix ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] Problems with satch.c under Linux 2.4 2008-03-11 10:10 [Xenomai-core] Problems with satch.c under Linux 2.4 Wolfgang Grandegger 2008-03-11 10:25 ` Gilles Chanteperdrix @ 2008-03-11 22:59 ` Gilles Chanteperdrix 2008-03-12 10:22 ` Wolfgang Grandegger 1 sibling, 1 reply; 8+ messages in thread From: Gilles Chanteperdrix @ 2008-03-11 22:59 UTC (permalink / raw) To: Wolfgang Grandegger; +Cc: xenomai-core [-- Attachment #1: message body and .signature --] [-- Type: text/plain, Size: 1412 bytes --] Wolfgang Grandegger wrote: > Hello, > > I tried to test the POSIX example program satch.c under Linux 2.4.25 for > PPC. I was able to fix a few issues but the module does still not load. > I have attached a patch for Xenomai 2.4.2 fixing: > > - User-space satch: It was necessary to move time.h and signal.h to the > end of the include block to get it compiled (otherwise clockid_t is > defined, etc.) > > - User-space satch: It was necessary to move "#define xnprintf printf" > behind the include block, otherwise the linker complains about missing > symbols. I wonder how this can work with 2.6. And what is the status > of xnprintf? > > - Makefile: to avoid a mixup of CFLAG definitions for compiling the > user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. > (see patch). Note sure if this is an issue for 2.6 as well. > > - Makefile: I added -DPRODUCER to the module build with Linux 2.4. > > - I got the module build, but insmod fails with: > > bash-2.05b# insmod satch.o > satch.o: unresolved symbol shm_unlink > satch.o: unresolved symbol ftruncate > satch.o: unresolved symbol shm_open > satch.o: unresolved symbol munmap > satch.o: unresolved symbol mmap > satch.o: unresolved symbol pse51_shm_close > > Any idea why? > > Thanks, Does the following patch improve anything ? -- Gilles Chanteperdrix. [-- Attachment #2: xeno-posix-fix-example.diff --] [-- Type: text/plain, Size: 3810 bytes --] Index: include/posix/sys/mman.h =================================================================== --- include/posix/sys/mman.h (revision 3561) +++ include/posix/sys/mman.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <asm/mman.h> #endif /* __KERNEL__ */ Index: include/posix/signal.h =================================================================== --- include/posix/signal.h (revision 3561) +++ include/posix/signal.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/signal.h> Index: include/posix/time.h =================================================================== --- include/posix/time.h (revision 3561) +++ include/posix/time.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/time.h> #define DELAYTIMER_MAX UINT_MAX Index: include/posix/mqueue.h =================================================================== --- include/posix/mqueue.h (revision 3561) +++ include/posix/mqueue.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/types.h> #include <linux/signal.h> Index: include/posix/semaphore.h =================================================================== --- include/posix/semaphore.h (revision 3561) +++ include/posix/semaphore.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/kernel.h> #include <linux/fcntl.h> Index: include/posix/errno.h =================================================================== --- include/posix/errno.h (revision 3561) +++ include/posix/errno.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/errno.h> #include <linux/unistd.h> /* conflicting declaration of errno. */ Index: include/posix/fcntl.h =================================================================== --- include/posix/fcntl.h (revision 3561) +++ include/posix/fcntl.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/fcntl.h> #endif /* __KERNEL__ */ Index: include/posix/sched.h =================================================================== --- include/posix/sched.h (revision 3561) +++ include/posix/sched.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/sched.h> #endif /* __KERNEL__ */ Index: include/posix/unistd.h =================================================================== --- include/posix/unistd.h (revision 3561) +++ include/posix/unistd.h (working copy) @@ -21,6 +21,8 @@ #if defined(__KERNEL__) || defined(__XENO_SIM__) +#include <nucleus/xenomai.h> + #ifdef __KERNEL__ #include <linux/types.h> #endif /* __KERNEL__ */ Index: examples/posix/Makefile =================================================================== --- examples/posix/Makefile (revision 3561) +++ examples/posix/Makefile (working copy) @@ -79,7 +79,7 @@ else ARCH ?= $(shell uname -i) INCLUDE := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/compat -I$(KSRC)/include/xenomai/posix -CFLAGS += $(shell $(MAKE) -s -C $(KSRC) CC=$(CC) ARCH=$(ARCH) SUBDIRS=$(PWD) modules) $(INCLUDE) +CFLAGS := $(shell $(MAKE) -s -C $(KSRC) CC=$(CC) ARCH=$(ARCH) SUBDIRS=$(PWD) modules) $(INCLUDE) all:: $(OBJS) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] Problems with satch.c under Linux 2.4 2008-03-11 22:59 ` Gilles Chanteperdrix @ 2008-03-12 10:22 ` Wolfgang Grandegger 2008-03-12 10:36 ` Gilles Chanteperdrix 0 siblings, 1 reply; 8+ messages in thread From: Wolfgang Grandegger @ 2008-03-12 10:22 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: xenomai-core [-- Attachment #1: Type: text/plain, Size: 1680 bytes --] Gilles Chanteperdrix wrote: > Wolfgang Grandegger wrote: > > Hello, > > > > I tried to test the POSIX example program satch.c under Linux 2.4.25 for > > PPC. I was able to fix a few issues but the module does still not load. > > I have attached a patch for Xenomai 2.4.2 fixing: > > > > - User-space satch: It was necessary to move time.h and signal.h to the > > end of the include block to get it compiled (otherwise clockid_t is > > defined, etc.) > > > > - User-space satch: It was necessary to move "#define xnprintf printf" > > behind the include block, otherwise the linker complains about missing > > symbols. I wonder how this can work with 2.6. And what is the status > > of xnprintf? > > > > - Makefile: to avoid a mixup of CFLAG definitions for compiling the > > user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. > > (see patch). Note sure if this is an issue for 2.6 as well. > > > > - Makefile: I added -DPRODUCER to the module build with Linux 2.4. > > > > - I got the module build, but insmod fails with: > > > > bash-2.05b# insmod satch.o > > satch.o: unresolved symbol shm_unlink > > satch.o: unresolved symbol ftruncate > > satch.o: unresolved symbol shm_open > > satch.o: unresolved symbol munmap > > satch.o: unresolved symbol mmap > > satch.o: unresolved symbol pse51_shm_close > > > > Any idea why? > > > > Thanks, > > Does the following patch improve anything ? Yes, the order of the include files does not make trouble any more. Nevertheless, I need the attached patch to fix the remaining problems with CFLAGS mangling and missing -DPRODUCER. Thanks, Wolfgang. [-- Attachment #2: xeno-posix-example-make.diff --] [-- Type: text/x-patch, Size: 1293 bytes --] Index: xenomai-2.4.2/examples/posix/Makefile =================================================================== --- xenomai-2.4.2.orig/examples/posix/Makefile +++ xenomai-2.4.2/examples/posix/Makefile @@ -35,16 +35,19 @@ endif CC=$(shell $(XENOCONFIG) --cc) -CFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --posix-cflags) +UCFLAGS=-DCONSUMER $(shell $(XENOCONFIG) --posix-cflags) -LDFLAGS=$(shell $(XENOCONFIG) --posix-ldflags) +ULDFLAGS=$(shell $(XENOCONFIG) --posix-ldflags) # This includes the library path of given Xenomai into the binary to make live # easier for beginners if Xenomai's libs are not in any default search path. -LDFLAGS+=-Xlinker -rpath -Xlinker $(shell $(XENOCONFIG) --libdir) +ULDFLAGS+=-Xlinker -rpath -Xlinker $(shell $(XENOCONFIG) --libdir) all:: $(APPLICATIONS) +$(APPLICATIONS): % : %.c + $(CC) $(UCFLAGS) -o $@ $< $(ULDFLAGS) + clean:: $(RM) $(APPLICATIONS) *.o @@ -78,7 +81,7 @@ else ARCH ?= $(shell uname -i) INCLUDE := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/compat -I$(KSRC)/include/xenomai/posix -CFLAGS := $(shell $(MAKE) -s -C $(KSRC) CC=$(CC) ARCH=$(ARCH) SUBDIRS=$(PWD) modules) $(INCLUDE) +CFLAGS := $(shell $(MAKE) -s -C $(KSRC) CC=$(CC) ARCH=$(ARCH) SUBDIRS=$(PWD) modules) $(INCLUDE) -DPRODUCER all:: $(OBJS) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] Problems with satch.c under Linux 2.4 2008-03-12 10:22 ` Wolfgang Grandegger @ 2008-03-12 10:36 ` Gilles Chanteperdrix 2008-03-12 12:11 ` Wolfgang Grandegger 0 siblings, 1 reply; 8+ messages in thread From: Gilles Chanteperdrix @ 2008-03-12 10:36 UTC (permalink / raw) To: Wolfgang Grandegger; +Cc: xenomai-core On Wed, Mar 12, 2008 at 11:22 AM, Wolfgang Grandegger <wg@domain.hid> wrote: > > Gilles Chanteperdrix wrote: > > Wolfgang Grandegger wrote: > > > Hello, > > > > > > I tried to test the POSIX example program satch.c under Linux 2.4.25 for > > > PPC. I was able to fix a few issues but the module does still not load. > > > I have attached a patch for Xenomai 2.4.2 fixing: > > > > > > - User-space satch: It was necessary to move time.h and signal.h to the > > > end of the include block to get it compiled (otherwise clockid_t is > > > defined, etc.) > > > > > > - User-space satch: It was necessary to move "#define xnprintf printf" > > > behind the include block, otherwise the linker complains about missing > > > symbols. I wonder how this can work with 2.6. And what is the status > > > of xnprintf? > > > > > > - Makefile: to avoid a mixup of CFLAG definitions for compiling the > > > user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. > > > (see patch). Note sure if this is an issue for 2.6 as well. > > > > > > - Makefile: I added -DPRODUCER to the module build with Linux 2.4. > > > > > > - I got the module build, but insmod fails with: > > > > > > bash-2.05b# insmod satch.o > > > satch.o: unresolved symbol shm_unlink > > > satch.o: unresolved symbol ftruncate > > > satch.o: unresolved symbol shm_open > > > satch.o: unresolved symbol munmap > > > satch.o: unresolved symbol mmap > > > satch.o: unresolved symbol pse51_shm_close > > > > > > Any idea why? > > > > > > Thanks, > > > > Does the following patch improve anything ? > > Yes, the order of the include files does not make trouble any more. > Nevertheless, I need the attached patch to fix the remaining problems > with CFLAGS mangling and missing -DPRODUCER. Do we really need the UCFLAGS stuff ? CFLAGS is a standard thing, how do the other examples cope with the same problem ? Perhaps we could put modules compilation in a separated makefile name Kbuild ? -- Gilles Chanteperdrix ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-core] Problems with satch.c under Linux 2.4 2008-03-12 10:36 ` Gilles Chanteperdrix @ 2008-03-12 12:11 ` Wolfgang Grandegger 0 siblings, 0 replies; 8+ messages in thread From: Wolfgang Grandegger @ 2008-03-12 12:11 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: xenomai-core Gilles Chanteperdrix wrote: > On Wed, Mar 12, 2008 at 11:22 AM, Wolfgang Grandegger <wg@domain.hid> wrote: >> Gilles Chanteperdrix wrote: >> > Wolfgang Grandegger wrote: >> > > Hello, >> > > >> > > I tried to test the POSIX example program satch.c under Linux 2.4.25 for >> > > PPC. I was able to fix a few issues but the module does still not load. >> > > I have attached a patch for Xenomai 2.4.2 fixing: >> > > >> > > - User-space satch: It was necessary to move time.h and signal.h to the >> > > end of the include block to get it compiled (otherwise clockid_t is >> > > defined, etc.) >> > > >> > > - User-space satch: It was necessary to move "#define xnprintf printf" >> > > behind the include block, otherwise the linker complains about missing >> > > symbols. I wonder how this can work with 2.6. And what is the status >> > > of xnprintf? >> > > >> > > - Makefile: to avoid a mixup of CFLAG definitions for compiling the >> > > user-space and kernel-space part, I renamed CFLAGS to UCFLAGS etc. >> > > (see patch). Note sure if this is an issue for 2.6 as well. >> > > >> > > - Makefile: I added -DPRODUCER to the module build with Linux 2.4. >> > > >> > > - I got the module build, but insmod fails with: >> > > >> > > bash-2.05b# insmod satch.o >> > > satch.o: unresolved symbol shm_unlink >> > > satch.o: unresolved symbol ftruncate >> > > satch.o: unresolved symbol shm_open >> > > satch.o: unresolved symbol munmap >> > > satch.o: unresolved symbol mmap >> > > satch.o: unresolved symbol pse51_shm_close >> > > >> > > Any idea why? >> > > >> > > Thanks, >> > >> > Does the following patch improve anything ? >> >> Yes, the order of the include files does not make trouble any more. >> Nevertheless, I need the attached patch to fix the remaining problems >> with CFLAGS mangling and missing -DPRODUCER. > > Do we really need the UCFLAGS stuff ? CFLAGS is a standard thing, how > do the other examples cope with the same problem ? Perhaps we could > put modules compilation in a separated makefile name Kbuild ? For Linux 2.4 we use this module capturing trick to get the CFLAGS of the kernel. That's what makes trouble. So, the problem only shows up when modules need to be built for Linux 2.4 together with at least on application. Yes, it might be better to use KCFLAGS for module compilation for 2.4. Going to find a better solution a.s.a.p. Wolfgang. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-03-12 12:11 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-03-11 10:10 [Xenomai-core] Problems with satch.c under Linux 2.4 Wolfgang Grandegger 2008-03-11 10:25 ` Gilles Chanteperdrix 2008-03-11 11:43 ` Wolfgang Grandegger 2008-03-11 13:37 ` Gilles Chanteperdrix 2008-03-11 22:59 ` Gilles Chanteperdrix 2008-03-12 10:22 ` Wolfgang Grandegger 2008-03-12 10:36 ` Gilles Chanteperdrix 2008-03-12 12:11 ` Wolfgang Grandegger
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.