Browse Source

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 <freifunk@adrianschmutzler.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
lilik-openwrt-22.03
Yousong Zhou 4 years ago
parent
commit
52e074411b
7 changed files with 115 additions and 22 deletions
  1. +14
    -9
      net/openvswitch/Makefile
  2. +1
    -2
      net/openvswitch/openvswitch.mk
  3. +60
    -0
      net/openvswitch/patches/0009-build-only-link-libopenvswitch-with-libunwind-libunb.patch
  4. +7
    -4
      net/ovn/Makefile
  5. +22
    -0
      net/ovn/patches/0001-build-skip-check-and-use-of-libunbound.patch
  6. +10
    -6
      net/ovn/patches/0002-build-skip-tests-and-docs.patch
  7. +1
    -1
      net/ovn/patches/0003-ovn-lib-fix-install_dir.patch

+ 14
- 9
net/openvswitch/Makefile View File

@ -17,7 +17,7 @@ include ./openvswitch.mk
# #
PKG_NAME:=openvswitch PKG_NAME:=openvswitch
PKG_VERSION:=$(ovs_version) PKG_VERSION:=$(ovs_version)
PKG_RELEASE:=7
PKG_RELEASE:=8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.openvswitch.org/releases/ PKG_SOURCE_URL:=https://www.openvswitch.org/releases/
PKG_HASH:=dd5f727427e36cab22bdeae61529d8c8fccacc53d968cfa7658f7f935ddda531 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 ovs_kmod_openvswitch-lisp-intree_files:= $(ovs_kmod_intree_dir)/vport-lisp.ko
$(eval $(call OvsKmodPackageTemplate,openvswitch-lisp-intree)) $(eval $(call OvsKmodPackageTemplate,openvswitch-lisp-intree))
ovs__common_depends:= +libatomic +libunbound +libunwind
ovs__common_depends:=+libatomic +librt
# Dependency review # Dependency review
# #
@ -166,42 +166,46 @@ ovs__common_depends:= +libatomic +libunbound +libunwind
# #
ovs_libopenvswitch_title:=Open vSwitch (libopenvswitch.so) ovs_libopenvswitch_title:=Open vSwitch (libopenvswitch.so)
ovs_libopenvswitch_hidden:=1 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* ovs_libopenvswitch_files:=usr/lib/libopenvswitch*.so*
$(eval $(call OvsPackageTemplate,libopenvswitch)) $(eval $(call OvsPackageTemplate,libopenvswitch))
ovs_libofproto_title:=Open vSwitch (libofproto.so libsflow.so) ovs_libofproto_title:=Open vSwitch (libofproto.so libsflow.so)
ovs_libofproto_hidden:=1 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* ovs_libofproto_files:=usr/lib/libofproto*.so* usr/lib/libsflow*.so*
$(eval $(call OvsPackageTemplate,libofproto)) $(eval $(call OvsPackageTemplate,libofproto))
ovs_libovsdb_title:=Open vSwitch (libovsdb.so) ovs_libovsdb_title:=Open vSwitch (libovsdb.so)
ovs_libovsdb_hidden:=1 ovs_libovsdb_hidden:=1
ovs_libovsdb_depends:=+librt
ovs_libovsdb_depends+=$(ovs__common_depends)
ovs_libovsdb_files:=usr/lib/libovsdb*.so* ovs_libovsdb_files:=usr/lib/libovsdb*.so*
$(eval $(call OvsPackageTemplate,libovsdb)) $(eval $(call OvsPackageTemplate,libovsdb))
ovs_vswitchd_title:=Open vSwitch (ovs-vswitchd) ovs_vswitchd_title:=Open vSwitch (ovs-vswitchd)
ovs_vswitchd_hidden:=1 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 ovs_vswitchd_files:=usr/sbin/ovs-vswitchd
$(eval $(call OvsPackageTemplate,vswitchd)) $(eval $(call OvsPackageTemplate,vswitchd))
ovs_ovsdb_title:=Open vSwitch (ovsdb-server) ovs_ovsdb_title:=Open vSwitch (ovsdb-server)
ovs_ovsdb_hidden:=1 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 ovs_ovsdb_files:=usr/sbin/ovsdb-server
$(eval $(call OvsPackageTemplate,ovsdb)) $(eval $(call OvsPackageTemplate,ovsdb))
ovs_common_title:=Open vSwitch (common files) ovs_common_title:=Open vSwitch (common files)
ovs_common_hidden:=1 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:= \ ovs_common_files:= \
usr/share/openvswitch/scripts/ovs-lib \ usr/share/openvswitch/scripts/ovs-lib \
usr/share/openvswitch/scripts/ovs-ctl \ usr/share/openvswitch/scripts/ovs-ctl \
@ -231,8 +235,9 @@ $(eval $(call OvsPackageTemplate,common))
# uuidgen is required for generating system-id # uuidgen is required for generating system-id
ovs_openvswitch_title:=Open vSwitch ovs_openvswitch_title:=Open vSwitch
ovs_openvswitch_hidden:= 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 +openvswitch-common +openvswitch-vswitchd +openvswitch-ovsdb +kmod-openvswitch
ovs_openvswitch_depends+=$(ovs__common_depends)
ovs_openvswitch_files:= usr/share/openvswitch/vswitch.ovsschema ovs_openvswitch_files:= usr/share/openvswitch/vswitch.ovsschema
$(eval $(call OvsPackageTemplate,openvswitch)) $(eval $(call OvsPackageTemplate,openvswitch))


+ 1
- 2
net/openvswitch/openvswitch.mk View File

@ -10,7 +10,6 @@ ovs_builddir=$(KERNEL_BUILD_DIR)/openvswitch-$(ovs_version)
# Shared vars, macros # Shared vars, macros
ovs__common_depends:=
ovs_packages:= ovs_packages:=
ovs_package_name=$(if $(filter openvswitch,$(1)),openvswitch,openvswitch-$(1)) ovs_package_name=$(if $(filter openvswitch,$(1)),openvswitch,openvswitch-$(1))
@ -22,7 +21,7 @@ define OvsPackageTemplate
URL:=https://www.openvswitch.org URL:=https://www.openvswitch.org
TITLE:=$(ovs_$(1)_title) TITLE:=$(ovs_$(1)_title)
HIDDEN:=$(ovs_$(1)_hidden) HIDDEN:=$(ovs_$(1)_hidden)
DEPENDS:=$(ovs_$(1)_depends) $(ovs__common_depends)
DEPENDS:=$(ovs_$(1)_depends)
endef endef
define Package/$(call ovs_package_name,$(1))/install define Package/$(call ovs_package_name,$(1))/install


+ 60
- 0
net/openvswitch/patches/0009-build-only-link-libopenvswitch-with-libunwind-libunb.patch View File

@ -0,0 +1,60 @@
From 6324f0c594e3773c754861e630fff694d1bec15a Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Wed, 29 Jul 2020 17:29:14 +0800
Subject: [PATCH] build: only link libopenvswitch with libunwind, libunbound
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
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])])

+ 7
- 4
net/ovn/Makefile View File

@ -10,7 +10,7 @@ include ../openvswitch/openvswitch.mk
PKG_NAME:=ovn PKG_NAME:=ovn
PKG_VERSION:=20.06.1 PKG_VERSION:=20.06.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/ovn-org/ovn.git PKG_SOURCE_URL:=https://github.com/ovn-org/ovn.git
@ -33,18 +33,19 @@ PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-host.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_title:=Open vSwitch (libovn.so)
ovs_libovn_hidden:=1 ovs_libovn_hidden:=1
ovs_libovn_depends:=+librt
ovs_libovn_depends+=$(ovs__common_depends)
ovs_libovn_files:=usr/lib/libovn*.so* ovs_libovn_files:=usr/lib/libovn*.so*
$(eval $(call OvsPackageTemplate,libovn)) $(eval $(call OvsPackageTemplate,libovn))
ovs_ovn-common_title:=Open Virtual Network (common files) ovs_ovn-common_title:=Open Virtual Network (common files)
ovs_ovn-common_hidden:=1 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:= \ ovs_ovn-common_files:= \
usr/share/ovn/scripts/ovn-ctl \ usr/share/ovn/scripts/ovn-ctl \
usr/share/ovn/scripts/ovn-lib \ 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_title:=Open Virtual Network (north package)
ovs_ovn-north_hidden:= ovs_ovn-north_hidden:=
ovs_ovn-north_depends:=+openvswitch-ovsdb +openvswitch-ovn-common ovs_ovn-north_depends:=+openvswitch-ovsdb +openvswitch-ovn-common
ovs_ovn-north_depends+=$(ovs__common_depends)
ovs_ovn-north_files:=\ ovs_ovn-north_files:=\
usr/share/ovn/ovn-nb.ovsschema \ usr/share/ovn/ovn-nb.ovsschema \
usr/share/ovn/ovn-sb.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_title:=Open Virtual Network (chassis package)
ovs_ovn-host_hidden:= ovs_ovn-host_hidden:=
ovs_ovn-host_depends:=+openvswitch +openvswitch-ovn-common ovs_ovn-host_depends:=+openvswitch +openvswitch-ovn-common
ovs_ovn-host_depends+=$(ovs__common_depends)
ovs_ovn-host_files:=usr/bin/ovn-controller ovs_ovn-host_files:=usr/bin/ovn-controller
$(eval $(call OvsPackageTemplate,ovn-host)) $(eval $(call OvsPackageTemplate,ovn-host))


+ 22
- 0
net/ovn/patches/0001-build-skip-check-and-use-of-libunbound.patch View File

@ -0,0 +1,22 @@
From f3cc8c83993486b9d35557f2bd85038d5bb96bc5 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Wed, 29 Jul 2020 20:09:56 +0800
Subject: [PATCH] build: skip check and use of libunbound
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
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])

net/ovn/patches/0001-build-skip-building-tests.patch → net/ovn/patches/0002-build-skip-tests-and-docs.patch View File


net/ovn/patches/0002-ovn-lib-fix-install_dir.patch → net/ovn/patches/0003-ovn-lib-fix-install_dir.patch View File


Loading…
Cancel
Save