Skip to content

Build with -ffunction-sections -fdata-sections -Wl,--gc-sections ? #18579

@sipa

Description

@sipa

Due to the organization of our codebase we tend to build and link in a bunch of functions into the binaries that aren't actually used.

I've tried building with -ffunction-sections -fdata-sections -Wl,--gc-sections, and it reduces bitcoind (after stripping) from 7.2 MB to 6.9 MB. The bitcoin-wallet tool goes from 3.5 MB to 1.3 MB.

Any reason why we don't do this? I only find a mention in #4042, but it's not clear how relevant that is to me.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions