HomeFreeBSD

cross-build: Fix bmake bootstrap with glibc 2.34

Description

cross-build: Fix bmake bootstrap with glibc 2.34

As of glibc 2.34, our unistd.h wrapper's inclusion of stdlib.h exposes
fragility in glibc's sys/wait.h and corresponding part of stdlib.h,
leading to "error: use of undeclared identifier 'WNOHANG'" and similar
errors when bootstrapping bmake.

Work around this by wrapping sys/wait.h to force stdlib.h's inclusion
first before it's implicitly included during the problematic window in
sys/wait.h.

MFC after: 1 week

(cherry picked from commit 9e5b0d9eac5b240dc0ee280870291fd11d499046)

Details

Provenance
jrtc27Authored on Dec 15 2021, 5:52 AM
Parents
rGb65517ccd760: cross-build: Add __weak_symbol definition for libdwarf bootstrap
Branches
Unknown
Tags
Unknown