From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Xenomai <xenomai@lists.linux.dev>
Subject: Re: [RFC] symbol wrapping for libcobalt
Date: Tue, 24 Nov 2026 16:56:13 +0100 [thread overview]
Message-ID: <87ecca2pgi.fsf@xenomai.org> (raw)
In-Reply-To: <ccfe86ea-2afd-4047-bc65-4dd1a35820fc@siemens.com> (Jan Kiszka's message of "Tue, 24 Nov 2026 13:30:05 +0100")
Jan Kiszka <jan.kiszka@siemens.com> writes:
> On 23.11.26 21:33, Philippe Gerum wrote:
>> We could use C11 thrd_create() the same way to create workers and get
>> into the exact same pitfalls without involving libstdc++ at all.
>>
>
> To be fair, using language provided threading and locking is generally
> are recipe for desaster on PREEMPT-RT as well because most are non-RT only.
>
Agreed. Also known as "The Fine Print" of the "Real-time Everywhere, Go
Wild, We Care!" promise.
>> - a way to somehow mark the object files that did include the libcobalt
>> headers, so that linking them without -Wl,--wrap fails.
>>
>
> Already some idea for how this could be implemented?
>
Some, still at the early stage though. I've been experimenting with them
lately. Not far away from a solution, but there is still some work ahead
to keep it simple. I'll follow-up on this.
>> - conversely, a way to mark the object files that did _not_ include the
>> libcobalt headers but the regular glibc ones, so that linking them
>> _with_ -Wl,--wrap fails when the wrap list contains inconsistently
>> used symbols.
>
> Well, the absence of the marker above must be enough in order to detect
> pre-built standard libs.
>
I don't think so. We need a way to actually claim that we don't want the
wrapping step to happen on a set of objects we manage, while excluding
libraries which plays no part in the Xenomai system from the
check. Otherwise, we would reject libgcc.a, crt.o, plus any unrelated
3rd-party library on the ground that they don't claim anything. IOW,
having no marker does not mean that we claim that we should not have
one, it just means that we don't care (in most cases because we don't
even know about Xenomai in the first place). So these are two separate
issues. Tricky.
>>
>> This metadata could be used by a checker tool that would answer the
>> following question: "where the heck each call to libcobalt services
>> actually goes for this executable"? It could also be used to generate
>> the wrap list on the fly for symbols which carry the 'wrapped' marker
>> by inspecting the object list.
>>
>> Icing on the cake, it should even be possible to use this information to
>> implement auto-annotation of source code by reading a wrapped binary,
>> i.e. patching in the __COBALT() annotations mechanically, for those who
>> want an easy way to depart from symbol wrapping for an existing
>> application.
>>
>> Thoughts welcome.
>>
>
> Having wrapping as an opt-in layer on top of an explicit
> POSIX-compatible API sounds fair to me. Then only users who need the
> wrapping for a good reason can select that separately. Technically,
> users could already do that with Xenomai 3 today, but it is not
> presented that way, thus likely only few will do it.
>
True, as wrapping even appears to be recommended since it is used
throughout the examples, tests and so on in our code base. Opt-in is
clearly the proper way.
--
Philippe.
prev parent reply other threads:[~2026-11-24 15:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 20:33 [RFC] symbol wrapping for libcobalt Philippe Gerum
2026-11-24 7:58 ` Julien Blanc
2026-11-24 11:12 ` Philippe Gerum
2026-11-24 12:30 ` Jan Kiszka
2026-11-24 15:56 ` Philippe Gerum [this message]
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=87ecca2pgi.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=jan.kiszka@siemens.com \
--cc=xenomai@lists.linux.dev \
/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.