Skip to content

fix: process/v2/exit_code: guard static_asserts on MIPS - #565

Open
WXbet wants to merge 1 commit into
boostorg:developfrom
WXbet:guard-mips-static-asserts
Open

fix: process/v2/exit_code: guard static_asserts on MIPS#565
WXbet wants to merge 1 commit into
boostorg:developfrom
WXbet:guard-mips-static-asserts

Conversation

@WXbet

@WXbet WXbet commented Aug 1, 2026

Copy link
Copy Markdown

glibc 2.44 added sysdeps/unix/sysv/linux/mips/bits/waitstatus.h (commit c19cdbf66ff62a4578ac2117d43ebb306ae36aeb) which defines WIFSTOPPED and WIFSIGNALED as static inline int functions rather than macros so that MIPS's SIGRTMAX=127 special-case (status 0x7f) can be handled. Since those inline functions are not constexpr, the four static_assert lines guarding still_active fail to compile on MIPS with

error: non-constant condition for static assertion
error: call to non-'constexpr' function 'int __WIFSTOPPED(int)'

whenever env.cpp (or any other TU pulling exit_code.hpp) is compiled.

Earlier glibc versions used the generic macro-based header on MIPS too and Boost.Process compiled fine there. musl has taken the same approach for MIPS since 2018 (musl commit 41c632824c...); this is the same class of problem previously reported for is_running.hpp / musl in issue #48, which was fixed by the v1 rewrite but resurfaced in v2's exit_code.hpp.

The asserts are compile-time sanity checks on Boost's own still_active constant (0x17f); the semantics on MIPS are unchanged (WIFSTOPPED returns true, the other three return false, as intended). Guard the block with #ifndef __mips__ so the checks keep firing on every port where they can, and are skipped only on the one arch where glibc implements the underlying primitives as inline functions.

glibc 2.44 added sysdeps/unix/sysv/linux/mips/bits/waitstatus.h
(commit c19cdbf66ff62a4578ac2117d43ebb306ae36aeb) which defines
WIFSTOPPED and WIFSIGNALED as `static inline int` functions rather
than macros so that MIPS's SIGRTMAX=127 special-case (status 0x7f)
can be handled. Since those inline functions are not constexpr, the
four static_assert lines guarding still_active fail to compile on
MIPS with

  error: non-constant condition for static assertion
  error: call to non-'constexpr' function 'int __WIFSTOPPED(int)'

whenever env.cpp (or any other TU pulling exit_code.hpp) is compiled.

Earlier glibc versions used the generic macro-based header on MIPS
too and Boost.Process compiled fine there. musl has taken the same
approach for MIPS since 2018 (musl commit 41c632824c...); this is the
same class of problem previously reported for is_running.hpp / musl
in issue boostorg#48, which was fixed by the v1 rewrite but resurfaced in
v2's exit_code.hpp.

The asserts are compile-time sanity checks on Boost's own still_active
constant (0x17f); the semantics on MIPS are unchanged (WIFSTOPPED
returns true, the other three return false, as intended). Guard the
block with `#ifndef __mips__` so the checks keep firing on every port
where they can, and are skipped only on the one arch where glibc
implements the underlying primitives as inline functions.
nickersk pushed a commit to nickersk/oe-alliance-core that referenced this pull request Aug 1, 2026
…s on MIPS

Two mips-specific bandaids on top of the openembedded-core
boost 1.91.0 recipe, both scoped to the mipsarch override:

1. BJAM_OPTS abi=o32 architecture=mips.
   Boost.Build's default_abi in boost-context-features.jam derives
   the ABI from os.platform (the build host, x86_64) and falls back
   to sysv, so on a mipsel cross-build b2 fails with

     No best alternative for libs/context/build/asm_sources
       with <architecture>mips <address-model>32 <abi>sysv ...

   OE-core already carries the analogous override for arm/aarch64 in
   boost.inc; extend the same idea to mips. Upstream fix:
   boostorg/context#334 (merged into develop 2026-07-23, will ship
   with boost 1.92.0). Drop this hunk once oe-core bumps to boost 1.92.

2. Source patch: guard four static_asserts in
   boost/process/v2/exit_code.hpp with #ifndef __mips__.

   Root cause: glibc 2.44 added
   sysdeps/unix/sysv/linux/mips/bits/waitstatus.h (commit
   c19cdbf66ff62a4578ac2117d43ebb306ae36aeb) which defines WIFSTOPPED
   and WIFSIGNALED as `static inline int` functions rather than
   macros, so that MIPS's SIGRTMAX=127 special-case (status 0x7f) can
   be handled. Earlier glibc used the generic macro-based header on
   MIPS as well and boost.process compiled fine there. Since the new
   inline functions are not constexpr, the static_asserts break.

   Strictly a (glibc >= 2.44) + MIPS combination. Upstream PR:
   boostorg/process#565
nickersk pushed a commit to nickersk/oe-alliance-core that referenced this pull request Aug 1, 2026
…s on MIPS

Two mips-specific bandaids on top of the openembedded-core
boost 1.91.0 recipe, both scoped to the mipsarch override:

1. BJAM_OPTS abi=o32 architecture=mips.
   Boost.Build's default_abi in boost-context-features.jam derives
   the ABI from os.platform (the build host, x86_64) and falls back
   to sysv, so on a mipsel cross-build b2 fails with

     No best alternative for libs/context/build/asm_sources
       with <architecture>mips <address-model>32 <abi>sysv ...

   OE-core already carries the analogous override for arm/aarch64 in
   boost.inc; extend the same idea to mips. Upstream fix:
   boostorg/context#334 (merged into develop 2026-07-23, will ship
   with boost 1.92.0). Drop this hunk once oe-core bumps to boost 1.92.

2. Source patch: guard four static_asserts in
   boost/process/v2/exit_code.hpp with #ifndef __mips__.

   Root cause: glibc 2.44 added
   sysdeps/unix/sysv/linux/mips/bits/waitstatus.h (commit
   c19cdbf66ff62a4578ac2117d43ebb306ae36aeb) which defines WIFSTOPPED
   and WIFSIGNALED as `static inline int` functions rather than
   macros, so that MIPS's SIGRTMAX=127 special-case (status 0x7f) can
   be handled. Earlier glibc used the generic macro-based header on
   MIPS as well and boost.process compiled fine there. Since the new
   inline functions are not constexpr, the static_asserts break.

   Strictly a (glibc >= 2.44) + MIPS combination. Upstream PR:
   boostorg/process#565
nickersk pushed a commit to nickersk/oe-alliance-core that referenced this pull request Aug 1, 2026
Two mips-specific bandaids on top of the openembedded-core
boost 1.91.0 recipe, both scoped to the mipsarch override:

1. BJAM_OPTS abi=o32 architecture=mips.
   Boost.Build's default_abi in boost-context-features.jam derives
   the ABI from os.platform (the build host, x86_64) and falls back
   to sysv, so on a mipsel cross-build b2 fails with

     No best alternative for libs/context/build/asm_sources
       with <architecture>mips <address-model>32 <abi>sysv ...

   OE-core already carries the analogous override for arm/aarch64 in
   boost.inc; extend the same idea to mips. Upstream fix:
   boostorg/context#334 (merged into develop 2026-07-23, will ship
   with boost 1.92.0). Drop this hunk once oe-core bumps to boost 1.92.

2. Source patch: guard four static_asserts in
   boost/process/v2/exit_code.hpp with #ifndef __mips__.

   Root cause: glibc 2.44 added
   sysdeps/unix/sysv/linux/mips/bits/waitstatus.h (commit
   c19cdbf66ff62a4578ac2117d43ebb306ae36aeb) which defines WIFSTOPPED
   and WIFSIGNALED as `static inline int` functions rather than
   macros, so that MIPS's SIGRTMAX=127 special-case (status 0x7f) can
   be handled. Earlier glibc used the generic macro-based header on
   MIPS as well and boost.process compiled fine there. Since the new
   inline functions are not constexpr, the static_asserts break.

   Strictly a (glibc >= 2.44) + MIPS combination. Upstream PR:
   boostorg/process#565
nickersk pushed a commit to nickersk/oe-alliance-core that referenced this pull request Aug 1, 2026
…s on MIPS

Two mips-specific bandaids on top of the openembedded-core
boost 1.91.0 recipe, both scoped to the mipsarch override:

1. BJAM_OPTS abi=o32 architecture=mips.
   Boost.Build's default_abi in boost-context-features.jam derives
   the ABI from os.platform (the build host, x86_64) and falls back
   to sysv, so on a mipsel cross-build b2 fails with

     No best alternative for libs/context/build/asm_sources
       with <architecture>mips <address-model>32 <abi>sysv ...

   OE-core already carries the analogous override for arm/aarch64 in
   boost.inc; extend the same idea to mips. Upstream fix:
   boostorg/context#334 (merged into develop 2026-07-23, will ship
   with boost 1.92.0). Drop this hunk once oe-core bumps to boost 1.92.

2. Source patch: guard four static_asserts in
   boost/process/v2/exit_code.hpp with #ifndef __mips__.

   Root cause: glibc 2.44 added
   sysdeps/unix/sysv/linux/mips/bits/waitstatus.h (commit
   c19cdbf66ff62a4578ac2117d43ebb306ae36aeb) which defines WIFSTOPPED
   and WIFSIGNALED as `static inline int` functions rather than
   macros, so that MIPS's SIGRTMAX=127 special-case (status 0x7f) can
   be handled. Earlier glibc used the generic macro-based header on
   MIPS as well and boost.process compiled fine there. Since the new
   inline functions are not constexpr, the static_asserts break.

   Strictly a (glibc >= 2.44) + MIPS combination. Upstream PR:
   boostorg/process#565
WXbet added a commit to oe-alliance/oe-alliance-core that referenced this pull request Aug 1, 2026
…s on MIPS

Two mips-specific bandaids on top of the openembedded-core
boost 1.91.0 recipe, both scoped to the mipsarch override:

1. BJAM_OPTS abi=o32 architecture=mips.
   Boost.Build's default_abi in boost-context-features.jam derives
   the ABI from os.platform (the build host, x86_64) and falls back
   to sysv, so on a mipsel cross-build b2 fails with

     No best alternative for libs/context/build/asm_sources
       with <architecture>mips <address-model>32 <abi>sysv ...

   OE-core already carries the analogous override for arm/aarch64 in
   boost.inc; extend the same idea to mips. Upstream fix:
   boostorg/context#334 (merged into develop 2026-07-23, will ship
   with boost 1.92.0). Drop this hunk once oe-core bumps to boost 1.92.

2. Source patch: guard four static_asserts in
   boost/process/v2/exit_code.hpp with #ifndef __mips__.

   Root cause: glibc 2.44 added
   sysdeps/unix/sysv/linux/mips/bits/waitstatus.h (commit
   c19cdbf66ff62a4578ac2117d43ebb306ae36aeb) which defines WIFSTOPPED
   and WIFSIGNALED as `static inline int` functions rather than
   macros, so that MIPS's SIGRTMAX=127 special-case (status 0x7f) can
   be handled. Earlier glibc used the generic macro-based header on
   MIPS as well and boost.process compiled fine there. Since the new
   inline functions are not constexpr, the static_asserts break.

   Strictly a (glibc >= 2.44) + MIPS combination. Upstream PR:
   boostorg/process#565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant