Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default binutils to disable compressed debug info #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rofl0r
Copy link
Contributor

@rofl0r rofl0r commented Aug 16, 2019

compressed debug info section is a relatively new feature, and having it on
by default causes link errors when the built libraries (most notably libgcc)
are later used with an older binutils version (for example binutils 2.27,
which was mcm's default version until just recently).

compressed debug info section is a relatively new feature, and having it on
by default causes link errors when the built libraries (most notably libgcc)
are later used with an older binutils version (for example binutils 2.27,
which was mcm's default version until just recently).
@rofl0r
Copy link
Contributor Author

rofl0r commented Aug 16, 2019

example error encountered (while building fontconfig 2.13.1 for x32): popcountsi2.o): unable to initialize decompress status for section .debug_info

@richfelker
Copy link
Owner

I'm not sure what we should do with this. Compressed debug info is likely a really big win for building gigantic C++ projects that take up multiple GB of disk space due to debug info, but the problem of breaking older tooling is definitely frustrating. We should at least add an example for disabling it, and possibly do it by default as you've requested...

@rofl0r
Copy link
Contributor Author

rofl0r commented Aug 16, 2019

for the record, in the case i describe i used mcm to compile a native gcc 6.5.0, whose libgcc.a then exposed the problem while using it inside a chroot with binutils 2.27.

Compressed debug info is likely a really big win for building gigantic C++ projects that take up multiple GB of disk space due to debug info,

certainly. though i'd argue that people that want this feature can simply add -Wl,--compress-debug-sections=zlib or -gz=zlib to their CXXFLAGS. (i suppose they had to do that manually as well until 2.32 was made default 3 months ago).

We should at least add an example for disabling it

that would work for me too

rofl0r added a commit to rofl0r/musl-cross-make that referenced this pull request Aug 20, 2021
rofl0r added a commit to sabotage-linux/sabotage that referenced this pull request Aug 28, 2021
distros using bleeding edge binutils default to produce compressed debug
sections, even if debug info was disabled via -g0 in CFLAGS, which leads
to error message like the following as soon as stage0 is built and the
user tries to use the toolchain (e.g., for building stage1):

/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/../../../crti.o:
file not recognized: File format not recognized

or

/bin/ld: /lib/gcc/x86_64-unknown-linux-gnu/3.4.6/../../../crtn.o:
unable to initialize decompress status for section .debug_aranges

more info in this PR: richfelker/musl-cross-make#73

other distros would probably just update to latest binutils to mitigate such
an issue, but this opens pandora's box and leads to a chain of consequences
such that gdb needs to be updated too, newer versions of which now use C++,
etc.
seen from a different PoV, sticking with an older and well-test binutils
version for the time being has the nice effect that binaries produced on
sabotage are way more portable and can be debugged with e.g. a 10 year old
gdb without issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants