https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118642
Bug ID: 118642 Summary: -specs=sync-none.specs doesn't work with LTO. Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: rearnsha at gcc dot gnu.org Target Milestone: --- Target: arm-none-eabi The arm-none-eabi port provides some alternative implementations of __sync_synchronize for different implementations of the architecture. These can be selected using one of -specs=sync-{none,dmb,cp15dmb}.specs. These specs fragments fail, however, when LTO is used because they unconditionally add a --defsym=__sync_synchronize=<implementation> to the linker arguments and that fails if libgcc is not added to the list of libraries. (gcc invokes LD during LTO and uses -nostdlib). .../ld-new:--defsym:1: undefined symbol `__sync_synchronize_none' referenced in expression