After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676846 - CFLAGS are reset when compiling with --enable-gcov.
CFLAGS are reset when compiling with --enable-gcov.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: common
git master
Other Linux
: Normal normal
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-25 21:24 UTC by Sebastian Rasmussen
Modified: 2012-05-26 14:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch to allow overriding/appending CFLAGS. (1.03 KB, patch)
2012-05-25 21:26 UTC, Sebastian Rasmussen
committed Details | Review

Description Sebastian Rasmussen 2012-05-25 21:24:43 UTC
If I try to compile my own gst-plugin and set/unset
features in, or include headers by setting compiler 
flags in CFLAGS when compiling like so:

CFLAGS="-DUSE_COOL_FEATURE -I/home/sebrn/src/downstream/include" make

Then the plugin will compile successfully. If I attempt
to do the same while compiling with gcov enabled (by
suppling --enable-gcov to configure) it will fail.
This means that it is impossible to override or append
new compiler flags using CFLAGS from the command-line.

The reason is that in the AG_GST_ARG_GCOV function in
common/m4/gst-args.m4 reset the value of CFLAGS (and 
others) instead of simply appending -O0. Glib handles
this by appending -O0, and therefore I propose that
GStreamer do the same. Then CFLAGS can again be used
to override/append compiler flags if so desired.
Comment 1 Sebastian Rasmussen 2012-05-25 21:26:06 UTC
Created attachment 215006 [details] [review]
Proposed patch to allow overriding/appending CFLAGS.
Comment 2 Tim-Philipp Müller 2012-05-26 11:50:55 UTC
Seems reasonable, I presume you have tested this with at least one of the gst modules as well to make sure the -O0 ends up in the right place.

 commit bdc49c4f46af4cdbf39e14c51fe6a5e137f55651
 Author: Sebastian Rasmussen <sebrn@axis.com>
 Date:   Fri May 25 23:13:59 2012 +0200

    gst-args.m4: append gcov flags to CFLAGS instead of replacing them
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676846

Not going to force a common update to all modules, let me know if you think it's needed. Will happen with the next common change otherwise.
Comment 3 Sebastian Rasmussen 2012-05-26 14:41:59 UTC
I tested with gst-plugins-base, -good and -bad and have not identified any ill effects from this patch. What I see from the make V=1 logs is that -O0 is appended as expected and is among the last of the compiler flags. This means that you can still supply -I and -D flags in CFLAGS, but you can not override -O0. This makes sense if you configured using --enable-gcov.

I'm happy with the patch sitting on master on gstreamer/common. Currently I'm using master when compiling. As long as it is eventually part of the 1.0 release in the future, that's  fine.