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

Description of cross build process #287

Open
deliciouslytyped opened this issue Apr 12, 2020 · 4 comments
Open

Description of cross build process #287

deliciouslytyped opened this issue Apr 12, 2020 · 4 comments

Comments

@deliciouslytyped
Copy link

Is there a description somewhere, in the rust docs, rfc, something..? that explains what exactly is necessary to do a cross build, or do I have to reverse engineer sysroot.rs?

@RalfJung
Copy link
Collaborator

There are a couple of examples in the README, or is that not what you are looking for?

@deliciouslytyped
Copy link
Author

deliciouslytyped commented Apr 12, 2020

Sorry, I'm all over the place right now, I meant the low level operations that would be needed to replicate what xargo does.

I.e. what libraries need to be built to get the minimum functionality to compile rust binaries, how they interrelate, stuff like that.

Everyone says libcore has no dependencies but nothing actually seems to be as simple as "just build libcore".
The other half of things is "just use xargo".

@RalfJung
Copy link
Collaborator

Oh. For that, no I don't think this is written down anywhere for xargo. But mostly it is preparing an appropriate cargo project and then it lets cargo do the heavy lifting. You can set XARGO_KEEP_TEMP=1 to make xargo not clean up after itself, then you can find the cargo project it creates in your OS temp dir (/tmp on Linux). After that, xargo just copies target/.../.../deps into the sysroot folder.

Moreover, nightly cargo can also build libcore and friends using -Zbuild-std, so you might have some luck by reading the information at https://github.com/rust-lang/wg-cargo-std-aware.

@deliciouslytyped
Copy link
Author

Yeah thanks, I found te environment variable by accident when peeking at sysroot.rs. :D
That's definitely helpful.

Thanks for mentioning build-std, I'll take a look!

If I saw correctly, most of the logic in sysroot is indeed the toml generation, so then the knowledge necessary to come up with that toml.

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