From 52e074411b937cd91d34ebeedc429de5dadce9a4 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 29 Jul 2020 17:30:38 +0800 Subject: [PATCH] openvswitch: only libopenvswitch depends on libunbound, libunwind This is to make explicit the conditional select of libunwind is only needed for libopenvswitch. If we spill it over other packages, the generated kconfig will have recursive dependency issue. 2 new patches were made for this goal The other thing is that "+libunwind" will cause it to be built if any of the packages defined in this Makefile is enabled (y or m). This is at the moment by-design of the build system. Libunwind does not support architectures like arc. Use conditional select To avoid (libunwind) build failures like the following, checking for ELF helper width... configure: error: Unknown ELF target: arc make[3]: *** [Makefile:65: /data/openwrt/build_dir/target-arc_arc700_uClibc/ libunwind-1.3.1/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1 Things like "+PACKAGE_openvswitch-libopenvswitch:libunwind" will also result in recursive deps error for chains of 3 nodes. Kconfig construct like the following will be made config A tristate select B depends on !(C) || (x) config B tristate select C config C tristate config x bool Other changes include - Shared use of variable ovs__common_depends was removed - Ovn doc build was patched out Link: https://github.com/openwrt/packages/pull/12959#issuecomment-665021413 Reported-by: Adrian Schmutzler Signed-off-by: Yousong Zhou --- net/openvswitch/Makefile | 23 ++++--- net/openvswitch/openvswitch.mk | 3 +- ...libopenvswitch-with-libunwind-libunb.patch | 60 +++++++++++++++++++ net/ovn/Makefile | 11 ++-- ...ild-skip-check-and-use-of-libunbound.patch | 22 +++++++ ...h => 0002-build-skip-tests-and-docs.patch} | 16 +++-- ...tch => 0003-ovn-lib-fix-install_dir.patch} | 2 +- 7 files changed, 115 insertions(+), 22 deletions(-) create mode 100644 net/openvswitch/patches/0009-build-only-link-libopenvswitch-with-libunwind-libunb.patch create mode 100644 net/ovn/patches/0001-build-skip-check-and-use-of-libunbound.patch rename net/ovn/patches/{0001-build-skip-building-tests.patch => 0002-build-skip-tests-and-docs.patch} (59%) rename net/ovn/patches/{0002-ovn-lib-fix-install_dir.patch => 0003-ovn-lib-fix-install_dir.patch} (93%) diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 74a0ae22c1..c869ace10b 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -17,7 +17,7 @@ include ./openvswitch.mk # PKG_NAME:=openvswitch PKG_VERSION:=$(ovs_version) -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.openvswitch.org/releases/ PKG_HASH:=dd5f727427e36cab22bdeae61529d8c8fccacc53d968cfa7658f7f935ddda531 @@ -156,7 +156,7 @@ ovs_kmod_openvswitch-lisp-intree_depends:= +kmod-openvswitch-intree ovs_kmod_openvswitch-lisp-intree_files:= $(ovs_kmod_intree_dir)/vport-lisp.ko $(eval $(call OvsKmodPackageTemplate,openvswitch-lisp-intree)) -ovs__common_depends:= +libatomic +libunbound +libunwind +ovs__common_depends:=+libatomic +librt # Dependency review # @@ -166,42 +166,46 @@ ovs__common_depends:= +libatomic +libunbound +libunwind # ovs_libopenvswitch_title:=Open vSwitch (libopenvswitch.so) ovs_libopenvswitch_hidden:=1 -ovs_libopenvswitch_depends:=+libopenssl +librt +ovs_libopenvswitch_depends:=+libopenssl +libunbound +!(arc||arceb):libunwind +ovs_libopenvswitch_depends+=$(ovs__common_depends) ovs_libopenvswitch_files:=usr/lib/libopenvswitch*.so* $(eval $(call OvsPackageTemplate,libopenvswitch)) ovs_libofproto_title:=Open vSwitch (libofproto.so libsflow.so) ovs_libofproto_hidden:=1 -ovs_libofproto_depends:=+librt +ovs_libofproto_depends+=$(ovs__common_depends) ovs_libofproto_files:=usr/lib/libofproto*.so* usr/lib/libsflow*.so* $(eval $(call OvsPackageTemplate,libofproto)) ovs_libovsdb_title:=Open vSwitch (libovsdb.so) ovs_libovsdb_hidden:=1 -ovs_libovsdb_depends:=+librt +ovs_libovsdb_depends+=$(ovs__common_depends) ovs_libovsdb_files:=usr/lib/libovsdb*.so* $(eval $(call OvsPackageTemplate,libovsdb)) ovs_vswitchd_title:=Open vSwitch (ovs-vswitchd) ovs_vswitchd_hidden:=1 -ovs_vswitchd_depends:=+librt +openvswitch-libopenvswitch +openvswitch-libofproto +ovs_vswitchd_depends:=+openvswitch-libopenvswitch +openvswitch-libofproto +ovs_vswitchd_depends+=$(ovs__common_depends) ovs_vswitchd_files:=usr/sbin/ovs-vswitchd $(eval $(call OvsPackageTemplate,vswitchd)) ovs_ovsdb_title:=Open vSwitch (ovsdb-server) ovs_ovsdb_hidden:=1 -ovs_ovsdb_depends:=+librt +openvswitch-libopenvswitch +openvswitch-libovsdb +ovs_ovsdb_depends:=+openvswitch-libopenvswitch +openvswitch-libovsdb +ovs_ovsdb_depends+=$(ovs__common_depends) ovs_ovsdb_files:=usr/sbin/ovsdb-server $(eval $(call OvsPackageTemplate,ovsdb)) ovs_common_title:=Open vSwitch (common files) ovs_common_hidden:=1 -ovs_common_depends:=+librt +openvswitch-libopenvswitch +openvswitch-libofproto +openvswitch-libovsdb +ovs_common_depends:=+openvswitch-libopenvswitch +openvswitch-libofproto +openvswitch-libovsdb +ovs_common_depends+=$(ovs__common_depends) ovs_common_files:= \ usr/share/openvswitch/scripts/ovs-lib \ usr/share/openvswitch/scripts/ovs-ctl \ @@ -231,8 +235,9 @@ $(eval $(call OvsPackageTemplate,common)) # uuidgen is required for generating system-id ovs_openvswitch_title:=Open vSwitch ovs_openvswitch_hidden:= -ovs_openvswitch_depends:=+librt +coreutils +coreutils-sleep +uuidgen \ +ovs_openvswitch_depends:=+coreutils +coreutils-sleep +uuidgen \ +openvswitch-common +openvswitch-vswitchd +openvswitch-ovsdb +kmod-openvswitch +ovs_openvswitch_depends+=$(ovs__common_depends) ovs_openvswitch_files:= usr/share/openvswitch/vswitch.ovsschema $(eval $(call OvsPackageTemplate,openvswitch)) diff --git a/net/openvswitch/openvswitch.mk b/net/openvswitch/openvswitch.mk index 78d35c031f..a90f3dabe9 100644 --- a/net/openvswitch/openvswitch.mk +++ b/net/openvswitch/openvswitch.mk @@ -10,7 +10,6 @@ ovs_builddir=$(KERNEL_BUILD_DIR)/openvswitch-$(ovs_version) # Shared vars, macros -ovs__common_depends:= ovs_packages:= ovs_package_name=$(if $(filter openvswitch,$(1)),openvswitch,openvswitch-$(1)) @@ -22,7 +21,7 @@ define OvsPackageTemplate URL:=https://www.openvswitch.org TITLE:=$(ovs_$(1)_title) HIDDEN:=$(ovs_$(1)_hidden) - DEPENDS:=$(ovs_$(1)_depends) $(ovs__common_depends) + DEPENDS:=$(ovs_$(1)_depends) endef define Package/$(call ovs_package_name,$(1))/install diff --git a/net/openvswitch/patches/0009-build-only-link-libopenvswitch-with-libunwind-libunb.patch b/net/openvswitch/patches/0009-build-only-link-libopenvswitch-with-libunwind-libunb.patch new file mode 100644 index 0000000000..106e748b1c --- /dev/null +++ b/net/openvswitch/patches/0009-build-only-link-libopenvswitch-with-libunwind-libunb.patch @@ -0,0 +1,60 @@ +From 6324f0c594e3773c754861e630fff694d1bec15a Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Wed, 29 Jul 2020 17:29:14 +0800 +Subject: [PATCH] build: only link libopenvswitch with libunwind, libunbound + +Signed-off-by: Yousong Zhou +--- + lib/automake.mk | 2 ++ + lib/libopenvswitch.pc.in | 2 +- + m4/openvswitch.m4 | 6 ++++-- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/lib/automake.mk b/lib/automake.mk +index 95925b57c..df95bea10 100644 +--- a/lib/automake.mk ++++ b/lib/automake.mk +@@ -10,6 +10,8 @@ lib_LTLIBRARIES += lib/libopenvswitch.la + lib_libopenvswitch_la_LIBADD = $(SSL_LIBS) + lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD) + lib_libopenvswitch_la_LIBADD += $(LIBBPF_LDADD) ++lib_libopenvswitch_la_LIBADD += $(LIBUNBOUND_LDADD) ++lib_libopenvswitch_la_LIBADD += $(LIBUNWIND_LDADD) + + if WIN32 + lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS} +diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in +index 2a3f2ca7b..c8d02eb5a 100644 +--- a/lib/libopenvswitch.pc.in ++++ b/lib/libopenvswitch.pc.in +@@ -7,5 +7,5 @@ Name: libopenvswitch + Description: Open vSwitch library + Version: @VERSION@ + Libs: -L${libdir} -lopenvswitch +-Libs.private: @LIBS@ ++Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@ @LIBUNBOUND_LDADD@ @LIBUNWIND_LDADD@ + Cflags: -I${includedir}/openvswitch +diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 +index ada31c491..6165cc7b1 100644 +--- a/m4/openvswitch.m4 ++++ b/m4/openvswitch.m4 +@@ -623,7 +623,8 @@ AC_DEFUN([OVS_CHECK_UNBOUND], + [AC_CHECK_LIB(unbound, ub_ctx_create, [HAVE_UNBOUND=yes], [HAVE_UNBOUND=no]) + if test "$HAVE_UNBOUND" = yes; then + AC_DEFINE([HAVE_UNBOUND], [1], [Define to 1 if unbound is detected.]) +- LIBS="$LIBS -lunbound" ++ LIBUNBOUND_LDADD="-lunbound" ++ AC_SUBST(LIBUNBOUND_LDADD) + fi + AM_CONDITIONAL([HAVE_UNBOUND], [test "$HAVE_UNBOUND" = yes]) + AC_SUBST([HAVE_UNBOUND])]) +@@ -635,7 +636,8 @@ AC_DEFUN([OVS_CHECK_UNWIND], + [HAVE_UNWIND=no]) + if test "$HAVE_UNWIND" = yes; then + AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.]) +- LIBS="$LIBS -lunwind" ++ LIBUNWIND_LDADD="-lunwind" ++ AC_SUBST(LIBUNWIND_LDADD) + fi + AM_CONDITIONAL([HAVE_UNWIND], [test "$HAVE_UNWIND" = yes]) + AC_SUBST([HAVE_UNWIND])]) diff --git a/net/ovn/Makefile b/net/ovn/Makefile index fa7ed552d1..5aba157cbf 100644 --- a/net/ovn/Makefile +++ b/net/ovn/Makefile @@ -10,7 +10,7 @@ include ../openvswitch/openvswitch.mk PKG_NAME:=ovn PKG_VERSION:=20.06.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/ovn-org/ovn.git @@ -33,18 +33,19 @@ PKG_MAINTAINER:=Yousong Zhou include $(INCLUDE_DIR)/package.mk include ../../lang/python/python3-host.mk -ovs__common_depends:= +libatomic +libunbound +ovs__common_depends:=+libatomic +librt ovs_libovn_title:=Open vSwitch (libovn.so) ovs_libovn_hidden:=1 -ovs_libovn_depends:=+librt +ovs_libovn_depends+=$(ovs__common_depends) ovs_libovn_files:=usr/lib/libovn*.so* $(eval $(call OvsPackageTemplate,libovn)) ovs_ovn-common_title:=Open Virtual Network (common files) ovs_ovn-common_hidden:=1 -ovs_ovn-common_depends:=+librt +openvswitch-common +openvswitch-libopenvswitch +openvswitch-libovn +openvswitch-libovsdb +ovs_ovn-common_depends:=+openvswitch-common +openvswitch-libopenvswitch +openvswitch-libovn +openvswitch-libovsdb +ovs_ovn-common_depends+=$(ovs__common_depends) ovs_ovn-common_files:= \ usr/share/ovn/scripts/ovn-ctl \ usr/share/ovn/scripts/ovn-lib \ @@ -58,6 +59,7 @@ $(eval $(call OvsPackageTemplate,ovn-common)) ovs_ovn-north_title:=Open Virtual Network (north package) ovs_ovn-north_hidden:= ovs_ovn-north_depends:=+openvswitch-ovsdb +openvswitch-ovn-common +ovs_ovn-north_depends+=$(ovs__common_depends) ovs_ovn-north_files:=\ usr/share/ovn/ovn-nb.ovsschema \ usr/share/ovn/ovn-sb.ovsschema \ @@ -68,6 +70,7 @@ $(eval $(call OvsPackageTemplate,ovn-north)) ovs_ovn-host_title:=Open Virtual Network (chassis package) ovs_ovn-host_hidden:= ovs_ovn-host_depends:=+openvswitch +openvswitch-ovn-common +ovs_ovn-host_depends+=$(ovs__common_depends) ovs_ovn-host_files:=usr/bin/ovn-controller $(eval $(call OvsPackageTemplate,ovn-host)) diff --git a/net/ovn/patches/0001-build-skip-check-and-use-of-libunbound.patch b/net/ovn/patches/0001-build-skip-check-and-use-of-libunbound.patch new file mode 100644 index 0000000000..e93deb19ce --- /dev/null +++ b/net/ovn/patches/0001-build-skip-check-and-use-of-libunbound.patch @@ -0,0 +1,22 @@ +From f3cc8c83993486b9d35557f2bd85038d5bb96bc5 Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Wed, 29 Jul 2020 20:09:56 +0800 +Subject: [PATCH] build: skip check and use of libunbound + +Signed-off-by: Yousong Zhou +--- + configure.ac | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 2bcd1945b..ad550fff8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -130,7 +130,6 @@ OVS_CHECK_LINUX_HOST + OVS_LIBTOOL_VERSIONS + OVS_CHECK_CXX + AX_FUNC_POSIX_MEMALIGN +-OVN_CHECK_UNBOUND + + OVS_CHECK_INCLUDE_NEXT([stdio.h string.h]) + AC_CONFIG_FILES([lib/libovn.sym]) diff --git a/net/ovn/patches/0001-build-skip-building-tests.patch b/net/ovn/patches/0002-build-skip-tests-and-docs.patch similarity index 59% rename from net/ovn/patches/0001-build-skip-building-tests.patch rename to net/ovn/patches/0002-build-skip-tests-and-docs.patch index 29842411c7..342dfabf03 100644 --- a/net/ovn/patches/0001-build-skip-building-tests.patch +++ b/net/ovn/patches/0002-build-skip-tests-and-docs.patch @@ -1,18 +1,22 @@ -From d048a1e98363197c0d2609f6adb6919bde473df4 Mon Sep 17 00:00:00 2001 +From cea7c74ecc4a0843f29ce1882d7876fff199a721 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 23 Mar 2020 14:18:30 +0800 -Subject: [PATCH] build: skip building tests +Subject: [PATCH] build: skip tests and docs Signed-off-by: Yousong Zhou --- - Makefile.am | 1 - - 1 file changed, 1 deletion(-) + Makefile.am | 2 -- + 1 file changed, 2 deletions(-) diff --git a/Makefile.am b/Makefile.am -index 04400e184..b2c42d84c 100644 +index 04400e184..c12cfcd11 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -492,7 +492,6 @@ include Documentation/automake.mk +@@ -488,11 +488,9 @@ dist-docs: + + + include automake.mk +-include Documentation/automake.mk include m4/automake.mk include lib/automake.mk include utilities/automake.mk diff --git a/net/ovn/patches/0002-ovn-lib-fix-install_dir.patch b/net/ovn/patches/0003-ovn-lib-fix-install_dir.patch similarity index 93% rename from net/ovn/patches/0002-ovn-lib-fix-install_dir.patch rename to net/ovn/patches/0003-ovn-lib-fix-install_dir.patch index b67dfd7b7f..46a7daadd6 100644 --- a/net/ovn/patches/0002-ovn-lib-fix-install_dir.patch +++ b/net/ovn/patches/0003-ovn-lib-fix-install_dir.patch @@ -1,4 +1,4 @@ -From ecf232bf32dd433642bb9da2ac0c2de483b8736a Mon Sep 17 00:00:00 2001 +From 7385d1e67dda100853cf748034220cdbed6b3d7c Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 23 Mar 2020 15:54:26 +0800 Subject: [PATCH] ovn-lib: fix install_dir()