From 34eb36517f8fd95765ed145457107a837cec3f6f Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 19 Oct 2021 16:47:00 -0700 Subject: [PATCH 1/3] dhcp6relay: Save the dbgsym package into the target folder This makes it possible to install the debug symbols if needed. Signed-off-by: Saikrishna Arcot --- rules/dhcp6relay.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rules/dhcp6relay.mk b/rules/dhcp6relay.mk index d9ff506d8a27..0fc20c2938bf 100644 --- a/rules/dhcp6relay.mk +++ b/rules/dhcp6relay.mk @@ -8,3 +8,6 @@ $(SONIC_DHCP6RELAY)_DEPENDS = $(LIBSWSSCOMMON) $(LIBHIREDIS) $(LIBSWSSCOMMON_DEV $(DOCKER_DHCP_RELAY)_INSTALL_DEBS = $(LIBSWSSCOMMON) $(LIBHIREDIS) $(LIBSWSSCOMMON_DEV) $(LIBHIREDIS_DEV) $(SONIC_DHCP6RELAY)_SRC_PATH = $(SRC_PATH)/$(SONIC_DHCP6RELAY_PKG_NAME) SONIC_DPKG_DEBS += $(SONIC_DHCP6RELAY) + +SONIC_DHCP6RELAY_DBG = sonic-$(SONIC_DHCP6RELAY_PKG_NAME)-dbgsym_$(SONIC_DHCP6RELAY_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(SONIC_DHCP6RELAY),$(SONIC_DHCP6RELAY_DBG))) From 5fe3711ab6ec40a198a9233b077f33d6501c8d2f Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 19 Oct 2021 18:54:43 -0700 Subject: [PATCH 2/3] Install dhcp6relay-dbg into the debug version of sonic-dhcp-relay container Signed-off-by: Saikrishna Arcot --- rules/docker-dhcp-relay.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index 42d7a3f86b33..ff5e68d6d663 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -9,7 +9,7 @@ $(DOCKER_DHCP_RELAY)_PATH = $(DOCKERS_PATH)/$(DOCKER_DHCP_RELAY_STEM) $(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_RELAY) $(SONIC_DHCPMON) $(SONIC_DHCP6RELAY) $(LIBSWSSCOMMON) $(DOCKER_DHCP_RELAY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) -$(DOCKER_DHCP_RELAY)_DBG_DEPENDS += $(ISC_DHCP_RELAY_DBG) +$(DOCKER_DHCP_RELAY)_DBG_DEPENDS += $(ISC_DHCP_RELAY_DBG) $(SONIC_DHCP6RELAY_DBG) $(DOCKER_DHCP_RELAY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) From 1f1b3d171848e054892b3d72f33d18614b606c3c Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 20 Oct 2021 16:18:47 -0700 Subject: [PATCH 3/3] Fix building dhcp6relay with debug info Signed-off-by: Saikrishna Arcot --- src/dhcp6relay/Makefile | 4 ++-- src/dhcp6relay/src/subdir.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dhcp6relay/Makefile b/src/dhcp6relay/Makefile index 4cbeb37fd188..4d2eedd042ec 100644 --- a/src/dhcp6relay/Makefile +++ b/src/dhcp6relay/Makefile @@ -4,8 +4,8 @@ CP := cp MKDIR := mkdir CC := g++ MV := mv -LIBS := -levent -lhiredis -lswsscommon -pthread -lboost_thread -lboost_system -I $(PWD)/../sonic-swss-common/common -CFLAGS = -g -Wall -std=gnu11 +LIBS := -levent -lhiredis -lswsscommon -pthread -lboost_thread -lboost_system +CFLAGS = -g -Wall -std=c++17 -fPIC -I $(PWD)/../sonic-swss-common/common PWD := $(shell pwd) ifneq ($(MAKECMDGOALS),clean) diff --git a/src/dhcp6relay/src/subdir.mk b/src/dhcp6relay/src/subdir.mk index af378319d78f..1c93d490ec63 100644 --- a/src/dhcp6relay/src/subdir.mk +++ b/src/dhcp6relay/src/subdir.mk @@ -18,6 +18,6 @@ C_DEPS += \ src/%.o: src/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(CC) -std=c++17 -D__FILENAME__="$(subst src/,,$<)" $(LIBS) -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + $(CC) -D__FILENAME__="$(subst src/,,$<)" $(CFLAGS) -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' '