Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 652146 - sys-devel/gdb-8.1-r1 automagic dependency on dev-libs/mpfr
Summary: sys-devel/gdb-8.1-r1 automagic dependency on dev-libs/mpfr
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-01 15:29 UTC by Mart Raudsepp
Modified: 2018-07-01 20:37 UTC (History)
0 users

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


Attachments
Patch (gdb.patch,1.21 KB, patch)
2018-07-01 19:57 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff
Patch (gdb.patch,1.21 KB, patch)
2018-07-01 20:11 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mart Raudsepp gentoo-dev 2018-04-01 15:29:02 UTC
gdb 8.1 added an optional dependency on dev-libs/mpfr (in gdb/configure.ac) with this NEWS item:

* GDB now uses the GNU MPFR library, if available, to emulate target
  floating-point arithmetic during expression evaluation when the target
  uses different floating-point formats than the host.  At least version
  3.1 of GNU MPFR is required.

But this was not accounted for in the 8.1 bump for the package.
The default in configure.ac is autodetection, thus we now have an automagic dependency (albeit quite likely mpfr is there on the system or even indirect deps). Please make it explicit with --with-mpfr and a mpfr:= dep (also guaranteeing rebuilds on mpfr ABI change, which have happened recently) or a USE flag and $(use_with ...). I'd personal choose the former (forced dep) if it's pulled in indirectly anyways quite likely, but might be useful to not have it for GDBserver-only use cases or something.
Comment 1 Larry the Git Cow gentoo-dev 2018-06-23 15:43:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddc1ddb8bf51e234d63c744d84eb306ecc6d2139

commit ddc1ddb8bf51e234d63c744d84eb306ecc6d2139
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2018-06-23 15:41:29 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2018-06-23 15:43:17 +0000

    sys-devel/gdb: Add dependency on dev-libs/mpfr
    
    Closes: https://bugs.gentoo.org/652146
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 sys-devel/gdb/gdb-8.1-r1.ebuild | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 2 Arfrever Frehtes Taifersar Arahesis 2018-07-01 04:49:04 UTC
# scanelf -qF "%F: %n" $(qlist sys-devel/gdb | sort) | grep -i mpfr
/usr/bin/gdb: libreadline.so.7,libz.so.1,libdl.so.2,libncursesw.so.6,libpthread.so.0,libm.so.6,libpython3.6.so.1.0,libexpat.so.1,liblzma.so.5,libmpfr.so.6,libc.so.6,ld-linux-x86-64.so.2
# grep client sys-devel/gdb/metadata.xml
 <flag name="client">Install the main "gdb" program (most people want this)</flag>


So this dependency should be conditional on USE="client", since /usr/bin/gdb is the only file linked against libmpfr.so.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2018-07-01 09:02:15 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #2)
> So this dependency should be conditional on USE="client", since /usr/bin/gdb
> is the only file linked against libmpfr.so.

Can you attach patch to the ebuild?
Comment 4 Arfrever Frehtes Taifersar Arahesis 2018-07-01 19:57:00 UTC
Created attachment 538022 [details, diff]
Patch

Passing --with-mpfr is a mistake.
configure.ac contains:

AC_ARG_WITH(mpfr,
[AS_HELP_STRING([--with-mpfr=PATH],
                [specify prefix directory for installed MPFR package.
                 Equivalent to --with-mpfr-include=PATH/include
                 plus --with-mpfr-lib=PATH/lib])])
AC_ARG_WITH(mpfr-include,
[AS_HELP_STRING([--with-mpfr-include=PATH],
                [specify directory for installed MPFR include files])])
AC_ARG_WITH(mpfr-lib,
[AS_HELP_STRING([--with-mpfr-lib=PATH],
                [specify directory for the installed MPFR library])])

if test "x$with_mpfr" != x; then
  gmplibs="-L$with_mpfr/lib $gmplibs"
  gmpinc="-I$with_mpfr/include $gmpinc"
fi
if test "x$with_mpfr_include" != x; then
  gmpinc="-I$with_mpfr_include $gmpinc"
fi
if test "x$with_mpfr_lib" != x; then
  gmplibs="-L$with_mpfr_lib $gmplibs"
fi
Comment 5 Arfrever Frehtes Taifersar Arahesis 2018-07-01 20:11:03 UTC
Created attachment 538036 [details, diff]
Patch

Improved patch with explicit slot added to dependency on dev-libs/mpfr.
Comment 6 Larry the Git Cow gentoo-dev 2018-07-01 20:37:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d11fb1a86270b960afdac2a2f8562c6468006099

commit d11fb1a86270b960afdac2a2f8562c6468006099
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-07-01 19:48:51 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-07-01 20:36:57 +0000

    sys-devel/gdb: Depend on dev-libs/mpfr only with USE="client".
    
    Do not pass --with-mpfr option which only sets paths for searching
    headers and libraries, resulting in using -Iyes/include and -Lyes/lib.
    
    Bug: https://bugs.gentoo.org/652146

 sys-devel/gdb/gdb-8.1-r2.ebuild | 256 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 256 insertions(+)