<div dir="ltr">Dear Thomas,<br><div class="gmail_extra"><br><div class="gmail_quote">2018-05-03 21:40 GMT+02:00 Thomas Petazzoni <span dir="ltr"><<a href="mailto:thomas.petazzoni@bootlin.com" target="_blank">thomas.petazzoni@bootlin.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Fabrice,<br>
<br>
Sorry for the slow feedback on this one.<br>
<span class="gmail-"><br>
On Sat,  7 Apr 2018 18:22:34 +0200, Fabrice Fontaine wrote:<br>
> Fixes:<br>
>  - <a href="http://autobuild.buildroot.net/results/b655d6853c25a195df28d91512b3ffb6c654fc90" rel="noreferrer" target="_blank">http://autobuild.buildroot.<wbr>net/results/<wbr>b655d6853c25a195df28d91512b3ff<wbr>b6c654fc90</a><br>
> <br>
> Signed-off-by: Fabrice Fontaine <<a href="mailto:fontaine.fabrice@gmail.com">fontaine.fabrice@gmail.com</a>><br>
<br>
</span>So, this happens because when BR2_SHARED_LIBS=y, gnutls installs only a<br>
shared library, while libcap installs both a static library and a<br>
shared library.<br>
<br>
But really, the crux of the problem is that LXC shouldn't try to build<br>
a statically linked program when BR2_SHARED_LIBS=y. It doesn't make<br>
sense, because we don't guarantee to provide static libraries when<br>
BR2_SHARED_LIBS=y: some packages do build static libraries<br>
unconditionally, but for examples the autotools packages that obey to<br>
--disable-static will not build/install static libraries when<br>
BR2_SHARED_LIBS=y.<br>
<br>
And in fact, I'm wondering how your patch resolves that really. I guess<br>
it disables GnuTLS support in such a situation, but that isn't really<br>
the right fix IMO. I would rather disable the build of the static<br>
version of the LXC program.<br>
<br>
Do you think you could have a look into this ?<br></blockquote><div>The issue was more subtle, init_lxc is a simple binary that LXC wants to be statically linked if it founds a static version of the only library that it needs: libcap. Indeed, this binary doesn't need gnutls or any other dependencies such as selinux or seccomp that are needed for liblxc. However, because AC_CHECK_LIB was added with its default behavior of adding gnutls to the global LIBS variable, linking of init_lxc was failing because gnutls was not static.<br></div><div>So, I think my patch is the right fix and it has been merged upstream: <a href="https://github.com/lxc/lxc/commit/49bc916b1daa79cffe38fae32059bcdd985c8c8e">https://github.com/lxc/lxc/commit/49bc916b1daa79cffe38fae32059bcdd985c8c8e</a>.<br></div><div>Moreover, the issue was raised because when BR2_SHARED_LIBS is set, the libcap package installs the static and the shared version of the library, I made a patch to change this behavior but I've not send it as it didn't fix the root cause of the issue.  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-HOEnZb"><font color="#888888"><br>
Thomas<br>
-- <br>
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)<br>
Embedded Linux and Kernel engineering<br>
<a href="https://bootlin.com" rel="noreferrer" target="_blank">https://bootlin.com</a><br>
</font></span></blockquote></div>Best Regards,<br><br></div><div class="gmail_extra">Fabrice<br></div></div>