https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005
Bug ID: 82005 Summary: The combination of -g and -flto does not work on darwin Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: dominiq at lps dot ens.fr CC: iains at gcc dot gnu.org, rguenth at gcc dot gnu.org Target Milestone: --- Host: x86_64-apple-darwin16 Target: x86_64-apple-darwin16 Build: x86_64-apple-darwin16 Created attachment 42059 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42059&action=edit cco5WIPL.ltrans0.s generated with -g -flto The combination of -g and -flto does not work on darwin. Consider the following test #include <stdio.h> #include <math.h> int main () { float result; result = sin(3.14159); printf("result = \t%.13e\n", result); } compiling it with -g -flto gives cco5WIPL.ltrans0.s:155:8: error: unsupported relocation with subtraction expression, symbol '_sinus.c.f4d7e603' can not be undefined in a subtraction expression .quad _sinus.c.f4d7e603-Lsection__debug_info+11 ^ cco5WIPL.ltrans0.s:157:8: error: unsupported relocation with subtraction expression, symbol '_sinus.c.f4d7e603' can not be undefined in a subtraction expression .quad _sinus.c.f4d7e603-Lsection__debug_info+1227 ^ cco5WIPL.ltrans0.s:163:8: error: unsupported relocation with subtraction expression, symbol '_sinus.c.f4d7e603' can not be undefined in a subtraction expression .quad _sinus.c.f4d7e603-Lsection__debug_info+1240 ^ lto-wrapper: fatal error: /opt/gcc/gcc8w/bin/gcc returned 1 exit status compilation terminated. collect2: fatal error: lto-wrapper returned 1 exit status compilation terminated.