diff mbox

build: Correctly determine the system type for GNU/Hurd systems.

Message ID e49fb0ce-d448-0a53-f476-7f650d09b1f7@gmail.com
State New
Headers show

Commit Message

Manolis Ragkousis June 17, 2016, 7:04 p.m. UTC
Hello everyone,

With this patch, anyone wanting to use Guix on his Hurd system will no
longer need to pass the system type to configure.

If it's okay I will push it to core-updates.

Thank you,
Manolis

Comments

Ludovic Courtès June 19, 2016, 1:57 p.m. UTC | #1
Manolis Ragkousis <manolis837@gmail.com> skribis:

> From b4aae91b25930b8f5cdb8af802e480eca8caf12e Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <manolis837@gmail.com>
> Date: Sat, 26 Mar 2016 16:53:40 +0200
> Subject: [PATCH] build: Correctly determine the system type for GNU/Hurd
>  systems.
>
> * m4/guix.m4 (GUIX_SYSTEM_TYPE): Add case for gnu.
> ---
>  m4/guix.m4 | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/m4/guix.m4 b/m4/guix.m4
> index 2d3dfd2..3396e05 100644
> --- a/m4/guix.m4
> +++ b/m4/guix.m4
> @@ -74,6 +74,9 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [
>         linux-gnu*)
>  	  # For backward compatibility, strip the `-gnu' part.
>  	  guix_system="$machine_name-linux";;
> +       gnu*)
> +          # When on Hurd, use i586 always.

“Always use i586 for GNU/Hurd.”

Apart from that, LGTM!

I wonder why this is needed though; normally, when building on
i586-unknown-gnu*, the next case:

--8<---------------cut here---------------start------------->8---
     case "$host_os" in
       linux-gnu*)
	  # For backward compatibility, strip the `-gnu' part.
	  guix_system="$machine_name-linux";;
       *)    # ← THIS CASE
	  # Strip the version number from names such as `gnu0.3',
	  # `darwin10.2.0', etc.
	  guix_system="$machine_name-`echo $host_os | "$SED" -e's/[0-9.]*$//g'`";;
     esac
--8<---------------cut here---------------end--------------->8---

… should produce “i586-gnu”, no?  What did you observe?  To put it
differently, what does ./build-aux/config.guess return on a GNU/Hurd
system?

Thanks,
Ludo’.
Manolis Ragkousis June 23, 2016, 4:17 p.m. UTC | #2
Hello everyone,

On 06/19/16 16:57, Ludovic Courtès wrote:
> I wonder why this is needed though; normally, when building on
> i586-unknown-gnu*, the next case:
> 
> --8<---------------cut here---------------start------------->8---
>      case "$host_os" in
>        linux-gnu*)
> 	  # For backward compatibility, strip the `-gnu' part.
> 	  guix_system="$machine_name-linux";;
>        *)    # ← THIS CASE
> 	  # Strip the version number from names such as `gnu0.3',
> 	  # `darwin10.2.0', etc.
> 	  guix_system="$machine_name-`echo $host_os | "$SED" -e's/[0-9.]*$//g'`";;
>      esac
> --8<---------------cut here---------------end--------------->8---
> 
> … should produce “i586-gnu”, no?  What did you observe?  To put it
> differently, what does ./build-aux/config.guess return on a GNU/Hurd
> system?

It produces "i686-gnu0.8" which is problematic and we expect "i586-gnu"
for our binaries to work.

I will push the updated patch to core-updates.

Thank you,
Manolis
Ludovic Courtès June 26, 2016, 9:34 p.m. UTC | #3
Hi!

Manolis Ragkousis <manolis837@gmail.com> skribis:

> On 06/19/16 16:57, Ludovic Courtès wrote:
>> I wonder why this is needed though; normally, when building on
>> i586-unknown-gnu*, the next case:
>> 
>> --8<---------------cut here---------------start------------->8---
>>      case "$host_os" in
>>        linux-gnu*)
>> 	  # For backward compatibility, strip the `-gnu' part.
>> 	  guix_system="$machine_name-linux";;
>>        *)    # ← THIS CASE
>> 	  # Strip the version number from names such as `gnu0.3',
>> 	  # `darwin10.2.0', etc.
>> 	  guix_system="$machine_name-`echo $host_os | "$SED" -e's/[0-9.]*$//g'`";;
>>      esac
>> --8<---------------cut here---------------end--------------->8---
>> 
>> … should produce “i586-gnu”, no?  What did you observe?  To put it
>> differently, what does ./build-aux/config.guess return on a GNU/Hurd
>> system?
>
> It produces "i686-gnu0.8" which is problematic and we expect "i586-gnu"
> for our binaries to work.

OK.  I can imagine that config.guess cannot distinguish between i686 and
i586; the “0.8” part is fun and much less expected (the last GNU release
that ever happened was called “0.3” :-)).

> I will push the updated patch to core-updates.

Perfect, thanks!

Ludo’.
diff mbox

Patch

From b4aae91b25930b8f5cdb8af802e480eca8caf12e Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Sat, 26 Mar 2016 16:53:40 +0200
Subject: [PATCH] build: Correctly determine the system type for GNU/Hurd
 systems.

* m4/guix.m4 (GUIX_SYSTEM_TYPE): Add case for gnu.
---
 m4/guix.m4 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/m4/guix.m4 b/m4/guix.m4
index 2d3dfd2..3396e05 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -74,6 +74,9 @@  AC_DEFUN([GUIX_SYSTEM_TYPE], [
        linux-gnu*)
 	  # For backward compatibility, strip the `-gnu' part.
 	  guix_system="$machine_name-linux";;
+       gnu*)
+          # When on Hurd, use i586 always.
+          guix_system="i586-gnu";;
        *)
 	  # Strip the version number from names such as `gnu0.3',
 	  # `darwin10.2.0', etc.
-- 
2.8.3