Skip to content

Default to -O2 instead of -O3 and allow -Os #178

@NickeZ

Description

@NickeZ

Hey,

It seems irresponsible to default to -O3 which is known to use "experimental" optimizations that sometimes even pessimize the build. Did you performance check if there is a significant difference between -O2 and -O3? Did you also check this for platforms like arm?

On the same note, our project is building libwally-core for embedded and we would like to use -Os. But this is explicitly not respected.

I think the motivation to disallow the correct optimizations is invalid. Optimization flags are always given on a project scope and not per library. You anyway can't control if the final binary is compiled with LTO for example.

My feature request is thus: Do not add optimization flags in case CFLAGS is set at configure time. I.e. I would want ./configure CFLAGS="-Os" to be respected.

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