Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 656184 - Sandbox does not build with slibtool
Summary: Sandbox does not build with slibtool
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Sandbox (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-20 20:15 UTC by orbea
Modified: 2018-07-15 15:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dlibtool build log (sandbox.dlibtool.log,82.38 KB, text/x-log)
2018-05-20 20:15 UTC, orbea
Details
Patch to fix the build with slibtool. (sandbox-2.13.patch,1.54 KB, patch)
2018-05-20 20:16 UTC, orbea
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description orbea 2018-05-20 20:15:30 UTC
Created attachment 532388 [details]
dlibtool build log

When building sandbox with slibtool instead of libtool I encounter the build issue shown in the attached log. After some investigation this seems like a sandbox bug and have also attached a patch to solve it.

The build fails because of multiple definitions of '__sb_dump_backtrace' which libtool seems to ignore, but slibtool will error on. Additionally this build error can be easily exposed for libtool by changing 'libsandbox_la_LIBSBLIB' in 'libsandbox/Makefile.am' from `libsbutil.a` to `libsbutil.la` as described in the comment.

This can be easily resolved by removing the extra and empty definition in libsbutil. If this or an alternative solution can be merged into sandbox it would be appreciated.
Comment 1 orbea 2018-05-20 20:16:40 UTC
Created attachment 532390 [details, diff]
Patch to fix the build with slibtool.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-06-03 06:29:57 UTC
Comment on attachment 532390 [details, diff]
Patch to fix the build with slibtool.

Thank you for your patch.  However, it doesn't look right to me.  The thing was clearly done like this for a reason, and you're just bluntly stripping the __sb_dump_backtrace() call.  I can't accept a patch that clearly kills functionality for everyone.
Comment 3 orbea 2018-06-03 13:05:08 UTC
Thanks for the reply. I was also not sure this was the best solution, but I do not think its stripping functionality because I just removed an empty definition. I do not think the current code is achieving the intended behavior and libtool is just ignoring the issue? Unfortunately my knowledge of C is limited and I'm not sure I can provide a more ideal patch.

If you could help find one it would be greatly appreciated!
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-06-03 13:21:37 UTC
The comment on top of the file you've removed says that the function is being replaced when libsandbox.so is preloaded.  If you grep for it, libsandbox/libsandbox.c defines the override with actual content.
Comment 5 orbea 2018-06-03 14:21:08 UTC
Yes, I saw that, but does it actually work as intended? The error message seems to indicate it doesn't and will also fail to build with libtool if I change libsandbox/Makefile.am from:

  libsandbox_la_LIBSBLIB = $(top_builddir)/libsbutil/.libs/libsbutil.a

to 

  libsandbox_la_LIBSBLIB = $(top_builddir)/libsbutil/libsbutil.la

As indicated in the above comment.

  # Could use the following to libsandbox_la_LIBADD, but then libtool links it
  # with --whole-archive, and libsandbox.so increase with a few KB in size:
  #       $(top_builddir)/libsbutil/libsbutil.la

I provided the patch not so much as a solution, but as a work around that may help find a solution. Maybe I didn't make that clear enough? :)