all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* arm-none-eabi toolchain and compiling C++ stuff
@ 2023-12-20 20:28 Attila Lendvai
  2023-12-20 20:53 ` Ekaitz Zarraga
  2023-12-21 16:11 ` Ricardo Wurmus
  0 siblings, 2 replies; 4+ messages in thread
From: Attila Lendvai @ 2023-12-20 20:28 UTC (permalink / raw)
  To: guix-devel

dear Guix,

i'm trying to compile something to a raspberry rp2040 microcontroller (https://codeberg.org/Riku_V/pico-serprog).

$ guix shell gcc-toolchain cmake make pkg-config -e "((@ (gnu packages embedded) make-arm-none-eabi-toolchain-7-2018-q2-update))"
$ cd _deps
$ git clone https://github.com/raspberrypi/pico-sdk.git pico_sdk-src
$ cd ..
$ cmake .
$ make

so far, so good. it compiles for a while, but then it fails with:

[ 14%] Building CXX object CMakeFiles/pico_serprog.dir/_deps/pico_sdk-src/src/rp2_common/pico_standard_link/new_delete.cpp.obj
In file included from pico-serprog/_deps/pico_sdk-src/src/rp2_common/pico_standard_link/new_delete.cpp:11:0:
/gnu/store/7i9fw82x6hljy6sb4g10v2dl53l7pybl-profile/arm-none-eabi/include/c++/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>

if i read this right, it tries to cross compile some C++ stuff, but a header file is missing.

$ guix locate stdlib.h
[...]
gcc-toolchain@13.2.0 /gnu/store/dpfxpfyghkc19wz8jwaw31llhnvn8ngx-gcc-toolchain-13.2.0/include/stdlib.h
gcc-toolchain@11.3.0 /gnu/store/5vn4pkf70ql7v1svrfknfkfsh4m3737h-gcc-toolchain-11.3.0/include/stdlib.h
clang-toolchain@15.0.7 /gnu/store/6m5gi7l7bi93gnzm2j422q9wawq3p6al-clang-toolchain-15.0.7/include/stdlib.h
[...]

i.e. it's usually part of the gcc-toolchain package... but it's not part of the cross-compiling ones?

is that a bug in (gnu packages embedded)? shall i look into fixing it?

or am i the one who has invalid expectations?

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“If money is your hope for independence you will never have it. The only real security that a man will have in this world is a reserve of knowledge, experience, and ability.”
	— Henry Ford (1863–1947)



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

* Re: arm-none-eabi toolchain and compiling C++ stuff
  2023-12-20 20:28 arm-none-eabi toolchain and compiling C++ stuff Attila Lendvai
@ 2023-12-20 20:53 ` Ekaitz Zarraga
  2023-12-21 16:11 ` Ricardo Wurmus
  1 sibling, 0 replies; 4+ messages in thread
From: Ekaitz Zarraga @ 2023-12-20 20:53 UTC (permalink / raw)
  To: Attila Lendvai, guix-devel



On 2023-12-20 21:28, Attila Lendvai wrote:
> dear Guix,
> 
> i'm trying to compile something to a raspberry rp2040 microcontroller (https://codeberg.org/Riku_V/pico-serprog).
> 
> $ guix shell gcc-toolchain cmake make pkg-config -e "((@ (gnu packages embedded) make-arm-none-eabi-toolchain-7-2018-q2-update))"
> $ cd _deps
> $ git clone https://github.com/raspberrypi/pico-sdk.git pico_sdk-src
> $ cd ..
> $ cmake .
> $ make
> 
> so far, so good. it compiles for a while, but then it fails with:
> 
> [ 14%] Building CXX object CMakeFiles/pico_serprog.dir/_deps/pico_sdk-src/src/rp2_common/pico_standard_link/new_delete.cpp.obj
> In file included from pico-serprog/_deps/pico_sdk-src/src/rp2_common/pico_standard_link/new_delete.cpp:11:0:
> /gnu/store/7i9fw82x6hljy6sb4g10v2dl53l7pybl-profile/arm-none-eabi/include/c++/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
>   #include_next <stdlib.h>
> 
> if i read this right, it tries to cross compile some C++ stuff, but a header file is missing.
> 
> $ guix locate stdlib.h
> [...]
> gcc-toolchain@13.2.0 /gnu/store/dpfxpfyghkc19wz8jwaw31llhnvn8ngx-gcc-toolchain-13.2.0/include/stdlib.h
> gcc-toolchain@11.3.0 /gnu/store/5vn4pkf70ql7v1svrfknfkfsh4m3737h-gcc-toolchain-11.3.0/include/stdlib.h
> clang-toolchain@15.0.7 /gnu/store/6m5gi7l7bi93gnzm2j422q9wawq3p6al-clang-toolchain-15.0.7/include/stdlib.h
> [...]
> 
> i.e. it's usually part of the gcc-toolchain package... but it's not part of the cross-compiling ones?
> 
> is that a bug in (gnu packages embedded)? shall i look into fixing it?
> 
> or am i the one who has invalid expectations?
> 

Hi Attila,

I reported the very same problem some time ago. This should just work in 
Guix. I don't think your expectations are wrong.
It should work.

In fact, there is a proposal:

https://lists.gnu.org/archive/html/guix-devel/2023-10/msg00014.html

That claims to fix this.
We should take a look into it.

Thanks for raising a little bit more of awareness on this... I have some 
Picos at home and they are literally unusable at this point :)

Cheers,
Ekaitz


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

* Re: arm-none-eabi toolchain and compiling C++ stuff
  2023-12-20 20:28 arm-none-eabi toolchain and compiling C++ stuff Attila Lendvai
  2023-12-20 20:53 ` Ekaitz Zarraga
@ 2023-12-21 16:11 ` Ricardo Wurmus
  1 sibling, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2023-12-21 16:11 UTC (permalink / raw)
  To: Attila Lendvai; +Cc: guix-devel


Attila Lendvai <attila@lendvai.name> writes:

> is that a bug in (gnu packages embedded)? shall i look into fixing it?
>
> or am i the one who has invalid expectations?

FWIW I have successfully been using
make-arm-none-eabi-nano-toolchain-4.9 with the Axoloti DSP board (via
the axoloti-patcher package).  The 2018 toolchain you are using should
also just work (perhaps after setting *_CROSS_* variables).  So this
could very well be a bug in the package.

-- 
Ricardo


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

* arm-none-eabi toolchain and compiling C++ stuff
@ 2024-09-06 16:01 Rutherther
  0 siblings, 0 replies; 4+ messages in thread
From: Rutherther @ 2024-09-06 16:01 UTC (permalink / raw)
  To: attila; +Cc: guix-devel


Hello Attila,

lately I've been trying to make arm-none-eabi toolchain with gcc 12.3,
since the older ones cannot be used with QMK. I also stumbled accross
this issue. The issue is actually caused by wrong order of paths in
"CROSS_CPLUS_INCLUDE_PATH". The C include path has to come after the C++ path.
So as a workaround, remove the /include from beginning of this, and
append it instead as last.

Apart from that you will probably have an issue with linking against the
libstdc++, since it's inside of "lib" folder instead or "arm-none-eabi/lib"
that is in CROSS_LIBRARY_PATH. As a workaround, just add
"$GUIX_ENVIRONMENT/lib" to "CROSS_LIBRARY_PATH".

I will try to submit the 12.3 patch soon. In the mean time I have it
inside of my own channel https://github.com/Rutherther/guix-exprs/blob/main/ruther/packages/embedded.scm

Redards,
Rutherther



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

end of thread, other threads:[~2024-09-07  8:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-20 20:28 arm-none-eabi toolchain and compiling C++ stuff Attila Lendvai
2023-12-20 20:53 ` Ekaitz Zarraga
2023-12-21 16:11 ` Ricardo Wurmus
  -- strict thread matches above, loose matches on Subject: below --
2024-09-06 16:01 Rutherther

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.