AlexEne / AlexEne/rust_hawktracer_sys

Issues cross-compiling from Linux to Windows

Abierto
#13 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
0
Forks
4
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I am cross-compiling from x86-64-unknown-linux-gnu to i686-pc-windows-gnu. Here are some issues I encountered:
- ```
/home/yalter/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_hawktracer_sys-0.4.2/hawktracer/lib/tcp_server.cpp:96:10: fatal error: WinSock2.h: No such file or directory
96 | #include
| ^~~~~~~~~~~~
```
```
/home/yalter/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_hawktracer_sys-0.4.2/hawktracer/lib/platform/windows/memory_usage.c:4:10: fatal error: Windows.h: No such file or directory
4 | #include
| ^~~~~~~~~~~
```
```
/home/yalter/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_hawktracer_sys-0.4.2/hawktracer/lib/platform/windows/memory_usage.c:5:10: fatal error: Psapi.h: No such file or directory
5 | #include
| ^~~~~~~~~
```
Fixed by making those includes all-lowercase.
- ```
cargo:rustc-link-search=all=/home/yalter/source/rs/bxt-rs/target/i686-pc-windows-gnu/debug/build/rust_hawktracer_sys-c9794263c9fe5873/out/build/lib/Debug
```
When using MinGW there's no additional `Debug`/`Release`/`RelWithDebInfo` folder in the end. Fixed by commenting out a line in `build.rs`.
- A lot of C++ linking errors. Fixed by copying the `println!("cargo:rustc-link-lib=dylib=stdc++");` line into the Windows branch as well. Although that made the built .dll require `libstdc++-6.dll` and a few other MinGW dlls; I couldn't change the line to say `static` because it couldn't find the static libstdc++ for some reason.

With those hack fixes in place, everything seemed to work fine.

I suspect these issues are specific to windows-gnu in general and not to just cross-compiling.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.