> > I´ve built a library which includes Xenomai posix functions. > > If a "customer" wants to use this library (links the library to his > > project) he unfortunately has to define all the wrappers for the > > posix functions I used within the library. Is this a general > > limitation when using posix in a library or do I simply not know how > > to build a proper Xenomai-library. Is there a posibility to > avoid the > > wrapers so the user simply has to link the library and needn´t to > > define anyhing else (just -lxenolib) ? > > > > Thank you in advance for your help Roderik > > It is a limitation that comes from using ld --wrap option. > Unfortunately, we really have no other mean to achieve compliance with > the posix interface, especially since Xenomai posix library needs > symbols from the libc libpthread library. > > In a near future, it will be possible to directly call xenomai posix > library services without using the --wrap trick. Only, you > will have to > prefix them or postfix them. Actually, you can already do that by > calling directly __wrap_service instead of service.
I did so and called, within the library, every posix_rt-function with the prefix __wrap_ : e.g. __wrap_shm_open then I compiled my application, which does not use any Xenomai-function, and linked it with pthread_rt an rt (-lpthread_rt -lrt) and my new Xenomai-library (linking without any wrapping defined). Linking and compiling did not produce any error. But, when I call a function in my library, which in turn calls __wrap_shm_open, then shm_open fails. When I link my application with wrapping (as provided by the XENO_CONFIG-script) then everything is fine. Do you have an explanation for this behavior or even better a solution ? > > Another way to solve your issue is to ship your library with a shell > script much like xeno-config which generates the correct > flags. You can > probably do what we have not done for xenomai: use the pkg-config > package. This approach is used for many libraries nowadays. > Achtung: Neue E-Mail-Adresse! Attention: New e-mail-address! [EMAIL PROTECTED] -------------------------------------------------------- manroland AG Vorsitzender des Aufsichtsrates: Hanno C. Fiedler Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall, Paul Steidle Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht Offenbach HRB-Nr. 42592 USt-Ident-Nr. DE 250200933 _______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
