Loading .gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,4 @@ CONFIG.local .project .cproject .settings mk/cc.mk CONFIG +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ CONFIG_DEBUG?=n # Treat warnings as errors (fail the build on any warning). CONFIG_WERROR?=n # Build with link-time optimization. CONFIG_LTO?=n # Build with code coverage instrumentation. CONFIG_COVERAGE?=n Loading Makefile +8 −2 Original line number Diff line number Diff line Loading @@ -38,17 +38,23 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk DIRS-y += lib test examples app .PHONY: all clean $(DIRS-y) config.h CONFIG.local .PHONY: all clean $(DIRS-y) config.h CONFIG.local mk/cc.mk all: $(DIRS-y) clean: $(DIRS-y) $(Q)rm -f mk/cc.mk $(Q)rm -f config.h app: lib test: lib examples: lib $(DIRS-y): config.h $(DIRS-y): mk/cc.mk config.h mk/cc.mk: $(Q)scripts/detect_cc.sh --cc=$(CC) --cxx=$(CXX) --lto=$(CONFIG_LTO) > $@.tmp; \ cmp -s $@.tmp $@ || mv $@.tmp $@ ; \ rm -f $@.tmp config.h: CONFIG CONFIG.local scripts/genconfig.py $(Q)python scripts/genconfig.py $(MAKEFLAGS) > $@.tmp; \ Loading configure +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ function usage() echo " --enable-asan Enable address sanitizer" echo " --enable-ubsan Enable undefined behavior sanitizer" echo " --enable-coverage Enable code coverage tracking" echo " --enable-lto Enable link-time optimization" echo " --with-env=path Use an alternate environment implementation" echo "" echo "Specifying Dependencies:" Loading Loading @@ -67,6 +68,12 @@ for i in "$@"; do --disable-coverage) CONFIG_COVERAGE=n ;; --enable-lto) CONFIG_LTO=y ;; --disable-lto) CONFIG_LTO=n ;; --enable-werror) CONFIG_WERROR=y ;; Loading Loading @@ -139,6 +146,9 @@ fi if [ -n "$CONFIG_COVERAGE" ]; then echo "CONFIG_COVERAGE?=$CONFIG_COVERAGE" >> CONFIG.local fi if [ -n "$CONFIG_LTO" ]; then echo "CONFIG_LTO?=$CONFIG_LTO" >> CONFIG.local fi if [ -n "$CONFIG_ASAN" ]; then echo "CONFIG_ASAN?=$CONFIG_ASAN" >> CONFIG.local fi Loading mk/spdk.common.mk +8 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ -include $(SPDK_ROOT_DIR)/CONFIG.local include $(SPDK_ROOT_DIR)/CONFIG -include $(SPDK_ROOT_DIR)/mk/cc.mk C_OPT ?= -fno-omit-frame-pointer ifneq ($(V),1) Q ?= @ Loading @@ -54,6 +56,11 @@ ifeq ($(CONFIG_WERROR), y) COMMON_CFLAGS += -Werror endif ifeq ($(CONFIG_LTO),y) COMMON_CFLAGS += -flto LDFLAGS += -flto endif COMMON_CFLAGS += -Wformat -Wformat-security COMMON_CFLAGS += -D_GNU_SOURCE Loading Loading @@ -149,7 +156,7 @@ LINK_CXX=\ LIB_C=\ $(Q)echo " LIB $(notdir $@)"; \ rm -f $@; \ ar crDs $@ $(OBJS) $(CCAR) crDs $@ $(OBJS) # Clean up generated files listed as arguments plus a default list CLEAN_C=\ Loading Loading
.gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,4 @@ CONFIG.local .project .cproject .settings mk/cc.mk
CONFIG +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ CONFIG_DEBUG?=n # Treat warnings as errors (fail the build on any warning). CONFIG_WERROR?=n # Build with link-time optimization. CONFIG_LTO?=n # Build with code coverage instrumentation. CONFIG_COVERAGE?=n Loading
Makefile +8 −2 Original line number Diff line number Diff line Loading @@ -38,17 +38,23 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk DIRS-y += lib test examples app .PHONY: all clean $(DIRS-y) config.h CONFIG.local .PHONY: all clean $(DIRS-y) config.h CONFIG.local mk/cc.mk all: $(DIRS-y) clean: $(DIRS-y) $(Q)rm -f mk/cc.mk $(Q)rm -f config.h app: lib test: lib examples: lib $(DIRS-y): config.h $(DIRS-y): mk/cc.mk config.h mk/cc.mk: $(Q)scripts/detect_cc.sh --cc=$(CC) --cxx=$(CXX) --lto=$(CONFIG_LTO) > $@.tmp; \ cmp -s $@.tmp $@ || mv $@.tmp $@ ; \ rm -f $@.tmp config.h: CONFIG CONFIG.local scripts/genconfig.py $(Q)python scripts/genconfig.py $(MAKEFLAGS) > $@.tmp; \ Loading
configure +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ function usage() echo " --enable-asan Enable address sanitizer" echo " --enable-ubsan Enable undefined behavior sanitizer" echo " --enable-coverage Enable code coverage tracking" echo " --enable-lto Enable link-time optimization" echo " --with-env=path Use an alternate environment implementation" echo "" echo "Specifying Dependencies:" Loading Loading @@ -67,6 +68,12 @@ for i in "$@"; do --disable-coverage) CONFIG_COVERAGE=n ;; --enable-lto) CONFIG_LTO=y ;; --disable-lto) CONFIG_LTO=n ;; --enable-werror) CONFIG_WERROR=y ;; Loading Loading @@ -139,6 +146,9 @@ fi if [ -n "$CONFIG_COVERAGE" ]; then echo "CONFIG_COVERAGE?=$CONFIG_COVERAGE" >> CONFIG.local fi if [ -n "$CONFIG_LTO" ]; then echo "CONFIG_LTO?=$CONFIG_LTO" >> CONFIG.local fi if [ -n "$CONFIG_ASAN" ]; then echo "CONFIG_ASAN?=$CONFIG_ASAN" >> CONFIG.local fi Loading
mk/spdk.common.mk +8 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ -include $(SPDK_ROOT_DIR)/CONFIG.local include $(SPDK_ROOT_DIR)/CONFIG -include $(SPDK_ROOT_DIR)/mk/cc.mk C_OPT ?= -fno-omit-frame-pointer ifneq ($(V),1) Q ?= @ Loading @@ -54,6 +56,11 @@ ifeq ($(CONFIG_WERROR), y) COMMON_CFLAGS += -Werror endif ifeq ($(CONFIG_LTO),y) COMMON_CFLAGS += -flto LDFLAGS += -flto endif COMMON_CFLAGS += -Wformat -Wformat-security COMMON_CFLAGS += -D_GNU_SOURCE Loading Loading @@ -149,7 +156,7 @@ LINK_CXX=\ LIB_C=\ $(Q)echo " LIB $(notdir $@)"; \ rm -f $@; \ ar crDs $@ $(OBJS) $(CCAR) crDs $@ $(OBJS) # Clean up generated files listed as arguments plus a default list CLEAN_C=\ Loading