[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A different way to build GCC to overcome issues, especially with C++
From: |
Attila Lendvai |
Subject: |
Re: A different way to build GCC to overcome issues, especially with C++ for embedded systems |
Date: |
Fri, 22 Dec 2023 10:56:42 +0000 |
TL;DR it's probably due to some cmake mess. and i gave up on compiling this; if
i really want to, i'll do it in a debian chroot.
> > i tried with your gcc … but it errors out with:
> >
> > $ make
> > [ 1%] Linking ASM executable bs2_default.elf
> > arm-none-eabi-gcc: error: nosys.specs: No such file or directory
>
>
> That file is located here:
> /gnu/store/…-newlib-arm-none-eabi-4.3.0/arm-none-eabi/lib/nosys.specs
that didn't help:
~/workspace/guix/guix/pre-inst-env guix shell gcc-toolchain cmake make
pkg-config -e '(@ (gnu packages embedded2)
gcc12-cross-newlib-arm-none-eabi-toolchain)'
cd ~/workspace/bios/pico-serprog
cmake .
COMPILER_PATH=/gnu/store/i9kpjzbagdlpm8bs10gxmm21b271s056-newlib-3.0.0-0.3ccfb40/arm-none-eabi/lib/
LDFLAGS=-B/gnu/store/i9kpjzbagdlpm8bs10gxmm21b271s056-newlib-3.0.0-0.3ccfb40/arm-none-eabi/lib/
make
it leads to the same problem.
but then i tried to compile the pico-sdk subproject as a standalone project,
and then it succeeds (but fails with a different error later). therefore i
think it's due to some cmake mess that i don't want to get deeper into. so, the
rest is just FYI:
git clone https://github.com/raspberrypi/pico-sdk
~/workspace/guix/guix/pre-inst-env guix shell gcc-toolchain cmake make
pkg-config -e '(@ (gnu packages embedded2)
gcc12-cross-newlib-arm-none-eabi-toolchain)'
cmake .
make
$ make
[ 0%] Building ASM object
src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
[ 0%] Linking ASM executable bs2_default.elf
[ 0%] Built target bs2_default
[ 0%] Creating directories for 'ELF2UF2Build'
[ 0%] No download step for 'ELF2UF2Build'
[ 0%] No update step for 'ELF2UF2Build'
[ 0%] No patch step for 'ELF2UF2Build'
[ 0%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler:
/gnu/store/3yqw7js9slid5q3d1f5bpbk92vann109-profile/bin/gcc
-- Check for working C compiler:
/gnu/store/3yqw7js9slid5q3d1f5bpbk92vann109-profile/bin/gcc - broken
CMake Error at
/gnu/store/4bn07jsqk6lxp0qdxv7kkc3krz3afnna-cmake-3.25.1/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70
(message):
The C compiler
"/gnu/store/3yqw7js9slid5q3d1f5bpbk92vann109-profile/bin/gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir:
/home/alendvai/workspace/bios/pico-sdk/elf2uf2/CMakeFiles/CMakeScratch/TryCompile-fg3QLY
Run Build
Command(s):/gnu/store/3yqw7js9slid5q3d1f5bpbk92vann109-profile/bin/make -f
Makefile cmTC_12bac/fast && make[3]: Entering directory
'/home/alendvai/workspace/bios/pico-sdk/elf2uf2/CMakeFiles/CMakeScratch/TryCompile-fg3QLY'
/gnu/store/3yqw7js9slid5q3d1f5bpbk92vann109-profile/bin/make -f
CMakeFiles/cmTC_12bac.dir/build.make CMakeFiles/cmTC_12bac.dir/build
make[4]: Entering directory
'/home/alendvai/workspace/bios/pico-sdk/elf2uf2/CMakeFiles/CMakeScratch/TryCompile-fg3QLY'
Building C object CMakeFiles/cmTC_12bac.dir/testCCompiler.c.o
/gnu/store/3yqw7js9slid5q3d1f5bpbk92vann109-profile/bin/gcc -o
CMakeFiles/cmTC_12bac.dir/testCCompiler.c.o -c
/home/alendvai/workspace/bios/pico-sdk/elf2uf2/CMakeFiles/CMakeScratch/TryCompile-fg3QLY/testCCompiler.c
as: unrecognized option '--64'
make[4]: *** [CMakeFiles/cmTC_12bac.dir/build.make:78:
CMakeFiles/cmTC_12bac.dir/testCCompiler.c.o] Error 1
make[4]: Leaving directory
'/home/alendvai/workspace/bios/pico-sdk/elf2uf2/CMakeFiles/CMakeScratch/TryCompile-fg3QLY'
make[3]: *** [Makefile:127: cmTC_12bac/fast] Error 2
make[3]: Leaving directory
'/home/alendvai/workspace/bios/pico-sdk/elf2uf2/CMakeFiles/CMakeScratch/TryCompile-fg3QLY'
the root cause of the messy error message above is the following:
as: unrecognized option '--64'
this happens with the host gcc (or due to some misconfiguration the host gcc is
used wrongly).
$ file src/rp2_common/boot_stage2/bs2_default.elf
src/rp2_common/boot_stage2/bs2_default.elf: ELF 32-bit LSB executable, ARM,
EABI5 version 1 (SYSV), statically linked, not stripped
--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Perfection is achieved, not when there is nothing more to add, but when there
is nothing left to take away.”
— Antoine de Saint-Exupery (1900–1944)