[lxc-devel] [PATCH 05/21] No need to link against rt and util on bionic

Stéphane Graber stgraber at ubuntu.com
Thu Jan 3 19:08:37 UTC 2013


On 01/03/2013 01:10 PM, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
>> When building on bionic, -lrt and -lutil only cause a build failure.
>> Dropping those fixes the build, so it appears that the symbols are defined
>> in the main library.
>>
>> This commit moves -lrt and -lutil under a !IS_BIONIC check.
>>
>> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
> 
> I suspect this will break lxccontainer.  -lrt is needed for semgetvalue.
> Can you run one of the lxccontainer test cases and, if they build+run,
> I'll be curious where sem_getvalue is coming from.
> 
> (See commit 5f29734f7d219: Fix build with --enable-tests on Fedora.)
> 
> Still it's only for bionic so for now
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


I can't test run, but I can confirm that I can build and link LXC with
the API. liblxc.so is properly produced and with the patch I just
submitted now, I can use --enable-tests and the test binaries appear to
link fine against liblxc.so

>> ---
>>  src/lxc/Makefile.am | 12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
>> index bf675f9..489beac 100644
>> --- a/src/lxc/Makefile.am
>> +++ b/src/lxc/Makefile.am
>> @@ -82,7 +82,11 @@ liblxc_so_LDFLAGS = \
>>  	-shared \
>>  	-Wl,-soname,liblxc.so.$(firstword $(subst ., ,$(VERSION)))
>>  
>> -liblxc_so_LDADD = -lutil $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS) -lrt
>> +liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS)
>> +
>> +if !IS_BIONIC
>> +liblxc_so_LDADD += -lutil -lrt
>> +endif
>>  
>>  bin_SCRIPTS = \
>>  	lxc-ps \
>> @@ -128,7 +132,11 @@ AM_LDFLAGS = -Wl,-E
>>  if ENABLE_RPATH
>>  AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
>>  endif
>> -LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SECCOMP_LIBS@ -lrt
>> +LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SECCOMP_LIBS@
>> +
>> +if !IS_BIONIC
>> +	LDADD += -lrt
>> +endif
>>  
>>  lxc_attach_SOURCES = lxc_attach.c
>>  lxc_cgroup_SOURCES = lxc_cgroup.c
>> -- 
>> 1.8.0
>>
>>
>> ------------------------------------------------------------------------------
>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>> MVPs and experts. ON SALE this month only -- learn more at:
>> http://p.sf.net/sfu/learnmore_122712
>> _______________________________________________
>> Lxc-devel mailing list
>> Lxc-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/lxc-devel


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130103/7e2ed80d/attachment.pgp>


More information about the lxc-devel mailing list