JuliaPackaging / Yggdrasil

Collection of builder repositories for BinaryBuilder.jl
https://binarybuilder.org
Other
305 stars 539 forks source link

Compile with debug and unwind tables info #819

Open ViralBShah opened 4 years ago

ViralBShah commented 4 years ago

@keno recently helped me debug some issue in Sundials.jl with RR. Very impressive - both Keno and RR. :-)

One of the things that came up was that it would be good to build binaries with -g (even with optimization turned on) and the -funwind-tables (is that the right flag to get unwind tables info)? That would greatly make it easier to debug things.

Of course Keno debugged the Sundials issue without any debug symbols in this case.

giordano commented 4 years ago

There is a bit tension here, because of the large size of the libraries. Users may not be happy to get very large binaries for a few reasons (slow internet connection, limited space on disk, etc...)

ViralBShah commented 4 years ago

I thought this is at best a 10-20% kind of thing. Is it substantially larger? My .julia is usually about 1G - mostly artifacts. These both sound reasonable.

ViralBShah commented 4 years ago

For slow internet people (e.g. in China), no optimizations will help. We need a server in China (and using CDNs etc.). I think having binaries that are easy to debug is valuable.

giordano commented 4 years ago

For example #800 reduced the size of a library from 19 MiB to 0.8 MiB

ViralBShah commented 4 years ago

That's a lot! Is there a diet version of -g?

giordano commented 4 years ago

-g takes a level, like -O. The default for gcc is -g2. -g0 means no debug information at all, -g1 should be the diet version.

Keno commented 4 years ago

We should build everything with split debug info. That way we can ship the debug symbols a separate artifact and install them after the fact. Unwind tables should always be enabled though, since the profiler uses them.