Building with `cargo-xwin` fails to link: `lld-link: error: undefined symbol: __movsb`
s1341 opened this issue · comments
When trying to build for windows on a linux host, mimalloc fails to link with the following error:
= note: lld-link: error: undefined symbol: __movsb
>>> referenced by /src/mimalloc_rust/libmimalloc-sys/c_src/mimalloc/include/mimalloc/internal.h:926
>>> liblibmimalloc_sys-087f9fdc909808e0.rlib(static.o):(_mi_memcpy)
I'm using cargo-xwin to cross compile.
I could successfully build with below command in ubuntu for msvc,
rustup component add llvm-tools-preview
rustup target add x86_64-pc-windows-msvc
rustup update
cargo xwin check --target x86_64-pc-windows-msvc --xwin-arch x86_64 --xwin-version 17 --tests
// you can run `build` instead of `check`
I'm still getting an error, using clang/lld-link 17 and rustc 1.77.1
Could you show me the command you tried? Are you sure the same command with my suggestion?
Here is my command:
cargo xwin build --target x86_64-pc-windows-msvc --release --xwin-version 17 --xwin-arch x86_64
Note that I am building a project which relies on mimalloc, not mimalloc directly.
If your project is open source, may I check it directly? or would you make a minimal reproducible example?
AFLplusplus/LibAFL#1607 build fuzzers/frida_gdiplus
with cargo xwin. Make sure to switch from dlmalloc to mimalloc in fuzzers/frida_gdiplus/src/lib.rs
....
It has been merged to main, so it should be easier to check now.