[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#939656: dh_strip should strip sections with LTO information from .a and .o files / lintian should warn about these



Control: tags -1 - moreinfo

On 29.09.19 11:03, Niels Thykier wrote:
Control: tags -1 moreinfo

Matthias Klose:
Package: debhelper,lintian
Severity: important

Some packages build with link time optimizations enabled, which is ok,
whoever then these packages may ship with static libs which still have
the LTO information in some sections of the object files (e.g.
ext2fsprogs).  This is not desired in most cases, so this information
should be removed from these files, and not shipped in the archive. Plus
the streaming format for the LTO information changes (even in GCC minor
releases), and leads to build errors when you try to use an old
streaming format with a newer compiler.  I'm asking for

  - dh_strip removing sections, as in

      strip -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_slim -N
__gnu_lto_v1

    which is turned on by default.

  - dh_strip providing an option not to remove these sections.

  - lintian warning about object files and static archives having such
    sections.

I'd like to see that implemented in debhelper, because LTO builds are
also sometimes enabled in upstream sources.

LTO is turned on by default in Suse, and their dh_strip equivalent
provides the functionality above for the removal of the LTO information.

Please feel free to split this issue into separate debhelper and lintian
tasks once a solution is agree upon.


When would you need to keep these LTO sections (but not use -k to keep
everything)?

-k is aliased as --keep-debug, this has nothing to do with LTO sections. Why do you want to blow up the size of a package needing LTO when only LTO is needed?

Keeping LTO information in a package can be useful when you have tightly coupled packages where you know that LTO optimization can be done across package boundaries.

Matthias


Reply to: