Bug 83971 - gcc -static link command hardcoded when --with-system-libunwind used
Summary: gcc -static link command hardcoded when --with-system-libunwind used
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-22 15:21 UTC by Jason Duerstock
Modified: 2018-01-22 16:15 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
example build log (299 bytes, text/plain)
2018-01-22 15:21 UTC, Jason Duerstock
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Duerstock 2018-01-22 15:21:21 UTC
Created attachment 43207 [details]
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()
Comment 1 Andrew Pinski 2018-01-22 15:28:37 UTC
Usually --with-system-libunwind is only used on ia64 and no other target.
Comment 2 Jason Duerstock 2018-01-22 16:15:12 UTC
At least tangentially related, what's the reason only ia64 needs libunwind?  What happens if gcc is built with --disable-libunwind-exceptions?  I haven't been able to find a clear explanation regarding this anywhere.