This is a quick followup on v2.3.0 with regression fixes.
-
#1060 adds a reference to
mainincrt<mcu>.o. It fixes anundefined reference to mainerror from the linker whenmainis implemented in an archive, like in Arduino. -
A patch introduced a syntax error #1061 in
util/setbaud.h. The patch has been reverted.
- Parts of the startup code are now optional and have been moved
from
crt<mcu>.oto the device support librarylib<mcu>.a.
When specific parts of the startup code are not wanted, a respective symbol can be defined so that the associated code is no more pulled in:- Define
__init_spto skip the setting of SP in.init2(#1011). - Define
__call_mainto skip callingmainandexitin.init9(#1012).
mainmust be executed by other means, e.g. by putting it in section.init9which is supported by -mno-call-main since GCC v15. - Define
__init_cvtto skip setting CPUINT_CTRLA.CPUINT_CVT in.init3(#1010).
This is only relevant when a Compact Vector Table is in effect, for example my means of -mcvt as supported since GCC v15.
- Define
-
Support has been added for: ATxmega16E5, ATA5791, ATA8210, ATA8510 (#876), ATA5835, ATA5787, ATA5700M322, ATtiny416auto, AVR32DA28S, AVR32DA32S, AVR32DA48S, AVR64DA28S, AVR64DA32S, AVR64DA48S AVR64DA64S, AVR128DA28S, AVR128DA32S, AVR128DA48S, AVR128DA64S, AVR16DU14, AVR16DU20, AVR16DU28, AVR16DU32, AVR32DU14, AVR32DU20, AVR32DU28, AVR32DU32, AVR32EB14, AVR32EB20, AVR32EB28, AVR32EB32, AVR16LA14, AVR16LA20, AVR16LA28, AVR16LA32, AVR32LA14, AVR32LA20, AVR32LA28, AVR32LA32, AVR32SD20, AVR32SD28, AVR32SD32.
-
Support has been added for the
stpcpy,stpcpy_P,stpcpy_F,stpcpy_PF,stpcpy_FXfunctions (#1015). -
Support for the
strtollandstrtoullfunctions has been added to <stdlib.h>. Thestrtolandstrtoulfunctions have been rewritten to increase performance. -
The
strtod,strtold,atofandatoflfunctions have been implemented to support IEEE double, i.e. they work with-mdouble=64. -
Support for some non-standard functions has been added to <stdlib.h>:
- 64-bit integer to ASCII conversions:
lltoa,ulltoa,ulltoa_base10. - 16-bit integer square root:
sqrtu16_floor. - 32-bit integer square root:
sqrtu32_floor. - 64-bit integer square root:
sqrtu64_floor(#1058).
- 64-bit integer to ASCII conversions:
-
Support has been added for some functions on Reduced Tiny (AVRrc):
_PROTECTED_WRITE_SPMandccp_write_spm(ATtiny102/104 only),_PROTECTED_WRITEandccp_write_io(#1053),memmem,memmem_P,strlcpy,strlcpy_P,strcasestr,strcasestr_P,strspn,strspn_P,strcspn,strcspn_P,strlcat_P,strsep,strsep_P,strpbrk_P,strtok_rP,ltoa,ultoa. -
Documentation for the <stdfix.h> header for ISO/IEC TR 18037 fixed-point support has been added.
-
Support has been added for the fixed-point arithmetic functions
rdivi,urdivi,lrdivi,ulrdivi(#999),sqrthr,sqrtuhr(#1024), ,sqrtr,sqrtur,sqrtlr,sqrtulr(#1058),sqrtk,sqrtuk,sqrthk,sqrtuhk,atank,atanuk,atanur,acosk,acosuk,asink,asinuk,log2uhk,log2uk,log21puhr,log21pur,exp2k,exp2uk,exp2m1ur,sinpi2k,sinuhk_deg,sinpi2ur,cospi2k,cosuhk_deg. -
Support has been added to <stdfix.h> for functions reading fixed-point values from program space like
pgm_read_*andpgm_read_*_far, where*stands for the fixed-point constant suffix. -
Support has been added to <stdfix.h> for functions accessing the EEPROM like
eeprom_read_*,eeprom_write_*andeeprom_update_*, where*stands for the fixed-point constant suffix. -
Support has been added for fixed-point to decimal ASCII conversions:
ktoa,uktoa,hktoa,uhktoa,rtoa,urtoa,hrtoa,uhrtoa. -
Support for
llabshas been added to <stdlib.h>. -
Support a new header <avr/flash.h> for better support of avr-gcc's named address spaces
__flashand__flashx. For example, it provides functions likestrcpy_Fandstrcpy_FXthat work the same likestrcpy_Pandstrcpy_PFfrom <avr/pgmspace.h>, but use proper address-space qualifiers. -
Support for Compact Vector Tables has been added as #1010. It is provided by
crt<mcu>-cvt.o. One way to use that variant of the startup code is by means of avr-gcc -mcvt which is supported since GCC v15. -
Support the
ISR_Nmacro in <avr/interrupt.h>. This allows to specify the IRQ number as an argument to the signal attribute, which is supported since GCC v15 PR116056. It allows to use static functions or functions defined in a C++ namespace as an ISR. It also allows to define ISR aliases without the penalty of an additional JMP/RJMP instruction (#765). -
Support for a new non-standard header <util/ram-usage.h> has been added. It can be used to get estimates of how much stack is used by a running program.
-
The
uint24_t,int24_tand associated types and macros have been added to <stdint.h> (#1045). -
EEPROM routines to access signed and unsigned integer types have been added to <avr/eeprom.h> for:
char,uint8_t,int8_t,uint16_t,int16_t,uint24_t,int24_t,uint32_t,int32_t,uint64_t,int64_t. -
The C/C++ register footprint of some common simple functions has been improved by implementing them as extern inline assembly stubs:
strlen,strlen_P,strcpy,strcpy_P,strcmp,strcmp_P,memcpy_P,strchr,strchr_P(#1013), and the functions from <ctype.h>. -
randandrand_rnow use a less resource-hungry algorithm. The runtime is less than 1/8 compared to the previous algorithm, and the code size is less than 1/4 while maintaining reasonable pseudo-randomness. The old implementation ofrandwas basically likerandom() & 0x7fff, so that you can return to the old algorithm if desired. -
common/asmdef.hused a sub-optimal definition of XJMP and XCALL (#993). Outcome was a sub-optimal code generation for some devices like the ones inavrxmega3/short-calls. -
Support for the floating-point functions
log2,log2f,log2l(#1032) andsincosfhas been added to <math.h>. -
The error of
asinfhas been improved from 8 ULPs to 3 ULPs. -
The error of
logfhas been improved from 5 ULPs to 3 ULPs. -
assertdoesn't usefprintfanymore, but a custom, light-weight function instead in order to diagnose a failed assertion. -
strftimedoesn't usesprintfanymore. The code size ofstrftime(including all dependencies) has been reduced by more than the code size ofsprintf. Support has been added for the%k,%land%Pformats. String literals have been moved to.progmemx. -
The benchmark page has been reworked. It includes now fixed-point and IEEE double floating-point benchmarks. The IEEE single floating-point benchmarks now include the code sizes, precision data, average execution times, and (lower bounds for the) worst case execution times.
-
Apart from
-Wl,-u,vfprintf -lprintf_fltthere is now the alternative-Wl,--defsym,vfprintf=vfprintf_fltwhich doesn't link the printf code when the application doesn't use printf, and when linked with-Wl,--gc-sections. Similar applies to the minimal variants and to the scanf functions like-Wl,--defsym,vfscanf=vfscanf_min. See vfprintf and #654. -
With
-mdouble=64, functions from the printf family now perform floating-point conversions instead of just printing a?. The value is converted to IEEE single for conversion. -
Added configure option
--with-doxygen=to select the Doxygen executable for generating the documentation. -
Added configure option
--with-man-page=to chose the page for the man pages. The default is3avr. Previous versions of AVR-LibC used the hard-coded page of3(#1051).
-
See also the list of issues closed for v2.3.
-
Since v2.2.0 (#936),
gcrt1.Sdefines symbols__DATA_REGION_ORIGIN__and__DATA_REGION_LENGTH__to allow for more precise diagnostics from the linker when the data region overflows. However, letting.datastart at__DATA_REGION_ORIGIN__is a relatively new addition in Binutils v2.40 PR29741, whereas using__DATA_REGION_LENGTH__for.datasize is a much older addition.Outcome may be that the linker script adopts the true size of
.databut not its start address, resulting in incorrect errors from the linker (#971). In order to resolve #971, a configure test has been added that checks for PR29741, and only defines the mentioned symbols when PR29741 is available.A similar test has been added for PR31177 which is a similar feature for the
.textregion. -
Due to several problem reports concerning the I/O headers for ATxmega64A1U and ATxmega128A1U (#391, #635, #643, #663, #875, #959, #960, #961), these headers have been updated to a more recent revision.
-
Added defines to
avr/io.hthat match the names in the ATmega324PA data sheet (#443). -
Fixed signature definitions in avr/io.h for several devices (#877) and add some missing signatures (#878).
-
Add missing ATmega328PB power reduction switches
PRPTCandPRSPI1toavr/power.h(#668). -
On AVRrc Reduced Tiny, add 0x4000 to the symbol address when
pgm_get_far_address()takes the address of an object inPROGMEM_FAR. This works similar to how the compiler implements the &-operator forPROGMEMobjects (#970). -
Fixed
memccpy(andmemccpy_P) on AVRrc (#1018). -
Fixed
atoiandatolon AVRrc (#1019). -
Define types from
stdint.hlikeint32_twithoutattribute((mode))(#496). -
Fixed
ld: undefined reference to E2END(#973). -
Don't skip 2-word instructions on cores with an according silicon bug. This will fix AVR-LibC build warnings as mentioned in #994 like:
libc/stdlib/ctype.S:80: Warning: skipping two-word instruction -
The
str[n]casecmp_PFfunctions used an algorithm that lead to different results compared tostr[n]casecmp[_P]. The far versions have been fixed so that they comply to POSIX.1-2008 (#1009). -
fflush()is now implemented as a proper (non-inline) function so that features like--wrapwill work as expected. For the same reason,clearerr(),ferror()andfeof()are no more implemented as macros but are proper (non-inline) functions, too. (#1017, #1003). -
Distribution is missing
dox_latex_header.tex,filter-dox.sh,avr-libc-logo-large.pngfromdoc/api/(#1023). -
Fixed a typo in the parameter name of
nanf(#1033). -
INFINITYfrommath.hhas been turned fromdoubletofloat(#1036). -
XRAMENDfor ATmega128A is now defined to 0xffff (#629). -
Fixed
strftime's return value (#1040) andstrftime("%r")(#1039). -
Saturate the value that
_delay_us/_delay_msare passing down to__builtin_avr_delay_cyclesin order to avoid UB (#681) for large values. -
Respect freelist size for small
reallocallocations (#660). -
Let
callocreturn NULL when the alloc size overflows (#1007). -
Fixed:
reallocfails if extending block in-place crosses the address 0xffff (#922). -
Fixed fuse defines for ATA5790 (#909).
-
Fixed the
ADC_CH_MUXNEG_enumvalues for ATxmega256D3 (#661). -
Fixed FUSE4_DEFAULT etc. defines in Xmega I/O headers (#523).
-
Fixed
atoffforwarding from wrongstrtodto correctstrtof(#1052). -
abortno more calls atexit functions or static destructors (#1056).abortdoesn't forward to_exit(1)any more but to a new, weak label__abortlocated in section.fini4.
-
Modernized the A simple project demo example project: It now uses the ATmega328P device that is widely used, for example on the Arduino Nano boards (#1044, #1048).
-
Fix support for ATxmega devices in avr/wdt.h (#646).
-
Improve runtime performance of
free()(#991).
- New news are now in
NEWS.mdand no more inNEWS.