[Fedora-packaging] about compiler flags

Orcan Ogetbil oget.fedora at gmail.com
Wed Apr 22 16:56:31 UTC 2009


I have 2 questions. The first one is brought to my attention by a
first time reviewer and he has got an interesting point.

The guidelines at
https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags
say:
"Adding to and overriding or filtering parts of these flags is
permitted if there's a good reason to do so; the rationale for doing
so should be reviewed and documented in the specfile especially in the
override and filter cases."

As you probably know that some packages add their own compiler flags
on top of what we specified as %optflags. Until now, I did not do
anything about these flags unless they override our %optflags. Now,
having a second thought, I realized that the above statement can be
interpreted in two ways:

1- The extra flags are added by the packager: This is the way I used
to interpret the guideline, and I always document if I add additional
flags on top of %{optflags}
2- The extra flags are added by the build script of upstream: Here is
the question: Do we need to document such cases in the specfile? I
know that we have hundreds (maybe thousands) of packages which don't
document this case in the specfile. Are such packages violating the
above guideline?


Second question: From the same link above:
"Compilers used to build packages should honor the applicable compiler
flags set in the system rpm configuration."

Does this apply to the stage where the compiler is doing the linking,
i.e: "gcc -shared -lthis -lthat..."? Do we need to honor %optflags in
this stage too? Again, I know many packages that don't pass %optflags
to the compiler during the linking. Do these pakcages violate the
guideline?

Orcan




More information about the Fedora-packaging mailing list