Closed MasterAwesome closed 7 months ago
It looks like it uses the system stdlib.h
where it gets __extension__ typedef int size_t
and gets typedef long unsigned int size_t
from stddef.h from LLVM's toolchain include path.
Turns out this was because LLVM defaulted to using GCC host machine's headers which were specific to x86_64 in typesizes.h
.
I'm guessing there's a way to build LLVM with libc types so the correct headers are used. In the meanwhile using aarch64-none-gcc
which has its sysroot to not use system headers and generating an intermediate with -E
works as expected.
Side question: Does anyone know how to approach the problem when a library meant for bare metal use, uses stdlib.h
and the only available compiler for that target is clang and I had the capability to build clang from source?
BINDGEN_EXTRA_CLANG_ARGS
and sysrooting correctly works
BINDGEN_EXTRA_CLANG_ARGS
and sysrooting correctly works
I encountered the same problem, do you have any solution?Can you explain these in more detail?
I tried to generate bindings for:
By running
$ bindgen foo.h -- --target=aarch64-unknown-none
. This fails with:Although the interesting part is if
stddef.h
is used instead things work as expected.