-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
custom_build: add HOST env var #1008
Conversation
Perhaps instead of BUILD_KIND a HOST environment variable could be exported? We would define HOST as the host triple of the rust compiler that we're using. |
I suppose so. I'll end up extracting the same info from that by just doing Are you thinking that it might be useful for some build scripts to examine the host? |
I'd also like to note that testing this plus the cooperating gcc-rs patch seems to result in target rlibs containing host objects (causing the final link to fail). [Strictly, this is better than what happens without these changes, which is build failure in the first user of gcc-rs] I'm looking at the cargo code to figure out why this is happening, any ideas? |
ccbbb14
to
41de291
Compare
I've updated to supply a HOST environment variable. As an aside: supplying HOST rather than BUILD_KIND also makes bootstrapping a version of cargo with this merged easier, as one can manually set HOST and have it be correct for an entire cargo invocation. |
I was just thinking that it's more in line with I'm not quite sure what's going on with gcc-rs, could you elaborate a little more on that? |
This is just to support some nice environment aliases in gcc-rs at the moment.
On the issue with cross-compilation and gcc-rs: Heres a log Relevant error should be selected, but I'll include it here for clarity:
That rlib actually contains a mix of TARGET (elf32 arm) and HOST (elf64 amd64) object files. Here's a It appears that somehow the HOST output of the time crate's build.rs is getting mixed with the TARGET output of the time crate's rust code, which then fails to link. |
That is... surprising! I'd have to take some more time to investigate though. |
This is just to support some nice environment aliases in gcc-rs at the moment.