summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 25 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 3fe0a05..bcd092d 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@
# define "CXFLAGS" to give extra flags to CC.
# e.g. make CXFLAGS=-O to optimise
-CXFLAGS ?=-O2 -D_FORTIFY_SOURCE=2
+CXFLAGS ?=-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE
TCC = tcc
UCLIBC_GCC = $(shell for nm in i386-uclibc-linux-gcc i386-uclibc-gcc; do which $$nm > /dev/null && { echo $$nm ; exit; } ; done; echo false No uclibc found )
#DIET_GCC = diet gcc
@@ -76,6 +76,27 @@ ifeq ($(origin STRINGOPOVERFLOW), undefined)
endif
endif
+ifeq ($(origin NOSTRICTOVERFLOW), undefined)
+ NOSTRICTOVERFLOW := $(shell $(CC) -Q --help=warning 2>&1 | grep "strict-overflow" | wc -l)
+ ifneq "$(NOSTRICTOVERFLOW)" "0"
+ CWFLAGS += -fno-strict-overflow
+ endif
+endif
+
+ifeq ($(origin NODELETENULLPOINTER), undefined)
+ NODELETENULLPOINTER := $(shell $(CC) -Q --help=optimizers 2>&1 | grep "delete-null-pointer-checks" | wc -l)
+ ifneq "$(NODELETENULLPOINTER)" "0"
+ CWFLAGS += -fno-delete-null-pointer-checks
+ endif
+endif
+
+ifeq ($(origin WRAPV), undefined)
+ WRAPV := $(shell $(CC) -Q --help=optimizers 2>&1 | grep "wrapv" | wc -l)
+ ifneq "$(WRAPV)" "0"
+ CWFLAGS += -fwrapv
+ endif
+endif
+
ifdef DEBIAN
CPPFLAGS += -DDEBIAN
endif
@@ -165,11 +186,11 @@ endif
OBJS = mdadm.o config.o policy.o mdstat.o ReadMe.o uuid.o util.o maps.o lib.o udev.o \
Manage.o Assemble.o Build.o \
- Create.o Detail.o Examine.o Grow.o Monitor.o dlink.o Kill.o Query.o \
+ Create.o Detail.o Examine.o Grow.o mdmonitor.o dlink.o Kill.o Query.o \
Incremental.o Dump.o \
mdopen.o super0.o super1.o super-ddf.o super-intel.o bitmap.o \
super-mbr.o super-gpt.o \
- restripe.o sysfs.o sha1.o mapfile.o crc32.o sg_io.o msg.o xmalloc.o \
+ restripe.o sysfs.o sha1.o mapfile.o crc32.o msg.o xmalloc.o \
platform-intel.o probe_roms.o crc32c.o drive_encryption.o
CHECK_OBJS = restripe.o uuid.o sysfs.o maps.o lib.o xmalloc.o dlink.o
@@ -180,7 +201,7 @@ INCL = mdadm.h part.h bitmap.h
MON_OBJS = mdmon.o monitor.o managemon.o uuid.o util.o maps.o mdstat.o sysfs.o config.o mapfile.o mdopen.o\
policy.o lib.o udev.o \
- Kill.o sg_io.o dlink.o ReadMe.o super-intel.o \
+ Kill.o dlink.o ReadMe.o super-intel.o \
super-mbr.o super-gpt.o \
super-ddf.o sha1.o crc32.o msg.o bitmap.o xmalloc.o \
platform-intel.o probe_roms.o crc32c.o drive_encryption.o
@@ -320,7 +341,6 @@ install-systemd: systemd/mdmon@.service
$(INSTALL) -D -m 755 .install.tmp.3 $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \
rm -f .install.tmp.3; \
done
- if [ -f /etc/SuSE-release -o -n "$(SUSE)" ] ;then $(INSTALL) -D -m 755 systemd/SUSE-mdadm_env.sh $(DESTDIR)$(LIB_DIR)/mdadm_env.sh ;fi
install-bin: mdadm mdmon
$(INSTALL) -D $(STRIP) -m 755 mdadm $(DESTDIR)$(BINDIR)/mdadm