i2pd
i2pd copied to clipboard
[proposal] Make static release builds
Quote from IRC:
SGLG hints to the devs of i2pd that it would be really nice if there were a statically compiled tar.gz'ed pre-compiled version that could be extracted and ran from the folder it was extracted to.
Portable binary? Sounds like a good idea.
I have this for linux armhf, would be nice to have a script that pulls in dependencies and builds a static release.
@hagen-i2p had some concerns about static builds for linux
Several releases ago there was issues with static build on unix with glibc/gethostbyname(), because it's nsswitch support with pluggable modules.
I'll try again.
The same warning. See message in last line.
/usr/lib/x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): In function dlfcn_globallookup': (.text+0x11): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libi2pd.a(Reseed.o): In function
boost::asio::detail::socket_ops::getaddrinfo(char const_, char const_, addrinfo const&, addrinfo**, boost::system::error_code&)':
/usr/include/boost/asio/detail/impl/socket_ops.ipp:3177: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
@hagen-i2p that commit fixed the option to statically build awesome!
Since this is a proposal for the static builds can I request static builds for armel? I have been trying it for a while now with a armel cmake toolchain using -DCMAKE_TOOLCHAIN_FILE=
without any succes.
I've just tried to build static i2pd with openssl and it gave me such error:
/tmp/static/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'
/tmp/static/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x334): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x3db): undefined reference to `dlerror'
/tmp/static/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x454): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x4fb): undefined reference to `dlerror'
/tmp/static/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x569): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x5cb): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x603): undefined reference to `dlerror'
/tmp/static/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x69f): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x709): undefined reference to `dlerror'
/tmp/static/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x762): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
Makefile:67: recipe for target 'i2pd' failed
make: *** [i2pd] Error 1
Google search showed that to fix that issue, I'll need to add -ldl
flag here
After that, it compiles and works perfect.
EDIT: I build with such command:
make LIBDIR="$STATDIR/lib" USE_STATIC=yes INCFLAGS="-I$STATDIR/include"
Did we still need that issue?
There is big demand for static Raspberry Pi build, so I guess yes
Now here no problems to build staticly, because I already created needed chroots for building packages, where I can also build static binary.