dot-a.eclass

Name

dot-a.eclass -- Functions to handle stripping LTO bytecode out of static archives.

Description

This eclass provides functions to strip LTO bytecode out of static archives (.a files).

Static libraries when built with LTO will contain LTO bytecode which is not portable across compiler versions or compiler vendors. To avoid pessimising the library and always filtering LTO, we can build it with -ffat-lto-objects instead, which builds some components twice. The installed part will then have the LTO contents stripped out, leaving the regular objects in the static archive.

Use should be passing calling lto-guarantee-fat before configure-time and calling strip-lto-bytecode after installation.

Most packages installing static libraries should be using this eclass, though it's not strictly necessary if the package filters LTO.

Supported EAPIs

8

Example

inherit dot-a

src_configure() {
    lto-guarantee-fat
    econf
}

src_install() {
    default
    strip-lto-bytecode
}

Functions

lto-guarantee-fat

If LTO is enabled, appends -ffat-lto-objects or any other flags needed to provide fat LTO objects.

strip-lto-bytecode [library|directory] [...]

Strips LTO bytecode from libraries (static archives) passed as arguments. Defaults to operating on ${ED} as a whole if no arguments are passed.

As an optimisation, if USE=static-libs exists for a package and is disabled, the default-searching behaviour with no arguments is suppressed.

Authors

Sam James <sam@gentoo.org>

Eli Schwartz <eschwartz@gentoo.org>

Maintainers

Toolchain Ninjas <toolchain@gentoo.org>

Reporting Bugs

Please report bugs via https://bugs.gentoo.org/