tikv / jemallocator

Rust allocator using jemalloc as a backend
Other
347 stars 58 forks source link

fix compile for win gnu target #18

Closed gaoxinge closed 2 years ago

gaoxinge commented 2 years ago

problem

Directly build on win gnu target will raise error:

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

reason

  1. the code below will search libjemalloc.a in $build_dir/lib:

https://github.com/tikv/jemallocator/blob/52de4257fab3e770f73d5174c12a095b49572fba/jemalloc-sys/build.rs#L306

  1. however win gnu will generate jemalloc.lib in $build_dir/lib

So they are mismatching.

fix

I update the jemalloc-sys/build.rs to generate libjemalloc.a in $build_dir/lib, base on the issue.