On Fri, 28 Jun 2024 22:12, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote:
I've been able to build rust device on windows, with a few tweaks
needed.
- specificy the target for libclang (used by bindgen), which targets
MSVC by default (so different set of headers)
- additional headers (libclang searches its own header with a relative
path instead of absolute)
- additional windows libs that must be linked in final executable
However, even tough I can build the executable, I get this error:
$ ./build/qemu-system-aarch64 -M virt
C:\w\qemu\build\qemu-system-aarch64.exe: unknown type 'x-pl011-rust'
Any idea of what could be missing here?
Sounds like either the rust lib is not linked to the final binary (which
you can confirm if you look at the included symbols and don't see
anything with rust origin) or the constructor decorated with
#[cfg_attr(target_os = "windows", link_section = ".CRT$XCU"] is not
linked properly (you can add a puts() and see if it's invoked or add a
breakpoint in gdb)