Closed statkashaman closed 1 month ago
the libtool call is missing the -lcap-ng
. I think the LIBCAPNG variables are not everywhere added in the .am files like the lzo , lz4 and flags. I think getting libcap-ng from an non system location has just not implemented yet as cross compiling for a different linux is kind of rare.
Will take a look
The problem here is the LIBS override in the make call. For libcap-ng and libgen-nl we set the CFLAGS and LIBS via the global variables instead of adding them via automake's AM_CFLAGS and opvnpn_LDADD. All other libraries are handled differently. Here is a patch that should make the handling consistent: https://gerrit.openvpn.net/c/openvpn/+/724
@statkashaman you can easily work around the problem by just calling make LIBS="-all-static -lcap-ng"
instead.
Note that the LIBS argument to configure is completely useless.
I need to compile openvpn for ARM, I took the ready-made instructions from here https://gist.github.com/Anubisss/afea82b97058e418e8030ee35e40f54f, but there the old version is built, when trying to build a new version of openvpn, another dependency libcap-ng is added, I also built a static library libcap-ng from the sources, the ./configure for openvpn passes without errors, but when executing make I get the following error:
To make it easier to reproduce, I am attaching my steps below: Run docker image for build:
The following commands are executed inside the container:
cd lzo-2.10 ./configure --prefix=/home/openvpn --enable-static --target=arm-linux-gnueabi --host=arm-linux-gnueabi
make && make install
cd /home/source wget https://github.com/lz4/lz4/archive/v1.9.4.tar.gz tar xvzf v1.9.4.tar.gz
cd lz4-1.9.4 make CC=arm-linux-gnueabi-gcc AR=arm-linux-gnueabi-ar && PREFIX=/home/openvpn make install
cd /home/source wget https://github.com/openssl/openssl/releases/download/openssl-3.1.6/openssl-3.1.6.tar.gz tar xvzf openssl-3.1.6.tar.gz
cd openssl-3.1.6 ./Configure gcc -static -no-shared --prefix=/home/openvpn --cross-compile-prefix=arm-linux-gnueabi-
make && make install
cd /home/source wget https://github.com/stevegrubb/libcap-ng/archive/refs/tags/v0.8.4.tar.gz tar xzvf v0.8.4.tar.gz
cd libcap-ng-0.8.4 ./autogen.sh ./configure --prefix=/home/openvpn --enable-static --target=arm-linux-gnueabi --host=arm-linux-gnueabi make && make install
cd /home/source wget https://swupdate.openvpn.org/community/releases/openvpn-2.6.12.tar.gz tar xvzf openvpn-2.6.12.tar.gz
cd openvpn-2.6.12 ./configure --target=arm-linux-gnueabi --host=arm-linux-gnueabi --prefix=/home/openvpn --enable-static --disable-shared --disable-debug --disable-plugins OPENSSL_CFLAGS="-I/home/openvpn/include" OPENSSL_LIBS="-L/home/openvpn/lib -lssl -lcrypto" LZO_CFLAGS="-I/home/openvpn/include" LZO_LIBS="-L/home/openvpn/lib -llzo2" LIBCAPNG_CFLAGS="-I/home/openvpn/include" LIBCAPNG_LIBS="-L/home/openvpn/lib -lcap-ng" LZ4_CFLAGS="-I/home/openvpn/include" LZ4_LIBS="-L/home/openvpn/lib -llz4" IFCONFIG=/sbin/ifconfig ROUTE=/sbin/route NETSTAT=/bin/netstat IPROUTE=/sbin/ip --enable-iproute2 LIBS="-L/home/openvpn/lib -lssl -lcrypto -llzo2 -lcap-ng -llz4" --disable-dco
make LIBS="-all-static"