[lxc-devel] commit d021832111871f46bbce7edb0806944b4247b5d0 code build failed on Fedora19

Dwight Engen dwight.engen at oracle.com
Thu Jun 19 18:52:52 UTC 2014


On Thu, 19 Jun 2014 14:16:28 +0000
Serge Hallyn <serge.hallyn at ubuntu.com> wrote:

> Quoting Stéphane Graber (stgraber at ubuntu.com):
> > On Thu, Jun 19, 2014 at 04:14:25PM +0800, simonjin wrote:
> > > All,
> > > 
> > > gcc -I../../src -DLXCROOTFSMOUNT=\"/usr/lib64/lxc/rootfs\"
> > > -DLXCPATH=\"/usr/var/lib/lxc\"
> > > -DLXC_GLOBAL_CONF=\"/usr/etc/lxc/lxc.conf\"
> > > -DLXCINITDIR=\"/usr/libexec\" -DLIBEXECDIR=\"/usr/libexec\"
> > > -DLXCTEMPLATEDIR=\"/usr/share/lxc/templates\"
> > > -DLOGPATH=\"/usr/var/log/lxc\"
> > > -DLXC_DEFAULT_CONFIG=\"/usr/etc/lxc/default.conf\"
> > > -DLXC_USERNIC_DB=\"/run/lxc/nics\"
> > > -DLXC_USERNIC_CONF=\"/usr/etc/lxc/lxc-usernet\"
> > > -DDEFAULT_CGROUP_PATTERN=\"/lxc/%n\" -DRUNTIME_PATH=\"/run\"
> > > -DSBINDIR=\"/usr/sbin\"   -DHAVE_SELINUX  -DHAVE_SECCOMP  -g -O2
> > > -Wall -Werror -static  -o init.lxc.static lxc_init.o error.o log.o
> > > utils.o caps.o   -lutil -lpthread -lselinux
> > > /usr/bin/ld: cannot find -lselinux
> > > /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libpthread.a(libpthread.o):
> > > In function `sem_open':
> > > (.text+0x67fb): warning: the use of `mktemp' is dangerous, better
> > > use `mkstemp'
> > > collect2: error: ld returned 1 exit status
> > > make[3]: *** [init.lxc.static] Error 1
> > 
> > Serge, looks like we have one more problem with the static
> > init.lxc, why would it need to be linked with libselinux?
> 
> more configure.ac badness.
> 
> I'll send out a patch to hopefully fix all of these issues today,
> hopefully after I get the seccomp cross-arch stuff done, but if that
> drags out then I'll do it before.

Hey, on Fedora you can yum install libselinux-static to get around
this, but that is just a workaround. Note that even with this,
init.lxc.static still won't build on Fedora which is what I'm trying to
fix in the other thread :)

Serge, I think I might've caused this by having -lselinux always in LIBS= to
begin with. Hoping to save you some work, the following patch splits
-lcap and -lselinux out of LIBS, so they can be specified only where
needed.


More information about the lxc-devel mailing list