I am trying to switch from libc_nano to picolibc. I just compiled picolibc from source, and installed the libraries (ninja
followed by ninja install
). The latter command copied the lib and headers to certain locations in /usr/local/picolibc/arm-none-eabi/*
I also use picolibc.specs
instead of nano.specs
in my linker script.
When I now compile my project, it complains about conflicting declarations
/opt/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h:292:26: error: conflicting declaration 'typedef struct __sFILE __FILE'292 | typedef struct __sFILE __FILE;
and
/usr/local/picolibc/arm-none-eabi/include/stdio.h:300:23: note: previous declaration as 'typedef struct __file __FILE' 300 | typedef struct __file __FILE;
Obviously I no longer want to use the libraries and headers in /opt/gcc-arm-none-eabi
. But I have no idea why it resolves them. In my CMakeTextFile.txt I declare my own includes, but I never had to worry about where the C/C++ headers were located. It "just magically figured that out".
How does the compiler get the "std lib include path" from?
How can I instruct the compiler to look for standard libs elsewhere?