On Fri, Dec 11, 2020 at 03:43:22PM +0100, Dumitru Ceara wrote: > Also, I'm still seeing the libopenvswitchavx512.la related error we > reported earlier: > > error: failed to run `rustc` to learn about target-specific information > > Caused by: > process didn't exit successfully: `rustc - --crate-name ___ > --print=file-names -L ../../lib/.libs -L /root/ovs/lib/.libs -lssl > -lcrypto -lcap-ng /root/ovs/lib/libopenvswitchavx512.la -lpthread -lrt > -lm -lunbound -lpthread -lrt -lm -lunbound -Awarnings --crate-type bin > --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type > staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit > code: 1) > --- stderr > error: multiple input filenames provided (first two filenames are `-` > and `/root/ovs/lib/libopenvswitchavx512.la`) > > I know you didn't hit this on your machines, but please let me know what > additional info you would require.
I was able to fix this with the following: -8<--------------------------cut here-------------------------->8-- From: Ben Pfaff <[email protected]> Date: Mon, 21 Dec 2020 18:17:57 -0800 Subject: [PATCH ovn] Extract dependencies from .la files recursively. Sometimes $dependency_libs in a libtool .la file points to another .la file. In that case, one must recurse, rather than just using its name directly. Signed-off-by: Ben Pfaff <[email protected]> --- build-aux/automake.mk | 1 + build-aux/libtool-deps | 35 +++++++++++++++++++++++++++++++++++ northd/automake.mk | 5 +++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100755 build-aux/libtool-deps diff --git a/build-aux/automake.mk b/build-aux/automake.mk index 9007ecda9c19..8ad279789b21 100644 --- a/build-aux/automake.mk +++ b/build-aux/automake.mk @@ -6,6 +6,7 @@ EXTRA_DIST += \ build-aux/dpdkstrip.py \ build-aux/generate-dhparams-c \ build-aux/initial-tab-whitelist \ + build-aux/libtool-deps \ build-aux/sodepends.py \ build-aux/soexpand.py \ build-aux/text2c \ diff --git a/build-aux/libtool-deps b/build-aux/libtool-deps new file mode 100755 index 000000000000..c9ef66274890 --- /dev/null +++ b/build-aux/libtool-deps @@ -0,0 +1,35 @@ +#! /bin/sh + +if test $# != 1; then + echo "$0: exactly one argument required (use --help for help)" >&2 + exit 1 +elif test $1 = "--help"; then + cat <<EOF +$0: extracts recursive library dependencies from libtool .la files +usage: $0 LIBRARY +where LIBRARY is a libtool .la file + +Prints the -l options required by the specified libtool .la library. +EOF + exit 0 +fi + +deps= +parse_dependencies() { + dependency_libs=none + . "$1" || exit 1 + if test "$dependency_libs" = none; then + echo "$1: not a libtool .la file (use --help for help)" >&2 + exit 1 + fi + + for dep in $dependency_libs; do + case $dep in + *.la) parse_dependencies "$dep" ;; + *) deps="$deps $dep" ;; + esac + done +} + +parse_dependencies "$1" +echo $deps diff --git a/northd/automake.mk b/northd/automake.mk index 1a28d7b8ee12..959612577101 100644 --- a/northd/automake.mk +++ b/northd/automake.mk @@ -94,9 +94,10 @@ cargo_build_01 = --features command-line --bin ovn_northd_cli cargo_build_10 = --lib cargo_build_11 = --features command-line +libtool_deps = $(srcdir)/build-aux/libtool-deps $(ddlog_targets): northd/ddlog.stamp lib/libovn.la $(OVS_LIBDIR)/libopenvswitch.la - $(AM_V_GEN)LIBOVN_DEPS=`. lib/libovn.la && echo "$$dependency_libs"` && \ - LIBOPENVSWITCH_DEPS=`. $(OVS_LIBDIR)/libopenvswitch.la && echo "$$dependency_libs"` && \ + $(AM_V_GEN)LIBOVN_DEPS=`$(libtool_deps) lib/libovn.la` && \ + LIBOPENVSWITCH_DEPS=`$(libtool_deps) $(OVS_LIBDIR)/libopenvswitch.la` && \ cd northd/ovn_northd_ddlog && \ RUSTC='$(RUSTC)' RUSTFLAGS="$(RUSTFLAGS)" \ cargo build --release $(CARGO_VERBOSE) $(cargo_build) --no-default-features --features ovsdb -- 2.28.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
