Bug 50764 - Only enable _FORTIFY_SOURCE if optimization enabled
Summary: Only enable _FORTIFY_SOURCE if optimization enabled
Status: RESOLVED FIXED
Alias: None
Product: accountsservice
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Matthias Clasen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-06 01:05 UTC by Stef Walter
Modified: 2012-06-07 14:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Only enable _FORTIFY_SOURCE if optimization enabled (1.84 KB, patch)
2012-06-06 01:05 UTC, Stef Walter
Details | Splinter Review

Description Stef Walter 2012-06-06 01:05:11 UTC
If _FORTIFY_SOURCE is enabled when optimization is turned off
(ie: due to a debug build) then we get lots of crap like this
printed out:

gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALSTATEDIR=\""/opt/build/var"\" -DDATADIR=\""/opt/build/share"\" -DICONDIR=\"/opt/build/var/lib/AccountsService/icons\" -DUSERDIR=\"/opt/build/var/lib/AccountsService/users\"  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0/   -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -Wall -Wextra -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wnested-externs -Wpointer-arith -Wswitch-enum -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations -Wno-missing-field-initializers -Wno-unused-parameter -Wcast-align -Wsign-compare -Wp,-D_FORTIFY_SOURCE=2    -g -O0 -MT accounts-generated.o -MD -MP -MF .deps/accounts-generated.Tpo -c -o accounts-generated.o accounts-generated.c
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 /usr/lib64/glib-2.0/include/glibconfig.h:11,
                 from /usr/include/glib-2.0/glib/gtypes.h:34,
                 from /usr/include/glib-2.0/glib/galloca.h:34,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/glib-2.0/gobject/gbinding.h:30,
                 from /usr/include/glib-2.0/glib-object.h:25,
                 from /usr/include/glib-2.0/gio/gioenums.h:30,
                 from /usr/include/glib-2.0/gio/giotypes.h:30,
                 from /usr/include/glib-2.0/gio/gio.h:28,
                 from accounts-generated.h:10,
                 from accounts-generated.c:11:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALSTATEDIR=\""/opt/build/var"\" -DDATADIR=\""/opt/build/share"\" -DICONDIR=\"/opt/build/var/lib/AccountsService/icons\" -DUSERDIR=\"/opt/build/var/lib/AccountsService/users\"  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0/   -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -Wall -Wextra -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wnested-externs -Wpointer-arith -Wswitch-enum -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations -Wno-missing-field-initializers -Wno-unused-parameter -Wcast-align -Wsign-compare -Wp,-D_FORTIFY_SOURCE=2    -g -O0 -MT accounts-user-generated.o -MD -MP -MF .deps/accounts-user-generated.Tpo -c -o accounts-user-generated.o accounts-user-generated.c
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 /usr/lib64/glib-2.0/include/glibconfig.h:11,
                 from /usr/include/glib-2.0/glib/gtypes.h:34,
                 from /usr/include/glib-2.0/glib/galloca.h:34,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/glib-2.0/gobject/gbinding.h:30,
                 from /usr/include/glib-2.0/glib-object.h:25,
                 from /usr/include/glib-2.0/gio/gioenums.h:30,
                 from /usr/include/glib-2.0/gio/giotypes.h:30,
                 from /usr/include/glib-2.0/gio/gio.h:28,
                 from accounts-user-generated.h:10,
                 from accounts-user-generated.c:11:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALSTATEDIR=\""/opt/build/var"\" -DDATADIR=\""/opt/build/share"\" -DICONDIR=\"/opt/build/var/lib/AccountsService/icons\" -DUSERDIR=\"/opt/build/var/lib/AccountsService/users\"  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0/   -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -Wall -Wextra -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wnested-externs -Wpointer-arith -Wswitch-enum -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations -Wno-missing-field-initializers -Wno-unused-parameter -Wcast-align -Wsign-compare -Wp,-D_FORTIFY_SOURCE=2    -g -O0 -MT daemon.o -MD -MP -MF .deps/daemon.Tpo -c -o daemon.o daemon.c
In file included from /usr/include/stdlib.h:25:0,
                 from daemon.c:24:
/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
Comment 1 Stef Walter 2012-06-06 01:05:16 UTC
Created attachment 62632 [details] [review]
Only enable _FORTIFY_SOURCE if optimization enabled

 * Otherwise we get a spew of warnings when building non-optimized
Comment 2 Ray Strode [halfline] 2012-06-07 14:15:47 UTC
thanks


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.