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

Allow per-target JEMALLOC_OVERRIDE env #90

Closed
Torrekie opened this issue Jun 14, 2024 · 5 comments · Fixed by #91
Closed

Allow per-target JEMALLOC_OVERRIDE env #90

Torrekie opened this issue Jun 14, 2024 · 5 comments · Fixed by #91

Comments

@Torrekie
Copy link

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

@BusyJay
Copy link
Member

BusyJay commented Jun 14, 2024

Can you explain more on what "failures" you met?

@Torrekie
Copy link
Author

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

@BusyJay
Copy link
Member

BusyJay commented Jun 17, 2024

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?

@Torrekie
Copy link
Author

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

@BusyJay
Copy link
Member

BusyJay commented Jun 17, 2024

I see. Would you like to send a PR?

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

Successfully merging a pull request may close this issue.

2 participants