From f52ce302bcf2b99689141f273e46886359b34a98 Mon Sep 17 00:00:00 2001 From: Amulya Meka Date: Fri, 21 Jan 2022 06:49:50 +0000 Subject: [PATCH] runtime: rectify passing empty options to -ldflags When no options are passed to -ldflags, it passes incorrect values(in this case, $BUILDFLAGS) to it. Fix passing empty values by passing $KATA_LDFLAGS in quotes. Fixes: #3521 Signed-off-by: Amulya Meka --- src/runtime/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/Makefile b/src/runtime/Makefile index e09a999b5d..52e6ff51dd 100644 --- a/src/runtime/Makefile +++ b/src/runtime/Makefile @@ -553,10 +553,10 @@ endef GENERATED_FILES += pkg/katautils/config-settings.go $(RUNTIME_OUTPUT): $(SOURCES) $(GENERATED_FILES) $(MAKEFILE_LIST) | show-summary - $(QUIET_BUILD)(cd $(RUNTIME_DIR) && go build -ldflags $(KATA_LDFLAGS) $(BUILDFLAGS) -o $@ .) + $(QUIET_BUILD)(cd $(RUNTIME_DIR) && go build -ldflags "$(KATA_LDFLAGS)" $(BUILDFLAGS) -o $@ .) $(SHIMV2_OUTPUT): $(SOURCES) $(GENERATED_FILES) $(MAKEFILE_LIST) - $(QUIET_BUILD)(cd $(SHIMV2_DIR)/ && go build -ldflags $(KATA_LDFLAGS) $(BUILDFLAGS) -o $@ .) + $(QUIET_BUILD)(cd $(SHIMV2_DIR)/ && go build -ldflags "$(KATA_LDFLAGS)" $(BUILDFLAGS) -o $@ .) $(MONITOR_OUTPUT): $(SOURCES) $(GENERATED_FILES) $(MAKEFILE_LIST) .git-commit $(QUIET_BUILD)(cd $(MONITOR_DIR)/ && CGO_ENABLED=0 go build \