[Bug c++/65199] Linker failure with -flto
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65199 --- Comment #2 from Goswin von Brederlow goswin-v-b at web dot de --- That fixes it. Isn't it a gcc bug though not to detect that itself?
[Bug c++/65199] Linker failure with -flto
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65199 --- Comment #1 from Richard Biener rguenth at gcc dot gnu.org --- Try marking your memcpy with __attribute__((used)).