#1477 Enhance the 'Compiler Flags' section.
Merged by james. Opened by mschorm.
mschorm/packaging-committee compiler_flags  into  master

Download 1477.patch

Link to this document:
https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/buildflags.md
for descibing the correct way to manipulate the compiler flags.

Set the requirement to: 'SHOULD use whenever possible'.

The goal of this change is to encourage people to start using the standard
set of macros we have, instead of inventing their own ways to edit
the CFLAGS / CXXFLAGS etc. enviromental variables.

This is a part of this Fedora Change for F43:
https://fedoraproject.org/wiki/Changes/Package-specific_RPM_Macros_For_Build_Flags
which introduced a set of macros for adding flags at the end of the default set,
which should obsolete any other way people invented to edit the content
of the CFLAGS / CXXFLAGS etc. enviromental variables.

The main advantages are that it is propagated to all calls of the %set_build_flags macro,
in every section, in the whole SPECfile. (instead of just the lines after
the "export CFLAGS" etc. call until the end of the current section)
Also, it is much more auditable.

rebased onto 24b018899f51fbbd10111afa5e6097ea39f6d3b2

Macros for compiler / linker flags are documented here:
https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/#_macros_providing_compiler_and_linker_flags

And already link to buildflags.md. Not sure if you want to move your changes there, or if they should be moved to the main page (which is already much too long IMO).

1 new commit added

  • Update the section "Macros providing compiler and linker flags" for year 2025

Thanks for the pointer, I missed that out.

I went through, and updated the section to the current state / year.

I don't like much that we have the theme of the build flags shattered between two sections.
However after several attempts to merge them, I haven't found any formulation that would sound right with me.

Therefore, since I proposed an addition of just a single brief paragraph to the main page, I'd leave the proposal as I wrote it, on the main page.

I agree the main page is already long enough, but I haven't got a better idea now, and I believe that the addition is valuable as it is.
The merge / rewording or re-making of the compiler flags topic can be done later, by someone with the right idea how to achieve it.

Commit 88dd6045 fixes this pull-request

Pull-Request has been merged by james

Pull-Request has been merged by james

Metadata