https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107201
Bug ID: 107201 Summary: [avr] -nodevicelib not working for devices -mmcu=avr... Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: gjl at gcc dot gnu.org Target Milestone: --- The -nodevicelib option can be used so that the executable is not linked against -l<device> when a device is specified as -mmcu=<device>. This is useful if such a library is not avilable. This is achieved by the following spec in the device-specs file specs-<device>: *avrlibc_devicelib: %{!nodevicelib:-lavr64dd64} However, in a spec function, the driver in ./gcc/config/avr/driver-avr.c[c]::avr_devicespecs_file() removes that option because it thinks that -mmcu=avr* is a device *family* like avr25 or avrxmega2 etc.: #if defined (WITH_AVRLIBC) " %{mmcu=avr*:" X_NODEVLIB "} %{!mmcu=*:" X_NODEVLIB "}", #else where X_NODEVLIB resolves to "%<nodevicelib %<nodevicespecs" This means that -nodevicelib is removed also for -mmcu=avr* devices, not only for -mmcu=avr* cores. All this worked because up to now, no AVR devices where named "avr*", so that "avr*" worked to identify cores.