From: Rutherther via Bug reports for GNU Guix <bug-guix@gnu.org>
To: 57109@debbugs.gnu.org
Cc: Jean Pierre De Jesus DIAZ <me@jeandudey.tech>,
Csepp <raingloom@riseup.net>
Subject: bug#57109: arm-none-eabi-toolchain atomic support is broken
Date: Sun, 08 Sep 2024 09:26:15 +0000 [thread overview]
Message-ID: <877cbmv6mj.fsf@protonmail.com> (raw)
In-Reply-To: <FxrTtbkN-kgBnsg2G8jk10dUAf5LGSIhQQKxosEukaNtGlCbHPCXA3HyNf6hzdYYe-qIRF6DlER0-Ma2XjMmzN8GDcwYPNP-5LylnDLavcY=@jeandudey.tech>
> Jean Pierre De Jesus DIAZ via Bug reports for GNU Guix <bug-guix@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
prev parent reply other threads:[~2024-09-08 9:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 11:14 bug#57109: arm-none-eabi-toolchain atomic support is broken Jean Pierre De Jesus DIAZ via Bug reports for GNU Guix
2022-08-16 14:14 ` Jean Pierre De Jesus DIAZ via Bug reports for GNU Guix
2022-08-18 14:24 ` Csepp
2024-09-08 9:26 ` Rutherther via Bug reports for GNU Guix [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877cbmv6mj.fsf@protonmail.com \
--to=bug-guix@gnu.org \
--cc=57109@debbugs.gnu.org \
--cc=me@jeandudey.tech \
--cc=raingloom@riseup.net \
--cc=rutherther@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).