From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 3/4] Add library version extenstion Date: Wed, 14 Jan 2015 16:48:16 +0100 Message-ID: <7480851.rW1TfZW1Fg@xps13> References: <1419109299-9603-1-git-send-email-nhorman@tuxdriver.com> <1419349913-21674-1-git-send-email-nhorman@tuxdriver.com> <1419349913-21674-3-git-send-email-nhorman@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Neil Horman Return-path: In-Reply-To: <1419349913-21674-3-git-send-email-nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-12-23 10:51, Neil Horman: > To differentiate libraries that break ABI, we add a library version number > suffix to the library, which must be incremented when a given libraries ABI is > broken. This patch enforces that addition, sets the initial abi soname > extension to 1 for each library and creates a symlink to the base SONAME so that > the test applications will link properly. [...] > --- a/mk/rte.lib.mk > +++ b/mk/rte.lib.mk > @@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk > > # VPATH contains at least SRCDIR > VPATH += $(SRCDIR) > - > ifeq ($(RTE_BUILD_SHARED_LIB),y) > -LIB := $(patsubst %.a,%.so,$(LIB)) > > +LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB)) > CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP) > > endif > @@ -63,6 +62,7 @@ build: _postbuild > > exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) > > + Newline changes seem weird. > ifeq ($(LINK_USING_CC),1) > # Override the definition of LD here, since we're linking with CC > LD := $(CC) $(CPU_CFLAGS) > @@ -113,6 +113,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib; > # > ifeq ($(RTE_BUILD_SHARED_LIB),y) > $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE > +ifeq ($(LIBABIVER),) > + @echo "Must Specify a $(LIB) ABI version" > + @exit 1 I think (not sure) that @false is better handled than @exit in case of parallel processing. > +endif > @[ -d $(dir $@) ] || mkdir -p $(dir $@) > $(if $(D),\ > @echo -n "$< -> $@ " ; \ > @@ -126,6 +130,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE > $(depfile_missing),\ > $(depfile_newer)),\ > $(O_TO_S_DO)) > + > ifeq ($(RTE_BUILD_COMBINE_LIBS),y) > $(if $(or \ > $(file_missing),\ > @@ -163,9 +168,13 @@ endif > # install lib in $(RTE_OUTPUT)/lib > # > $(RTE_OUTPUT)/lib/$(LIB): $(LIB) > + $(eval LIBSONAME := $(basename $(LIB))) > @echo " INSTALL-LIB $(LIB)" > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib > +ifeq ($(RTE_BUILD_SHARED_LIB),y) > + $(Q)ln -s -f ./$(LIB) $(RTE_OUTPUT)/lib/$(LIBSONAME) > +endif Why using ./ ? Why using the eval trick for $(LIBSONAME) instead of $(basename $(LIB)) ? Even better, you could use $< instead of $(LIB), matter of taste. -- Thomas