Hi, References: PR 32945, PR 25120, PR 6352
Functions memcpy_PF/strcpy_PF incorrectly emits lpm when elpm is needed. Enabling elpm was based on FLASHEND macro which is not defined when building library for specific architecture. Replacing FLASHEND based check with __AVR_HAVE_ELPM__ (as suggested in PR 32945) resolves that issue. But, finding RAMPZ register address still not addressed. Currently it is based on RAMPZ macro in device header file. So, building library for specific arch will result in error as AVR_RAMPZ_ADDR is not defined. (include/avr/common.h) 284 #if defined(RAMPZ) 285 # define AVR_RAMPZ_REG RAMPZ 286 # if __AVR_ARCH__ >= 100 287 # define AVR_RAMPZ_ADDR _SFR_MEM_ADDR(RAMPZ) 288 # else 289 # define AVR_RAMPZ_ADDR _SFR_IO_ADDR(RAMPZ) 290 # endif 291 #endif It is possible to hard-code RAMPZ register address irrespective of device header file (gcc also hard-codes RAMPZ address) as follows: +# define AVR_RAMPZ_REG (_SFR_IO8(0x3B)) +# define AVR_RAMPZ_ADDR (_SFR_IO8(0x3B)) This will enable building library for a architecture than a device. Please give your feedback. Regards, Pitchumani _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev