All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Hans Søndergaard (HSO)" <HSO@VIAUC.DK>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Xenomai on AT91SAM9260
Date: Thu, 1 May 2008 18:55:41 +0200	[thread overview]
Message-ID: <18457.62989.876794.339734@domain.hid> (raw)
In-Reply-To: <2220D86D21B55040AB683933DBD97B5A263A38EC01@domain.hid>

[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 1546 bytes --]

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.

[-- Attachment #2: xeno-fix-uclibc-includes.diff --]
[-- Type: text/plain, Size: 2585 bytes --]

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]))
 

      parent reply	other threads:[~2008-05-01 16:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 11:37 [Xenomai-help] Xenomai on AT91SAM9260 Hans Søndergaard (HSO)
2008-04-29 12:18 ` Gilles Chanteperdrix
2008-05-01  5:46   ` Hans Søndergaard (HSO)
2008-05-01 16:04     ` Gilles Chanteperdrix
2008-05-01 17:02       ` Philippe Gerum
2008-05-03  8:21         ` Hans Søndergaard (HSO)
2008-05-03 14:14           ` Gilles Chanteperdrix
2008-05-04 15:16             ` Hans Søndergaard (HSO)
2008-05-01 16:55     ` Gilles Chanteperdrix [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18457.62989.876794.339734@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=HSO@VIAUC.DK \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.