Skip to contentSkip to conversation

xenomai 2.5.0 uclibc 0.30 compatibility?

Xenomai-help [email protected] 2 participants 9 messages Jan 30, 2010 – Feb 4, 2010 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hello, I have a problem building Xenomai 2.5.0 with an arm-linux-uclibgnueabi toolchain.
Previous version Xenomai 2.4.10 builds with no problems at all(excluding testsuite clock compiling)
Now I'm getting this 'twisted' error compiling posix skin:

.........everithing before has built without problems
===================================
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/opt/pct210_build/xenomai-2.5.0-eabi/src/skins/native'
Making all in posix
make[3]: Entering directory `/opt/pct210_build/xenomai-2.5.0-eabi/src/skins/posix'
/bin/sh ../../../libtool --tag=CC --mode=compile
/opt/toolchains/arm926t-uclibcgnueabi/usr/bin/arm-linux-gcc -DHAVE_CONFIG_H -I.
-I../../../src/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -march=armv5
-D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../../include
-I../../../include/posix -I../../../ksrc/skins -MT
libpthread_rt_la-init.lo -MD -MP -MF .deps/libpthread_rt_la-init.Tpo -c -o libpthread_rt_la-init.lo test -f 'init.c' || echo './'init.c libtool:
compile: /opt/toolchains/arm926t-uclibcgnueabi/usr/bin/arm-linux-gcc -DHAVE_CONFIG_H -I. -I../../../src/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall
-pipe -march=armv5 -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../../include
-I../../../include/posix -I../../../ksrc/skins -MT libpthread_rt_la-init.lo -MD -MP -MF .deps/libpthread_rt_la-init.Tpo -c init.c -fPIC -DPIC -o .libs/libpthread_rt_la-init.o
init.c:1: warning: target CPU does not support interworking
In file included from ../../../src/include/asm/xenomai/atomic.h:82,

                 from ../../../include/nucleus/system.h:26,
                 from ../../../src/include/asm/xenomai/system.h:223,
                 from ../../../include/nucleus/types.h:40,
                 from ../../../include/nucleus/thread.h:25,
                 from ../../../include/posix/pthread.h:136,

from /opt/toolchains/arm926t-uclibcgnueabi/usr/include/bits/uClibc_mutex.h:15,

from /opt/toolchains/arm926t-uclibcgnueabi/usr/include/bits/uClibc_stdio.h:119,

from /opt/toolchains/arm926t-uclibcgnueabi/usr/include/stdio.h:72,

                 from init.c:19:

../../../src/include/asm/xenomai/syscall.h: In
function ‘xeno_arm_features_check’:
../../../src/include/asm/xenomai/syscall.h:377: error:
‘stderr’ undeclared
(first use in this function) ../../../src/include/asm/xenomai/syscall.h:377: error: (Each undeclared identifier is reported only once ../../../src/include/asm/xenomai/syscall.h:377: error: for each function it appears in.)
make[3]: *** [libpthread_rt_la-init.lo] Error 1
make[3]: Leaving directory `/opt/pct210_build/xenomai-2.5.0-eabi/src/skins/posix'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/pct210_build/xenomai-2.5.0-eabi/src/skins' make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/pct210_build/xenomai-2.5.0-eabi/src'
make: *** [all-recursive] Error 1
==============================================
Here is a part of configuration log:

[email protected]# head config.log
==============================================
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Xenomai configure 2.5.0, which was generated by GNU Autoconf 2.64. Invocation command line was

$ ./configure --build=i686-linux --host=arm-linux
--prefix=/usr/xenomai-2.5.0-eabi
--enable-shared
CC=/opt/toolchains/arm926t-uclibcgnueabi/usr/bin/arm-linux-gcc
LD=/opt/toolchains/arm926t-uclibcgnueabi/usr/bin/arm-linux-ld
--enable-arm-mach=at91sam926x

## --------- ##
## Platform. ##
===============================================
Any idea would be wellcome.
Is this due to uClibc maybe?
Regards for guys from community, Philippe, Jan, Gilles...

#1 lore raw
Quoted 15 lines · [email protected] wrote:

In file included from ../../../src/include/asm/xenomai/atomic.h:82,

                 from ../../../include/nucleus/system.h:26,
                 from ../../../src/include/asm/xenomai/system.h:223,
                 from ../../../include/nucleus/types.h:40,
                 from ../../../include/nucleus/thread.h:25,
                 from ../../../include/posix/pthread.h:136,

from /opt/toolchains/arm926t-uclibcgnueabi/usr/include/bits/uClibc_mutex.h:15,

from /opt/toolchains/arm926t-uclibcgnueabi/usr/include/bits/uClibc_stdio.h:119,

from /opt/toolchains/arm926t-uclibcgnueabi/usr/include/stdio.h:72,

                 from init.c:19:
Quoted 9 lines

../../../src/include/asm/xenomai/syscall.h: In
function ‘xeno_arm_features_check’:
../../../src/include/asm/xenomai/syscall.h:377: error:
‘stderr’ undeclared
(first use in this function) ../../../src/include/asm/xenomai/syscall.h:377: error: (Each undeclared identifier is reported only once ../../../src/include/asm/xenomai/syscall.h:377: error: for each function it appears in.)

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

You can fix this locally by #including pthread.h before stdio.h. We will
propose a better fix for 2.5.1.

Signature · 1 line
Gilles Chanteperdrix
#2 lore raw
Quoted 3 lines · On Sunday 31 January 2010 11:31:28 Gilles Chanteperdrix wrote:

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

Same thing,
I can't figure out which file to include in pthread.h posix/init.c - same error
include/asm-arm/xenomai/syscall.h - produce error from start building rtdm ...

#3 lore raw
Quoted 9 lines · Sinisa Denic
Quoted 3 lines · On Sunday 31 January 2010 11:31:28 Gilles Chanteperdrix wrote:

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

Same thing,
I can't figure out which file to include in pthread.h posix/init.c - same error
include/asm-arm/xenomai/syscall.h - produce error from start building rtdm ...

In every .c file where you get the error, you should try and include pthread.h before anything else.

Signature · 1 line
					    Gilles.
#4 lore raw
Quoted 6 lines · On Monday 01 February 2010 14:07:15 Gilles Chanteperdrix wrote:
Quoted 5 lines · Sinisa Denic
Quoted 3 lines · On Sunday 31 January 2010 11:31:28 Gilles Chanteperdrix wrote:

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

Quoted 8 lines
Quoted 5 lines

Same thing,
I can't figure out which file to include in pthread.h posix/init.c - same error include/asm-arm/xenomai/syscall.h - produce error from start building rtdm ...

In every .c file where you get the error, you should try and include pthread.h before anything else.

Ok, now I've got it built. In attach there is a patch, maybe usefull to someone.

Thank you Gilles, greetings from Belgrade.

src/skins/posix/clock.c +1 -2
index 98595d4..5c06671 100644
@@ -15,12 +15,11 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
-
+#include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include <pthread.h>		/* For pthread_setcanceltype. */
 #include <posix/syscall.h>
 #include <time.h>
 #include <asm-generic/xenomai/bits/timeconv.h>
src/skins/posix/init.c +1 -1
index 6028dd9..8301495 100644
@@ -15,7 +15,7 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
-
+#include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
src/testsuite/irqbench/irqloop.c +1 -1
index e97123f..6999e9e 100644
@@ -16,11 +16,11 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <string.h>
-#include <pthread.h>
 #include <unistd.h>
 #include <limits.h>
 #include <sys/mman.h>
src/testsuite/sigtest/sigtest.c +1 -0
index 628d573..5b24379 100644
@@ -1,3 +1,4 @@
+#include <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
src/testsuite/switchtest/switchtest.c +1 -1
index 66d0eab..20d8979 100644
@@ -1,4 +1,5 @@
 #include <ctype.h>
+#include <pthread.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -8,7 +9,6 @@
 #include <sched.h>
 #include <signal.h>
 #include <unistd.h>
-#include <pthread.h>
 #include <sys/mman.h>
 #include <semaphore.h>
 #include <setjmp.h>
src/testsuite/unit/mutex-torture.c +1 -1
index 70bda14..671b2dd 100644
@@ -8,6 +8,7 @@
  * Released under the terms of GPLv2.
  */
 
+#include <pthread.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -15,7 +16,6 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <sys/mman.h>
-#include <pthread.h>
 #include <native/timer.h>
 
 #ifndef XENO_POSIX
#5 lore raw
Quoted 11 lines · Sinisa Denic
Quoted 10 lines · On Monday 01 February 2010 14:07:15 Gilles Chanteperdrix wrote:
Quoted 9 lines · Sinisa Denic
Quoted 3 lines · On Sunday 31 January 2010 11:31:28 Gilles Chanteperdrix wrote:

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

Same thing,
I can't figure out which file to include in pthread.h posix/init.c - same error include/asm-arm/xenomai/syscall.h - produce error from start building rtdm ...

Quoted 6 lines
Quoted 2 lines

In every .c file where you get the error, you should try and include pthread.h before anything else.

Ok, now I've got it built. In attach there is a patch, maybe usefull to someone.

Xenomai v2.5.1 should include a cleaner fix (along with the I-pipe for Linux 2.6.30 fixed for the arm926ejs issue, as well as some improvements on at91). So, it would be nice if you could test this release and report.

Signature · 1 line
					    Gilles.
#6 lore raw
Quoted 17 lines · On Wednesday 03 February 2010 19:30:00 you wrote:
Quoted 16 lines · Sinisa Denic
Quoted 14 lines · On Monday 01 February 2010 14:07:15 Gilles Chanteperdrix wrote:
Quoted 10 lines · Sinisa Denic
Quoted 3 lines · On Sunday 31 January 2010 11:31:28 Gilles Chanteperdrix wrote:

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

Same thing,
I can't figure out which file to include in pthread.h posix/init.c - same error include/asm-arm/xenomai/syscall.h - produce error from start building rtdm ...

In every .c file where you get the error, you should try and include pthread.h before anything else.

Quoted 6 lines
Quoted 2 lines

Ok, now I've got it built. In attach there is a patch, maybe usefull to someone.

Xenomai v2.5.1 should include a cleaner fix (along with the I-pipe for Linux 2.6.30 fixed for the arm926ejs issue, as well as some improvements on at91). So, it would be nice if you could test this release and report.

Ok , previos problems didn't appear, but now I'm getting this:

latency.c:12:22: error: execinfo.h: No such file or directory latency.c: In function ‘mode_sw’:
latency.c:460: warning: implicit declaration of function ‘backtrace’ latency.c:461: warning: implicit declaration of
function ‘backtrace_symbols_fd’
make[3]: *** [latency-latency.o] Error 1
make[3]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src/testsuite/latency' make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src/testsuite' make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src'
make: *** [all-recursive] Error 1

In order to compile xeno2.5.1 I skipped testsuite building and it passed

Sinisa.

#7 lore raw
Quoted 37 lines · Sinisa Denic
Quoted 12 lines · On Wednesday 03 February 2010 19:30:00 you wrote:
Quoted 11 lines · Sinisa Denic
Quoted 10 lines · On Monday 01 February 2010 14:07:15 Gilles Chanteperdrix wrote:
Quoted 9 lines · Sinisa Denic
Quoted 3 lines · On Sunday 31 January 2010 11:31:28 Gilles Chanteperdrix wrote:

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

Same thing,
I can't figure out which file to include in pthread.h posix/init.c - same error include/asm-arm/xenomai/syscall.h - produce error from start building rtdm ...

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

In every .c file where you get the error, you should try and include pthread.h before anything else.

Ok, now I've got it built. In attach there is a patch, maybe usefull to someone.

Xenomai v2.5.1 should include a cleaner fix (along with the I-pipe for Linux 2.6.30 fixed for the arm926ejs issue, as well as some improvements on at91). So, it would be nice if you could test this release and report.

Ok , previos problems didn't appear, but now I'm getting this:

latency.c:12:22: error: execinfo.h: No such file or directory latency.c: In function ‘mode_sw’:
latency.c:460: warning: implicit declaration of function ‘backtrace’ latency.c:461: warning: implicit declaration of
function ‘backtrace_symbols_fd’
make[3]: *** [latency-latency.o] Error 1
make[3]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src/testsuite/latency' make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src/testsuite' make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src'
make: *** [all-recursive] Error 1

Quoted 1 line

In order to compile xeno2.5.1 I skipped testsuite building and it passed

Ok. Could you try the following patch?

(quoted diff) +0 -0

b/src/testsuite/latency/latency.c
index ca5f1bf..f397b42 100644

src/testsuite/latency/latency.c +10 -0
@@ -9,7 +9,9 @@
 #include <sys/time.h>
 #include <unistd.h>
 
+#ifndef __UCLIBC__
 #include <execinfo.h>
+#endif /* !__UCLIBC__ */
 
 #include <native/task.h>
 #include <native/timer.h>
@@ -447,7 +449,13 @@ void faulthand(int sig)
 
 void mode_sw(int sig)
 {
+#ifndef __UCLIBC__
 	const char buffer[] = "Mode switch, aborting. Backtrace:\n";
+#else /* __UCLIBC__ */
+	const char buffer[] = "Mode switch, aborting."
+		" Backtrace unavailable with uclibc.\n";
+#endif /* __UCLIBC__ */
+	
 	static void *bt[200];
 	unsigned n;
 
@@ -457,8 +465,10 @@ void mode_sw(int sig)
 	}
 
 	write(STDERR_FILENO, buffer, sizeof(buffer));
+#ifndef __UCLIBC__
 	n = backtrace(bt, sizeof(bt)/sizeof(bt[0]));
 	backtrace_symbols_fd(bt, n, STDERR_FILENO);
+#endif /* !__UCLIBC__ */
 
 	signal(sig, SIG_DFL);
 	kill(getpid(), sig);
Signature · 4 lines
Gilles Chanteperdrix, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#10 lore raw
In reply to a message not in the archive
Quoted 89 lines · On Thursday 04 February 2010 15:25:19 you wrote:
Quoted 88 lines · Sinisa Denic
Quoted 87 lines · On Thursday 04 February 2010 14:21:27 you wrote:
Quoted 43 lines · Sinisa Denic
Quoted 17 lines · On Wednesday 03 February 2010 19:30:00 you wrote:
Quoted 16 lines · Sinisa Denic
Quoted 14 lines · On Monday 01 February 2010 14:07:15 Gilles Chanteperdrix wrote:
Quoted 10 lines · Sinisa Denic
Quoted 3 lines · On Sunday 31 January 2010 11:31:28 Gilles Chanteperdrix wrote:

This is bad news, the problem is that uclibc's stdio.h needs pthread.h, which because of the -I flags we pass is xenomai's pthread.h, which includes asm/syscall.h, which needs stdio.h.

Same thing,
I can't figure out which file to include in pthread.h posix/init.c - same error include/asm-arm/xenomai/syscall.h - produce error from start building rtdm ...

In every .c file where you get the error, you should try and include pthread.h before anything else.

Quoted 7 lines
Quoted 2 lines

Ok, now I've got it built. In attach there is a patch, maybe usefull to someone.

Xenomai v2.5.1 should include a cleaner fix (along with the I-pipe for Linux 2.6.30 fixed for the arm926ejs issue, as well as some improvements on at91). So, it would be nice if you could test this release and report.

Ok , previos problems didn't appear, but now I'm getting this:

latency.c:12:22: error: execinfo.h: No such file or directory latency.c: In function ‘mode_sw’:
latency.c:460: warning: implicit declaration of function ‘backtrace’ latency.c:461: warning: implicit declaration of
function ‘backtrace_symbols_fd’
make[3]: *** [latency-latency.o] Error 1
make[3]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src/testsuite/latency' make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src/testsuite' make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/pct210_build/xenomai-2.5.1-eabi/src'
make: *** [all-recursive] Error 1

Quoted 2 lines

In order to compile xeno2.5.1 I skipped testsuite building and it passed

Ok. Could you try the following patch?

src/testsuite/latency/latency.c +10 -0
index ca5f1bf..f397b42 100644
@@ -9,7 +9,9 @@
 #include <sys/time.h>
 #include <unistd.h>
 
+#ifndef __UCLIBC__
 #include <execinfo.h>
+#endif /* !__UCLIBC__ */
 
 #include <native/task.h>
 #include <native/timer.h>
@@ -447,7 +449,13 @@ void faulthand(int sig)
 
 void mode_sw(int sig)
 {
+#ifndef __UCLIBC__
 	const char buffer[] = "Mode switch, aborting. Backtrace:\n";
+#else /* __UCLIBC__ */
+	const char buffer[] = "Mode switch, aborting."
+		" Backtrace unavailable with uclibc.\n";
+#endif /* __UCLIBC__ */
+
 	static void *bt[200];
 	unsigned n;
 
@@ -457,8 +465,10 @@ void mode_sw(int sig)
 	}
 
 	write(STDERR_FILENO, buffer, sizeof(buffer));
+#ifndef __UCLIBC__
 	n = backtrace(bt, sizeof(bt)/sizeof(bt[0]));
 	backtrace_symbols_fd(bt, n, STDERR_FILENO);
+#endif /* !__UCLIBC__ */
 
Quoted 6 lines
Quoted 4 lines

src/testsuite/latency/latency.c void mode_sw(int sig) · line 474

Quoted 2 lines
src/testsuite/latency/latency.c +0 -0
 	signal(sig, SIG_DFL);
 	kill(getpid(), sig);

Could you sand as attachment I have malformed patch problem, thanks.

Here it comes.

Ok ,with this patch everthing seems good, I could build without problems. Thank you Gilles