Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Add rt squarewave example in buildroot
@ 2012-01-23 14:43 Willy
  2012-01-23 21:14 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Willy @ 2012-01-23 14:43 UTC (permalink / raw)
  To: buildroot

Hi,
I've compiled and configured the 3.0.14 kernel with rt patch? 
in buildroot 11-2011.
I'm trying to build the rt example "squarewave"? in buildroot.
When I launch "make" I obtain the following error:
buildrootfolder/output/host/usr/bin/i586-unknown-linux-uclibc-gcc -c \
    rtpatchonoff.c 
buildrootfolder/output/host/usr/bin/i586-unknown-linux-uclibc-gcc \
    rtpatchonoff.o
-o rtpatchonoff -lrt -Wall
rtpatchonoff.o: In function `main':
rtpatchonoff.c:(.text+0x176): undefined reference to `clock_nanosleep'
collect2: ld returned 1 exit status
make[1]: *** [rtpatchonoff] Errore 1
...

The makefile included in the package rtpatchonoff is:
[makefile]
all: rtpatchonoff -lrt

rtpatchonoff: rtpatchonoff.o -lrt
	$(CC) rtpatchonoff.o -o rtpatchonoff -lrt -Wall

rtpatchonoff.o: rtpatchonoff.c
	$(CC) -c rtpatchonoff.c 

clean:
	rm -f rtpatchonoff
[/makefile]

The .mk file is:
[mk]
RTPATCHONOFF_VERSION = 1.0
RTPATCHONOFF_SOURCE = rtpatchonoff-$(RTPATCHONOFF_VERSION).tar.gz
RTPATCHONOFF_SITE = http://nonesiste.com

define RTPATCHONOFF_BUILD_CMDS
    $(MAKE) CC=$(TARGET_CC) LD=$(TARGET_LD) -C $(@D)  all
endef

define RTPATCHONOFF_INSTALL_TARGET_CMDS
	$(INSTALL) -D -m 0755 $(@D)/rtpatchonoff $(TARGET_DIR)/usr/bin 
endef

$(eval $(call GENTARGETS,package,rtpatchonoff))
[/mk]

Where is the problem?

clock_nanosleep is defined in
buildrootfolder/output/toolchain/uClibc-0.9.32/librt/clock_nanosleep.c


? - http://www.kernel.org/pub/linux/kernel/projects/rt/
? - https://rt.wiki.kernel.org/articles/s/q/u/Squarewave-example.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Add rt squarewave example in buildroot
  2012-01-23 14:43 [Buildroot] Add rt squarewave example in buildroot Willy
@ 2012-01-23 21:14 ` Thomas Petazzoni
  2012-01-24  8:07   ` Willy
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2012-01-23 21:14 UTC (permalink / raw)
  To: buildroot

Le Mon, 23 Jan 2012 14:43:06 +0000 (UTC),
Willy <willy@willygroup.org> a ?crit :

> I've compiled and configured the 3.0.14 kernel with rt patch? 
> in buildroot 11-2011.

Which toolchain are you using? Have you modified the uClibc
configuration?

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Add rt squarewave example in buildroot
  2012-01-23 21:14 ` Thomas Petazzoni
@ 2012-01-24  8:07   ` Willy
  2012-01-24  9:32     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Willy @ 2012-01-24  8:07 UTC (permalink / raw)
  To: buildroot

Thomas Petazzoni <thomas.petazzoni@...> writes:

> Le Mon, 23 Jan 2012 14:43:06 +0000 (UTC),
> Willy <willy <at> willygroup.org> a ?crit :
> 
> > I've compiled and configured the 3.0.14 kernel with rt patch? 
> > in buildroot 11-2011.
> 
> Which toolchain are you using? Have you modified the uClibc
> configuration?

I'm using the generated toolchain with the default configuration.

Thanks,
Willy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Add rt squarewave example in buildroot
  2012-01-24  8:07   ` Willy
@ 2012-01-24  9:32     ` Thomas Petazzoni
  2012-01-24 10:18       ` Willy
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2012-01-24  9:32 UTC (permalink / raw)
  To: buildroot

Le Tue, 24 Jan 2012 08:07:04 +0000 (UTC),
Willy <willy@willygroup.org> a ?crit :

> I'm using the generated toolchain with the default configuration.

Strange, the uClibc is by default compiled with
UCLIBC_HAS_ADVANCED_REALTIME, clock_nanosleep() should be there in
librt. Can you try with a test case program?

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Add rt squarewave example in buildroot
  2012-01-24  9:32     ` Thomas Petazzoni
@ 2012-01-24 10:18       ` Willy
  0 siblings, 0 replies; 5+ messages in thread
From: Willy @ 2012-01-24 10:18 UTC (permalink / raw)
  To: buildroot

Thomas Petazzoni <thomas.petazzoni@...> writes:

> Can you try with a test case program?

How?

> Strange, the uClibc is by default compiled with
> UCLIBC_HAS_ADVANCED_REALTIME, clock_nanosleep() should be there in
> librt.

The uClibc configuration file contains:
output/toolchain/uClibc-0.9.32/.config:UCLIBC_HAS_ADVANCED_REALTIME=y

And this file:
output/toolchain/uClibc-0.9.32/librt/clock_nanosleep.c
exists and contains:
######################
<cut>
#ifdef __ASSUME_POSIX_TIMERS
int
clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
		 struct timespec *rem)
{
<cut>
}
#else
# ifdef __NR_clock_nanosleep
extern int __libc_missing_posix_timers attribute_hidden;
#  define SYSDEP_NANOSLEEP \
  if (!__libc_missing_posix_timers)					      \
    {									      \
    <cut>
    }
# endif
# include <sysdeps/unix/clock_nanosleep.c>
#endif
########################

Thanks,
Willy

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-24 10:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23 14:43 [Buildroot] Add rt squarewave example in buildroot Willy
2012-01-23 21:14 ` Thomas Petazzoni
2012-01-24  8:07   ` Willy
2012-01-24  9:32     ` Thomas Petazzoni
2012-01-24 10:18       ` Willy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox