Open Torrekie opened 2 weeks ago
Can you explain more on what "failures" you met?
this can failure when cross compiling a binary incompatible scene like from Darwin to Linux while they uses completely different executable formats. As there is only one JEMALLOC_OVERRIDE can be defined, the linker will eventually complains about unsupported binary format
I don't get it. You should cross compile for one target at a time, right? So why not just specify the correct JEMALLOC_OVERRIDE
for each compile?
rustc itself is using jemalllc-sys, while it compiles build and host toolchain at same time when host
specified in config.toml, defining env per target is necessary because it was not able to compile host toolchain without compiling a build toolchain (even with rust compilers specified). I think that's why openssl-sys supported per target env, since it was also vendored by official rustc source
I see. Would you like to send a PR?
While cross-compiling, setting
JEMALLOC_OVERRIDE
could cause failures due to incompatibilities between build and host platforms.A better solution would be something like openssl-sys/build/find_normal.rs#L14 which has implementation at openssl-sys/build/main.rs#L41, which allows env definitions as a form of
<TARGET_TRIPLE>_ENV
(e.g.AARCH64_APPLE_DARWIN_MYENV