Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with cargo-xwin fails to link: lld-link: error: undefined symbol: __movsb #104

Open
s1341 opened this issue Oct 9, 2023 · 7 comments

Comments

@s1341
Copy link

s1341 commented Oct 9, 2023

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.

@namse
Copy link

namse commented Mar 27, 2024

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`

@s1341
Copy link
Author

s1341 commented Apr 2, 2024

I'm still getting an error, using clang/lld-link 17 and rustc 1.77.1

@namse
Copy link

namse commented Apr 2, 2024

Could you show me the command you tried? Are you sure the same command with my suggestion?

@s1341
Copy link
Author

s1341 commented Apr 3, 2024

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.

@namse
Copy link

namse commented Apr 8, 2024

If your project is open source, may I check it directly? or would you make a minimal reproducible example?

@s1341
Copy link
Author

s1341 commented May 12, 2024

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....

@s1341
Copy link
Author

s1341 commented May 15, 2024

It has been merged to main, so it should be easier to check now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants