all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help needed fixing linux-libre-5.2 on aarch64
@ 2019-07-13  3:41 Mark H Weaver
  2019-07-14 11:05 ` Pierre Langlois
  0 siblings, 1 reply; 7+ messages in thread
From: Mark H Weaver @ 2019-07-13  3:41 UTC (permalink / raw)
  To: guix-devel

The 'kernel-updates' includes a preliminary commit to update linux-libre
to version 5.2.  Berlin has built it successfully on all supported
architectures except for aarch64, where it fails:

  https://ci.guix.gnu.org/build/1448778/details

I would be grateful if someone with access to aarch64 hardware could
debug this and propose a fix.  Until then, I'm reluctant to push this
update to 'master'.

See below for the relevant excerpt from the build log.

     Thanks,
       Mark


--8<---------------cut here---------------start------------->8---
  CC [M]  arch/arm64/lib/xor-neon.o
In file included from /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/stdint.h:34:0,
                 from /gnu/store/7ykq1909hf7jgkvqcxdz7r0dglnbx005-gcc-7.4.0-lib/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/include/arm_neon.h:33,
                 from ./arch/arm64/include/asm/neon-intrinsics.h:33,
                 from arch/arm64/lib/xor-neon.c:11:
/gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/bits/stdint-intn.h:27:19: error: conflicting types for 'int64_t'
 typedef __int64_t int64_t;
                   ^~~~~~~
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from arch/arm64/lib/xor-neon.c:10:
./include/linux/types.h:114:15: note: previous declaration of 'int64_t' was here
 typedef s64   int64_t;
               ^~~~~~~
In file included from /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/stdint.h:37:0,
                 from /gnu/store/7ykq1909hf7jgkvqcxdz7r0dglnbx005-gcc-7.4.0-lib/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/include/arm_neon.h:33,
                 from ./arch/arm64/include/asm/neon-intrinsics.h:33,
                 from arch/arm64/lib/xor-neon.c:11:
/gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/bits/stdint-uintn.h:27:20: error: conflicting types for 'uint64_t'
 typedef __uint64_t uint64_t;
                    ^~~~~~~~
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from arch/arm64/lib/xor-neon.c:10:
./include/linux/types.h:112:15: note: previous declaration of 'uint64_t' was here
 typedef u64   uint64_t;
               ^~~~~~~~
make[1]: *** [scripts/Makefile.build:285: arch/arm64/lib/xor-neon.o] Error 1
make: *** [Makefile:1071: arch/arm64/lib] Error 2
--8<---------------cut here---------------end--------------->8---

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help needed fixing linux-libre-5.2 on aarch64
  2019-07-13  3:41 Help needed fixing linux-libre-5.2 on aarch64 Mark H Weaver
@ 2019-07-14 11:05 ` Pierre Langlois
  2019-07-14 12:24   ` Pierre Langlois
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Langlois @ 2019-07-14 11:05 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Guix-devel

Hi Mark!

Mark H Weaver writes:

> The 'kernel-updates' includes a preliminary commit to update linux-libre
> to version 5.2.  Berlin has built it successfully on all supported
> architectures except for aarch64, where it fails:
>
>   https://ci.guix.gnu.org/build/1448778/details
>
> I would be grateful if someone with access to aarch64 hardware could
> debug this and propose a fix.  Until then, I'm reluctant to push this
> update to 'master'.
>
> See below for the relevant excerpt from the build log.
>
>      Thanks,
>        Mark
>
>
> --8<---------------cut here---------------start------------->8---
>   CC [M]  arch/arm64/lib/xor-neon.o
> In file included from /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/stdint.h:34:0,
>                  from /gnu/store/7ykq1909hf7jgkvqcxdz7r0dglnbx005-gcc-7.4.0-lib/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/include/arm_neon.h:33,
>                  from ./arch/arm64/include/asm/neon-intrinsics.h:33,
>                  from arch/arm64/lib/xor-neon.c:11:
> /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/bits/stdint-intn.h:27:19: error: conflicting types for 'int64_t'
>  typedef __int64_t int64_t;
>                    ^~~~~~~
> In file included from ./include/linux/list.h:5:0,
>                  from ./include/linux/module.h:9,
>                  from arch/arm64/lib/xor-neon.c:10:
> ./include/linux/types.h:114:15: note: previous declaration of 'int64_t' was here
>  typedef s64   int64_t;
>                ^~~~~~~
> In file included from /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/stdint.h:37:0,
>                  from /gnu/store/7ykq1909hf7jgkvqcxdz7r0dglnbx005-gcc-7.4.0-lib/lib/gcc/aarch64-unknown-linux-gnu/7.4.0/include/arm_neon.h:33,
>                  from ./arch/arm64/include/asm/neon-intrinsics.h:33,
>                  from arch/arm64/lib/xor-neon.c:11:
> /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/bits/stdint-uintn.h:27:20: error: conflicting types for 'uint64_t'
>  typedef __uint64_t uint64_t;
>                     ^~~~~~~~
> In file included from ./include/linux/list.h:5:0,
>                  from ./include/linux/module.h:9,
>                  from arch/arm64/lib/xor-neon.c:10:
> ./include/linux/types.h:112:15: note: previous declaration of 'uint64_t' was here
>  typedef u64   uint64_t;
>                ^~~~~~~~
> make[1]: *** [scripts/Makefile.build:285: arch/arm64/lib/xor-neon.o] Error 1
> make: *** [Makefile:1071: arch/arm64/lib] Error 2
> --8<---------------cut here---------------end--------------->8---

I have access to some hardware at the moment so I thought I'd give this
a shot and yeah, I can reproduce it! I have access to a softiron board
(that's the same as what's on berlin.guixsd.org right?) running Ubuntu
with guix installed on top.

The strange thing is, the failure only happens with building using guix,
I can build linux on the board from source just fine:

```
# From a local checkout of linux (not linux-libre)
~/linux ((v5.2))$ guix environment -C linux-libre
~/linux [env]$ make defconfig
~/linux [env]$ make -j8
# OK
```

Whereas with `guix build linux-libre` I can see the error. And it still
happens if I keep the build around with `guix build -K linux-libre`:

```
/tmp/guix-build-linux-libre-5.2.drv-0/linux-5.2$ source ../environment-variables
/tmp/guix-build-linux-libre-5.2.drv-0/linux-5.2$ make -j8
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
./scripts/mkcompile_h: line 47: hostname: command not found
  CC [M]  arch/arm64/lib/xor-neon.o
In file included from /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/stdint.h:34:0,
                 from /gnu/store/7ykq1909hf7jgkvqcxdz7r0dglnbx005-gcc-7.4.0-lib/lib/gcc/aarch64-unknown-linux-gnu
/7.4.0/include/arm_neon.h:33,
                 from ./arch/arm64/include/asm/neon-intrinsics.h:33,
                 from arch/arm64/lib/xor-neon.c:11:
/gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/bits/stdint-intn.h:27:19: error: conflicting types
 for 'int64_t'
 typedef __int64_t int64_t;
                   ^~~~~~~
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from arch/arm64/lib/xor-neon.c:10:
./include/linux/types.h:114:15: note: previous declaration of 'int64_t' was here
 typedef s64   int64_t;
               ^~~~~~~
In file included from /gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/stdint.h:37:0,
                 from /gnu/store/7ykq1909hf7jgkvqcxdz7r0dglnbx005-gcc-7.4.0-lib/lib/gcc/aarch64-unknown-linux-gnu
/7.4.0/include/arm_neon.h:33,
                 from ./arch/arm64/include/asm/neon-intrinsics.h:33,
                 from arch/arm64/lib/xor-neon.c:11:
/gnu/store/im7irb1qnmvwypz53dxv5i75wy94dcz5-glibc-2.28/include/bits/stdint-uintn.h:27:20: error: conflicting type
s for 'uint64_t'
 typedef __uint64_t uint64_t;
                    ^~~~~~~~
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from arch/arm64/lib/xor-neon.c:10:
./include/linux/types.h:112:15: note: previous declaration of 'uint64_t' was here
 typedef u64   uint64_t;
               ^~~~~~~~
make[1]: *** [scripts/Makefile.build:285: arch/arm64/lib/xor-neon.o] Error 1
make: *** [Makefile:1071: arch/arm64/lib] Error 2
make: *** Waiting for unfinished jobs....
```

So I tried to compare the environments and saw we had a
'work-around-gcc-7-include-path-issue phase:

```
(add-before 'configure 'work-around-gcc-7-include-path-issue
  (lambda _
    (unsetenv "C_INCLUDE_PATH")
    (unsetenv "CPLUS_INCLUDE_PATH")
    #t))
```

And if I remove it then the error goes away! The build hasn't finished
yet for me, but it's gone past the offending xor-neon.c file so we
/should/ be good.

I'm not really sure why though, do you know why this phase was required
at the time? I haven't tested that linux-libre still builds on x86 with
this phase removed yet, trying it now.

Hope this helps!

Thanks,
Pierre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help needed fixing linux-libre-5.2 on aarch64
  2019-07-14 11:05 ` Pierre Langlois
@ 2019-07-14 12:24   ` Pierre Langlois
  2019-07-14 12:48     ` swedebugia
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pierre Langlois @ 2019-07-14 12:24 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]


> And if I remove it then the error goes away! The build hasn't finished
> yet for me, but it's gone past the offending xor-neon.c file so we
> /should/ be good.
>
> I'm not really sure why though, do you know why this phase was required
> at the time? I haven't tested that linux-libre still builds on x86 with
> this phase removed yet, trying it now.

OK, I've now built kernels with the attached patch on the kernel-updates
branch for x86_64 and aarch64! I've also tested with
--system=armhf-linux on the softiron and --system=i868-linux on my x86
desktop, it all looks good!


[-- Attachment #2: 0001-gnu-linux-libre-Fix-build-on-aarch64.patch --]
[-- Type: text/x-patch, Size: 1518 bytes --]

From db0cd6773c54d9a8f9dd332cb20abab770e29a51 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sun, 14 Jul 2019 12:47:06 +0100
Subject: [PATCH] gnu: linux-libre: Fix build on aarch64.

* gnu/packages/linux.scm (make-linux-libre)[arguments]: Remove
'work-around-gcc-7-include-path-issue phase.
---
 gnu/packages/linux.scm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 41991c9e45..d63755d791 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -35,6 +35,7 @@
 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
+;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -355,11 +356,6 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
              (substitute* (find-files "." "^Makefile(\\.include)?$")
                (("/bin/pwd") "pwd"))
              #t))
-         (add-before 'configure 'work-around-gcc-7-include-path-issue
-           (lambda _
-             (unsetenv "C_INCLUDE_PATH")
-             (unsetenv "CPLUS_INCLUDE_PATH")
-             #t))
          (replace 'configure
            (lambda* (#:key inputs native-inputs target #:allow-other-keys)
              ;; Avoid introducing timestamps
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: Help needed fixing linux-libre-5.2 on aarch64
  2019-07-14 12:24   ` Pierre Langlois
@ 2019-07-14 12:48     ` swedebugia
  2019-07-14 14:01     ` Pierre Langlois
  2019-07-14 14:46     ` Ludovic Courtès
  2 siblings, 0 replies; 7+ messages in thread
From: swedebugia @ 2019-07-14 12:48 UTC (permalink / raw)
  To: guix-devel

On 2019-07-14 14:24, Pierre Langlois wrote:
> 
>> And if I remove it then the error goes away! The build hasn't finished
>> yet for me, but it's gone past the offending xor-neon.c file so we
>> /should/ be good.
>>
>> I'm not really sure why though, do you know why this phase was required
>> at the time? I haven't tested that linux-libre still builds on x86 with
>> this phase removed yet, trying it now.
> 
> OK, I've now built kernels with the attached patch on the kernel-updates
> branch for x86_64 and aarch64! I've also tested with
> --system=armhf-linux on the softiron and --system=i868-linux on my x86
> desktop, it all looks good!

Nice work!

-- 
Cheers
Swedebugia

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help needed fixing linux-libre-5.2 on aarch64
  2019-07-14 12:24   ` Pierre Langlois
  2019-07-14 12:48     ` swedebugia
@ 2019-07-14 14:01     ` Pierre Langlois
  2019-07-14 14:46     ` Ludovic Courtès
  2 siblings, 0 replies; 7+ messages in thread
From: Pierre Langlois @ 2019-07-14 14:01 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]


Pierre Langlois writes:

>> And if I remove it then the error goes away! The build hasn't finished
>> yet for me, but it's gone past the offending xor-neon.c file so we
>> /should/ be good.
>>
>> I'm not really sure why though, do you know why this phase was required
>> at the time? I haven't tested that linux-libre still builds on x86 with
>> this phase removed yet, trying it now.
>
> OK, I've now built kernels with the attached patch on the kernel-updates
> branch for x86_64 and aarch64! I've also tested with
> --system=armhf-linux on the softiron and --system=i868-linux on my x86
> desktop, it all looks good!

> * gnu/packages/linux.scm (make-linux-libre)[arguments]: Remove
> 'work-around-gcc-7-include-path-issue phase.
> ---
>  gnu/packages/linux.scm | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 41991c9e45..d63755d791 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -35,6 +35,7 @@
>  ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
>  ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
>  ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
> +;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>

Whoops, I hadn't realized I had edited this file before, see attached
for a fixed patch.


[-- Attachment #2: 0001-gnu-linux-libre-Fix-build-on-aarch64.patch --]
[-- Type: text/x-patch, Size: 1725 bytes --]

From 1f855451dfd4c3068eebcc09cacf79bb6df97cc8 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sun, 14 Jul 2019 12:47:06 +0100
Subject: [PATCH] gnu: linux-libre: Fix build on aarch64.

* gnu/packages/linux.scm (make-linux-libre)[arguments]: Remove
'work-around-gcc-7-include-path-issue phase.
---
 gnu/packages/linux.scm | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 41991c9e45..c1a5bbebc0 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -30,7 +30,7 @@
 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
 ;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
-;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -355,11 +355,6 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
              (substitute* (find-files "." "^Makefile(\\.include)?$")
                (("/bin/pwd") "pwd"))
              #t))
-         (add-before 'configure 'work-around-gcc-7-include-path-issue
-           (lambda _
-             (unsetenv "C_INCLUDE_PATH")
-             (unsetenv "CPLUS_INCLUDE_PATH")
-             #t))
          (replace 'configure
            (lambda* (#:key inputs native-inputs target #:allow-other-keys)
              ;; Avoid introducing timestamps
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: Help needed fixing linux-libre-5.2 on aarch64
  2019-07-14 12:24   ` Pierre Langlois
  2019-07-14 12:48     ` swedebugia
  2019-07-14 14:01     ` Pierre Langlois
@ 2019-07-14 14:46     ` Ludovic Courtès
  2019-07-14 19:39       ` Mark H Weaver
  2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2019-07-14 14:46 UTC (permalink / raw)
  To: Pierre Langlois; +Cc: Guix-devel

Hello,

Pierre Langlois <pierre.langlois@gmx.com> skribis:

> OK, I've now built kernels with the attached patch on the kernel-updates
> branch for x86_64 and aarch64! I've also tested with
> --system=armhf-linux on the softiron and --system=i868-linux on my x86
> desktop, it all looks good!
>
> From db0cd6773c54d9a8f9dd332cb20abab770e29a51 Mon Sep 17 00:00:00 2001
> From: Pierre Langlois <pierre.langlois@gmx.com>
> Date: Sun, 14 Jul 2019 12:47:06 +0100
> Subject: [PATCH] gnu: linux-libre: Fix build on aarch64.
>
> * gnu/packages/linux.scm (make-linux-libre)[arguments]: Remove
> 'work-around-gcc-7-include-path-issue phase.

Any idea why this hack is no longer needed, and also why things behaved
differently on AArch64?

Thanks for working on this!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help needed fixing linux-libre-5.2 on aarch64
  2019-07-14 14:46     ` Ludovic Courtès
@ 2019-07-14 19:39       ` Mark H Weaver
  0 siblings, 0 replies; 7+ messages in thread
From: Mark H Weaver @ 2019-07-14 19:39 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi,

Pierre Langlois <pierre.langlois@gmx.com> wrote:
> OK, I've now built kernels with the attached patch on the kernel-updates
> branch for x86_64 and aarch64! I've also tested with
> --system=armhf-linux on the softiron and --system=i868-linux on my x86
> desktop, it all looks good!

Thank you Pierre, this is much appreciated.  I went ahead and pushed the
5.2 update and your fix to 'master'.

Ludovic Courtès <ludo@gnu.org> wrote:
> Any idea why this hack is no longer needed, and also why things behaved
> differently on AArch64?

I'm not sure.  I added that workaround in the commit that enabled
compilation of GCC plugins in our 'linux-libre' packages, and also
enabled use of GCC-7 on all architectures, whereas previously GCC-7 was
used only on x86_64 and i686.

In general, that kind of workaround was often needed when compiling
packages with GCC-7, because the C include path generated by 'set-paths'
was somehow breaking some uses of "#include_next" in the C standard
library, maybe because the path elements were in the wrong order.  I
don't remember the precise details.

Here's the relevant commit, for the record:

commit ce899af10901bf9ed06fe0528b8c4f628ebba4fd
Author: Mark H Weaver <mhw@netris.org>
Date:   Mon Dec 31 22:33:33 2018 -0500

    gnu: linux-libre: Build with GCC-7 on all systems.
    
    * gnu/packages/linux.scm (make-linux-libre)[native-inputs]: Include GCC-7
    unconditionally.  Previously it was included only on Intel systems.
    Add GMP, MPFR, and MPC.
    [arguments]: Add 'work-around-gcc-7-include-path-issue' phase.


Anyway, thanks again Pierre!

      Mark

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-14 19:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-13  3:41 Help needed fixing linux-libre-5.2 on aarch64 Mark H Weaver
2019-07-14 11:05 ` Pierre Langlois
2019-07-14 12:24   ` Pierre Langlois
2019-07-14 12:48     ` swedebugia
2019-07-14 14:01     ` Pierre Langlois
2019-07-14 14:46     ` Ludovic Courtès
2019-07-14 19:39       ` Mark H Weaver

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.