2022-06-03 19:15:11 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2017-05-30 22:47:51 +00:00
|
|
|
# Copyright (c) Intel Corporation.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2021-09-24 12:08:29 +00:00
|
|
|
SPDK_MOCK_SYSCALLS += \
|
2021-02-26 15:17:45 +00:00
|
|
|
calloc \
|
|
|
|
pthread_mutexattr_init \
|
|
|
|
pthread_mutex_init \
|
|
|
|
recvmsg \
|
|
|
|
sendmsg \
|
|
|
|
writev
|
|
|
|
|
|
|
|
define add_wrap_with_prefix
|
|
|
|
$(2:%=-Wl,--wrap,$(1)%)
|
|
|
|
endef
|
|
|
|
|
|
|
|
ifeq ($(OS),Windows)
|
|
|
|
# Windows needs a thin layer above the system calls to provide POSIX
|
|
|
|
# functionality. For GCC, use the prefix wpdk_ to ensure that the layer
|
|
|
|
# is called. For other compilers, --wrap is not supported so the layer
|
|
|
|
# implements an alternative mechanism to enable mocking.
|
|
|
|
ifeq ($(CC_TYPE),gcc)
|
|
|
|
LDFLAGS += $(call add_wrap_with_prefix,wpdk_,$(SPDK_MOCK_SYSCALLS))
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
LDFLAGS += $(call add_wrap_with_prefix,,$(SPDK_MOCK_SYSCALLS))
|
|
|
|
endif
|