While src_prepare checks for USE=debug, multilib_src_install does not. The latter only installs the release build. I fiddled with the ebuild and came up with a solution that worked for me, see attachments. Before the patches to the build: qlist tbb | grep debug (returns nothing) After the patches to the ebuild: qlist tbb | grep debug /usr/lib64/libtbbmalloc_proxy_debug.so /usr/lib64/libtbbmalloc_debug.so /usr/lib64/libtbb_debug.so /usr/lib64/libtbbmalloc_proxy_debug.so.2 /usr/lib64/libtbbmalloc_debug.so.2 /usr/lib64/libtbb_debug.so.2 I came accross this issue because cnnx from #gentoo was trying to build sci-libs/opencascade-6.9.0 (build.log attached), which failed with /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltbb_debug /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ltbbmalloc_debug Reproducible: Always
Created attachment 415920 [details] sci-libs/opencascade-6.9.0 build.log from cnnx (irc)
Created attachment 415922 [details, diff] Patch install function to respect USE=debug and install the debug libs
Created attachment 415924 [details] tbb-4.3.20150611.ebuild with the patch applied and renamed to tbb-4.3.20150611-r1.ebuild
Thanks for the patch. Would you like to send a PR on Github or should I take it from here?
Please take it, thanks.
commit ccb7ff1a98f902c510ba58052a0ad428384224f0 Author: Justin Lecher <jlec@gentoo.org> Date: Sun Nov 8 18:47:33 2015 +0100 dev-cpp/tbb: Properly install debug libs thanks Konstantin (elxa) for the patch Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=564678 Package-Manager: portage-2.2.23 Signed-off-by: Justin Lecher <jlec@gentoo.org> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccb7ff1a98f902c510ba58052a0ad428384224f0