[Xenomai] Porting a library to Xenomai

Leopold Palomo-Avellaneda leo at alaxarxa.net
Thu Dec 17 10:00:17 CET 2015


El Dijous, 17 de desembre de 2015, a les 01:05:18, Gilles Chanteperdrix va 
escriure:
[...]
> > 
> > - Some of you have tried to "Xenomaize" a common POSIX library, for
> > instance with threads and sockets (Poco?... )?
> 
> Yes, back in 2006 to 2009, I ported several applications related to
> VOIP to use Xenomai and RTnet. From this experience, I wrote this
> guide:
> https://xenomai.org/2014/08/porting-a-linux-application-to-xenomai-dual-kern
> el/

the famous great page ...

> > - If I create a library (POSIX) and I wrap the functions (-
> > Wl,@/usr/lib/x86_64-linux-gnu/posix.wrappers). The library users must wrap
> > wrap their code too, right? (for instance if they have a
> > printf...)
> 
> You should compile (and more importantly link edit) all your code,
> whether library or executable, with the flags obtained via
> xeno-config. 

ok, that's clear. For the current case I suppose that it's be the same if the 
library is C++ or C. To be more concisely, if I create a dynamic C++ library 
(*) (libXenofoo), with some *.cpp files. I understand that:

- to compile the files I have to pass the POSIX cflags obtained by xeno-config
- to link that library, I have to pass the POSIX ldflags obtained by xeno-config 
(wrap, etc)

After, if I have a program the uses libXenofoo (dynamic)
- to compile my program, If I don't uses any __Xeno__ * flag I don't need to 
pass the POSIX cflags. Right?
- to link the program against libXenofoo, I understand that yes, that I should 
uses the POSIX ldflags obtained by xeno-config (wrap, etc). Right?

> If you want to use the static version of the POSIX skin
> library, it gets a little more complicated, you do not want to wrap
> the symbols of the POSIX skin library itself and you should use the
> "wrap-link.sh" script, to do the link edit in two stages.

I don't understand that, probably because I use cmake and hides this. But, I 
have created my static version of libXenofoo passing _only_ one time and the 
program have worked. Please, could you elaborate a bit more this?

Leopold


(*) C++ simple, nothing sophisticated with templates, dynamic memory 
allocations, garbage collection. Some classes taking care about memory, etc. 


-- 
--
Linux User 152692     GPG: 05F4A7A949A2D9AA
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://xenomai.org/pipermail/xenomai/attachments/20151217/e69efd1b/attachment.sig>


More information about the Xenomai mailing list