Skip to contentSkip to conversation

Mercury build fixes

PATCH Superseded Yegor Yefremov 3 participants 12 messages Nov 18 – Nov 24

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Mercury build fixes

The Mercury core and its testsuite no longer build on next, as several includes are only pulled in indirectly with Cobalt. This series fixes that, based on next this time.

Tested by building next plus this series with Buildroot:
- Mercury, with and without the testsuite and the Alchemy, pSOS and VxWorks skins, for armv5 (uClibc), armv7 (glibc), aarch64 (glibc, GCC 6) and a static uClibc arm toolchain. The Mercury testsuite also needs Florian's 454ae865 ("testsuite/smokey/alchemytests: Fix build failure with core !cobalt") from wip/flo/refactor-includes, which I applied for testing.
- Cobalt with the testsuite and all skins for armv7 and aarch64, and for x86_64 with GCC 16 together with a 6.12 Dovetail kernel. With uClibc, Cobalt fails as before on __OPEN_NEEDS_MODE in rtdm.c and on the missing <sys/auxv.h> in parse_vdso.c, which this series doesn't touch.

Patches 1, 2 and 4 also apply to stable/v3.3.x, patch 3 only partly, as most of the affected bool users were added after v3.3.

Changes v1 -> v2:
- Rebased on next.
- Dropped the autotune, sched-tp and pSOS/VxWorks GCC 16 fixes, which are already in next (thanks Florian).
- Patch 1: include the headers only for the Mercury core (suggested by Florian).
- New patches 3 and 4: further missing includes found when building the Mercury testsuite.

Yegor Yefremov (4):
lib: Restore includes needed by the Mercury core testsuite/smokey/alchemytests: Add missing includes testsuite/smokey: Include stdbool.h where needed testsuite/gpiobench: Include stdarg.h

 lib/boilerplate/setup.c                      | 3 +++
 lib/copperplate/internal.c                   | 4 ++++
 testsuite/gpiobench/gpiobench.c              | 1 +
 testsuite/smokey/alchemytests/alchemytests.c | 1 +
 testsuite/smokey/alchemytests/event-1.c      | 1 +
 testsuite/smokey/alchemytests/mq-2.c         | 1 +
 testsuite/smokey/alchemytests/task-11.c      | 1 +
 testsuite/smokey/alchemytests/task-2.c       | 2 ++
 testsuite/smokey/psostests/task-2.c          | 1 +
 testsuite/smokey/vxworkstests/task-2.c       | 1 +
 10 files changed, 16 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/4 lib: Restore includes needed by the Mercury core

Commits 41de7cc7196f ("lib/boilerplate: Cleanup includes") and 7b7ddf4a3658 ("lib/copperplate: Cleanup includes") dropped headers that are still needed by the Mercury-only code paths. With the Cobalt core, that code is not built, but building the Mercury core fails:

setup.c: In function '__xenomai_init':
setup.c:606:23: error: implicit declaration of function 'mlockall' [-Wimplicit-function-declaration] setup.c:606:32: error: 'MCL_CURRENT' undeclared (first use in this function) setup.c:606:46: error: 'MCL_FUTURE' undeclared (first use in this function)

internal.c:108:24: error: '__NR_tkill' undeclared (first use in this function)

Include <sys/mman.h> and <sys/syscall.h> again, only for the Mercury core, after xeno_config.h has been pulled in.

Fixes 41de7cc7196f ("lib/boilerplate: Cleanup includes")
Fixes 7b7ddf4a3658 ("lib/copperplate: Cleanup includes")
Assisted-by Claude:claude-opus-5-5
---
 lib/boilerplate/setup.c    | 3 +++
 lib/copperplate/internal.c | 4 ++++
 2 files changed, 7 insertions(+)
lib/boilerplate/setup.c +3 -0
index 7bb24f6f4..e4ebfb54f 100644
@@ -30,6 +30,9 @@
 #include <assert.h>
 
 #include <xeno_config.h>
+#ifdef CONFIG_XENO_MERCURY
+#include <sys/mman.h>
+#endif
 #include <boilerplate/lock.h>
 #include <boilerplate/ancillaries.h>
 #include <xenomai/init.h>
lib/copperplate/internal.c +4 -0
index ed3f2e4fa..103af3a3c 100644
@@ -31,6 +31,10 @@
 #include <copperplate/threadobj.h>
 #include "internal.h"
 
+#ifdef CONFIG_XENO_MERCURY
+#include <sys/syscall.h>
+#endif
+
 static int thread_spawn_prologue(struct corethread_attributes *cta);
 
 static int thread_spawn_epilogue(struct corethread_attributes *cta);
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/4 testsuite/smokey/alchemytests: Add missing includes

In reply to Yegor Yefremov

With the Mercury core, the alchemy tests fail to build, as some declarations are only pulled in indirectly by the Cobalt headers:

alchemytests.c:43:17: error: implicit declaration of function 'fprintf' [-Wimplicit-function-declaration] alchemytests.c:43:25: error: 'stderr' undeclared (first use in this function) task-2.c:34:17: error: implicit declaration of function 'compiler_barrier' [-Wimplicit-function-declaration]

Include <stdio.h> and <boilerplate/atomic.h>.

Fixes 61fc9ff4b721 ("alchemytests: Set cpu-affinity by env var")
Fixes 10d898c40e26 ("alchemytests: Fix task-2")
Assisted-by Claude:claude-opus-5-5
---
 testsuite/smokey/alchemytests/alchemytests.c | 1 +
 testsuite/smokey/alchemytests/task-2.c       | 1 +
 2 files changed, 2 insertions(+)
testsuite/smokey/alchemytests/alchemytests.c +1 -0
index b596a1e17..bd01fe227 100644
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <smokey/smokey.h>
testsuite/smokey/alchemytests/task-2.c +1 -0
index d0180bfac..b2db20ab3 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
+#include <boilerplate/atomic.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/sem.h>
Signature · 1 line
2.34.1
#3 lore raw

PATCH v2 3/4 testsuite/smokey: Include stdbool.h where needed

In reply to Yegor Yefremov

Several Alchemy, pSOS and VxWorks tests use bool without including <stdbool.h>. With the Cobalt core, the header is pulled in indirectly, and GCC 15 and later default to C23 where bool is a keyword, but building the Mercury core with an older compiler fails:

event-1.c:14:8: error: unknown type name 'bool'
mq-2.c:10:8: error: unknown type name 'bool'
task-11.c:64:2: error: unknown type name 'bool'
task-2.c:17:8: error: unknown type name 'bool'

Include <stdbool.h> in the affected tests.

Fixes e7cfe856c498 ("testsuite: smokey - new testcase alchemy/task-11")
Fixes eef4a9cd9327 ("testsuite/smokey/alchemytests: Account for race condition inside QEMU")
Fixes 54e9c5098634 ("testsuite/smokey/alchemytests: Relax mq-2 test over VM")
Fixes 79df634b5b23 ("testsuite: smokey: Raise some delays in skin tests when running in VM")
Assisted-by Claude:claude-opus-5-5
---
 testsuite/smokey/alchemytests/event-1.c | 1 +
 testsuite/smokey/alchemytests/mq-2.c    | 1 +
 testsuite/smokey/alchemytests/task-11.c | 1 +
 testsuite/smokey/alchemytests/task-2.c  | 1 +
 testsuite/smokey/psostests/task-2.c     | 1 +
 testsuite/smokey/vxworkstests/task-2.c  | 1 +
 6 files changed, 6 insertions(+)
testsuite/smokey/alchemytests/event-1.c +1 -0
index d691192ec..9d13c4d7a 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 #include <alchemy/event.h>
testsuite/smokey/alchemytests/mq-2.c +1 -0
index 09b26b213..f3c3f9ce7 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <boilerplate/ancillaries.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
testsuite/smokey/alchemytests/task-11.c +1 -0
index 6d07e0270..cdf4cd476 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
 
testsuite/smokey/alchemytests/task-2.c +1 -0
index b2db20ab3..216a3cd87 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <boilerplate/atomic.h>
 #include <copperplate/traceobj.h>
 #include <alchemy/task.h>
testsuite/smokey/psostests/task-2.c +1 -0
index af0c0ff98..1b8f09f2f 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <copperplate/traceobj.h>
 #include <copperplate/threadobj.h>
 #include <psos/psos.h>
testsuite/smokey/vxworkstests/task-2.c +1 -0
index bf2613143..14f4dbac9 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <stdlib.h>
+#include <stdbool.h>
 #include <unistd.h>
 #include <copperplate/threadobj.h>
 #include <copperplate/traceobj.h>
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 4/4 testsuite/gpiobench: Include stdarg.h

In reply to Yegor Yefremov

gpiobench uses va_list, va_start() and va_end(), but stopped including <stdarg.h> indirectly when <xenomai/init.h> was dropped. With the Cobalt core, the header still comes in through other headers, but building the Mercury core fails:

gpiobench.c:268:9: error: unknown type name 'va_list'
gpiobench.c:283:9: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration]

Include <stdarg.h> directly.

Fixes 17defbb7bb64 ("testsuite: Cleanup of unused includes")
Assisted-by Claude:claude-opus-5-5
---
 testsuite/gpiobench/gpiobench.c | 1 +
 1 file changed, 1 insertion(+)
testsuite/gpiobench/gpiobench.c +1 -0
index f2cbb2549..44f04ff4d 100644
@@ -21,6 +21,7 @@
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include <stdarg.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
Signature · 1 line
2.34.1
#5 lore raw
In reply to Yegor Yefremov
Quoted 11 lines · Yegor Yefremov

The Mercury core and its testsuite no longer build on next, as several includes are only pulled in indirectly with Cobalt. This series fixes that, based on next this time.

Tested by building next plus this series with Buildroot:
- Mercury, with and without the testsuite and the Alchemy, pSOS and VxWorks skins, for armv5 (uClibc), armv7 (glibc), aarch64 (glibc, GCC 6) and a static uClibc arm toolchain. The Mercury testsuite also needs Florian's 454ae865 ("testsuite/smokey/alchemytests: Fix build failure with core !cobalt") from wip/flo/refactor-includes, which I applied for testing.

Feel free to integrate that patch into your series already.

Quoted 8 lines

- Cobalt with the testsuite and all skins for armv7 and aarch64, and for x86_64 with GCC 16 together with a 6.12 Dovetail kernel. With uClibc, Cobalt fails as before on __OPEN_NEEDS_MODE in rtdm.c and on the missing <sys/auxv.h> in parse_vdso.c, which this series doesn't touch.

Patches 1, 2 and 4 also apply to stable/v3.3.x, patch 3 only partly, as most of the affected bool users were added after v3.3.

Could you please share the exact build configuration (./configure arguments) and glibc version that you are using?

I want to learn if the missing includes are related to the glibc version or not. Should be easy to figure out. I want to make sure the ongoing refactoring doesn't introduce any regression.

Thanks!

Florian

#6 lore raw
Quoted 6 lines · Florian Bezdeka
Quoted 4 lines

The Mercury testsuite
also needs Florian's 454ae865 ("testsuite/smokey/alchemytests: Fix build failure with core !cobalt") from wip/flo/refactor-includes, which I applied for testing.

Feel free to integrate that patch into your series already.

OK, I'll include it in v3.

Quoted 6 lines

Could you please share the exact build configuration (./configure arguments) and glibc version that you are using?

I want to learn if the missing includes are related to the glibc version or not. Should be easy to figure out. I want to make sure the ongoing refactoring doesn't introduce any regression.

Buildroot runs (apart from the usual --host/--prefix/... options):

  ./configure --with-core=mercury --enable-smp --disable-registry \
      --enable-testsuite --includedir=/usr/include/xenomai/

and only "-O2 -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=1" in CFLAGS.

To answer the glibc question, I built next plus 454ae865 outside of Buildroot with these options, plain "-O2" and "make -k", so that all errors show up:

aarch64, glibc 2.24, GCC 6
armv7, glibc 2.44, GCC 16
armv5, uClibc-ng 1.0.59, GCC 15
x86_64 host, glibc 2.35, GCC 11

The missing includes are not related to the C library. Every toolchain fails on the same lines:

lib/boilerplate/setup.c: mlockall, MCL_CURRENT, MCL_FUTURE lib/copperplate/internal.c: __NR_tkill alchemytests.c: fprintf, stderr
alchemytests task-2.c: compiler_barrier gpiobench.c: va_start, va_end (with uClibc also va_list)

The only one that depends on the toolchain is bool. It is missing with GCC 6 and GCC 11 (in event-1.c, mq-2.c, task-11.c and task-2.c), but not with GCC 15 and 16, which default to C23, where bool is a keyword.

With the v2 series on top, the GCC 6 and GCC 11 builds complete without errors.

Regards,
Yegor

#7 lore raw
Quoted 14 lines · Yegor Yefremov
Quoted 6 lines · Florian Bezdeka
Quoted 4 lines

The Mercury testsuite
also needs Florian's 454ae865 ("testsuite/smokey/alchemytests: Fix build failure with core !cobalt") from wip/flo/refactor-includes, which I applied for testing.

Feel free to integrate that patch into your series already.

OK, I'll include it in v3.

Quoted 3 lines

Could you please share the exact build configuration (./configure arguments) and glibc version that you are using?

Quoted 8 lines
Quoted 3 lines

I want to learn if the missing includes are related to the glibc version or not. Should be easy to figure out. I want to make sure the ongoing refactoring doesn't introduce any regression.

Buildroot runs (apart from the usual --host/--prefix/... options):

  ./configure --with-core=mercury --enable-smp --disable-registry \
      --enable-testsuite --includedir=/usr/include/xenomai/

Thanks! Just wondering if mercury is really (still) used. At least from my perspective I/we did not care much about this in the recent past.

Quoted 11 lines

and only "-O2 -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=1" in CFLAGS.

To answer the glibc question, I built next plus 454ae865 outside of Buildroot with these options, plain "-O2" and "make -k", so that all errors show up:

aarch64, glibc 2.24, GCC 6
armv7, glibc 2.44, GCC 16
armv5, uClibc-ng 1.0.59, GCC 15
x86_64 host, glibc 2.35, GCC 11

Thanks for that matrix.

- All, especially armv5, uClibc-ng 1.0.59, GCC 15
What is the situation regarding time64_t in this scenario? Is that properly handled? (relevant mapping, libc macros, ...)

- All:
We mainly test and build for the current Debian releases, with default compiler/toolchain versions.

If you need more than that, we have to make sure that we build and test against those versions as well. At least some build tests should be added. Otherwise, we will most likely break it again.

Will you look into that?

I'm normally ahead of time and try to compile with recent gcc as soon as they are released. Older versions run out of scope at the moment.

Quoted 19 lines

The missing includes are not related to the C library. Every toolchain fails on the same lines:

lib/boilerplate/setup.c: mlockall, MCL_CURRENT, MCL_FUTURE lib/copperplate/internal.c: __NR_tkill alchemytests.c: fprintf, stderr
alchemytests task-2.c: compiler_barrier gpiobench.c: va_start, va_end (with uClibc also va_list)

The only one that depends on the toolchain is bool. It is missing with GCC 6 and GCC 11 (in event-1.c, mq-2.c, task-11.c and task-2.c), but not with GCC 15 and 16, which default to C23, where bool is a keyword.

With the v2 series on top, the GCC 6 and GCC 11 builds complete without errors.

Regards,
Yegor

#8 lore raw

Hi Florian,

Quoted 2 lines · Florian Bezdeka

Thanks! Just wondering if mercury is really (still) used. At least from my perspective I/we did not care much about this in the recent past.

Buildroot offers both cores, and Mercury is the only option on boards without a Dovetail kernel. The Buildroot autobuilders build it with random configurations, which is how these failures showed up.

Quoted 3 lines

- All, especially armv5, uClibc-ng 1.0.59, GCC 15
What is the situation regarding time64_t in this scenario? Is that properly handled? (relevant mapping, libc macros, ...)

uClibc-ng has no _TIME_BITS opt-in: with UCLIBC_USE_TIME64 (the default, enabled in Buildroot with kernel headers >= 5.1), time_t is always 64-bit on 32-bit targets. features.h then defines __USE_TIME_BITS64, but not __TIMESIZE. In the armv5 and armv7 uClibc-ng toolchains, sizeof(time_t) is 8 and sizeof(struct timespec) is 16.

For Mercury this is fine: nothing outside lib/cobalt depends on these macros, so it uses the 64-bit time_t of the C library. The only issue is that configure only recognizes glibc >= 2.34, so on 32-bit uClibc-ng it sets CONFIG_XENO_LIBS_TIME64=no and warns "You're affected by the time_t overflow in 2038", which is not true there.

Since you asked, I also built the Cobalt libraries from next for armv7 with uClibc-ng 1.0.59 (Bootlin armv7-eabihf uclibc stable-2026.08) and found two problems:

1. lib/cobalt/rtdm.c does not build: __OPEN_NEEDS_MODE() is a glibc specific macro from <fcntl.h> that uClibc-ng doesn't have. This has been there since 89f00a2e5 ("lib/cobalt: Wrap __open_2/__open64_2 to support _FORTIFY_SOURCE"), so Cobalt on uClibc-ng doesn't build since v3.1.1.

2. With a local fallback for that macro, libcobalt builds, but the vDSO lookup and struct timespec don't match. lib/cobalt/wrappers_time64.c checks only __USE_TIME_BITS64 and uses the 64-bit syscalls, which is right. lib/cobalt/arch/{arm,x86}/include/asm/xenomai/time.h checks "__USE_TIME_BITS64 && __TIMESIZE == 32", which is false without __TIMESIZE, so libcobalt resolves the 32-bit __vdso_clock_gettime (with glibc it resolves __vdso_clock_gettime64). cobalt_read_ns(), and therefore copperplate's clockobj, then passes a 16-byte struct timespec to a function that fills an 8-byte old_timespec32. I could not run it on Cobalt hardware, but calling a function with the same ABI that way under qemu-arm gives 8680820741732130394 ns instead of 1000500000000 ns.

I can send patches for both, e.g. falling back to __WORDSIZE == 32 when __TIMESIZE is not defined, and teaching the configure check about uClibc-ng's __UCLIBC_USE_TIME64__, if that's the direction you prefer.

Quoted 9 lines

- All:
We mainly test and build for the current Debian releases, with default compiler/toolchain versions.

If you need more than that, we have to make sure that we build and test against those versions as well. At least some build tests should be added. Otherwise, we will most likely break it again.

Will you look into that?

Yes. Buildroot's autobuilders build Xenomai with many toolchains (glibc, uClibc-ng, old and new GCC), so I'll report and fix breakages from there. I can also add a few build-only CI jobs, e.g. Mercury and Cobalt with a uClibc-ng toolchain and an older GCC, if you're fine with using Bootlin's prebuilt toolchains for that.

Regards,
Yegor

#9 lore raw

Hi Yegor,

Quoted 15 lines · Yegor Yefremov

Hi Florian,

Quoted 2 lines · Florian Bezdeka

Thanks! Just wondering if mercury is really (still) used. At least from my perspective I/we did not care much about this in the recent past.

Buildroot offers both cores, and Mercury is the only option on boards without a Dovetail kernel. The Buildroot autobuilders build it with random configurations, which is how these failures showed up.

Quoted 3 lines

- All, especially armv5, uClibc-ng 1.0.59, GCC 15
What is the situation regarding time64_t in this scenario? Is that properly handled? (relevant mapping, libc macros, ...)

Quoted 5 lines

uClibc-ng has no _TIME_BITS opt-in: with UCLIBC_USE_TIME64 (the default, enabled in Buildroot with kernel headers >= 5.1), time_t is always 64-bit on 32-bit targets. features.h then defines __USE_TIME_BITS64, but not __TIMESIZE. In the armv5 and armv7 uClibc-ng toolchains, sizeof(time_t) is 8 and sizeof(struct timespec) is 16.

Thanks for that information. That helps and explains why it "works".

Quoted 11 lines

For Mercury this is fine: nothing outside lib/cobalt depends on these macros, so it uses the 64-bit time_t of the C library. The only issue is that configure only recognizes glibc >= 2.34, so on 32-bit uClibc-ng it sets CONFIG_XENO_LIBS_TIME64=no and warns "You're affected by the time_t overflow in 2038", which is not true there.

Since you asked, I also built the Cobalt libraries from next for armv7 with uClibc-ng 1.0.59 (Bootlin armv7-eabihf uclibc stable-2026.08) and found two problems:

Quoted 5 lines

1. lib/cobalt/rtdm.c does not build: __OPEN_NEEDS_MODE() is a glibc specific macro from <fcntl.h> that uClibc-ng doesn't have. This has been there since 89f00a2e5 ("lib/cobalt: Wrap __open_2/__open64_2 to support _FORTIFY_SOURCE"), so Cobalt on uClibc-ng doesn't build since v3.1.1.

That's from 2020...

I guess the first thing to clarify is: Do we want to support that? Seems nobody is using it as it is broken for ~6 years already. I don't have an opinion on that yet.

Quoted 13 lines

2. With a local fallback for that macro, libcobalt builds, but the vDSO lookup and struct timespec don't match. lib/cobalt/wrappers_time64.c checks only __USE_TIME_BITS64 and uses the 64-bit syscalls, which is right. lib/cobalt/arch/{arm,x86}/include/asm/xenomai/time.h checks "__USE_TIME_BITS64 && __TIMESIZE == 32", which is false without __TIMESIZE, so libcobalt resolves the 32-bit __vdso_clock_gettime (with glibc it resolves __vdso_clock_gettime64). cobalt_read_ns(), and therefore copperplate's clockobj, then passes a 16-byte struct timespec to a function that fills an 8-byte old_timespec32. I could not run it on Cobalt hardware, but calling a function with the same ABI that way under qemu-arm gives 8680820741732130394 ns instead of 1000500000000 ns.

That one will need some more cycles here. Some input: The problem with glibc is, that it changed between versions when __USE_TIME_BITS64 is actually set. Older versions had it enabled only when compat (so time32) applications explicitly requested time64_t support. Meanwhile it is also set for architectures where the native time_t is 64 bit already.

Whenever we can re-use / share the time64_t services for the native case it's enough to check for __USE_TIME_BITS64. If not - e.g. because of a different ABI / memory layout we need to check for __TIMESIZE == 32 to identify the compat case.

For sure, that is still fixable, but needs some more thoughts (and testing) first.

Quoted 4 lines

I can send patches for both, e.g. falling back to __WORDSIZE == 32 when __TIMESIZE is not defined, and teaching the configure check about uClibc-ng's __UCLIBC_USE_TIME64__, if that's the direction you prefer.

Thanks for that offer, once again the question is: Does someone really need it...

Quoted 9 lines
Quoted 9 lines

- All:
We mainly test and build for the current Debian releases, with default compiler/toolchain versions.

If you need more than that, we have to make sure that we build and test against those versions as well. At least some build tests should be added. Otherwise, we will most likely break it again.

Quoted 7 lines
Quoted 1 line

Will you look into that?

Yes. Buildroot's autobuilders build Xenomai with many toolchains (glibc, uClibc-ng, old and new GCC), so I'll report and fix breakages from there. I can also add a few build-only CI jobs, e.g. Mercury and Cobalt with a uClibc-ng toolchain and an older GCC, if you're fine with using Bootlin's prebuilt toolchains for that.

That's good, but too late. We should know on "merge" or "before release" if something got broken. Not afterwards. Or is that infrastructure building regularly any next/development branches?

Best regards,
Florian

#10 lore raw

Hi Florian,

Quoted 3 lines · Florian Bezdeka

I guess the first thing to clarify is: Do we want to support that? Seems nobody is using it as it is broken for ~6 years already. I don't have an opinion on that yet.

Fair enough, that's for you and Jan to decide. I've asked on the Buildroot list who uses Xenomai there and with which core and C library, and will report back. If Cobalt on uClibc-ng is not supported, I'll make Cobalt depend on glibc in Buildroot, so users get a clear limitation instead of a build failure.

Quoted 4 lines

Whenever we can re-use / share the time64_t services for the native case it's enough to check for __USE_TIME_BITS64. If not - e.g. because of a different ABI / memory layout we need to check for __TIMESIZE == 32 to identify the compat case.

Thanks for the explanation. I won't send anything there unless you decide to support uClibc-ng.

Quoted 3 lines

That's good, but too late. We should know on "merge" or "before release" if something got broken. Not afterwards. Or is that infrastructure building regularly any next/development branches?

No, the Buildroot autobuilders only build the released version that Buildroot packages, so they find problems only after a release.

To catch them before merge, the place would be your GitLab CI. Right now it builds only Cobalt, with the Debian trixie GCC 14 cross compilers and the bullseye GCC 10 i386-userland job. Mercury isn't built at all, which is how the missing includes went unnoticed. I could add userland-only jobs next to i386-userland, e.g.:

- Mercury with the existing Debian arm/arm64 cross compilers
- Mercury with a 32-bit arm uClibc-ng toolchain from Bootlin's prebuilt toolchains

Each job would just run configure and make. Would that be acceptable?

For a broader check before a release, Buildroot's utils/test-pkg can build any Xenomai commit against Buildroot's set of prebuilt toolchains (glibc and uClibc-ng, various architectures and GCC versions; Buildroot doesn't offer Xenomai with musl). It only needs a Buildroot checkout and a config snippet:

  $ cat xenomai.config
  BR2_PACKAGE_XENOMAI=y
  BR2_PACKAGE_XENOMAI_CUSTOM_GIT=y
  BR2_PACKAGE_XENOMAI_REPOSITORY="https://gitlab.com/xenomai/xenomai3/xenomai.git"
  BR2_PACKAGE_XENOMAI_REPOSITORY_VERSION="<sha1 or tag>"
  BR2_PACKAGE_XENOMAI_MERCURY=y   # or BR2_PACKAGE_XENOMAI_COBALT=y
  $ ./utils/test-pkg -c xenomai.config -p xenomai      # default subset
  $ ./utils/test-pkg -c xenomai.config -p xenomai -a   # all toolchains

Toolchains the package doesn't support are skipped, and failed builds can be re-run after a fix. For example, current next (9fe2f61f3) with Mercury and the armv5 uClibc-ng toolchain fails in 2.5 minutes with the lib/boilerplate/setup.c mlockall()/MCL_CURRENT error that v3 of this series fixes. I'm happy to run this on a release candidate or on next before a release and report the results, if you ping me.

Regards,
Yegor

#11 lore raw
Quoted 8 lines · Yegor Yefremov

Hi Florian,

Quoted 3 lines · Florian Bezdeka

I guess the first thing to clarify is: Do we want to support that? Seems nobody is using it as it is broken for ~6 years already. I don't have an opinion on that yet.

Quoted 6 lines

Fair enough, that's for you and Jan to decide. I've asked on the Buildroot list who uses Xenomai there and with which core and C library, and will report back. If Cobalt on uClibc-ng is not supported, I'll make Cobalt depend on glibc in Buildroot, so users get a clear limitation instead of a build failure.

We should at least not actively make Xenomai glibc-only. Even if uClibc-ng is now broken because no one cared, we should at least keep musl as libc alternative in mind. But with AI conveniently checking now also for corner cases, even actively building them, it can be straightforward to also address them - just happened in
https://lore.kernel.org/xenomai/[email protected]/T/#u

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center