GNU bug report logs - #57109
arm-none-eabi-toolchain atomic support is broken

Previous Next

Package: guix;

Reported by: Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech>

Date: Wed, 10 Aug 2022 11:16:02 UTC

Severity: normal

To reply to this bug, email your comments to 57109 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#57109; Package guix. (Wed, 10 Aug 2022 11:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 10 Aug 2022 11:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech>
To: "bug-guix <at> gnu.org" <bug-guix <at> gnu.org>
Subject: arm-none-eabi-toolchain atomic support is broken
Date: Wed, 10 Aug 2022 11:14:37 +0000
The atomic supports for this toolchain is broken:

A minimal test case:

guix shell arm-none-eabi-toolchain -- \
   bash -c "echo '#include <stdatomic.h>' \
 | arm-none-eabi-gcc -x c -o /dev/null -c -"

Something similar found online:

https://sourceware.org/legacy-ml/newlib/2017/msg00150.html

However no solution.

This happens with all versions of the arm-none-eabi-toolchain
packages.

—
Jean-Pierre De Jesus DIAZ




Information forwarded to bug-guix <at> gnu.org:
bug#57109; Package guix. (Tue, 16 Aug 2022 14:15:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech>
To: "bug-guix <at> gnu.org" <bug-guix <at> gnu.org>
Subject: Re: arm-none-eabi-toolchain atomic support is broken
Date: Tue, 16 Aug 2022 14:14:29 +0000
The following works though. No newlib or anything:

guix shell --expression='((@ (gnu packages cross-base) cross-gcc) "arm-none-eabi")' -- \
   bash -c "echo '#include <stdatomic.h>' \
 | arm-none-eabi-gcc -x c -o /dev/null -c -"


—
Jean-Pierre De Jesus DIAZ


------- Original Message -------
On Wednesday, August 10th, 2022 at 1:14 PM, Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech> wrote:


> The atomic supports for this toolchain is broken:
> 
> A minimal test case:
> 
> guix shell arm-none-eabi-toolchain -- \
> bash -c "echo '#include <stdatomic.h>' \
> 
> | arm-none-eabi-gcc -x c -o /dev/null -c -"
> 
> Something similar found online:
> 
> https://sourceware.org/legacy-ml/newlib/2017/msg00150.html
> 
> However no solution.
> 
> This happens with all versions of the arm-none-eabi-toolchain
> packages.
> 
> —
> Jean-Pierre De Jesus DIAZ




Information forwarded to bug-guix <at> gnu.org:
bug#57109; Package guix. (Thu, 18 Aug 2022 14:27:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Csepp <raingloom <at> riseup.net>
To: Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech>
Cc: bug-guix <at> gnu.org, 57109 <at> debbugs.gnu.org
Subject: Re: bug#57109: arm-none-eabi-toolchain atomic support is broken
Date: Thu, 18 Aug 2022 16:24:01 +0200
Jean Pierre De Jesus DIAZ via Bug reports for GNU Guix <bug-guix <at> gnu.org> writes:

> The following works though. No newlib or anything:
>
> guix shell --expression='((@ (gnu packages cross-base) cross-gcc) "arm-none-eabi")' -- \
>    bash -c "echo '#include <stdatomic.h>' \
>  | arm-none-eabi-gcc -x c -o /dev/null -c -"
>
>
> —
> Jean-Pierre De Jesus DIAZ
>
>
> ------- Original Message -------
> On Wednesday, August 10th, 2022 at 1:14 PM, Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech> wrote:
>
>
>> The atomic supports for this toolchain is broken:
>> 
>> A minimal test case:
>> 
>> guix shell arm-none-eabi-toolchain -- \
>> bash -c "echo '#include <stdatomic.h>' \
>> 
>> | arm-none-eabi-gcc -x c -o /dev/null -c -"
>> 
>> Something similar found online:
>> 
>> https://sourceware.org/legacy-ml/newlib/2017/msg00150.html
>> 
>> However no solution.
>> 
>> This happens with all versions of the arm-none-eabi-toolchain
>> packages.
>> 
>> —
>> Jean-Pierre De Jesus DIAZ

Might be a good idea to add a (regression) test for this in advance.
Wish I could help, but my expermientation with cross compilation with
Guix were largely fruitless.




Information forwarded to bug-guix <at> gnu.org:
bug#57109; Package guix. (Thu, 18 Aug 2022 14:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#57109; Package guix. (Sun, 08 Sep 2024 09:27:01 GMT) Full text and rfc822 format available.

Message #17 received at 57109 <at> debbugs.gnu.org (full text, mbox):

From: Rutherther <rutherther <at> protonmail.com>
To: 57109 <at> debbugs.gnu.org
Cc: Jean Pierre De Jesus DIAZ <me <at> jeandudey.tech>, Csepp <raingloom <at> riseup.net>
Subject: Re: arm-none-eabi-toolchain atomic support is broken
Date: Sun, 08 Sep 2024 09:26:15 +0000
> Jean Pierre De Jesus DIAZ via Bug reports for GNU Guix <bug-guix <at> gnu.org> writes:
> 
> > The following works though. No newlib or anything:
> >
> > guix shell --expression='((@ (gnu packages cross-base) cross-gcc) "arm-none-eabi")' -- \
> >    bash -c "echo '#include <stdatomic.h>' \
> >  | arm-none-eabi-gcc -x c -o /dev/null -c -"
> >
> >
> > —
> > Jean-Pierre De Jesus DIAZ
> >

The reason this works is that the stdatomic.h is used from gcc itself,
instead of the stdatomic.h coming from newlib. It works even with the
arm-none-eabi gcc's coming from `gnu packages embedded`.

The newlib one seems to be broken, though I am unable to find any
discussion on newlib's part. I've tried toolchain coming from
developer.arm.com directly (through nixpkgs that packages the binaries)
and found out that they use stdatomic.h coming from gcc even in full toolchain.

The problem in the Guix ones is that since those use
CROSS_C_INCLUDE_PATH. The paths here get priority to the ones coming from gcc
itself. This then means the newlib stdatomic.h shadows the one coming
from (arm-none-eabi-)gcc:lib.

The toolchain from developer.arm.com does not have this issue, since it
relies on the paths directly from gcc, having the one with newlib as
last. When I try directly including stdatomic.h from newlib, I also
get this error even with that toolchain.

A solution could be to prepend the include path from gcc:lib into the
CROSS_C_INCLUDE_PATH to make it take priority, and prefer the packages
coming from there, or to stop relying on the env vars.

See the toolchain from Nix, the one not using env vars:
```
#include <...> search starts here:
 /nix/store/v9njly0h3i308dgyxzcqb6lqf71q8mkl-gcc-arm-embedded-12.3.rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/include
 /nix/store/v9njly0h3i308dgyxzcqb6lqf71q8mkl-gcc-arm-embedded-12.3.rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/include-fixed
 /nix/store/v9njly0h3i308dgyxzcqb6lqf71q8mkl-gcc-arm-embedded-12.3.rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/include
```

See Guix one:
```
#include <...> search starts here:
 /gnu/store/h5jxagsf8236ff3lbfcd4yk1qhk2bs4p-profile/arm-none-eabi/include
 /gnu/store/pjc5ysriqs6w99ihkza7xgwm8clfpgp0-gcc-cross-sans-libc-arm-none-eabi-7-2018-q2-update-1.261907-lib/lib/gcc/arm-none-eabi/7.3.1/include
 /gnu/store/pjc5ysriqs6w99ihkza7xgwm8clfpgp0-gcc-cross-sans-libc-arm-none-eabi-7-2018-q2-update-1.261907-lib/lib/gcc/arm-none-eabi/7.3.1/include-fixed
```

Regards,
Rutherther





This bug report was last modified 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.