https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111635
Bug ID: 111635 Summary: Objects built with -flto cannot be linked with Xcode Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: amy at amyspark dot me CC: marxin at gcc dot gnu.org Target Milestone: --- Created attachment 56013 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56013&action=edit Full build failure log Hi, This is to report that GCC is feeding broken assembly to AppleClang as part of LTO linking. The output looks as follows: /var/folders/l1/b3htrbqd3w3f32x9lk1yll6h0000gn/T//ccPBRnCj.s:1628:18: error: non-local symbol required in directive .private_extern LPBX0.lto_priv.0 ^ /var/folders/l1/b3htrbqd3w3f32x9lk1yll6h0000gn/T//ccPBRnCj.s:1629:9: error: non-local symbol required in directive .globl LPBX0.lto_priv.0 (snip) followed by the corresponding: make: *** [/var/folders/l1/b3htrbqd3w3f32x9lk1yll6h0000gn/T//ccVBnAk5.ltrans1.ltrans.o] Error 1 make: *** Waiting for unfinished jobs.... /var/folders/l1/b3htrbqd3w3f32x9lk1yll6h0000gn/T//ccpBZ3qu.s:360623:1: error: assembler local symbol 'LPBX0.lto_priv.0' not defined ^ (snip) I am not able to attach the resulting assembly as this happens during the linking step and the files are lost upon failure. It is still easily reproducible by building https://github.com/blackmagic-debug/bmpflash with `meson setup build -Db_lto=true --buildtype=debug` followed by `meson compile -C build`. This was tested with GCC 13.2.0 as shipped by Homebrew, Xcode 13.2.1.