%rename link	picolibc_link
%rename cpp	picolibc_cpp
%rename cc1	picolibc_cc1
%rename cc1plus	picolibc_cc1plus

*cpp:
-isystem %{-picolibc-prefix=*:%*/picolibc/arm-none-eabi/include;:%R/picolibc/arm-none-eabi/include} %(picolibc_cpp)

*cc1:
%{!ftls-model:-ftls-model=local-exec} %(picolibc_cc1) 

*cc1plus:
-idirafter %{-picolibc-prefix=*:%*/picolibc/arm-none-eabi/include;:%R/picolibc/arm-none-eabi/include} %{!ftls-model:-ftls-model=local-exec} %(picolibc_cc1plus)  

*link:
%{DPICOLIBC_FLOAT_PRINTF_SCANF:--defsym=vfprintf=__f_vfprintf} %{DPICOLIBC_FLOAT_PRINTF_SCANF:--defsym=vfscanf=__f_vfscanf} %{DPICOLIBC_INTEGER_PRINTF_SCANF:--defsym=vfprintf=__i_vfprintf} %{DPICOLIBC_INTEGER_PRINTF_SCANF:--defsym=vfscanf=__i_vfscanf} -L%{-picolibc-prefix=*:%*/picolibc/arm-none-eabi/lib/%M;:%R/picolibc/arm-none-eabi/lib/%M} -L%{-picolibc-prefix=*:%*/picolibc/arm-none-eabi/lib;:%R/picolibc/arm-none-eabi/lib} %{!T:-Tpicolibcpp.ld} %(picolibc_link) --gc-sections 

*lib:
--start-group %(libgcc)  -lc %{-oslib=*:-l%*} --end-group

*endfile:
crtend%O%s

*startfile:
%{-picolibc-prefix=*:%*/picolibc/arm-none-eabi/lib/%M/crt0%{-crt0=*:-%*%O;:%O}%s;:%R/picolibc/arm-none-eabi/lib/%M/crt0%{-crt0=*:-%*%O;:%O}%s} crtbegin%O%s

