Commit 01452b1b authored by Duncan Bellamy's avatar Duncan Bellamy Committed by Tomasz Zawadzki
Browse files

thread/bdev: add check for execinfo.h for libc implementations that do not include it



Fixes #3036

Change-Id: I9bd3109b1589f2c3331b5173c7c91c409d265906
Signed-off-by: default avatarDuncan Bellamy <dunk@denkimushi.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/18852


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 6f76c505
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -209,6 +209,9 @@ CONFIG_HAVE_LIBBSD=n
# Is DPDK using libarchive?
CONFIG_HAVE_LIBARCHIVE=n

# execinfo.h is available
CONFIG_HAVE_EXECINFO_H=n

# Path to IPSEC_MB used by DPDK
CONFIG_IPSEC_MB_DIR=

+4 −0
Original line number Diff line number Diff line
@@ -1100,6 +1100,10 @@ if echo -e '#include <uuid/uuid.h>\nint main(void) { uuid_generate_sha1(NULL, NU
	CONFIG[HAVE_UUID_GENERATE_SHA1]="y"
fi

if echo -e '#include <execinfo.h>' | "${BUILD_CMD[@]}" -c - 2> /dev/null; then
	CONFIG[HAVE_EXECINFO_H]=y
fi

if [[ "${CONFIG[OCF]}" = "y" ]]; then
	# If OCF_PATH is a file, assume it is a library and use it to compile with
	if [ -f ${CONFIG[OCF_PATH]} ]; then
+4 −3
Original line number Diff line number Diff line
@@ -25,10 +25,9 @@
#ifdef __linux__
#include <sys/timerfd.h>
#include <sys/eventfd.h>
#include <execinfo.h>
#endif

#ifdef __FreeBSD__
#ifdef SPDK_HAVE_EXECINFO_H
#include <execinfo.h>
#endif

@@ -2946,7 +2945,7 @@ sspin_fini_internal(struct spdk_spinlock *sspin)
#endif
}

#ifdef DEBUG
#if defined(DEBUG) && defined(SPDK_HAVE_EXECINFO_H)
#define SSPIN_GET_STACK(sspin, which) \
	do { \
		if (sspin->internal != NULL) { \
@@ -2961,6 +2960,7 @@ sspin_fini_internal(struct spdk_spinlock *sspin)
static void
sspin_stack_print(const char *title, const struct sspin_stack *sspin_stack)
{
#ifdef SPDK_HAVE_EXECINFO_H
	char **stack;
	size_t i;

@@ -2980,6 +2980,7 @@ sspin_stack_print(const char *title, const struct sspin_stack *sspin_stack)
		SPDK_ERRLOG("    #%" PRIu64 ": %s\n", i, stack[i]);
	}
	free(stack);
#endif /* SPDK_HAVE_EXECINFO_H */
}

static void
+2 −0
Original line number Diff line number Diff line
@@ -4,7 +4,9 @@
 */

#include <ocf/ocf.h>
#ifdef SPDK_HAVE_EXECINFO_H
#include <execinfo.h>
#endif

#include "spdk/env.h"
#include "spdk/log.h"