Hans Søndergaard (HSO) wrote:
> from ../../../../xenomai-2.4.3/src/skins/posix/init.c:20:
> ../../../src/include/asm/xenomai/syscall.h: In function
> 'xeno_arm_features_check
> ':
> ../../../src/include/asm/xenomai/syscall.h:295: error: 'stderr' undeclared
> (firs
> t use in this function)
> ../../../src/include/asm/xenomai/syscall.h:295: error: (Each undeclared
> identifi
> er is reported only once
> ../../../src/include/asm/xenomai/syscall.h:295: error: for each function it
> appe
> ars in.)
>
> Obviously there is something wrong with the include path used:
> uClibc_mutex.h should not include 'pthread.h' in the Xenomai
> distribution but rather the version in uClibc itself.
>
> Why this happens I'm trying to discover.
>
> The complete configure I'm using is:
>
> ../xenomai-2.4.3/configure --build=i686-pc-linux-gnu --host=arm-linux-uclibc
> --enable-arm-mach=at91sam926x --enable-arm-tsc
The way I see it, the problem is that posix/pthread.h includes
nucleus/thread.h and nucleus/intr.h to get a few constants
definitions. And since these include files include other include files,
we end up with the whole stack of xenomai includes. So, I propose the
following patch which basically stop including other include files in
nucleus/thread.h and nucleus/intr.h when included from user-space. The
only downside of this solution is that application like cyclictest who
want to use the I-pipe tracer now need to include explicitely
nucleus/trace.h.
--
Gilles.
Index: include/nucleus/thread.h
===================================================================
--- include/nucleus/thread.h (revision 3732)
+++ include/nucleus/thread.h (working copy)
@@ -22,8 +22,6 @@
#ifndef _XENO_NUCLEUS_THREAD_H
#define _XENO_NUCLEUS_THREAD_H
-#include <nucleus/timer.h>
-
/*! @ingroup nucleus
@defgroup nucleus_state_flags Thread state flags.
@brief Bits reporting permanent or transient states of thread.
@@ -130,6 +128,7 @@
#if defined(__KERNEL__) || defined(__XENO_SIM__)
#include <nucleus/stat.h>
+#include <nucleus/timer.h>
#ifdef __XENO_SIM__
/* Pseudo-status (must not conflict with other bits) */
Index: include/nucleus/intr.h
===================================================================
--- include/nucleus/intr.h (revision 3732)
+++ include/nucleus/intr.h (working copy)
@@ -22,8 +22,6 @@
#ifndef _XENO_NUCLEUS_INTR_H
#define _XENO_NUCLEUS_INTR_H
-#include <nucleus/types.h>
-
/* Possible return values of ISR. */
#define XN_ISR_NONE 0x1
#define XN_ISR_HANDLED 0x2
@@ -41,6 +39,7 @@
#if defined(__KERNEL__) || defined(__XENO_SIM__)
+#include <nucleus/types.h>
#include <nucleus/stat.h>
typedef struct xnintr {
Index: src/skins/posix/rtdm.c
===================================================================
--- src/skins/posix/rtdm.c (revision 3732)
+++ src/skins/posix/rtdm.c (working copy)
@@ -18,6 +18,7 @@
*/
#include <errno.h>
+#include <string.h>
#include <stdarg.h>
#include <pthread.h>
#include <fcntl.h>
Index: src/skins/posix/thread.c
===================================================================
--- src/skins/posix/thread.c (revision 3732)
+++ src/skins/posix/thread.c (working copy)
@@ -17,6 +17,7 @@
*/
#include <stddef.h>
+#include <string.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
Index: src/skins/posix/clock.c
===================================================================
--- src/skins/posix/clock.c (revision 3732)
+++ src/skins/posix/clock.c (working copy)
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include <pthread.h> /* For pthread_setcanceltype. */
#include <posix/syscall.h>
Index: src/testsuite/cyclic/cyclictest.c
===================================================================
--- src/testsuite/cyclic/cyclictest.c (revision 3732)
+++ src/testsuite/cyclic/cyclictest.c (working copy)
@@ -35,6 +35,7 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
+#include <nucleus/trace.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help