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

Cross compiling from Linux to Win fails with mingw on Ubuntu #165

Open
ohsayan opened this issue Nov 19, 2020 · 1 comment
Open

Cross compiling from Linux to Win fails with mingw on Ubuntu #165

ohsayan opened this issue Nov 19, 2020 · 1 comment

Comments

@ohsayan
Copy link

ohsayan commented Nov 19, 2020

Our project currently relies on jemalloc for all targets except msvc ones; recently I tried cross compiling from Linux to windows via mingw64 on Ubuntu. However, the build cargo build --target x86_64-pc-windows-gnu failed with:

 error: could not find native static library `jemalloc`, perhaps an -L flag is missing?

error: aborting due to previous error

error: could not compile `jemalloc-sys`.

Caused by:
  process didn't exit successfully: `rustc --crate-name jemalloc_sys /home/sayan/.cargo/registry/src/github.com-1ecc6299db9ec823/jemalloc-sys-0.3.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="background_threads_runtime_support"' -C metadata=592eff35d4f0dba5 -C extra-filename=-592eff35d4f0dba5 --out-dir /home/sayan/terrabasedb/target/x86_64-pc-windows-gnu/debug/deps --target x86_64-pc-windows-gnu -L dependency=/home/sayan/terrabasedb/target/x86_64-pc-windows-gnu/debug/deps -L dependency=/home/sayan/terrabasedb/target/debug/deps --extern libc=/home/sayan/terrabasedb/target/x86_64-pc-windows-gnu/debug/deps/liblibc-f8c318a8f004413f.rmeta --cap-lints allow -L native=/home/sayan/terrabasedb/target/x86_64-pc-windows-gnu/debug/build/jemalloc-sys-6b79eb43e4607fb4/out/build/lib --cfg prefixed -l static=jemalloc` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed

I'm on rust 1.47 (stable channel)

@Fuwn
Copy link

Fuwn commented May 20, 2021

Came across this issue as well, same circumstances. #153 also seems to have the exact same issue but unfortunately, their solution did not work for me, it might work for you though!

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