Using arm-none-eabi toolchain from Debian repository some examples (the first being fatfs_iterate) fail to link due to missing _write, _read, _close and _lseek implementations. This is not manifesting with ARM's GCC toolchain because they build newlib with CFLAGS_FOR_TARGET '-g -O2 -ffunction-sections -fdata-sections'.
What happens here is that DirectoryEntryIterator::calculateUnixTime ref. mktime ref. _tzset_unlocked ref. _tzset_unlocked_r ref. siscanf ref. __seofread which comes from stdio.o which also has __sread and that requires _read. If stdio.o had separate sections for all the functions, __sread wouldn't get linked in (thanks to --gc-sections).
The build can be pacified by using --specs=nosys.specs.
Using arm-none-eabi toolchain from Debian repository some examples (the first being fatfs_iterate) fail to link due to missing
_write,_read,_closeand_lseekimplementations. This is not manifesting with ARM's GCC toolchain because they build newlib withCFLAGS_FOR_TARGET '-g -O2 -ffunction-sections -fdata-sections'.What happens here is that
DirectoryEntryIterator::calculateUnixTimeref.mktimeref._tzset_unlockedref._tzset_unlocked_rref.siscanfref.__seofreadwhich comes from stdio.o which also has__sreadand that requires_read. If stdio.o had separate sections for all the functions,__sreadwouldn't get linked in (thanks to--gc-sections).The build can be pacified by using
--specs=nosys.specs.