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.
Created attachment 532390 [details, diff] Patch to fix the build with slibtool.
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.
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!
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.
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? :)
This is fixed in the current slibtool main (master) branch, please see the following commits. https://git.midipix.org/cgit.cgi/slibtool/commit/?id=6a1ae75038ff6d45ff3c7bbd4ef090798545e617 https://git.midipix.org/cgit.cgi/slibtool/commit/?id=2a0acb3d2d178cce84d511b727e1410ebb8dbce5 https://git.midipix.org/cgit.cgi/slibtool/commit/?id=ba8a741ee5b66da5a2d44c1c9b9f6eb6d54e0b18 https://git.midipix.org/cgit.cgi/slibtool/commit/?id=46aa6f554c0f2ef1affa5ae292fffec6907ff4b3 I'll mark this as resolved, thanks for the time!