Created attachment 1219012 [details] flags.patch Please apply the attached patch to implement this Fedora 26 Change: https://fedoraproject.org/wiki/Changes/Fedora26CFlags
Hmm. No objections to the change as such, but I'm wondering about the __global_conly_cflags thingie. Up to now all languages have been merrily using __global_cflags but if we're starting to add languange-specific options then perhaps instead of inventing new foo-only names we should move that basis to some other macro and save cflags/cppflags/cxxflags etc for their original purposes. So the rpmrc entries would become something like this: optflags: i386 %{?__global_compiler_flags} -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables And the macros side (again something like): %__global_compiler_flags -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches %{_hardened_cflags} %__global_cflags -Werror=implicit-function-declaration -Werror=implicit-int %__global_cxxflags [...] # whenever we get there %__global_ldflags -Wl,-z,relro %{?_hardened_ldflags} ...etc, and then lump 'em together in %configure. Untested and all, but I'm think you'll get the idea. That'd actually be something to adopt at rpm upstream, the %__global_fooflags stuff was always a Fedora-specific thing for no good reasons at all.
If you want to combine this with a larger flags reorganization, that's fine. But I think it's important not to call g++ with -Wimplicit-function-declaration because the option is accepted by g++ probably by accident. C++ does not have implied function declarations. Likewise, -Werror=implicit-int is the default for g++, and disabled by -fpermissive (as required by the C++ language).
Yes, different languages needing different flags is well understood, its a bit of a miracle that we've gotten this far without splitting them and so cflags has been abused for a global set of things. This being the first language-specific addition the change needs to be done now. So I'm really not suggesting anything else than what you're doing technically, only naming-wise.
After half-forgetting this for a couple of weeks :-/ I went ahead and applied the part that drops Atom optimizations + built it for rawhide, so at least the part that directly affects built binaries is now in. I'll try to look into sorting out the other half along the lines of comment #1 RSN, feel free to kick me if you haven't heard anything by the end of this week.
And done, as of redhat-rpm-config-60-1.fc26. However note that for a more complete coverage of the language specific flags, there are many other packages should be updated too, to replace %optflags with appropriate language-specific macros, similar to what is done to %configure here: http://pkgs.fedoraproject.org/cgit/rpms/redhat-rpm-config.git/commit/?id=3081c4e7d573893caa1f2813e0a658d0a53d1991 At least: - kde-filesystem (macros.kde4) - qt (macros.qt4) - cmake (macros.cmake) IIRC Python extensions are C-only so %py2_build and %py3_build should be updated to pass %__global_cflags to build instead of %optflags - python - python3 ...and probably there are many many more.
This change caused a huge amount of havoc and is basically breaking Rawhide: https://bugzilla.redhat.com/show_bug.cgi?id=1401231 I propose it be reverted until we figure out how to do it properly.
Sorry, we need to revert the -Werror=implicit-* bits. There is no chance we can get this working in any reasonable time frame, there is simply too much breakage. Clearly, my initial testing of this change was way off.
(In reply to Florian Weimer from comment #7) > Sorry, we need to revert the -Werror=implicit-* bits. There is no chance we > can get this working in any reasonable time frame, there is simply too much > breakage. > > Clearly, my initial testing of this change was way off. Is there a plan to enable -Werror=implicit-* in rawhide(f27)?
(In reply to Lukas Slebodnik from comment #8) > (In reply to Florian Weimer from comment #7) > > Sorry, we need to revert the -Werror=implicit-* bits. There is no chance we > > can get this working in any reasonable time frame, there is simply too much > > breakage. > > > > Clearly, my initial testing of this change was way off. > > Is there a plan to enable -Werror=implicit-* in rawhide(f27)? No, it doesn't seem realistic at this point.
Is there a new timeframe or has the effort been wholly abandoned?