Preventing the build from adding options like '-pipe' et al

Ralph Seichter abbot at monksofcool.net
Mon Oct 28 17:08:28 UTC 2019


* Valentin V. Bartenev:

> Could you provide a link to the policy with this requirement?

Thanks for the quick response.  [1] section "Makefile Variables" states:
"Sometimes, badly behaved Makefile.am files will override user variables
such as CFLAGS. This must not be allowed (...)"  [2] offers additional
information, especially the "Not Filtering Variables" section.

I actually have open QA bugs for these build issues, so it is not me
being overzealous.

[1] https://devmanual.gentoo.org/general-concepts/autotools/index.html
[2] https://devmanual.gentoo.org/general-concepts/user-environment/index.html

> I'm curious how it's solved with other ebuilds

Unless better methods are available, we usually patch autotools files
which don't comply with Gentoo's rules. However, it is obviously much
nicer if the upstream build process can be configured to use only the
flags we provide at build time.

> It's quite normal for a build system to add some additional flags,
> that developers see reasonable for their software.

I think that depends on the situation and/or target platform, and Gentoo
supports some non-mainstream platforms. Forcing options like '-pipe' on
the user which have effects during build time, or '-g' which adds debug
symbols the user might not want, clashes with Gentoo's idea of providing
users with the widest range (within reason) of choices.

Note that individual Gentoo developers have individual views in this
matter, and the above is how I understand the Gentoo QA team's
opinion. I am not a team member though, so don't take what I wrote as
scripture. However, the Gentoo developer manual defines the rules by
which Gentoo devs have to abide, so just ignoring the additional flags
is not really an option I have.

-Ralph


More information about the unit mailing list