Re: Statically linking with libgmp and libmpfr

Andrew Pinski via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CA+=Sn1=uSmdEGR4Vb8vyn5-zd7jX3tx3EMuFRxsivJWBbAh5LQ@mail.gmail.com>
On Fri, May 16, 2025 at 1:57 AM Vahedi, Shahab via Gdb
<[email protected]> wrote:
>
> I've managed to _work around_ this by populating a "static only" lib dir
> and pointing the "configure" to it:
>
> $ mkdir -p /only/static/libs
> $ cp /usr/lib/libgmp.a  /only/static/libs
> $ cp /usr/lib/libmpfr.a /only/static/libs
>
> $ tree /only/static/libs
>   /only/static/libs
>   |-- libgmp.a
>   `-- libmpfr.a
>
>
> $ configure ...                              \
>             --with-gmp-lib=/only/static/libs \
>             --with-mpfr-lib=/only/static/libs
> $ make
>
> $ libtree -vv gdb/gdb
>   [ no signs of gmp or mpfr ]
>
>
> I still am interested in an out-of-the-box approach, if any, like GDB <= 13.2.

The out of the box approach is to put the GMP/MPFR sources in the top
level directory and that will build gmp/mpfr (static only) and link
against those .
So don't build GMP/MPFR separately when building gdb.

Thanks,
Andrew

>
>
> Cheers,
> Shahab
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.