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 677373 - Only enable _FORTIFY_SOURCE if optimization enabled
Only enable _FORTIFY_SOURCE if optimization enabled
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-04 08:41 UTC by Stef Walter
Modified: 2012-06-06 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Only enable _FORTIFY_SOURCE if optimization enabled (1.54 KB, patch)
2012-06-04 08:42 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2012-06-04 08:41:58 UTC
When building with optimization disabled (for example for debugging)
then _FORTIFY_SOURCE produces a massive amount of warnings about
optimization being disabled.

The attached patch fixes the issue by disabling _FORTIFY_SOURCE
for non-optimized builds (for which it doesn't work anyway).

Just a few lines of the warning output:

In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from cc-notebook.c:25:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-shell-category-view.o
In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from /opt/build/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /opt/build/include/gtk-3.0/gdk/gdk.h:30,
                 from /opt/build/include/gtk-3.0/gtk/gtk.h:30,
                 from cc-shell-category-view.h:25,
                 from cc-shell-category-view.c:21:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-shell-item-view.o
In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from /opt/build/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /opt/build/include/gtk-3.0/gdk/gdk.h:30,
                 from /opt/build/include/gtk-3.0/gtk/gtk.h:30,
                 from cc-shell-item-view.h:24,
                 from cc-shell-item-view.c:21:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-shell-model.o
In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from /opt/build/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /opt/build/include/gtk-3.0/gdk/gdk.h:30,
                 from /opt/build/include/gtk-3.0/gtk/gtk.h:30,
                 from cc-shell-model.h:25,
                 from cc-shell-model.c:22:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-editable-entry.o
In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from /opt/build/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /opt/build/include/gtk-3.0/gdk/gdk.h:30,
                 from /opt/build/include/gtk-3.0/gtk/gtk.h:30,
                 from cc-editable-entry.h:25,
                 from cc-editable-entry.c:23:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-strength-bar.o
In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from cc-strength-bar.c:26:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-panel.o
In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from /opt/build/include/glib-2.0/gobject/gbinding.h:30,
                 from /opt/build/include/glib-2.0/glib-object.h:25,
                 from cc-panel.h:28,
                 from cc-panel.c:36:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-shell.o
In file included from /usr/include/limits.h:27:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
                 from /opt/build/lib64/glib-2.0/include/glibconfig.h:11,
                 from /opt/build/include/glib-2.0/glib/gtypes.h:34,
                 from /opt/build/include/glib-2.0/glib/galloca.h:34,
                 from /opt/build/include/glib-2.0/glib.h:32,
                 from /opt/build/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /opt/build/include/gtk-3.0/gdk/gdk.h:30,
                 from /opt/build/include/gtk-3.0/gtk/gtk.h:30,
                 from cc-shell.h:25,
                 from cc-shell.c:33:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  CC     cc-shell-marshal.o
^Cmake[3]: *** [cc-shell-marshal.o] Interrupt
make[2]: *** [all] Interrupt
make[1]: *** [all-recursive] Interrupt
Comment 1 Stef Walter 2012-06-04 08:42:01 UTC
Created attachment 215530 [details] [review]
Only enable _FORTIFY_SOURCE if optimization enabled

 * Otherwise we get a spew of warnings when building non-optimized
Comment 2 Bastien Nocera 2012-06-06 14:49:36 UTC
Review of attachment 215530 [details] [review]:

No idea who added that.
Comment 3 Bastien Nocera 2012-06-06 14:50:06 UTC
Prepend "build: " to the commit subject, and remove the "*" from the commit message.
Comment 4 Stef Walter 2012-06-06 16:07:15 UTC
Thanks. Merged into master