Commit Graph

17 Commits

Author SHA1 Message Date
Daniel Verkamp
2e03f6fe1c build: enable strict prototypes warning
This catches functions with empty parameter lists, which are not the
same as void parameter lists in C, as well as other (less-likely)
K&R-style parameter lists.

Change-Id: I18b09e01a60b3669d1cc5d8d96eec20cd872c497
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 16:05:06 -07:00
Daniel Verkamp
8307eb5f55 build: enable missing function declaration warning
This helps weed out functions that should be static, functions that are
not declared in public header files, and .c files that don't include
their .h interface headers.

Change-Id: Ie39f83ad4b320847e4a938bd1d4d0b4fa21c2ffa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:23 -07:00
Daniel Verkamp
e9fa656027 build: enable -Wextra except -Wunused-parameter
-Wold-style-declaration, -Wsign-compare, and
-Wmissing-field-initializers are included in -Wextra.

-Wunused-parameter is not very useful, so disable that explicitly, but
enable the rest of -Wextra.

Change-Id: I034b368d16306544e0eadafab9ec1ccf27f21645
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:22 -07:00
Daniel Verkamp
fd93c1b1ef build: enable missing field initializer warning
Replace {0} initializers with {}, since it is equivalent and simpler
(and avoids the warning).

Change-Id: Id2014a352e2c627598cd3b4f1ca04dba35f2dc3a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:22 -07:00
Daniel Verkamp
a945f60c79 build: enable signed-vs-unsigned compare warning
Change-Id: I93f069241cb74b3ec7d272bc390998372c376b16
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:22 -07:00
Daniel Verkamp
497d40b19b build: add CONFIG_COVERAGE code coverage option
Collect coverage information for use with gcov.

Coverage is disabled on FreeBSD because the current version of clang
provided by FreeBSD can't successfully link with -ftest-coverage enabled
(the compiler-rt support libs are too old).

Change-Id: Icc444936caa852bfb9a02b37223209319a27a770
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:49 -07:00
Daniel Verkamp
c9cc869a3e nvme/perf: add Linux libaio benchmarking support
This allows comparing the Linux kernel driver's performance to the SPDK
user-mode NVMe driver.

Change-Id: I71c70163a4133c2f237c8c57b3c698ec261455f5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-26 11:16:57 -07:00
Daniel Verkamp
3adea82331 build: always build with -fPIC
This allows the same objects to be linked into static and shared
libraries and allows the creation of position-independent executables
with the static libraries.

Change-Id: I119949c3644c02a83e414227615dcc2d8f896286
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-13 10:12:54 -07:00
Daniel Verkamp
557f3bd6c2 build: enable -fstack-protector
Change-Id: I2ba23c48ee8b9048022cff6cc861e990fd1ff570
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-13 10:04:04 -07:00
Daniel Verkamp
3a2b871a41 build: enable printf format warnings
Some of these are covered under -Wall, but add them all just to be clear.

Change-Id: I63104be4bf58becd19a4c30a4d275d2c24c6761d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-12 16:41:55 -07:00
Daniel Verkamp
28b4b01136 build: enable noexecstack
Modern toolchains already enable noexecstack by default, but set it
explicitly just to be sure.

Change-Id: I2866220db5a5ed0bb6e78a4e83763839ea3b93b0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-12 16:41:54 -07:00
Daniel Verkamp
ed3b72fba9 build: enable _FORTIFY_SOURCE=2 for release builds
Change-Id: I61a0700c2ee6e22cdde6e6cc8c491a1e52043136
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-12 16:41:54 -07:00
Daniel Verkamp
92a7dba668 build: enable full RELRO in LDFLAGS
This forces the ELF loader to resolve all relocations immediately at
load time rather than allowing lazy binding.

Therefore the loader can make the GOT (global offset table) read-only
once the relocations are complete during the loading process.

Change-Id: I89a878d1060ce79d58c5be7700d8b122a33a8ceb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-12 16:41:54 -07:00
Jim Harris
1d90157262 Fix header file dependencies.
Move dependency includes into a new spdk.deps.mk file,
then include it at the end of Makefiles that build
source files.

Also add a test to autobuild.sh to confirm that
binaries are regenerated if we make after touching a
header file.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If6a1905706a840f92cbdf3ace7fbdb27fe2de213
2015-09-28 09:07:04 -07:00
Daniel Verkamp
f19d1faedd build: disable assert() when building for release
Set -DNDEBUG to make assert() a no-op.  Since nvme_assert() is just an
alias for assert(), this controls compilation of nvme_assert as well.

Change-Id: Ie9d0c7fea007eff030179c1b54865adc3dcaf6b6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-25 14:22:49 -07:00
Jim Harris
068b20abab build: add OS to spdk.common.mk
This will add different flags, src files, etc. for FreeBSD.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4f2d664cf42d01745318f241ce9558dccf148b7d
2015-09-25 09:36:43 -07:00
Daniel Verkamp
1010fb3af1 SPDK: Initial check-in
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-21 08:52:41 -07:00