[Xenomai] Question about the implementation of tunables.

Philippe Gerum rpm at xenomai.org
Tue Dec 6 13:06:02 CET 2016

On 12/05/2016 05:36 PM, Ronny Meeus wrote:
> Hello
> we use the pSOS skin over the Mercury core.
> I'm preparing a set of patches that introduce new tunables.
> What I observe is that in a small test applications it works well but once I
> start to use these in our real applications, I observe that the tunables are
> not called.
> I have identified that the root-cause of this is that we postpone the calling
> of the static constructors to a certain point in the application init and call
> __do_global_ctors_aux ourselves.
> (to make this work our build enviroment uses the -nostartfiles linker option
> and some other constructs ...)
> Now the question is: are there any option to make this work or have other
> people seen similar issues before?
> So we should be able to call the static constructors of the tunables only
> before we call copperplate_init ...

It's not a matter of building a small or large application, it is a
matter of disabling the normal runtime init code by passing the
-nostartfiles option to the linker, which could affect a so-called small
test program the same way.

I don't see any reasonable way to fix the issue with your app: like any
regular user-space code may do, the Xenomai libs depends on the regular
C runtime startup code to execute prior to entering main(). Since you
manually handle the pre-main() init code yourself it seems, you need to
add the libcopperplate and libpsos .init sections to the list of duties
your own early runtime code carries out.


More information about the Xenomai mailing list