still have not got nft compiledā¦this is my (crosscompile) way:
git clone https://git.netfilter.org/libmnl
git clone git://git.netfilter.org/libnftnl
git clone git://git.netfilter.org/nftables
#build libmnl for armhf
cd libmnl
sh autogen.sh
mkdir install
sh configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install
make
make install
#build libnftnl
cd ../libnftnl/
sh autogen.sh
mkdir install
./configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install LIBMNL_LIBS=../libmnl/install/lib LIBMNL_CFLAGS=../libmnl/include/
make
make install
#build nft
cd ../nftables/
sh autogen.sh
sh configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install PKG_CONFIG_PATH="../libnftnl/install/lib/pkgconfig:../libmnl/install/lib/pkgconfig" LIBMNL_LIBS=../libmnl/install/lib LIBMNL_CFLAGS=../libmnl/include/
still got:
checking for LIBMNL... yes
checking for LIBNFTNL... yes
checking for __gmpz_init in -lgmp... no
configure: error: No suitable version of libgmp found
seems like this is also an armhf-lib required, but have not found any repo to build itā¦and cannot install it on x86_64 host seems like i can obtain source from here https://gmplib.org/#DOWNLOAD, but only mercurial repo and no gitā¦download source-package (*.xz) is very slow
wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz
tar -xvf gmp-6.2.1.tar.xz
cd gmp-6.2.1/
./configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install
make
make install
last step suggests make check, which fails
FAIL: t-bswap
FAIL: t-constants
FAIL: t-count_zeros
FAIL: t-hightomask
FAIL: t-modlinv
FAIL: t-popc
FAIL: t-parity
FAIL: t-sub
netherless i tried to include it into nftables-config, but this does also fail
sh configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install PKG_CONFIG_PATH="../libnftnl/install/lib/pkgconfig:../libmnl/install/lib/pkgconfig:../gmp-6.2.1/install/lib/pkgconfig" LIBMNL_LIBS=../libmnl/install/lib LIBMNL_CFLAGS=../libmnl/include/ LIBGMP_LIBS=../libmnl/install/lib LIBGMP_CFLAGS=../gmp-6.2.1/include
checking for __gmpz_init in -lgmp... no
configure: error: No suitable version of libgmp found
but i got configure working with --with-mini-gmp --without-cli
without-cli disables readline libraryā¦iām not sure this is right as nft is a cli-tool
for make i had to use absolute names (instead of ā¦/)
BASE="$(pwd)/../"; sh configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install PKG_CONFIG_PATH="$BASE/libnftnl/install/lib/pkgconfig:$BASE/libmnl/install/lib/pkgconfig" LIBMNL_LIBS=$BASE/libmnl/install/lib LIBMNL_CFLAGS=$BASE/libmnl/include/ --with-mini-gmp --without-cli
native-way still stops on ld-error
but now iām on same state as native compile
CCLD nft
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_nest_start'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_bind'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_nlmsg_batch_current'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_nest_end'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_put_u16'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_fprintf'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_put_u8'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_get_payload'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_get_u32'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_get_payload_len'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_nlmsg_batch_is_empty'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_get_payload_offset'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_get_u16'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_get_payload_len'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_put_extra_header'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_next'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_get_u64'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_put_u64'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_get_payload_tail'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_nlmsg_batch_next'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_setsockopt'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_nlmsg_batch_stop'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_parse'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_put_header'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_get_portid'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_get_str'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_nlmsg_batch_head'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_cb_run'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_put_strz'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_get_type'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_get_u8'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_nlmsg_batch_start'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_validate'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_put_str'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_ok'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_sendto'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_recvfrom'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_nlmsg_size'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_put_u32'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_nlmsg_batch_size'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_cb_run2'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_open'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_get_payload'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /media/data_nvme/git/nft/libnftnl/install/lib/libnftnl.so.11: undefined reference to `mnl_attr_parse_nested'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_put'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_get_fd'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_socket_close'
/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./.libs/libnftables.so: undefined reference to `mnl_attr_type_valid'
i tried to pass the lib dirs with LDFLAGS,LD_LIBRARY_PATH and --libdir= to configureā¦still get the linker-errors
tried also to configure libnftnl without relative paths
BASE="$(pwd)/..";
./configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install LIBMNL_LIBS=$BASE/libmnl/install/lib LIBMNL_CFLAGS=$BASE/libmnl/include/
make clean
make
make install
cd ../nftables
sh configure --host=arm-linux-gnueabihf --prefix=$(pwd)/install PKG_CONFIG_PATH="$BASE/libnftnl/install/lib/pkgconfig:$BASE/libmnl/install/lib/pkgconfig" LIBMNL_LIBS=$BASE/libmnl/install/lib LIBMNL_CFLAGS=$BASE/libmnl/include
make clean
make
but still the same