Hi Ekaitz!
I tried to reproduce your problem, and indeed it produces the same error
you are encountering.
$ guix shell arm-none-eabi-toolchain
[env]$ ls
a.c
[env]$ cat a.c
#include <cstdlib>
void operator delete(void* p) {std::free(p);}
int main() {return 0;}
[env]$ arm-none-eabi-g++ -x c++ 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.
Then I tried it with my self build toolchain
gcc12-cross-newlib-arm-none-eabi-toolchain-12.2.0¹, which works as expected:
$ arm-none-eabi-g++ -x c++ -c a.c
$ ls
a.c a.o
$ arm-none-eabi-g++ -x c++ a.c -lg -lrdpmon
$ ls
a.c a.o a.out
$ file a.out
a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
statically linked, with debug_info, not stripped
Bye
Stefan
¹ https://lists.gnu.org/archive/html/guix-devel/2023-10/msg00014.html