Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master][build] fix compile error when enable nostrip #6058

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions rules/functions
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,12 @@ $(foreach deb,$(1), \
fi; \
done; } )
endef

###############################################################################
## src/*/Makefile functions
###############################################################################
define add_dbgsym_debs
ifneq ($(findstring nostrip, $(1)), nostrip)
DERIVED_TARGETS = $(2) $(3)
endif
endef
7 changes: 6 additions & 1 deletion src/hiredis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = libhiredis0.14_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = libhiredis0.14-dbgsym_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb libhiredis-dev_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
DEBUG_TARGETS = libhiredis0.14-dbgsym_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = libhiredis-dev_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf hiredis-$(HIREDIS_VERSION)
Expand Down
7 changes: 6 additions & 1 deletion src/isc-dhcp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = $(ISC_DHCP_RELAY)
DERIVED_TARGETS = $(ISC_DHCP_RELAY_DBG)
DEBUG_TARGETS = $(ISC_DHCP_RELAY_DBG)
DERIVED_TARGETS =

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
Expand Down
12 changes: 8 additions & 4 deletions src/libteam/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = libteam5_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = libteam-dev_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
libteamdctl0_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
libteam-utils_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
libteam5-dbgsym_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
DEBUG_TARGETS = libteam5-dbgsym_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
libteamdctl0-dbgsym_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
libteam-utils-dbgsym_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = libteam-dev_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
libteamdctl0_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb \
libteam-utils_$(LIBTEAM_VERSION)_$(CONFIGURED_ARCH).deb

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Obtain libteam
Expand Down
7 changes: 6 additions & 1 deletion src/libyang/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = $(LIBYANG)
DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG) $(LIBYANG_PY2) $(LIBYANG_PY3) $(LIBYANG_CPP)
DEBUG_TARGETS = $(LIBYANG_DBG)
DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_PY2) $(LIBYANG_PY3) $(LIBYANG_CPP)

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Obtaining the libyang
Expand Down
7 changes: 6 additions & 1 deletion src/lldpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = $(LLDPD)
DERIVED_TARGETS = $(LIBLLDPCTL) $(LLDPD_DBG)
DEBUG_TARGETS = $(LLDPD_DBG)
DERIVED_TARGETS = $(LIBLLDPCTL)

LLDP_URL = https://sonicstorage.blob.core.windows.net/debian/pool/main/l/lldpd

Expand All @@ -15,6 +18,8 @@ DSC_FILE_URL = $(LLDP_URL)/$(DSC_FILE)
ORIG_FILE_URL = $(LLDP_URL)/$(ORIG_FILE)
DEBIAN_FILE_URL = $(LLDP_URL)/$(DEBIAN_FILE)

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
rm -rf lldpd-$(LLDPD_VERSION)
Expand Down
11 changes: 7 additions & 4 deletions src/lm-sensors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = $(LM_SENSORS)
DEBUG_TARGETS = $(LM_SENSORS_DBG) \
$(LIBSENSORS_DBG) \
$(SENSORD_DBG)
DERIVED_TARGETS = fancontrol_$(LM_SENSORS_VERSION_FULL)_all.deb \
$(LIBSENSORS) \
sensord_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
$(LM_SENSORS_DBG) \
$(LIBSENSORS_DBG) \
$(SENSORD_DBG)
sensord_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf lm-sensors-$(LM_SENSORS_VERSION)
Expand Down
7 changes: 6 additions & 1 deletion src/monit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = monit_$(MONIT_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = monit-dbgsym_$(MONIT_VERSION)_$(CONFIGURED_ARCH).deb
DEBUG_TARGETS = monit-dbgsym_$(MONIT_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS =

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
Expand Down
7 changes: 6 additions & 1 deletion src/openssh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = openssh-server_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = openssh-server-dbgsym_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb
DEBUG_TARGETS = openssh-server-dbgsym_$(OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS =

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Obtain openssh: https://salsa.debian.org/ssh-team/openssh/-/tree/debian/1%257.9p1-10+deb10u2
Expand Down
8 changes: 6 additions & 2 deletions src/redis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e

include /sonic/rules/functions

REDIS_VERSION = 5.0.3
REDIS_VERSION_FULL = $(REDIS_VERSION)-3~bpo9+2

MAIN_TARGET = redis-server_$(REDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
DEBUG_TARGETS = redis-tools-dbgsym_$(REDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = redis-tools_$(REDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
redis-sentinel_$(REDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
redis-tools-dbgsym_$(REDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
redis-sentinel_$(REDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf redis_build
Expand Down
7 changes: 6 additions & 1 deletion src/sflow/hsflowd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = $(HSFLOWD)
DERIVED_TARGET = $(HSFLOWD_DBG)
DEBUG_TARGETS = $(HSFLOWD_DBG)
DERIVED_TARGET =

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -fr ./host-sflow
Expand Down
8 changes: 6 additions & 2 deletions src/snmpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@ SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = libsnmp-base_$(SNMPD_VERSION_FULL)_all.deb
DEBUG_TARGETS = snmp-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmpd-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = snmptrapd_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmp_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmpd_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmp-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmpd-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp30_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp30-dbg_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp-dev_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp-perl_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
python-netsnmp_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
tkmib_$(SNMPD_VERSION_FULL)_all.deb

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf net-snmp-$(SNMPD_VERSION)

Expand Down
7 changes: 6 additions & 1 deletion src/sonic-frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = $(FRR)
DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(FRR_SNMP) $(FRR_SNMP_DBG)
DEBUG_TARGETS = $(FRR_DBG) $(FRR_SNMP_DBG)
DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_SNMP)
SUFFIX = $(shell date +%Y%m%d\.%H%M%S)
STG_BRANCH = stg_temp.$(SUFFIX)

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package
pushd ./frr
Expand Down
7 changes: 6 additions & 1 deletion src/swig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

include /sonic/rules/functions

MAIN_TARGET = $(SWIG_BASE)
DERIVED_TARGETS = $(SWIG) $(SWIG_DBG)
DEBUG_TARGETS = $(SWIG_DBG)
DERIVED_TARGETS = $(SWIG)

$(eval $(call add_dbgsym_debs, $(DEB_BUILD_OPTIONS), $(DEBUG_TARGETS), $(DERIVED_TARGETS)))

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -fr ./swig-$(SWIG_VERSION) *.deb
Expand Down
6 changes: 5 additions & 1 deletion src/systemd-sonic-generator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ CFLAGS=-std=gnu99

BINARY = systemd-sonic-generator
MAIN_TARGET = $(BINARY)_1.0.0_$(CONFIGURED_ARCH).deb
DEBUG_TARGETS = $(BINARY)-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-buildpackage -us -uc -b
mv ../$(MAIN_TARGET) $(DEST)/
rm ../$(BINARY)-* ../$(BINARY)_*
rm ../$(BINARY)_*
ifneq ($(findstring nostrip,$(DEB_BUILD_OPTIONS)),nostrip)
rm ../$(DEBUG_TARGETS)
endif

$(BINARY): systemd-sonic-generator.c
rm -f ./systemd-sonic-generator
Expand Down