Mr Dash Four: could you try following the steps Alon gave in his earlier
mail to see if it works for you? The buildsystem fetches the
dependencies from standard URLs, see "openvpn-build/generic/build.vars".
Except that they are not "standard", at least not all of them.

The openvpn url in build.vars from Alon's project defaults to "https://github.com/downloads/alonbl/openvpn/openvpn-${OPENVPN_VERSION}.tar.gz";. As evident, the openvpn source refers to "openvpn-${OPENVPN_VERSION}.tar.gz" (${OPENVPN_VERSION} itself defaults to "2.3_alpha1").

Naturally, one would assume that this is the standard openvpn source version 2.3 alpha1, hence I did not use "https://github.com/downloads/alonbl"; - a private github repository of Alon himself (nothing whatsoever to do with openvpn), but opted to download and archive that same openvpn version from the main openvpn.net git repository, using the appropriate tag ("v2.3_alpha1"). It is worth noting that I did exactly the same with all other source dependencies, like lzo, openssh etc (something I have made very clear in one of my last posts) and downloaded their corresponding sources from "official" repositories directly.

That, I thought, rather naively as it turned out, should get me the desired version of openvpn as I assumed that the openvpn source code "offered" by Alon and the official one were exactly the same. How wrong was I!

The Alon's version of "openvpn 2.3_alpha1" is very different from "openvpn 2.3_alpha1" downloaded from the official openvpn git repository using the same tag! If you do not believe me - take a look for yourself.

I don't mind Alon (or anybody else for that matter) altering the openvpn source code and its structure, because at the end of the day it is an open source project, but to give it a name like "openvpn 2.3_alpha1" clearly implying that this is the official "openvpn 2.3_alpha1" source without explicitly stating that there were alterations/changes made to that source code is clearly very misleading and in this respect Alon is no better than the scum out there offering "loaded" source code of well-known software products to naive idiots like myself, stupid enough to download it.

As for the main topic of this thread - static build of openvpn, the following is the last gcc command line which links and creates the final openvpn executable (again, using the "standard" openvpn source and not the mickey-mouse version Alon is "offering") - judge for yourself whether this produces a monolithic, statically-linked openvpn executable:

arm-pc-linux-gnueabi-gcc -g -O2 -o openvpn base64.o buffer.o crypto.o dhcp.o error.o event.o fdmisc.o forward.o fragment.o gremlin.o helper.o httpdigest.o lladdr.o init.o interval.o list.o lzo.o manage.o mbuf.o misc.o mroute.o mss.o mtcp.o mtu.o mudp.o multi.o ntlm.o occ.o pkcs11.o openvpn.o options.o otime.o packet_id.o perf.o pf.o ping.o plugin.o pool.o proto.o proxy.o ieproxy.o ps.o push.o reliable.o route.o schedule.o session_id.o shaper.o sig.o socket.o socks.o ssl.o status.o tun.o win32.o cryptoapi.o memcmp.o -lssl -lcrypto -llzo2

As I already pointed out in my previous post, to produce a proper, statically-linked openvpn executable, the following options need to be added to the above command line:

"-static", "-static-libgcc" and "-ldl" at the very end, in order to avoid "unknown symbol" link errors like:

"undefined reference to `dlopen'", "undefined reference to `dlsym'", "undefined reference to `dladdr'" and "undefined reference to `dlerror'".

To conclude this, I am very happy that I was finally able to produce openvpn, which is statically-linked so that I could avoid all bionic dependencies or depending on any other android-based stuff. Now I can, hopefully, use this on my android device without further problems, fingers crossed!

Reply via email to