Skip to content

Support for providing compiler flags during build #745

Open
@omajid

Description

@omajid

Certain linux distributions, like Fedora, require that all the native code in the distribution gets built with some distribution-standard compiler options.

Debian has a Release goal for supporting standard (security) flags :

This goal is to update as many packages as possible to use security hardening build flags via dpkg-buildflags. These flags enable various protections against security issues such as stack smashing, predictable locations of values in memory, etc.

Even more information here: https://wiki.debian.org/Hardening. This also applies to Ubuntu, since it follows Debian's packaging rules. In fact, Ubuntu recommends you get your package into Debian first.

Fedora says:

Compilers used to build packages must honor the applicable compiler flags set in the system rpm configuration. Honoring means that the contents of that variable is used as the basis of the flags actually used by the compiler during the package build.

Gentoo says:

In Gentoo-based systems, set the CFLAGS and CXXFLAGS variables in /etc/portage/make.conf. Variables set in this file will be exported to the environment of programs invoked by portage such that all packages will be compiled using these options as a base.

It would be great if source-build provided a way for a distribution maintainer to pass these flags in one place so all libraries and executables built by source-build can follow the distribution's policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-buildImprovements in source-build's own build processarea-upstream-fixNeeds a change in a contributing repo

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions