All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] Undefined reference to Posix shm_* with uClibc
@ 2009-12-07 13:42 Hagen.Langbartels
  2009-12-09 18:32 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Hagen.Langbartels @ 2009-12-07 13:42 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]

Hi all,

I tried to compile Xenomai 2.5rc4 with uClibc 0.9.30.1 and ran into some 
problems with references to the 
posix functions shm_open and shm_unlink in /src/skins/posix/wrappers.c, 
which do not exist in uClibc.

Unlinke in  /src/skins/posix/shm.c the existence of these functions is not 
verfied (via #ifdef HAVE_SHM_*)
and the build fails.

The following patch is a quick and dirty fix for this problem. I hope this 
might be helpful.


diff -Nur xenomai-2.4.93.orig/src/skins/posix/wrappers.c 
xenomai-2.4.93.work/src/skins/posix/wrappers.c
--- xenomai-2.4.93.orig/src/skins/posix/wrappers.c      2009-03-30 
12:24:50.000000000 +0200
+++ xenomai-2.4.93.work/src/skins/posix/wrappers.c      2009-12-07 
14:22:03.983876500 +0100
@@ -245,17 +245,21 @@
 }
 
 /* shm */
+#ifdef HAVE_SHM_OPEN
 __attribute__ ((weak))
 int __real_shm_open(const char *name, int oflag, mode_t mode)
 {
        return shm_open(name, oflag, mode);
 }
+#endif
 
+#ifdef HAVE_SHM_UNLINK
 __attribute__ ((weak))
 int __real_shm_unlink(const char *name)
 {
        return shm_unlink(name);
 }
+#endif
 
 __attribute__ ((weak))
 int __real_ftruncate(int fildes, long length)




Best regards,
Hagen Langbartels

SIEB & MEYER AG
Dipl.-Inf. (FH) Hagen Langbartels

Auf dem Schmaarkamp 21
21339 Lüneburg
Germany
Tel.: +49-4131-203-1133
Fax.: +49-4131-38562
E-mail: development@domain.hid
www.sieb-meyer.de

Vorstand: Markus Meyer, Torsten Blankenburg
Aufsichtsratsvorsitzender: Hans Reinen
Amtsgericht Lüneburg: HRB 1805
Umsatzsteuer-ID.-Nr.: DE 116085664

[-- Attachment #2: Type: text/html, Size: 3222 bytes --]

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

* Re: [Xenomai-core] Undefined reference to Posix shm_* with uClibc
  2009-12-07 13:42 [Xenomai-core] Undefined reference to Posix shm_* with uClibc Hagen.Langbartels
@ 2009-12-09 18:32 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2009-12-09 18:32 UTC (permalink / raw)
  To: Hagen.Langbartels; +Cc: xenomai

Hagen.Langbartels@domain.hid wrote:
> Hi all,
> 
> I tried to compile Xenomai 2.5rc4 with uClibc 0.9.30.1 and ran into some 
> problems with references to the 
> posix functions shm_open and shm_unlink in /src/skins/posix/wrappers.c, 
> which do not exist in uClibc.
> 
> Unlinke in  /src/skins/posix/shm.c the existence of these functions is not 
> verfied (via #ifdef HAVE_SHM_*)
> and the build fails.
> 
> The following patch is a quick and dirty fix for this problem. I hope this 
> might be helpful.
> 

Actually, it looks clean to me. Can you provide it with the formal
signed-off, proper title and short description (as recent commits look
like in Xenomai)?

Jan

> 
> diff -Nur xenomai-2.4.93.orig/src/skins/posix/wrappers.c 
> xenomai-2.4.93.work/src/skins/posix/wrappers.c
> --- xenomai-2.4.93.orig/src/skins/posix/wrappers.c      2009-03-30 
> 12:24:50.000000000 +0200
> +++ xenomai-2.4.93.work/src/skins/posix/wrappers.c      2009-12-07 
> 14:22:03.983876500 +0100
> @@ -245,17 +245,21 @@
>  }
>  
>  /* shm */
> +#ifdef HAVE_SHM_OPEN
>  __attribute__ ((weak))
>  int __real_shm_open(const char *name, int oflag, mode_t mode)
>  {
>         return shm_open(name, oflag, mode);
>  }
> +#endif
>  
> +#ifdef HAVE_SHM_UNLINK
>  __attribute__ ((weak))
>  int __real_shm_unlink(const char *name)
>  {
>         return shm_unlink(name);
>  }
> +#endif
>  
>  __attribute__ ((weak))
>  int __real_ftruncate(int fildes, long length)
> 
> 
> 
> 
> Best regards,
> Hagen Langbartels
> 
> SIEB & MEYER AG
> Dipl.-Inf. (FH) Hagen Langbartels
> 
> Auf dem Schmaarkamp 21
> 21339 Lüneburg
> Germany
> Tel.: +49-4131-203-1133
> Fax.: +49-4131-38562
> E-mail: development@domain.hid
> www.sieb-meyer.de
> 
> Vorstand: Markus Meyer, Torsten Blankenburg
> Aufsichtsratsvorsitzender: Hans Reinen
> Amtsgericht Lüneburg: HRB 1805
> Umsatzsteuer-ID.-Nr.: DE 116085664
> 
> 

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux


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

end of thread, other threads:[~2009-12-09 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-07 13:42 [Xenomai-core] Undefined reference to Posix shm_* with uClibc Hagen.Langbartels
2009-12-09 18:32 ` Jan Kiszka

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.