GNU bug report logs -
#31473
[PATCH] daemon: Allow building for armhf-linux on aarch64-linux.
Previous Next
Reported by: Efraim Flashner <efraim <at> flashner.co.il>
Date: Wed, 16 May 2018 12:12:02 UTC
Severity: normal
Tags: patch
Done: Efraim Flashner <efraim <at> flashner.co.il>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31473 in the body.
You can then email your comments to 31473 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#31473
; Package
guix-patches
.
(Wed, 16 May 2018 12:12:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Efraim Flashner <efraim <at> flashner.co.il>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Wed, 16 May 2018 12:12:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* nix/libstore/build.cc (canBuildLocally): Allow building armhf-linux
builds on aarch64-linux.
(DerivationGoal::runChild) Throw error if attempting to build for
armhf-linux on an unsupported platform.
* doc/guix.texi (Invoking guix build): Document how to build natively
for armhf-linux on aarch64-linux. Add note that on some aarch64
machines this is unsupported.
---
doc/guix.texi | 9 ++++++++-
nix/libstore/build.cc | 8 ++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index a771ab7ae..e64b91608 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5855,9 +5855,16 @@ information on cross-compilation.
An example use of this is on Linux-based systems, which can emulate
different personalities. For instance, passing
-@code{--system=i686-linux} on an @code{x86_64-linux} system allows you
+@code{--system=i686-linux} on an @code{x86_64-linux} system or
+@code{--system=armhf-linux} on an @code{aarch64-linux} system allows you
to build packages in a complete 32-bit environment.
+@quotation Note
+Building for an @code{armhf-linux} system is unconditionally enabled on
+@code{aarch64-linux} machines, although certain aarch64 chipsets do not
+allow for this functionality.
+@end quotation
+
Similarly, when transparent emulation with QEMU and @code{binfmt_misc}
is enabled (@pxref{Virtualization Services,
@code{qemu-binfmt-service-type}}), you can build for any system for
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 34647e677..c7f32494d 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1244,6 +1244,7 @@ static bool canBuildLocally(const string & platform)
return platform == settings.thisSystem
#if __linux__
|| (platform == "i686-linux" && settings.thisSystem == "x86_64-linux")
+ || (platform == "armhf-linux" && settings.thisSystem == "aarch64-linux")
#endif
;
}
@@ -2220,6 +2221,13 @@ void DerivationGoal::runChild()
throw SysError("cannot set i686-linux personality");
}
+ if (drv.platform == "armhf-linux" &&
+ (settings.thisSystem == "aarch64-linux" ||
+ (!strcmp(utsbuf.sysname, "Linux") && !strcmp(utsbuf.machine, "aarch64")))) {
+ if (personality(PER_LINUX32) == -1)
+ throw SysError("cannot set armhf-linux personality");
+ }
+
/* Impersonate a Linux 2.6 machine to get some determinism in
builds that depend on the kernel version. */
if ((drv.platform == "i686-linux" || drv.platform == "x86_64-linux") && settings.impersonateLinux26) {
--
2.17.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#31473
; Package
guix-patches
.
(Thu, 17 May 2018 11:22:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 31473 <at> debbugs.gnu.org (full text, mbox):
Hello Efraim,
Efraim Flashner <efraim <at> flashner.co.il> skribis:
> * nix/libstore/build.cc (canBuildLocally): Allow building armhf-linux
> builds on aarch64-linux.
> (DerivationGoal::runChild) Throw error if attempting to build for
> armhf-linux on an unsupported platform.
> * doc/guix.texi (Invoking guix build): Document how to build natively
> for armhf-linux on aarch64-linux. Add note that on some aarch64
> machines this is unsupported.
Awesome! If you’ve confirmed that it works for you, go for it.
> +@quotation Note
> +Building for an @code{armhf-linux} system is unconditionally enabled on
> +@code{aarch64-linux} machines, although certain aarch64 chipsets do not
> +allow for this functionality.
> +@end quotation
Perhaps we should list a couple of chipsets known to support this?
Would it make sense?
Thank you!
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#31473
; Package
guix-patches
.
(Thu, 17 May 2018 11:28:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 31473 <at> debbugs.gnu.org (full text, mbox):
On May 17, 2018 11:21:38 AM UTC, ludo <at> gnu.org wrote:
>Hello Efraim,
>
>Efraim Flashner <efraim <at> flashner.co.il> skribis:
>
>> * nix/libstore/build.cc (canBuildLocally): Allow building armhf-linux
>> builds on aarch64-linux.
>> (DerivationGoal::runChild) Throw error if attempting to build for
>> armhf-linux on an unsupported platform.
>> * doc/guix.texi (Invoking guix build): Document how to build natively
>> for armhf-linux on aarch64-linux. Add note that on some aarch64
>> machines this is unsupported.
>
>Awesome! If you’ve confirmed that it works for you, go for it.
>
>> +@quotation Note
>> +Building for an @code{armhf-linux} system is unconditionally enabled
>on
>> +@code{aarch64-linux} machines, although certain aarch64 chipsets do
>not
>> +allow for this functionality.
>> +@end quotation
>
>Perhaps we should list a couple of chipsets known to support this?
>Would it make sense?
>
>Thank you!
>
>Ludo’.
The ThunderX for sure, and I've heard the expressobin might not but I'm not sure. I didn't want to have an incomplete list. The closest I've heard for a way to check is to compile and run a program called all-arch, but it's harder on a source distro.
I could change it to "... not allow this functionality, notably the ThunderX."
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#31473
; Package
guix-patches
.
(Thu, 17 May 2018 14:09:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 31473 <at> debbugs.gnu.org (full text, mbox):
Efraim Flashner <efraim <at> flashner.co.il> skribis:
> On May 17, 2018 11:21:38 AM UTC, ludo <at> gnu.org wrote:
[...]
>>Perhaps we should list a couple of chipsets known to support this?
>>Would it make sense?
[...]
> I could change it to "... not allow this functionality, notably the ThunderX."
Sounds good, go for it!
Thanks,
Ludo’.
bug closed, send any further explanations to
31473 <at> debbugs.gnu.org and Efraim Flashner <efraim <at> flashner.co.il>
Request was from
Efraim Flashner <efraim <at> flashner.co.il>
to
control <at> debbugs.gnu.org
.
(Mon, 21 May 2018 07:58:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 18 Jun 2018 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 87 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.