guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cross-compilation, Guix "system", and GNU "triplet"


From: Chris Marusich
Subject: Cross-compilation, Guix "system", and GNU "triplet"
Date: Thu, 23 Nov 2017 16:46:23 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hi,

As mentioned in bug 29402 [1], Guix uses strings like "armhf-linux" to
identify a system platform.  However, to cross-compile a package using
Guix, you need to specify the target platform's "GNU triplet", which
looks like "arm-linux-gnueabihf" (e.g. by invoking "guix build
--target=arm-linux-gnueabihf hello").  These are not the same thing.

OK, so Guix system "armhf-linux" maps to GNU triplet
"arm-linux-gnueabihf".  Or perhaps a better way to think of this is that
Guix system "armhf-linux" refers to a very specific platform choice -
and it happens to be the case that that platform can also be identified
by the GNU triplet "arm-linux-gnueabihf".  What about other ARM
variants?  When we eventually get Guix running on two variants of ARM,
will we just define another special string, like "the-second-arm-linux",
to identify its Guix system?

My understanding is that multiple GNU triplets can refer to the same
platform.  For example, I believe "arm-linux-gnueabihf" is the same as
"arm-unknown-linux-gnueabihf" because config.sub in Autoconf translates
the former to the latter.  Do they refer to the same platform?

Guix seems to treat them differently:

--8<---------------cut here---------------start------------->8---
[0] [env] address@hidden:~/guix
$ ./pre-inst-env guix build --no-substitutes --target=arm-linux-gnueabihf hello
/gnu/store/g7cmg23ssqwknpmbbrvap60iv524i9fw-hello-2.10
[0] [env] address@hidden:~/guix
$ ./pre-inst-env guix build --no-substitutes 
--target=arm-unknown-linux-gnueabihf hello
@ build-started 
/gnu/store/9kk7b46s836n5r0jh0sb00v8p3i5vlhg-gcc-cross-arm-unknown-linux-gnueabihf-5.4.0.drv
 - x86_64-linux 
/var/log/guix/drvs/9k//k7b46s836n5r0jh0sb00v8p3i5vlhg-gcc-cross-arm-unknown-linux-gnueabihf-5.4.0.drv.bz2
...
--8<---------------cut here---------------end--------------->8---

As you can see, Guix initiated a build even though the targets are "the
same" as far as Autoconf is concerned.  Perhaps this is because the
strings "arm-linux-gnueabihf" and "arm-unknown-linux-gnueabihf" differ,
which causes the derivations' output paths to differ?  I don't know, but
if that's the case, then it would explain why the second invocation
above resulted in a build, even though these two targets refer to the
same platform.

Finally, I want to ask for some clarification regarding the "GNU
triplet" concept in general.  Using the language of the section titled
"Specifying Target Triplets" in the Autoconf manual, I understand that a
GNU triplet takes the following form:

    `CPU-VENDOR-OS', where OS can be `SYSTEM' or `KERNEL-SYSTEM'

It seems to me that "SYSTEM" here always denotes an ABI, such as
"gnueabihf".  Can SYSTEM ever refer to something that is NOT an ABI?
The reason I ask is because in the Autoconf manual, this part of the
"triplet" is sometimes referred to as the SYSTEM (in the section
mentioned above), and sometimes it is referred to as the OS (in the
section titled "System Type").  But it seems to me that it is neither a
"system" nor an "os"; it is always an ABI.  Am I right?

Thank you for taking the time to help me understand!

Footnotes: 
[1]  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29402

-- 
Chris

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]