Re: [Dar-support] Static dar build issues again
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
|
From: Denis C. <dar...@fr...> - 2022-01-20 15:41:41
|
Le 20/01/2022 à 16:10, Robin Atwood a écrit : > On Wed, 19 Jan 2022 19:56:32 +0100 > Denis Corbin <dar...@fr...> wrote: > >> Le 19/01/2022 à 15:36, Robin Atwood a écrit : [...] > > As I said in my first post I checked-out your code from GitHub. I then > ran misc/init, followed by ./configure and make in the usual way. I > copied the binary from /usr/src/dev/dar-code/src/dar_suite/.libs/dar > and renamed it dar_static on my USB disk. this is not correct, 'dar' is not 'dar_static', the compilation process will provide a dar_static binary beside dar if you have met all the prerequisites for static linking. > I then ran it using the path > which you can see in my post: > # ../dar_static -l backup-FULL-1642269601 -v > > The problem is this: > > Building dar_static : NO (system does not support static linking, > see note below) > > So I followed the note and got: > > # grep -e -static -A 2 config.log > configure:15282: checking if gcc static flag -static works > configure:15311: result: yes > configure:15326: checking if gcc supports -c -o file.o > -- > configure:20679: checking if g++ static flag -static works > configure:20708: result: yes > configure:20720: checking if g++ supports -c -o file.o > -- > configure:29118: g++ -o conftest -g -O2 -static conftest.cpp > -largon2 -lpthread -lattr -lgcrypt -lgpg-error -llz4 -lzstd -llzma > -llzo2 -lbz2 -lz -ldl -lcap -L/usr/lib64 -lgpgme -lassuan -lgpg-error > -lcurl >&5 > /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: > cannot find -largon2 > /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: > cannot find -llz4 > > So I need to install argon2 and lz4? correct, you can instead invoke ./configure with --disable-argon2-linking and --disable-lz4-linking options, though you will not have these feature available in the resulting dar_static binary. >>This is also a problem: > >> is first to have installed all the static flavors of the libraries you >> want dar to rely on > > I don't want static libraries in general because my executables would > be enormous and eat up memory. Having static libraries does not prevent to have dynamic libraries too, beside. All the operating system binaries can rely on the dynamic library flavors, you end with one copy of each static library before compiling dar_static. What I usually do when the static flavor of a library is not provided by a distro is to compile it by hand and install it somewhere in non system path. The compilation process depends on each library but usually something like this makes the tricks: ./configure --prefix=/some/path --enable-static Then I set the these variable before calling dar's ./configure export LDFLAGS=-L/some/path/lib export CXXFLAGS=-I/some/path/include export CFLAGS=$CXXFLAGS > Is there some nifty way of building > static libraries that are only used by dar? I have a Gentoo system. the problem is not specific to the distro (Gentoo or other), but specific to statically linked libraries usage. > > Thanks > Robin > note that I provide dar_static binaries for Linux/x86 platforms at https://dar.edrusb.org/dar.linux.free.fr/Releases/Dar_static/ all binaries are stipped and upx compressed, and provided with signature for you can validate it has not been tampered. dar_static only depends on the linux kernel and CPU processor thus these binaries should work on any distro, including Gentoo assuming with a compatible Linux kernel and CPU, of course. > |