From 9ae6f5893b4a4e5d60d82b80d4feea1a8db8d5fd Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 24 Sep 2020 00:12:58 +0000 Subject: [PATCH] build: only link rt where needed Only libraries that are using shm_open require linking rt when creating the shared library. Stop including it on every library and just add it to LOCAL_SYS_LIBS in the one case where it is used (spdk_trace). Signed-off-by: Jim Harris Change-Id: Ic13128873a76c355b14871a0dea0922488c9cd13 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4370 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker Reviewed-by: Aleksey Marchuk --- lib/trace/Makefile | 1 + mk/spdk.lib.mk | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/trace/Makefile b/lib/trace/Makefile index 9102c320a..f9a3efb05 100644 --- a/lib/trace/Makefile +++ b/lib/trace/Makefile @@ -39,6 +39,7 @@ SO_MINOR := 0 C_SRCS = trace.c trace_flags.c trace_rpc.c LIBNAME = trace +LOCAL_SYS_LIBS = -lrt SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_trace.map) diff --git a/mk/spdk.lib.mk b/mk/spdk.lib.mk index 926c82bcc..39bf907ff 100644 --- a/mk/spdk.lib.mk +++ b/mk/spdk.lib.mk @@ -60,9 +60,7 @@ DEP := $(LIB) endif ifeq ($(OS),FreeBSD) -LOCAL_SYS_LIBS += -L/usr/local/lib -lrt -else -LOCAL_SYS_LIBS += -lrt +LOCAL_SYS_LIBS += -L/usr/local/lib endif define subdirs_rule