Bug 2560

Summary: ffmpeg overrides %{optflags}
Product: Fedora Reporter: Andrea Musuruane <musuruan>
Component: ffmpegAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: RESOLVED FIXED    
Severity: normal CC: belegdol, hans, kwizart
Priority: P5    
Version: 19   
Hardware: All   
OS: GNU/Linux   
namespace:

Description Andrea Musuruane 2012-11-03 10:26:19 CET
Compile output is not verbose and it needs to be corrected in the spec file. 

If you add "V=1" to make you can actually check what is going on when compiling. You will then notice that the following CFLAGS are used:

gcc -I. -I/builddir/build/BUILD/ffmpeg-1.0/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DHAVE_AV_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -std=c99 -fomit-frame-pointer -fPIC -pthread -I/usr/include/p11-kit-1 -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/freetype2 -D_REENTRANT -I/usr/include/p11-kit-1 -I/usr/include/schroedinger-1.0 -I/usr/include/orc-0.4  -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes  -MMD -MF libavdevice/alldevices.d -MT libavdevice/alldevices.o -c -o libavdevice/alldevices.o /builddir/build/BUILD/ffmpeg-1.0/libavdevice/alldevices.c

As you can see the first part is composed by the standard Fedora optflags. In
the second part there are other flags. The "-O3" that overrides the "-O2". This is not permitted by Fedora Guidelines: 
https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Compiler_flags

"For C, C++, and Fortran code, the %{optflags} macro contains these flags. Overriding these flags for performance optimizations (for instance, -O3 instead of -O2) is generally discouraged. If you can present benchmarks that show a significant speedup for this particular code, this could be revisited on a case-by-case basis. 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 must be documented in the specfile."
Comment 1 Andrea Musuruane 2012-11-03 12:13:58 CET
Thanks for handling this issue. There is still a problem though. Looking at the build logs, it seems that a file is not compiled using standard flags:

gcc -I. -I/builddir/build/BUILD/ffmpeg-1.0/ -D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g  -std=c99 -Wall -MMD -MF doc/print_options.d -MT doc/print_options.o -c -o doc/print_options.o /builddir/build/BUILD/ffmpeg-1.0/doc/print_options.c
Comment 2 Julian Sikorski 2012-11-03 14:23:00 CET
Should be fixed now.