AlexEne / AlexEne/rust_hawktracer_sys

Issues cross-compiling from Linux to Windows

Ouverte
#13 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
0
Forks
4
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.