unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Ekaitz Zarraga <ekaitz@elenq.tech>
To: Ekaitz Zarraga <ekaitz@elenq.tech>
Cc: "help-guix\\\\@gnu.org" <help-guix@gnu.org>
Subject: Re: arm-none-eabi-toolchain: stdlib.h not found
Date: Tue, 26 Sep 2023 22:35:23 +0000	[thread overview]
Message-ID: <ffpENFHW82V73oF6swbVFlZWGp-I1tOY_TGuicNOg_jHKl3838m5Ve6JBpnzvxycsgdoL0aF8SctJ3MoTG7Pc2bJWt2UQv1_P-Q80x9HaOM=@elenq.tech> (raw)
In-Reply-To: <LS9D34XWKkrdXhio7lXAU0oBgJkWLRH4gBLmfDTgRofYTU2yarAdh0RVl7k1SlDrRLzfbTUYRyUDM1Oaq7yvtUFHeygUh98ddwuf42W7reg=@elenq.tech>





ElenQ Technology


------- Original Message -------
On Tuesday, September 26th, 2023 at 22:28, Ekaitz Zarraga <ekaitz@elenq.tech> wrote:


> 
> ------- Original Message -------
> On Tuesday, September 5th, 2023 at 18:09, Ekaitz Zarraga ekaitz@elenq.tech wrote:
> 
> 
> 
> > Hi,
> > 
> > If I guix shell to arm-none-eabi-toolchain:
> > 
> > `Ekaitz@tuxedo ~/projects/TESTS$ guix shell arm-none-eabi-toolchain`
> > 
> > arm-none-eabi-toolchain can't use cstdlib because:
> > 
> > ```
> > Ekaitz@tuxedo ~/projects/TESTS [env]$ cat a.c
> > #include <cstdlib>
> > 
> > void operator delete(void *p) { std::free(p); }
> > 
> > Ekaitz@tuxedo ~/projects/TESTS [env]$ arm-none-eabi-g++ a.c
> > In file included from a.c:1:0:
> > /gnu/store/6bq6svar4b2mkp2k3laxqqs1nsxykrvf-profile/arm-none-eabi/include/c++/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
> > #include_next <stdlib.h>
> > 
> > ^~~~~~~~~~
> > compilation terminated.
> > Ekaitz@tuxedo ~/projects/TESTS [env]$
> > `But:`
> > Ekaitz@tuxedo ~/projects/TESTS [env]$ ls $CROSS_C_INCLUDE_PATH | grep stdlib
> > stdlib.h
> > ```
> > 
> > Ideas?
> 
> 
> 
> Hi,
> 
> I dug a little bit further and I found a very interesting behavior:
> 
> Preprocessor doesn't work vanilla:
> 
> ```
> Ekaitz@tuxedo ~/projects/rp2040/TESTS/RANDOM [env]$ arm-none-eabi-cpp a.c
> # 1 "a.c"
> # 1 "<built-in>"
> 
> # 1 "<command-line>"
> 
> # 1 "a.c"
> a.c:1:10: fatal error: cstdlib: No such file or directory
> #include <cstdlib>
> 
> ^~~~~~~~~
> compilation terminated.
> `We have CROSS_CPLUS_INCLUDE_PATH correctly set:`
> Ekaitz@tuxedo ~/projects/rp2040/TESTS/RANDOM [env]$ echo $CROSS_CPLUS_INCLUDE_PATH
> /gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include:/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++:/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi
> `If we insert exactly the same directories pointed by CROSS_CPLUS_INCLUDE_PATH manually to the preprocessor it works!`
> Ekaitz@tuxedo ~/projects/rp2040/TESTS/RANDOM [env]$ arm-none-eabi-cpp a.c -I/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include -I/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++ -I/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi
> # 1 "a.c"
> # 1 "<built-in>"
> 
> # 1 "<command-line>"
> 
> # 1 "a.c"
> # 1 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/cstdlib" 1
> # 39 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/cstdlib"
> 
> # 40 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/cstdlib" 3
> 
> # 1 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi/bits/c++config.h" 1 3
> # 533 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi/bits/c++config.h" 3
> # 1 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi/bits/os_defines.h" 1 3
> # 534 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi/bits/c++config.h" 2 3
> 
> 
> # 1 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi/bits/cpu_defines.h" 1 3
> # 537 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi/bits/c++config.h" 2 3
> # 42 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/cstdlib" 2 3
> # 75 "/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/cstdlib" 3
> ...
> ```
> 
> Anyone has an idea of what I'm missing here and why isn't it just automagic?
> 
> It should just work, or am I superwrong?
> 
> Thanks!


Oh! Too fast!

It was a different problem!

```
Ekaitz@tuxedo ~/projects/rp2040/TESTS/RANDOM [env]$ arm-none-eabi-g++  -I/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include -I/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++ -I/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/arm-none-eabi a.c
In file included from a.c:1:0:
/gnu/store/6zcm3xq6d3a0j6pnjd09b3zj1c9qbmrl-profile/arm-none-eabi/include/c++/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
```

The problem is with C++ only.
With C, as per the previous email, I managed to pass the preprocessing step, but in C++ it doesn't!
It doesn't really matter if I play with the -I flag.
It just doesn't work :(



  reply	other threads:[~2023-09-26 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 18:09 arm-none-eabi-toolchain: stdlib.h not found Ekaitz Zarraga
2023-09-26 22:28 ` Ekaitz Zarraga
2023-09-26 22:35   ` Ekaitz Zarraga [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-07 11:44 Stefan
2024-09-06 21:32 Rutherther

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='ffpENFHW82V73oF6swbVFlZWGp-I1tOY_TGuicNOg_jHKl3838m5Ve6JBpnzvxycsgdoL0aF8SctJ3MoTG7Pc2bJWt2UQv1_P-Q80x9HaOM=@elenq.tech' \
    --to=ekaitz@elenq.tech \
    --cc=help-guix@gnu.org \
    /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.
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).