Skip to content

Attempt to detect incorrect/improveable incorrect linker flags #50

@fredemmott

Description

@fredemmott

Is your feature request related to a problem? Please describe.

I use CMake RelWithDebInfo builds - I don't use Release as I'm never going to distribute something if I don't have debug symbols for it :)

It seems that this disables some of the usual release mode linker flags, in particular:

  • /INCREMENTAL:NO - SizeBench does warn about this
  • /OPT:ICF
  • /OPT:REF

Describe the solution you'd like

It seems like SizeBench could make a reasonable guess that /OPT:ICF or /OPT:REF were not passed, and suggest I enable them.

Describe alternatives you've considered

doing it with sizebench without 'magic' :)

I eventually found all of these flags through looking through SizeBench's reports; for example, the lack of /OPT:REF was obvious from this:

Image

I'm only using one of those WinRT classes, so the majority of them should not be in my executable. After everything else, finding this and turning on /OPT:REF cut my executable from 3MB to 1.5MB

Additional context

Thank you so much for this incredible tool. I read the 2021 blog post last night, and this morning I easily cut my executable from 12.5MB to 1.5MB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions