Skip to content

Commit

Permalink
build: switch to AX_VALGRIND_H to find valgrind.h
Browse files Browse the repository at this point in the history
Switch to AX_VALGRIND_H macro to find valgrind.h for valgrind wrap
of dlclose symbol in the flux-broker.

Add resulting $(VALGRIND_CFLAGS) to broker build, and fix up use
of HAVE_VALGRIND, HAVE_VALGRIND_H, and HAVE_VALGRIND_VALGRIND_H.
  • Loading branch information
grondo committed May 3, 2018
1 parent 6534c0b commit 77fbc2f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ AC_CHECK_HEADERS( \
xlocale.h \
endian.h \
inttypes.h \
valgrind/valgrind.h \
)

##
Expand Down Expand Up @@ -202,6 +201,7 @@ PKG_CHECK_MODULES([HWLOC], [hwloc >= 1.11.1], [], [])
PKG_CHECK_MODULES([SQLITE], [sqlite3], [], [])
LX_FIND_MPI
AM_CONDITIONAL([HAVE_MPI], [test "$have_C_mpi" = yes])
AX_VALGRIND_H
AX_CODE_COVERAGE

AC_ARG_ENABLE(caliper,
Expand Down
2 changes: 1 addition & 1 deletion src/broker/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AM_LDFLAGS = \

AM_CPPFLAGS = \
-I$(top_srcdir) -I$(top_srcdir)/src/include \
$(ZMQ_CFLAGS)
$(ZMQ_CFLAGS) $(VALGRIND_CFLAGS)

fluxcmd_PROGRAMS = flux-broker

Expand Down
10 changes: 7 additions & 3 deletions src/broker/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@
#include <caliper/cali.h>
#include <sys/syscall.h>
#endif
#if HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
#if HAVE_VALGRIND
# if HAVE_VALGRIND_H
# include <valgrind.h>
# elif HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
# endif
#endif

#include "src/common/libutil/log.h"
Expand Down Expand Up @@ -1955,7 +1959,7 @@ static const struct flux_handle_ops broker_handle_ops = {
};


#if HAVE_VALGRIND_VALGRIND_H
#if HAVE_VALGRIND
/* Disable dlclose() during valgrind operation
*/
void I_WRAP_SONAME_FNNAME_ZZ(Za,dlclose)(void *dso) {}
Expand Down
2 changes: 1 addition & 1 deletion t/t5000-valgrind.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi
# run to be forced on the cmdline with -d, --debug.
#
have_valgrind_h() {
grep -q "^#define HAVE_VALGRIND_VALGRIND_H" ${FLUX_BUILD_DIR}/config/config.h
grep -q "^#define HAVE_VALGRIND 1" ${FLUX_BUILD_DIR}/config/config.h
}
if ! have_valgrind_h && test "$debug" = ""; then
skip_all='skipping valgrind tests b/c valgrind.h not found. Use -d, --debug to force'
Expand Down

0 comments on commit 77fbc2f

Please sign in to comment.