mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
This was not as straight forward as expected. Specifically, adding the new flag to CFLAGS in configure.ac did not work and was causing compiler warnings. For instance, compiling memcheck/tests/execve2.c will generate a -Wnonnull warning even though the testcase is explicitly compiled with -Wno-nonnull. The reason is that (a) -Wformat is implied by -Wnonnull and (b) the list of compiler flags gets assembled in the wrong order. The culprit appears to be that we modify CFLAGS in configure.ac and that really is not the right place. Conceptually, configure should determine tool-chain capabilities and not assemble compiler flags. That should be done in Makefiles. This patch entangles all this. So, whatever was added to CFLAGS in configure.ac has now been moved to Makefile.all.am and Makefile.tool-tests.am. Those are: -Wno-long-long -Wwrite-strings -Wcast-qual -fno-stack-protector Note, that this change allows us to simplify Makefile.tool-tests.am which in the past was disabling some of those flags (e.g. by adding -Wno-cast-qual again). In case of the clang compiler, extra command line options are needed. I've moved those into a separate 'if COMPILER_IS_CLANG' section and not merge them into baseline flags. Related to BZ 334727. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14798
47 lines
1.7 KiB
Makefile
47 lines
1.7 KiB
Makefile
# This file is used for tool tests, and also in perf/Makefile.am.
|
|
|
|
include $(top_srcdir)/Makefile.all.am
|
|
|
|
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \
|
|
-I$(top_srcdir)/coregrind -I$(top_builddir)/include \
|
|
-I$(top_srcdir)/VEX/pub \
|
|
-I$(top_builddir)/VEX/pub \
|
|
-DVGA_@VGCONF_ARCH_PRI@=1 \
|
|
-DVGO_@VGCONF_OS@=1 \
|
|
-DVGP_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1 \
|
|
-DVGPV_@VGCONF_ARCH_PRI@_@VGCONF_OS@_@VGCONF_PLATVARIANT@=1
|
|
|
|
if VGCONF_HAVE_PLATFORM_SEC
|
|
AM_CPPFLAGS += -DVGA_SEC_@VGCONF_ARCH_SEC@=1 \
|
|
-DVGP_SEC_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1
|
|
endif
|
|
|
|
# Nb: Tools need to augment these flags with an arch-selection option, such
|
|
# as $(AM_FLAG_M3264_PRI).
|
|
AM_CFLAGS = -Winline -Wall -Wshadow -Wno-long-long -g \
|
|
@FLAG_FNO_STACK_PROTECTOR@
|
|
AM_CXXFLAGS = -Winline -Wall -Wshadow -Wno-long-long -g \
|
|
@FLAG_FNO_STACK_PROTECTOR@
|
|
# Include AM_CPPFLAGS in AM_CCASFLAGS to allow for older versions of
|
|
# automake; see comments in Makefile.all.am for more detail.
|
|
AM_CCASFLAGS = $(AM_CPPFLAGS)
|
|
|
|
if VGCONF_OS_IS_DARWIN
|
|
noinst_DSYMS = $(check_PROGRAMS)
|
|
endif
|
|
|
|
if COMPILER_IS_CLANG
|
|
AM_CFLAGS += -Wno-format-extra-args # perf/tinycc.c
|
|
AM_CFLAGS += -Wno-literal-range # none/tests/amd64/fxtract.c
|
|
AM_CFLAGS += -Wno-tautological-constant-out-of-range-compare # ...../aes.c
|
|
AM_CFLAGS += -Wno-self-assign # memcheck/tests/unit_libcbase.c
|
|
AM_CFLAGS += -Wno-string-plus-int # drd/tests/annotate_ignore_rw.c
|
|
AM_CFLAGS += -Wno-uninitialized # clang 3.4.2 and earlier
|
|
AM_CFLAGS += -Wno-unused-value # clang 3.0.0
|
|
AM_CXXFLAGS += -Wno-unused-private-field # drd/tests/tsan_unittest.cpp
|
|
endif
|
|
|
|
check-local: build-noinst_DSYMS
|
|
|
|
clean-local: clean-noinst_DSYMS
|