From: Neil Horman Date: Mon, 2 Feb 2015 17:40:21 +0000 (-0500) Subject: mk: add library version extension X-Git-Tag: spdx-start~9790 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=133b75923b17ca7140a958651aff40e53d1e8e83;p=dpdk.git mk: add library version extension 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. Signed-off-by: Neil Horman Acked-by: Sergio Gonzalez Monroy --- diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile index aba885b1c7..68dc248e77 100644 --- a/lib/librte_acl/Makefile +++ b/lib/librte_acl/Makefile @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) EXPORT_MAP := rte_acl_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile index a4f73ded54..032c240f5e 100644 --- a/lib/librte_cfgfile/Makefile +++ b/lib/librte_cfgfile/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_cfgfile_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile index 3c71831d24..719dff6592 100644 --- a/lib/librte_cmdline/Makefile +++ b/lib/librte_cmdline/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_cmdline_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile index 0bab870bb5..0c57533c10 100644 --- a/lib/librte_compat/Makefile +++ b/lib/librte_compat/Makefile @@ -32,6 +32,8 @@ include $(RTE_SDK)/mk/rte.vars.mk +LIBABIVER := 1 + # install includes SYMLINK-y-include := rte_compat.h diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile index 3674a2c45f..4c9af172a0 100644 --- a/lib/librte_distributor/Makefile +++ b/lib/librte_distributor/Makefile @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) EXPORT_MAP := rte_distributor_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile index 0b5f9d978d..ae214a4dbc 100644 --- a/lib/librte_eal/bsdapp/eal/Makefile +++ b/lib/librte_eal/bsdapp/eal/Makefile @@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3 EXPORT_MAP := rte_eal_version.map +LIBABIVER := 1 + # specific to linuxapp exec-env SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile index bae8af1d00..e117cecdd9 100644 --- a/lib/librte_eal/linuxapp/eal/Makefile +++ b/lib/librte_eal/linuxapp/eal/Makefile @@ -35,6 +35,8 @@ LIB = librte_eal.a EXPORT_MAP := rte_eal_version.map +LIBABIVER := 1 + VPATH += $(RTE_SDK)/lib/librte_eal/common CFLAGS += -I$(SRCDIR)/include diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile index 80ad78de64..c0e576835e 100644 --- a/lib/librte_ether/Makefile +++ b/lib/librte_ether/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_ether_version.map +LIBABIVER := 1 + SRCS-y += rte_ethdev.c # diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile index bec61ab85e..3696cb1b5f 100644 --- a/lib/librte_hash/Makefile +++ b/lib/librte_hash/Makefile @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) EXPORT_MAP := rte_hash_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile index aa88578482..fe926f7ec0 100644 --- a/lib/librte_ip_frag/Makefile +++ b/lib/librte_ip_frag/Makefile @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) EXPORT_MAP := rte_ipfrag_version.map +LIBABIVER := 1 + #source files ifeq ($(CONFIG_RTE_MBUF_REFCNT),y) SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile index 068ee10420..16defdbaac 100644 --- a/lib/librte_ivshmem/Makefile +++ b/lib/librte_ivshmem/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_ivshmem_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile index 93a516d222..7107832f6f 100644 --- a/lib/librte_kni/Makefile +++ b/lib/librte_kni/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing EXPORT_MAP := rte_kni_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile index b1c34f3231..87b09f2048 100644 --- a/lib/librte_kvargs/Makefile +++ b/lib/librte_kvargs/Makefile @@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_kvargs_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile index 821463025a..35e6389d4b 100644 --- a/lib/librte_lpm/Makefile +++ b/lib/librte_lpm/Makefile @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) EXPORT_MAP := rte_lpm_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile index 15b7eed64d..947e41c9d4 100644 --- a/lib/librte_malloc/Makefile +++ b/lib/librte_malloc/Makefile @@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk # library name LIB = librte_malloc.a +LIBABIVER := 1 + CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_malloc_version.map diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile index 03becae834..080f3cf720 100644 --- a/lib/librte_mbuf/Makefile +++ b/lib/librte_mbuf/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_mbuf_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile index 31d1a712f3..940d1f77ac 100644 --- a/lib/librte_mempool/Makefile +++ b/lib/librte_mempool/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_mempool_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y) diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile index c4a7a32124..8765881de1 100644 --- a/lib/librte_meter/Makefile +++ b/lib/librte_meter/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_meter_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile index 15b58df587..15e406be66 100644 --- a/lib/librte_pipeline/Makefile +++ b/lib/librte_pipeline/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pipeline_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile index 85a78604f7..f0bf53716a 100644 --- a/lib/librte_pmd_af_packet/Makefile +++ b/lib/librte_pmd_af_packet/Makefile @@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a EXPORT_MAP := rte_pmd_af_packet_version.map +LIBABIVER := 1 + CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile index 074110a0d7..d6c81a86a5 100644 --- a/lib/librte_pmd_bond/Makefile +++ b/lib/librte_pmd_bond/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_eth_bond_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile index cd1444438a..8c8fed85fe 100644 --- a/lib/librte_pmd_e1000/Makefile +++ b/lib/librte_pmd_e1000/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_e1000_version.map +LIBABIVER := 1 + ifeq ($(CC), icc) # # CFLAGS for icc diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile index 697231c888..251a898cd7 100644 --- a/lib/librte_pmd_enic/Makefile +++ b/lib/librte_pmd_enic/Makefile @@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a EXPORT_MAP := rte_pmd_enic_version.map +LIBABIVER := 1 + CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ CFLAGS += -O3 diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile index 73de373754..9a0eec8808 100644 --- a/lib/librte_pmd_i40e/Makefile +++ b/lib/librte_pmd_i40e/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_i40e_version.map +LIBABIVER := 1 + # # Add extra flags for base driver files (also known as shared code) # to disable warnings diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile index e0a17f621c..d580f628ef 100644 --- a/lib/librte_pmd_ixgbe/Makefile +++ b/lib/librte_pmd_ixgbe/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_ixgbe_version.map +LIBABIVER := 1 + ifeq ($(CC), icc) # # CFLAGS for icc diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile index cb6678e3f8..0775dbc294 100644 --- a/lib/librte_pmd_pcap/Makefile +++ b/lib/librte_pmd_pcap/Makefile @@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_pcap_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile index aa1b461678..e442d0bb65 100644 --- a/lib/librte_pmd_ring/Makefile +++ b/lib/librte_pmd_ring/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_eth_ring_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile index d979c59cc3..793067f7a2 100644 --- a/lib/librte_pmd_virtio/Makefile +++ b/lib/librte_pmd_virtio/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_virtio_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile index f3ab178b65..93e55801d9 100644 --- a/lib/librte_pmd_vmxnet3/Makefile +++ b/lib/librte_pmd_vmxnet3/Makefile @@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3 EXPORT_MAP := rte_pmd_vmxnet3_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile index 4510603aae..f0c796cea6 100644 --- a/lib/librte_pmd_xenvirt/Makefile +++ b/lib/librte_pmd_xenvirt/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_eth_xenvirt_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile index 266ed39f2c..0e38452e43 100644 --- a/lib/librte_port/Makefile +++ b/lib/librte_port/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_port_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile index 0547dcdb3d..cee95cd841 100644 --- a/lib/librte_power/Makefile +++ b/lib/librte_power/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing EXPORT_MAP := rte_power_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile index b437dc559d..84ad3d336d 100644 --- a/lib/librte_ring/Makefile +++ b/lib/librte_ring/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_ring_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile index 48f280a3da..b1cb285334 100644 --- a/lib/librte_sched/Makefile +++ b/lib/librte_sched/Makefile @@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE EXPORT_MAP := rte_sched_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile index 4e1a54aa03..0d8394c723 100644 --- a/lib/librte_table/Makefile +++ b/lib/librte_table/Makefile @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_table_version.map +LIBABIVER := 1 + # # all source are stored in SRCS-y # diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile index 9fb6079e45..2aabef852f 100644 --- a/lib/librte_timer/Makefile +++ b/lib/librte_timer/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_timer_version.map +LIBABIVER := 1 + # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 96a7dd0d8d..369c25a993 100644 --- a/lib/librte_vhost/Makefile +++ b/lib/librte_vhost/Makefile @@ -36,6 +36,8 @@ LIB = librte_vhost.a EXPORT_MAP := rte_vhost_version.map +LIBABIVER := 1 + CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse LDFLAGS += -lfuse # all source are stored in SRCS-y diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index 1d3b64628b..865a3077d5 100644 --- 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 @@ -113,6 +112,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" + @false +endif @[ -d $(dir $@) ] || mkdir -p $(dir $@) $(if $(D),\ @echo -n "$< -> $@ " ; \ @@ -126,6 +129,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 +167,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 $< $(RTE_OUTPUT)/lib/$(LIBSONAME) +endif # # Clean all generated files