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

Bootstrap configuration --host= option not enough on its own #33908

Closed
MagaTailor opened this issue May 27, 2016 · 7 comments
Closed

Bootstrap configuration --host= option not enough on its own #33908

MagaTailor opened this issue May 27, 2016 · 7 comments

Comments

@MagaTailor
Copy link

MagaTailor commented May 27, 2016

It was already brought to @alexcrichton's attention two months ago, and again yesterday, the --build flag was needed to set the LLVM runtime during cross-bootstrap, i.e. determine the actually desired host compiler.

For some reason he keeps repeating the same advice, so it's time to open an issue about it.

Lets's illustrate the problem on ARM, that is an arm-linux-gnueabihf host, which normally picks arm-unknown-linux-gnueabihf as the build configuration, trying to bootstrap the armv7 version:

Following @alexcrichton's suggestion:
./configure --host=armv7-unknown-linux-gnueabihf

we get the following:

CFG_BUILD            := arm-unknown-linux-gnueabihf
CFG_HOST             := arm-unknown-linux-gnueabihf armv7-etc
CFG_TARGET           := arm-unknown-linux-gnueabihf armv7-etc

that is, compiler runtime was picked up from the actual host detection, whereas the armv7 part is added as a second crate-set. To actually get the host compiler we want in a single switch, the following is necessary:
./configure --build=armv7-unknown-linux-gnueabihf

This doesn't look completely illogical (or it would have been noticed a long time ago) cause we have two separate build systems (rust and llvm), and unlike gcc, llvm can emit code for every supported architecture by default.

@alexcrichton
Copy link
Member

This is working as intended as our build system always has, the --host and --target options are additive, not replacing. That is, CFG_HOST is always a superset of CFG_BUILD, and CFG_TARGET is always a superset of CFG_HOST. It's not currently supported to have a CFG_HOST which does not include CFG_BUILD, do you intend for this bug report to suffice for that?

@MagaTailor
Copy link
Author

The problem is, during cross-bootstrap (this feature works great just for getting additional targets), contrary to the usual --host logic and common sense, after make install you get the build host's runtime, which is not what was bargained for. Or so everyone, who stumbled on it, says.

As I'd opined in the reddit thread I didn't have a problem with it, but maybe it should behave more intuitively indeed - your call.

@MagaTailor
Copy link
Author

MagaTailor commented May 27, 2016

I've just remembered an ARM issue about two sets of crates in the same tarball - don't tell me it was the same problem all that time!

@alexcrichton
Copy link
Member

I would personally actually be surprised if make install worked with a --host configuration, there's probably some bugs around that with installing the wrong thing most likely.

@MagaTailor
Copy link
Author

Presently to cross-bootstrap a single architecture compiler without fail, it's either necessary to set all three CFG's to the desired triple or use the shorthand --build=triple.

Should the case where just --host is provided, and it's different from the build host, be treated specially? (as everyone seems to expect)

@alexcrichton
Copy link
Member

I don't think it would really change anything because to build a stageN compiler for any target you need a stageN build compiler to build it.

@MagaTailor MagaTailor changed the title Bootstrap configuration --host= option broken? Bootstrap configuration --host= option not enough on its own Feb 8, 2017
@MagaTailor
Copy link
Author

Whatever.

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