-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
doc/stdenv/cross-compilation.chapter.md: explain tuples #180030
Closed
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4c59f44
doc/stdenv/cross-compilation.chapter.md: explain tuples
35475b8
Update doc/stdenv/cross-compilation.chapter.md
1e28866
minimize reference to multiarch, mentioning it only in the case where…
a0b3adf
"Nix host double" -> "Nix system double", "the previous format" -> "t…
dd6235b
remove mention of multiarch
f34b04e
add link to LLVM triples documentation
494a1fd
cross-compilation.md: correct the authoritative source of config.sub
c3d8109
Update doc/stdenv/cross-compilation.chapter.md
d110097
fix trailing whitespace
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd honestly leave Multiarch out of this. It is yet another system that has not necessary anything to do with us, since it is what Debian does. autoconf OTOH is used for figuring out
builtins.currentSystem
, so it makes sense why it is a point of reference for us.Another problem about multiarch is that we actually don't do multiarch (in the sense of the directory layout) and getting a multiarch (i.e. multilib) gcc to work is a struggle (if it's even possible?), so using the term may lead to confusion.
Note also that
autoconf
itself calls its (1), 2, 3 or 4 component platform strings target triplets, canonical system type or canonical name.Considering the string to be up to 5 components is a bad idea, especially for documentation purposes. Both nixpkgs and autoconf only allow up to 4 dash-separated components. While autoconf surely globs on the 4th components (in fact it probably does on all of them), considering it as (sometimes) multifielded is a stretch. Nixpkgs treats it as an opaque string and this is, in my opinion, the correct interpretation, even though some of those strings relate to each other via some structure. The used libc is derived from the ABI in nixpkgs and never directly derived from the platform string.
Nix host double is a bad term, it'd be better to call them Nix systems or Nix system doubles for consistency. It's also not the “previous format”, but very much used today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I am interested in that.
Okay.
I think is slightly bonkers to call a four-component thing a "triple".
Unfortunately the last two components are not separated by a dash.
This is not true! Both
mips64el-linux-gnuabin32
andmips64el-linux-muslabin32
use the same ABI:n32
yet they use different libcs. If the libc were derived from the ABI then this would be impossible!This is exactly the sort of confusion that comes from people pretending that the last two components are really one big component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I didn't write that sentence, it was preexisting text. I have however updated it with your recommendation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see, nixpkgs does not consider these ABIs the same:
The
libc
is derived in after parsing the triple itself by looking at the ABI, but you can of course also theoretically override this (lib.systems.elaborate { config = "mips64el-linux-muslabin32"; libc = "glibc"; }
(where the ABI would stay musl and evenisMusl == true
)). This is why I think it makes more sense to treat the ABI component as some opaque string which we can sometimes extract more information out of (n32
ABI,musl
“ABI”).Overall I guess it is a bit of a problem that we conflate ABI and libc in nixpkgs in a weird way which is also not done by autoconf (the third component for autoconf can either be
os
orkernel-system
which is much vaguer (e.g.linux-musl
)).Yes, but I'm not sure about a good alternative that is also in use; LLVM's triples are also not always three component strings.
https://gist.github.com/sternenseemann/a00d91b8e58cca3e18792771483b4c25
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is an egregious nixpkgs bug which really should be fixed.
n32
is an ABI and so isx32
;gnuabin32
,muslabin32
,gnuabix32
, andmuslabix32
are not ABIs.Musl isn't an ABI... they maintain a list of ABIs they support and links to what they use as the definition for each ABI.
ABIs exist even when there is no libc around:
no_std
rust binary will have no libc involved at all (neither "musl" nor "gnu" nor anything else), yet it still has to pick an ABI if it wants to make system calls into the kernel.file
can easily detect the ABI of a statically-linked ELF binary (it's part of the magic bytes), but not which libc (if any) it includesAs far as I can tell autoconf considers any part matching the regex
e?abi[^-]*$
to be a comment field. As I mentioned elsewhere,arm-unknown-linux-eabicrazypants
is a valid autoconf-name.canonical?