- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Description
There were a lot of minor bugs, fixes are in #2700
Note: this all happens with an RP2350 target.
Motivation
I installed newest ATfE toolchain (clang 21.1.1) from https://github.com/arm/arm-toolchain/releases. In contrast to clang 19.1.5 (https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases) no combination of PICO_CLIB does compile. Either cmake already failed or compilation did.
Compiling with develop-8fcd
Results of compiling my project (https://github.com/rgrr/yapicoprobe):
#     clang                19.1.5   21.1.1
#         develop-8fcd
#              llvm_libc    FAIL     FAIL      (19.1.5: wrong header, 21.1.1: unknown _BEGIN_STD_C)
#              picolibc      OK      FAIL      (21.1.1: cmake fails, same as -DPICO_CLIB=)
#              newlib        OK      FAIL      (19.1.5: program claims picolibc, 21.1.1: cmake fails)
So no luck with clang 21.1.1!
With clang 19.1.5 it also seemed that the build system does actually not obey the PICO_CLIB parameter because my program claimed that it was built with picolibc although newlib had been specified.
With clang 19.1.5 output of PICO_CLIB="" was the same as for "picolibc", so default runtime seems to be picolibc.  Compilation with "newlib" did produce a slightly smaller image (169100/169236).
Result of my experiments
- build system does not obey PICO_CLIB specification
- clang 21.1.1 does not build at all
Compilation after fixing
gcc
#     gcc                 14.2.1
#         develop-8fcd
#             llvm_libc    FAIL      (mixture of newlib/llvm_libc)
#             picolibc     FAIL      (FDEV_SETUP_STREAM is unknown, mixture if newlib/picolibc)
#             newlibc       OK       (same as -DPICO_CLIB=)
#         new
#             llvm_libc    FAIL      (mixture of newlib/llvm_libc)
#             picolibc     FAIL      (FDEV_SETUP_STREAM is unknown, mixture if newlib/picolibc)
#             newlib        OK       (same as -DPICO_CLIB=)
gcc build is untouched.
clang
#     clang                19.1.5   21.1.1
#         develop-8fcd
#              llvm_libc    FAIL     FAIL      (19.1.5: wrong header, 21.1.1: unknown _BEGIN_STD_C)
#              picolibc      OK      FAIL      (21.1.1: cmake fails, same as -DPICO_CLIB=)
#              newlib        OK      FAIL      (19.1.5: program claims picolibc, 21.1.1: cmake fails)
#         new
#              llvm_libc -  FAIL      OK       (19.1.5: llvm_libc has some incompatibilities)
#              picolibc  -   OK       OK
#              newlib    -   OK       OK       (same as -DPICO_CLIB=)
clang 19.1.5 compiles and runs with newlib and picolibc (and selects them correctly), default is newlib. With llvm_libc it does not compile due to limitations of the runtime. E.g. atan2() is missing and also some headers.
clang 21.1.1 compiles and runs with all runtimes.