All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leopold Palomo-Avellaneda <leo@alaxarxa.net>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai list <xenomai@xenomai.org>
Subject: Re: [Xenomai] Porting a library to Xenomai
Date: Thu, 17 Dec 2015 10:00:17 +0100	[thread overview]
Message-ID: <5183191.iz6aZqeNVV@soho> (raw)
In-Reply-To: <20151217000518.GC25151@hermes.click-hack.org>

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>

  reply	other threads:[~2015-12-17  9:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 12:44 [Xenomai] Porting a library to Xenomai Leopold Palomo-Avellaneda
2015-12-11 13:20 ` Gilles Chanteperdrix
2015-12-11 14:03   ` Leopold Palomo-Avellaneda
2015-12-11 14:09     ` Gilles Chanteperdrix
2015-12-11 15:33       ` Leopold Palomo-Avellaneda
2015-12-11 16:31         ` Gilles Chanteperdrix
2015-12-15 15:16           ` Leopold Palomo-Avellaneda
2015-12-15 15:46             ` Gilles Chanteperdrix
2015-12-16 15:45               ` Leopold Palomo-Avellaneda
2015-12-17  0:05                 ` Gilles Chanteperdrix
2015-12-17  9:00                   ` Leopold Palomo-Avellaneda [this message]
2015-12-17  9:25                     ` Gilles Chanteperdrix

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=5183191.iz6aZqeNVV@soho \
    --to=leo@alaxarxa.net \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.