From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 3CBAB902 for ; Fri, 3 Jul 2015 00:07:10 +0200 (CEST) Received: by wguu7 with SMTP id u7so74069649wgu.3 for ; Thu, 02 Jul 2015 15:07:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=adrLzqmoU/VL1dL8mExlCiJnE1Rof8aRuAP3sD3s/b8=; b=FvjPUDSGh5tpyPtVhBY1oKuZQ1AcHpvJ9oKMma3HtXrYWD/FG2JWlD/SfckfMTBWUb YTd1mSWGzcNkHpN82V+NyK74Pbl9PWTadVUMIBmnJo949tpPaTx0IJILZP4uLYrx4Yqk Ucbuy/fvO97seVH+ru0TRK5Jr+D6kuf24SP+esSzs7cTwkLpjf6CSlKHv1YBj7GzCpdJ MqKxlY2US0k0YcOe9LcC2uGxaEZjMgbFwt2Qk3cJZH5+4pvSHjjwuJot/JF9W4jX4PFi mk93X7wLVEMQ2EwS5X9qqNAD8yuL4JVPwsJ1UovCNxMm/Pmq6ER9vnGBWMGV5W+hhMxl Xzfw== X-Gm-Message-State: ALoCoQkPsPkhd9Zu5G2f5wwoQfUxlQpL5BVdS5v1FotgWZlQmpzzoKWNy7iCvQ6g/Tu78YVJfGNM X-Received: by 10.180.91.76 with SMTP id cc12mr60245372wib.67.1435874830093; Thu, 02 Jul 2015 15:07:10 -0700 (PDT) Received: from localhost.localdomain (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id a6sm10101833wjy.33.2015.07.02.15.07.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Jul 2015 15:07:08 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Fri, 3 Jul 2015 00:05:46 +0200 Message-Id: <1435874746-32095-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.4.2 Subject: [dpdk-dev] [PATCH] mk: enable next abi in static libs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 22:07:10 -0000 When a change makes really hard to keep ABI compatibility, instead of waiting next release to break the ABI, it is smoother to introduce the new code and enable it only for static libraries. The flag RTE_NEXT_ABI may be used to "ifdef" the new code. When the release is out, a dynamically linked application can use the new shared libraries without rebuild while developpers can prepare their application for the next ABI by reading the deprecation notice and easily testing the new code. When starting the next release cycle, the "ifdefs" will be removed and the ABI break will be marked by incrementing LIBABIVER. The new option CONFIG_RTE_NEXT_ABI is not defined in the configuration templates because it is deduced from CONFIG_RTE_BUILD_SHARED_LIB. It is automatically enabled for static libraries and disabled for shared libraries. It can be forced to another value by editing the generated .config file. It shouldn't be enabled for shared libraries because it would break the ABI without changing the version number LIBABIVER. That's why a warning is printed in this case. The guideline is also updated to integrate this new possibility. Signed-off-by: Thomas Monjalon --- doc/guides/guidelines/versioning.rst | 2 ++ lib/Makefile | 4 ++++ mk/rte.sdkconfig.mk | 3 +++ pkg/dpdk.spec | 1 + scripts/validate-abi.sh | 2 ++ 5 files changed, 12 insertions(+) diff --git a/doc/guides/guidelines/versioning.rst b/doc/guides/guidelines/versioning.rst index a1c9368..6bc2a8e 100644 --- a/doc/guides/guidelines/versioning.rst +++ b/doc/guides/guidelines/versioning.rst @@ -57,6 +57,8 @@ being provided. The requirements for doing so are: #. A full deprecation cycle, as explained above, must be made to offer downstream consumers sufficient warning of the change. + The changes may be shown and used in static builds before the deprecation + cycle by conditioning them with RTE_NEXT_ABI option. #. The ``LIBABIVER`` variable in the makefile(s) where the ABI changes are incorporated must be incremented in parallel with the ABI changes diff --git a/lib/Makefile b/lib/Makefile index 5f480f9..ebf56ba 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -31,6 +31,10 @@ include $(RTE_SDK)/mk/rte.vars.mk +ifeq '$(CONFIG_RTE_BUILD_SHARED_LIB)$(CONFIG_RTE_NEXT_ABI)' 'yy' +$(info WARNING: Shared libraries versioning is tainted!) +endif + DIRS-y += librte_compat DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk index f8d95b1..135825c 100644 --- a/mk/rte.sdkconfig.mk +++ b/mk/rte.sdkconfig.mk @@ -77,6 +77,9 @@ $(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE | $(RTE_OUTPUT) $(CPP) -undef -P -x assembler-with-cpp \ -ffreestanding \ -o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \ + printf 'CONFIG_RTE_NEXT_ABI=' >> $(RTE_OUTPUT)/.config_tmp ; \ + sed -n 's,CONFIG_RTE_BUILD_SHARED_LIB=,,p' $(RTE_OUTPUT)/.config_tmp | \ + tr 'yn' 'ny' >> $(RTE_OUTPUT)/.config_tmp ; \ if ! cmp -s $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config; then \ cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config ; \ cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config.orig ; \ diff --git a/pkg/dpdk.spec b/pkg/dpdk.spec index 5f6ec6a..fb71ccc 100644 --- a/pkg/dpdk.spec +++ b/pkg/dpdk.spec @@ -82,6 +82,7 @@ make O=%{target} T=%{target} config sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config sed -ri 's,(RTE_APP_TEST=).*,\1n,' %{target}/.config sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config +sed -ri 's,(RTE_NEXT_ABI=).*,\1n,' %{target}/.config sed -ri 's,(LIBRTE_VHOST=).*,\1y,' %{target}/.config sed -ri 's,(LIBRTE_PMD_PCAP=).*,\1y,' %{target}/.config sed -ri 's,(LIBRTE_PMD_XENVIRT=).*,\1y,' %{target}/.config diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh index 1747b8b..4476433 100755 --- a/scripts/validate-abi.sh +++ b/scripts/validate-abi.sh @@ -157,6 +157,7 @@ git checkout $TAG1 # Make sure we configure SHARED libraries # Also turn off IGB and KNI as those require kernel headers to build sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET +sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET @@ -198,6 +199,7 @@ git checkout $TAG2 # Make sure we configure SHARED libraries # Also turn off IGB and KNI as those require kernel headers to build sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET +sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET -- 2.4.2