dotnet / dotnet/source-build

Support for providing compiler flags during build

Open
#745 2 comments 1 reaction 0 assignees View on GitHub
area-build area-upstream-fix
Dominant language
No language data
Stars
287
Forks
145
Avg merge
1d 22h
Merged PRs (30d)
10

Description

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](https://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags) :

> 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](https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags):

> 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.