https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83971
Bug ID: 83971 Summary: gcc -static link command hardcoded when --with-system-libunwind used Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jason.duerstock at gmail dot com Target Milestone: --- Created attachment 43207 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43207&action=edit example build log Modern versions of libunwind include liblzma for decompressing compressed symbol tables. So when gcc is built with --with-system-libunwind, static links will fail because gcc is hardcoded to use "-lunwind" rather than the results of "pkg-config --libs --static libunwind". As a result, liblzma.a is not included when it should be. See https://buildd.debian.org/status/fetch.php?pkg=libdebug&arch=ia64&ver=0.5.2-2&stamp=1516055815&raw=0 for a full build log. The problem seems to stem from gcc/gcc.c:init_spec()