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

This toolchain type definition is incorrect in my opinion #2089

Open
trcrsired opened this issue Jan 21, 2024 · 1 comment
Open

This toolchain type definition is incorrect in my opinion #2089

trcrsired opened this issue Jan 21, 2024 · 1 comment

Comments

@trcrsired
Copy link

trcrsired commented Jan 21, 2024

build == host == target (“native”)

This is a plain native toolchain, targeting the exact same machine as the one it is built on, and running again on this exact same machine. You have to build such a toolchain when you want to use an updated component, such as a newer gcc for example.

build == host != target (“cross”)

This is a classic cross-toolchain, which is expected to be run on the same machine it is compiled on, and generate code to run on a second machine, the target.

build != host == target (“cross-native”)

Such a toolchain is also a native toolchain, as it targets the same machine as it runs on. But it is build on another machine. You want such a toolchain when porting to a new architecture, or if the build machine is much faster than the host machine.

build != host != target (“canadian”)

This one is called a “Canadian Cross”¹ toolchain, and is tricky. The three machines in play are different. You might want such a toolchain if you have a fast build machine, but the users will use it on another machine, and will produce code to run on a third machine.

The term Canadian Cross was coined because at the time that these issues were all being hashed out, Canada had three national political parties [(per Wikipedia)](http://en.wikipedia.org/wiki/Cross_compiler#Canadian_Cross).

what if it is build == target !=host for example?

Today, people talk about canadian, they literally mean the compiler does not run on the same platform as the build. Usually they mean canadian native. Not canadian cross either. (GCC folks did that in issues too to describe it as a canadian).

I would like to give a more precise and accurate definition.

We have two big categories. native and canadian:

When build == host, it is a native.
When build != host, it is a canadian.

So we have a graph like this:

image

So. clang only has native and canadian. Clang does not have cross (because clang itself does not distinguish native and cross)

https://crosstool-ng.github.io/docs/toolchain-types/

Can you use my definitions here? Because i have a debate with other people and they just use yours as a "proof" which i do not agree.

@QBos07
Copy link
Contributor

QBos07 commented Jan 23, 2024

what if it is build == target !=host for example?

Since that isn't used that often there isn't a generaly agreed term. I just heared of it to be refered to as 'cross-back' but we group it under canadian because it doesn't change how we compile it.

It is possible that idividual terms can change because the exact definiton is not needed for the tool/issue (at that point).

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