mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 08:01:26 +00:00
The netstack-lwip update generates its lwIP bindings at build time for the
exact target rather than shipping them checked in, so bindgen now parses
mingw's headers under `--target=x86_64-pc-windows-gnu`. That reaches
`stdlib.h`, and on mingw `stdlib.h` reaches `malloc.h`, which includes
`mm_malloc.h` -- a header the compiler is expected to supply rather than the
sysroot.
clang has one, in its resource directory, and the cross image carries four
copies of it. The libclang bindgen loads simply does not put that directory on
the include path for this target, so the build fails on a header that is
sitting right there:
/usr/x86_64-w64-mingw32/include/malloc.h:84:10:
fatal error: 'mm_malloc.h' file not found
`Cross.toml` links clang's copy into the sysroot clang is already searching --
it found `malloc.h` there -- which is enough, and the glob keeps an LLVM bump
in the image from breaking it again.
Only this target is affected: it is the only one whose headers reach
`mm_malloc.h`. The x86-64 and aarch64 musl targets were built clean to check.
Both `ci.yml` and `release.yml` run `cross` from the repository root, so
neither workflow needs a change.
20 lines
879 B
TOML
20 lines
879 B
TOML
[build.env]
|
|
passthrough = [
|
|
"CFG_COMMIT_HASH",
|
|
"CFG_COMMIT_DATE",
|
|
]
|
|
|
|
[target.x86_64-pc-windows-gnu]
|
|
image = "ghcr.io/cross-rs/x86_64-pc-windows-gnu:main"
|
|
# mingw's `malloc.h` includes `mm_malloc.h`, which is a header the compiler is
|
|
# expected to supply rather than the sysroot. clang has one, in its resource
|
|
# directory; the libclang that bindgen loads in this image does not put that
|
|
# directory on the include path for a `*-windows-gnu` target, so a build script
|
|
# that parses lwIP's headers -- netstack-lwip's does, for the exact target --
|
|
# fails on a header that is right there. Linking it into the sysroot clang is
|
|
# already searching is enough, and the glob keeps it from breaking the next
|
|
# time the image moves to a new LLVM.
|
|
pre-build = [
|
|
"ln -sf \"$(ls -d /usr/lib/clang/*/include | head -1)/mm_malloc.h\" /usr/x86_64-w64-mingw32/include/mm_malloc.h",
|
|
]
|