xref: /spdk/mk/spdk.common.mk (revision 18c8b52afa69f39481ebb75711b2f30b11693f9d)
1#  SPDX-License-Identifier: BSD-3-Clause
2#  Copyright (c) Intel Corporation.
3#  Copyright (c) 2017, IBM Corporation.
4#  Copyright (c) 2019, 2021 Mellanox Corporation.
5#  All rights reserved.
6#
7
8ifeq ($(wildcard $(SPDK_ROOT_DIR)/mk/config.mk),)
9$(error mk/config.mk: file not found. Please run configure before make)
10endif
11
12include $(SPDK_ROOT_DIR)/mk/config.mk
13-include $(SPDK_ROOT_DIR)/mk/cc.flags.mk
14-include $(SPDK_ROOT_DIR)/mk/cc.mk
15
16ifneq ($(V),1)
17Q ?= @
18endif
19S ?= $(notdir $(CURDIR))
20
21DESTDIR?=
22EXEEXT?=
23
24ifneq ($(prefix),)
25CONFIG_PREFIX=$(prefix)
26endif
27
28bindir?=$(CONFIG_PREFIX)/bin
29ifeq ($(CONFIG_LIBDIR),)
30libdir?=$(CONFIG_PREFIX)/lib
31else
32libdir?=$(CONFIG_LIBDIR)
33endif
34includedir?=$(CONFIG_PREFIX)/include
35
36ifeq ($(MAKECMDGOALS),)
37MAKECMDGOALS=$(.DEFAULT_GOAL)
38endif
39
40TARGET_TRIPLET := $(shell $(CC) -dumpmachine)
41TARGET_TRIPLET_WORDS := $(subst -, ,$(TARGET_TRIPLET))
42
43ifneq ($(filter linux%,$(TARGET_TRIPLET_WORDS)),)
44OS = Linux
45endif
46ifneq ($(filter freebsd%,$(TARGET_TRIPLET_WORDS)),)
47OS = FreeBSD
48endif
49ifneq ($(filter mingw% windows%,$(TARGET_TRIPLET_WORDS)),)
50OS = Windows
51endif
52
53TARGET_ARCHITECTURE ?= $(CONFIG_ARCH)
54TARGET_MACHINE := $(firstword $(TARGET_TRIPLET_WORDS))
55
56ifeq ($(OS),Windows)
57EXEEXT = .exe
58endif
59
60COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -fno-strict-aliasing -I$(SPDK_ROOT_DIR)/include
61
62ifneq ($(filter powerpc% ppc%,$(TARGET_MACHINE)),)
63COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE)
64else ifeq ($(TARGET_MACHINE),aarch64)
65COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
66COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
67else ifeq ('$(TARGET_MACHINE)|$(TARGET_ARCHITECTURE)','riscv64|native')
68# -march=native is not yet supported by GCC on RISC-V. Falling back to default.
69else
70COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
71endif
72
73ifeq ($(TARGET_MACHINE),x86_64)
74# Don't use AVX-512 instructions in SPDK code - it breaks Valgrind for
75# some cases where compiler decides to hyper-optimize a relatively
76# simple operation (like int-to-float converstion) using AVX-512
77COMMON_CFLAGS += -mno-avx512f
78endif
79
80ifeq ($(CONFIG_WERROR), y)
81COMMON_CFLAGS += -Werror
82endif
83
84ifeq ($(CONFIG_LTO),y)
85COMMON_CFLAGS += -flto
86LDFLAGS += -flto
87endif
88
89ifeq ($(CONFIG_PGO_CAPTURE),y)
90COMMON_CFLAGS += -fprofile-generate=$(SPDK_ROOT_DIR)/build/pgo
91LDFLAGS += -fprofile-generate=$(SPDK_ROOT_DIR)/build/pgo
92endif
93
94ifeq ($(CONFIG_PGO_USE),y)
95COMMON_CFLAGS += -fprofile-use=$(SPDK_ROOT_DIR)/build/pgo
96LDFLAGS += -fprofile-use=$(SPDK_ROOT_DIR)/build/pgo
97endif
98
99ifeq ($(CONFIG_CET),y)
100COMMON_CFLAGS += -fcf-protection
101LDFLAGS += -fcf-protection
102endif
103
104COMMON_CFLAGS += -Wformat -Wformat-security
105
106COMMON_CFLAGS += -D_GNU_SOURCE
107
108# Always build PIC code so that objects can be used in shared libs and position-independent executables
109COMMON_CFLAGS += -fPIC
110
111# Enable stack buffer overflow checking
112COMMON_CFLAGS += -fstack-protector
113
114ifeq ($(OS).$(CC_TYPE),Windows.gcc)
115# Workaround for gcc bug 86832 - invalid TLS usage
116COMMON_CFLAGS += -mstack-protector-guard=global
117endif
118
119# Prevent accidental multiple definitions of global variables
120COMMON_CFLAGS += -fno-common
121
122# Enable full RELRO - no lazy relocation (resolve everything at load time).
123# This allows the GOT to be made read-only early in the loading process.
124ifneq ($(OS),Windows)
125LDFLAGS += -Wl,-z,relro,-z,now
126endif
127
128# Make the stack non-executable.
129# This is the default in most environments, but it doesn't hurt to set it explicitly.
130ifneq ($(OS),Windows)
131LDFLAGS += -Wl,-z,noexecstack
132endif
133
134# Specify the linker to use
135ifneq ($(LD_TYPE),)
136LDFLAGS += -fuse-ld=$(LD_TYPE)
137endif
138
139SYS_LIBS =
140
141ifeq ($(OS),FreeBSD)
142SYS_LIBS += -L/usr/local/lib
143COMMON_CFLAGS += -I/usr/local/include
144endif
145
146# Attach only if PMDK lib specified with configure
147ifneq ($(CONFIG_PMDK_DIR),)
148LIBS += -L$(CONFIG_PMDK_DIR)/src/nondebug
149COMMON_CFLAGS += -I$(CONFIG_PMDK_DIR)/src/include
150endif
151
152ifeq ($(CONFIG_RDMA),y)
153SYS_LIBS += -libverbs -lrdmacm
154endif
155
156ifeq ($(CONFIG_URING),y)
157SYS_LIBS += -luring
158ifneq ($(strip $(CONFIG_URING_PATH)),)
159CFLAGS += -I$(CONFIG_URING_PATH)
160LDFLAGS += -L$(CONFIG_URING_PATH)
161endif
162endif
163
164IPSEC_MB_DIR=$(CONFIG_IPSEC_MB_DIR)
165
166ISAL_DIR=$(SPDK_ROOT_DIR)/isa-l
167ifeq ($(CONFIG_ISAL), y)
168SYS_LIBS += -L$(ISAL_DIR)/.libs -lisal
169COMMON_CFLAGS += -I$(ISAL_DIR)/..
170endif
171
172ifeq ($(CONFIG_VFIO_USER), y)
173ifneq ($(CONFIG_VFIO_USER_DIR),)
174VFIO_USER_SRC_DIR=$(CONFIG_VFIO_USER_DIR)
175else
176VFIO_USER_SRC_DIR=$(SPDK_ROOT_DIR)/libvfio-user
177endif
178ifeq ($(CONFIG_DEBUG), y)
179VFIO_USER_BUILD_TYPE=debug
180else
181VFIO_USER_BUILD_TYPE=release
182endif
183ifeq ($(CONFIG_SHARED), y)
184VFIO_USER_BUILD_SHARED=shared
185else
186VFIO_USER_BUILD_SHARED=static
187endif
188VFIO_USER_LIB_PREFIX=/usr/local/lib
189VFIO_USER_BUILD_DIR=$(SPDK_ROOT_DIR)/build/libvfio-user/build-$(VFIO_USER_BUILD_TYPE)
190VFIO_USER_INSTALL_DIR=$(SPDK_ROOT_DIR)/build/libvfio-user
191VFIO_USER_INCLUDE_DIR=$(VFIO_USER_INSTALL_DIR)/usr/local/include
192VFIO_USER_LIBRARY_DIR=$(VFIO_USER_INSTALL_DIR)$(VFIO_USER_LIB_PREFIX)
193
194CFLAGS += -I$(VFIO_USER_INCLUDE_DIR)
195LDFLAGS += -L$(VFIO_USER_LIBRARY_DIR)
196SYS_LIBS += -lvfio-user -ljson-c
197endif
198
199ifeq ($(CONFIG_XNVME), y)
200XNVME_DIR=$(SPDK_ROOT_DIR)/xnvme
201XNVME_INSTALL_DIR=$(XNVME_DIR)/builddir/lib
202XNVME_INCLUDE_DIR=$(XNVME_DIR)/include
203
204CFLAGS += -I$(XNVME_INCLUDE_DIR)
205LDFLAGS += -L$(XNVME_INSTALL_DIR)
206SYS_LIBS += -lxnvme
207endif
208
209ifeq ($(CONFIG_DAOS),y)
210ifneq ($(CONFIG_DAOS_DIR),)
211CFLAGS += -I$(CONFIG_DAOS_DIR)/include
212LDFLAGS += -L$(CONFIG_DAOS_DIR)/lib64
213endif
214endif
215
216#Attach only if FreeBSD and RDMA is specified with configure
217ifeq ($(OS),FreeBSD)
218ifeq ($(CONFIG_RDMA),y)
219# Mellanox - MLX4 HBA Userspace Library
220ifneq ("$(wildcard /usr/lib/libmlx4.*)","")
221SYS_LIBS += -lmlx4
222endif
223# Mellanox - MLX5 HBA Userspace Library
224ifneq ("$(wildcard /usr/lib/libmlx5.*)","")
225SYS_LIBS += -lmlx5
226endif
227# Chelsio HBA Userspace Library
228ifneq ("$(wildcard /usr/lib/libcxgb4.*)","")
229SYS_LIBS += -lcxgb4
230endif
231endif
232endif
233
234ifeq ($(CONFIG_FC),y)
235ifneq ($(strip $(CONFIG_FC_PATH)),)
236SYS_LIBS += -L$(CONFIG_FC_PATH)
237endif
238SYS_LIBS += -lufc
239endif
240
241ifeq ($(CONFIG_DEBUG), y)
242COMMON_CFLAGS += -DDEBUG -O0 -fno-omit-frame-pointer
243else
244COMMON_CFLAGS += -DNDEBUG -O2
245# Enable _FORTIFY_SOURCE checks - these only work when optimizations are enabled.
246COMMON_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
247endif
248
249ifeq ($(CONFIG_COVERAGE), y)
250COMMON_CFLAGS += -fprofile-arcs -ftest-coverage
251LDFLAGS += -fprofile-arcs -ftest-coverage
252ifeq ($(OS),FreeBSD)
253LDFLAGS += --coverage
254endif
255endif
256
257ifeq ($(OS),Windows)
258WPDK_DIR = $(abspath $(CONFIG_WPDK_DIR))
259COMMON_CFLAGS += -I$(WPDK_DIR)/include/wpdk -I$(WPDK_DIR)/include
260LDFLAGS += -L$(WPDK_DIR)/lib
261ifeq ($(CONFIG_SHARED),y)
262SYS_LIBS += -lwpdk
263else
264SYS_LIBS += $(WPDK_DIR)/lib/libwpdk.a
265endif
266SYS_LIBS += -ldbghelp -lkernel32 -lsetupapi -lws2_32 -lrpcrt4 -liphlpapi
267endif
268
269include $(CONFIG_ENV)/env.mk
270
271ifeq ($(CONFIG_ASAN),y)
272COMMON_CFLAGS += -fsanitize=address
273LDFLAGS += -fsanitize=address
274endif
275
276ifeq ($(CONFIG_UBSAN),y)
277COMMON_CFLAGS += -fsanitize=undefined
278LDFLAGS += -fsanitize=undefined
279endif
280
281ifeq ($(CONFIG_TSAN),y)
282COMMON_CFLAGS += -fsanitize=thread
283LDFLAGS += -fsanitize=thread
284endif
285
286ifeq ($(CONFIG_FUZZER),y)
287COMMON_CFLAGS += -fsanitize=fuzzer-no-link
288LDFLAGS += -fsanitize=fuzzer-no-link
289SYS_LIBS += $(CONFIG_FUZZER_LIB)
290endif
291
292SPDK_GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
293ifneq (, $(SPDK_GIT_COMMIT))
294COMMON_CFLAGS += -DSPDK_GIT_COMMIT=$(SPDK_GIT_COMMIT)
295endif
296
297ifneq ($(OS),Windows)
298COMMON_CFLAGS += -pthread
299SYS_LIBS += -pthread
300endif
301
302ifeq ($(CONFIG_IDXD_KERNEL),y)
303SYS_LIBS += -laccel-config
304endif
305
306CFLAGS   += $(COMMON_CFLAGS) -Wno-pointer-sign -Wstrict-prototypes -Wold-style-definition -std=gnu99
307CXXFLAGS += $(COMMON_CFLAGS) -std=c++11
308
309SYS_LIBS += -lrt
310SYS_LIBS += -luuid
311SYS_LIBS += -lssl
312SYS_LIBS += -lcrypto
313SYS_LIBS += -lm
314
315PKGCONF ?= pkg-config
316ifneq ($(strip $(CONFIG_OPENSSL_PATH)),)
317CFLAGS += -I$(CONFIG_OPENSSL_PATH)/include
318LDFLAGS += -L$(CONFIG_OPENSSL_PATH)
319else
320# `libssl11` name is unique to Centos7 via EPEL
321# So it's safe to add it here without additional check for Centos7
322ifeq ($(shell $(PKGCONF) --exists libssl11 && echo 1),1)
323CFLAGS  += $(shell $(PKGCONF) --cflags libssl11)
324LDFLAGS += $(shell $(PKGCONF) --libs libssl11)
325endif
326endif
327
328ifneq ($(CONFIG_NVME_CUSE)$(CONFIG_FUSE),nn)
329SYS_LIBS += -lfuse3
330endif
331
332ifeq ($(OS).$(CC_TYPE),Windows.gcc)
333# Include libssp.a for stack-protector and _FORTIFY_SOURCE
334SYS_LIBS += -l:libssp.a
335endif
336
337MAKEFLAGS += --no-print-directory
338
339C_SRCS += $(C_SRCS-y)
340CXX_SRCS += $(CXX_SRCS-y)
341
342OBJS = $(C_SRCS:.c=.o) $(CXX_SRCS:.cpp=.o)
343
344DEPFLAGS = -MMD -MP -MF $*.d.tmp
345
346# Compile first input $< (.c) into $@ (.o)
347COMPILE_C=\
348	$(Q)echo "  CC $S/$@"; \
349	$(CC) -o $@ $(DEPFLAGS) $(CFLAGS) -c $< && \
350	mv -f $*.d.tmp $*.d && touch -c $@
351
352COMPILE_CXX=\
353	$(Q)echo "  CXX $S/$@"; \
354	$(CXX) -o $@ $(DEPFLAGS) $(CXXFLAGS) -c $< && \
355	mv -f $*.d.tmp $*.d && touch -c $@
356
357ENV_LDFLAGS = $(if $(SPDK_NO_LINK_ENV),,$(ENV_LINKER_ARGS))
358
359# Link $(OBJS) and $(LIBS) into $@ (app)
360LINK_C=\
361	$(Q)echo "  LINK $(notdir $@)"; \
362	$(CC) -o $@ $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) $(ENV_LDFLAGS) $(SYS_LIBS)
363
364LINK_CXX=\
365	$(Q)echo "  LINK $(notdir $@)"; \
366	$(CXX) -o $@ $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) $(ENV_LDFLAGS) $(SYS_LIBS)
367
368# Provide function to ease build of a shared lib
369define spdk_build_realname_shared_lib
370	$(1) -o $@ -shared $(CPPFLAGS) $(LDFLAGS) \
371	    -Wl,-rpath=$(DESTDIR)/$(libdir) \
372	    -Wl,--soname,$(notdir $@) \
373	    -Wl,--whole-archive $(2) -Wl,--no-whole-archive \
374	    -Wl,--version-script=$(3) \
375	    $(4) -Wl,--no-as-needed $(5) -Wl,--as-needed
376endef
377
378BUILD_LINKERNAME_LIB=\
379	ln -sf $(notdir $<) $@
380
381# Archive $(OBJS) into $@ (.a)
382LIB_C=\
383	$(Q)echo "  LIB $(notdir $@)"; \
384	rm -f $@; \
385	mkdir -p $(dir $@); \
386	$(CCAR) crDs $@ $(OBJS)
387
388# Clean up generated files listed as arguments plus a default list
389CLEAN_C=\
390	$(Q)rm -f *.a *.lib *.o *.obj *.d *.d.tmp *.pdb *.gcno *.gcda
391
392# Install a library
393INSTALL_LIB=\
394	$(Q)echo "  INSTALL $(DESTDIR)$(libdir)/$(notdir $(LIB))"; \
395	install -d -m 755 "$(DESTDIR)$(libdir)"; \
396	install -m 644 "$(LIB)" "$(DESTDIR)$(libdir)/"
397
398# Uninstall a library
399UNINSTALL_LIB=\
400	$(Q)echo "  UNINSTALL $(DESTDIR)$(libdir)/$(notdir $(LIB))";\
401	rm -f "$(DESTDIR)$(libdir)/$(notdir $(LIB))"; \
402	if [ -d "$(DESTDIR)$(libdir)" ] && [ $$(ls -A "$(DESTDIR)$(libdir)" | wc -l) -eq 0 ]; then rm -rf "$(DESTDIR)$(libdir)"; fi
403
404define pkgconfig_install
405	echo "  INSTALL $(DESTDIR)$(libdir)/pkgconfig/$(notdir $(1))";
406	install -d -m 755 "$(DESTDIR)$(libdir)/pkgconfig";
407	install -m 644 "$(1)" "$(DESTDIR)$(libdir)/pkgconfig";
408endef
409
410define pkgconfig_uninstall
411	echo "  UNINSTALL $(DESTDIR)$(libdir)/pkgconfig/$(notdir $(1))";
412	rm -f "$(DESTDIR)$(libdir)/pkgconfig/$(notdir $(1))";
413	if [ -d "$(DESTDIR)$(libdir)/pkgconfig" ] && [ $$(ls -A "$(DESTDIR)$(libdir)/pkgconfig" | wc -l) -eq 0 ]; then rm -rf "$(DESTDIR)$(libdir)/pkgconfig"; fi;
414endef
415
416ifeq ($(OS),FreeBSD)
417INSTALL_REL_SYMLINK := install -l rs
418else
419INSTALL_REL_SYMLINK := ln -sf -r
420endif
421
422define spdk_install_lib_symlink
423	$(INSTALL_REL_SYMLINK) $(DESTDIR)$(libdir)/$(1) $(DESTDIR)$(libdir)/$(2)
424endef
425
426INSTALL_SHARED_LIB=\
427	$(Q)echo "  INSTALL $(DESTDIR)$(libdir)/$(notdir $(SHARED_LINKED_LIB))"; \
428	install -d -m 755 "$(DESTDIR)$(libdir)"; \
429	if file $(SHARED_REALNAME_LIB) | grep -q 'LSB shared object'; then \
430		perm_mode=755; \
431	else \
432		perm_mode=644; \
433	fi; \
434	install -m $$perm_mode "$(SHARED_REALNAME_LIB)" "$(DESTDIR)$(libdir)/"; \
435	$(call spdk_install_lib_symlink,$(notdir $(SHARED_REALNAME_LIB)),$(notdir $(SHARED_LINKED_LIB)));
436
437# Uninstall an shared library
438UNINSTALL_SHARED_LIB=\
439	$(Q)echo "  UNINSTALL $(DESTDIR)$(libdir)/$(notdir $(SHARED_LINKED_LIB))"; \
440	rm -f "$(DESTDIR)$(libdir)/$(notdir $(SHARED_LINKED_LIB))"; \
441	rm -f "$(DESTDIR)$(libdir)/$(notdir $(SHARED_REALNAME_LIB))"; \
442	if [ -d "$(DESTDIR)$(libdir)" ] && [ $$(ls -A "$(DESTDIR)$(libdir)" | wc -l) -eq 0 ]; then rm -rf "$(DESTDIR)$(libdir)"; fi
443
444
445# Install an app binary
446INSTALL_APP=\
447	$(Q)echo "  INSTALL $(DESTDIR)$(bindir)/$(notdir $<)"; \
448	install -d -m 755 "$(DESTDIR)$(bindir)"; \
449	install -m 755 "$<" "$(DESTDIR)$(bindir)/"
450
451# Uninstall an app binary
452UNINSTALL_APP=\
453        $(Q)echo "  UNINSTALL $(DESTDIR)$(bindir)/$(notdir $(APP))"; \
454	rm -f "$(DESTDIR)$(bindir)/$(notdir $(APP))"; \
455	if [ -d "$(DESTDIR)$(bindir)" ] && [ $$(ls -A "$(DESTDIR)$(bindir)" | wc -l) -eq 0 ]; then rm -rf "$(DESTDIR)$(bindir)"; fi
456
457INSTALL_EXAMPLE=\
458	$(Q)echo "  INSTALL $(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \
459	install -d -m 755 "$(DESTDIR)$(bindir)"; \
460	install -m 755 "$<" "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"
461
462# Uninstall an example binary
463UNINSTALL_EXAMPLE=\
464	$(Q)echo "  UNINSTALL $(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \
465	rm -f "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \
466	if [ -d "$(DESTDIR)$(bindir)" ] && [ $$(ls -A "$(DESTDIR)$(bindir)" | wc -l) -eq 0 ]; then rm -rf "$(DESTDIR)$(bindir)"; fi
467
468# Install a header
469INSTALL_HEADER=\
470	$(Q)echo "  INSTALL $@"; \
471	install -d -m 755 "$(DESTDIR)$(includedir)/$(dir $(patsubst $(DESTDIR)$(includedir)/%,%,$@))"; \
472	install -m 644 "$(patsubst $(DESTDIR)$(includedir)/%,%,$@)" "$(DESTDIR)$(includedir)/$(dir $(patsubst $(DESTDIR)$(includedir)/%,%,$@))";
473
474# Uninstall a header
475UNINSTALL_HEADER=\
476	$(Q)echo "  UNINSTALL $@"; \
477	rm -rf "$(DESTDIR)$(includedir)/$(dir $(patsubst $(DESTDIR)$(includedir)/%,%,$@))$(notdir $@)"; \
478	if [ -d "$(DESTDIR)$(includedir)/$(dir $(patsubst $(DESTDIR)$(includedir)/%,%,$@))" ] \
479	&& [ $$(ls -A "$(DESTDIR)$(includedir)/$(dir $(patsubst $(DESTDIR)$(includedir)/%,%,$@))" | wc -l) -eq 0 ]; \
480	then rm -rf "$(DESTDIR)$(includedir)/$(dir $(patsubst $(DESTDIR)$(includedir)/%,%,$@))"; fi
481
482%.o: %.c %.d $(MAKEFILE_LIST)
483	$(COMPILE_C)
484
485%.o: %.cpp %.d $(MAKEFILE_LIST)
486	$(COMPILE_CXX)
487
488%.d: ;
489
490define spdk_lib_list_to_static_libs
491$(1:%=$(SPDK_ROOT_DIR)/build/lib/libspdk_%.a)
492endef
493
494define spdk_lib_list_to_shared_libs
495$(1:%=$(SPDK_ROOT_DIR)/build/lib/libspdk_%.so)
496endef
497
498define add_no_as_needed
499-Wl,--no-as-needed $(1) -Wl,-as-needed
500endef
501
502define add_whole_archive
503-Wl,--whole-archive $(1) -Wl,--no-whole-archive
504endef
505
506define pkgconfig_filename
507$(SPDK_ROOT_DIR)/build/lib/pkgconfig/$(1).pc
508endef
509