DOT-A.ECLASS

Section: eclass-manpages (5)
Updated: May 2025
Index Return to Main Contents

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/

FILES

dot-a.eclass

SEE ALSO

ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/dot-a.eclass


Index

NAME
DESCRIPTION
SUPPORTED EAPIS
EXAMPLE
FUNCTIONS
AUTHORS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:27:01 GMT, May 08, 2025