[lxc-users] The purpose of init.lxc.static

Leonid Isaev lisaev at umail.iu.edu
Wed Jun 18 04:19:14 UTC 2014


Hi,

	I couldn't find anything in the mailing lists and the commit message
(in commit 2d4b3e3) is rather terse. So, I wonder in which scenarios and why
init.lxc.static is necessary? There appears to be no ./configure flag which
disables this (like --disable-static).
	The practical reason for this question is that Archlinux has recently
dropped static libs from most packages [1], and as a result, I can not build
the current git, AFAIU because of the -static flag:
------
gcc -I../../src -DLXCROOTFSMOUNT=\"/usr/lib/lxc/rootfs\"
-DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\"
-DLXCINITDIR=\"/usr/lib\" -DLIBEXECDIR=\"/usr/lib\"
-DLXCTEMPLATEDIR=\"/usr/share/lxc/templates\" -DLOGPATH=\"/var/log/lxc\"
-DLXC_DEFAULT_CONFIG=\"/etc/lxc/default.conf\"
-DLXC_USERNIC_DB=\"/run/lxc/nics\" -DLXC_USERNIC_CONF=\"/etc/lxc/lxc-usernet\"
-DDEFAULT_CGROUP_PATTERN=\"/lxc/%n\" -DRUNTIME_PATH=\"/run\"
-DSBINDIR=\"/usr/bin\"     -DHAVE_SECCOMP  -march=x86-64 -mtune=generic -O1
-pipe -fstack-protector-all -fexceptions -fno-delete-null-pointer-checks
--param=ssp-buffer-size=4 -Wall -Werror -static
-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o init.lxc.static lxc_init.o
error.o log.o utils.o caps.o  -lcap -lutil -lpthread -lcap 
/usr/bin/ld: cannot find -lcap
/usr/bin/ld: cannot find -lutil
/usr/bin/ld: cannot find -lcap
collect2: error: ld returned 1 exit status
Makefile:877: recipe for target 'init.lxc.static' failed
------

There are no libcap.a (from libcap-2.24) and libutil.a (from glibc-2.19). In
the case of glibc, the static libs are actually shipped by the package (e.g.
libpthread.a), so it seems that libutils.a is not provided by upstream. The
libcap package has only shared libs.

The lxc-stable 1.0.4 builds fine though.

[1] https://www.archlinux.org/todo/remove-static-libraries/

Thanks in advance,
-- 
Leonid Isaev
GPG fingerprints: DA92 034D B4A8 EC51 7EA6  20DF 9291 EE8A 043C B8C4
                  C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140618/14a8dd52/attachment.sig>


More information about the lxc-users mailing list