https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66587
Bug ID: 66587 Summary: -no_compact_unwind is dropped for -nodefaultlibs/-nostdlib Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: ossman at cendio dot se Target Milestone: --- As the summary states, you will get bitten by bug 41260 if you happen to specify -nodefaultlibs or -nostdlib as -no_compact_unwind is pulled in via %(link_gcc_c_sequence), which in turn is conditional on those first to flags. The comment in the code states that -no_compact_unwind is needed because of problems with libSystem. In that case it would make sense to tie it to where libSystem gets pulled in. However, reading bug 41260 and related links, I interpret things as being a problem in Apple's ld. Hence the flag should always be used as that linker is always assumed. I'm not sure what the best approach is to do that. I'm planning on trying to move it from LINK_GCC_C_SEQUENCE_SPEC to LINK_SPEC. (The same thing might affect the "-no_pie" magic, but I haven't found the justification for that code)