summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-03-03 00:54:17 +0100
committerNeilBrown <neilb@suse.de>2010-03-03 00:54:17 +0100
commitfcf5762500297536d3c3376945684c4f654ffe44 (patch)
treedf16a74f63ba3739e467c62e580f6bcc7f019389 /Makefile
parentFix warning about unused variable. (diff)
downloadmdadm-fcf5762500297536d3c3376945684c4f654ffe44.tar.xz
mdadm-fcf5762500297536d3c3376945684c4f654ffe44.zip
Add _FORTIFY_SOURCE to mdadm.O2 build.
When building mdadm.O2, set _FORTIFY_SOURCE to get more warnings, and also build mdmon.O2 to find warnings in that code too. Then fix the warnings. Suggested-by: Luca Berra <bluca@comedia.it> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1836b4b4..a23923c9 100644
--- a/Makefile
+++ b/Makefile
@@ -97,6 +97,10 @@ MON_OBJS = mdmon.o monitor.o managemon.o util.o mdstat.o sysfs.o config.o \
super-ddf.o sha1.o crc32.o msg.o bitmap.o \
platform-intel.o probe_roms.o
+MON_SRCS = mdmon.c monitor.c managemon.c util.c mdstat.c sysfs.c config.c \
+ Kill.c sg_io.c dlink.c ReadMe.c super0.c super1.c super-intel.c \
+ super-ddf.c sha1.c crc32.c msg.c bitmap.c \
+ platform-intel.c probe_roms.c
STATICSRC = pwgr.c
STATICOBJS = pwgr.o
@@ -138,8 +142,11 @@ mdadm.klibc : $(SRCS) mdadm.h
mdadm.Os : $(SRCS) mdadm.h
$(CC) -o mdadm.Os $(CFLAGS) -DHAVE_STDINT_H -Os $(SRCS)
-mdadm.O2 : $(SRCS) mdadm.h
- $(CC) -o mdadm.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 $(SRCS)
+mdadm.O2 : $(SRCS) mdadm.h mdmon.O2
+ $(CC) -o mdadm.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS)
+
+mdmon.O2 : $(MON_SRCS) mdadm.h mdmon.h
+ $(CC) -o mdmon.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS)
mdmon : $(MON_OBJS)
$(CC) $(LDFLAGS) -o mdmon $(MON_OBJS) $(LDLIBS)