I built mpc and libmpr as static libraries and installed them into a temprary location. I passed --with-mpfr=/... and --with-mpc=/... to configure. I expected the build process to pick up the static libraries provided at the given locations. But the resulting binary uses the shared libraries insalled in /lib64. gdb/Makefile was written with this line: LIBMPFR = -lmpfr -lgmp I configured and build gcc with the same options, and gcc uses the static libraries. In the gcc build directory gcc/Makefile contains the following line: GMPLIBS = -L/.../lib -L/.../lib -L/.../lib -lmpc -lmpfr -lgmp The difference is, that gcc's configure added -L options with the path of the static libraries. The config.log does contain a setting with -L options: gmplibs='-L/.../lib -L/.../lib -L/.../lib -lmpc -lmpfr -lgmp' but this setting is not used when building gdb. :-( I just found, that there also is a config.log in the gdb subdirectory. I see, that '--with-gmp=/...' '--with-mpfr=/...' were passed tot he sub-configure. But I see, that this path is not used: configure:10086: checking whether to use MPFR configure:10088: result: /... configure:10521: checking for libmpfr configure:10541: gcc -o conftest -g -O2 conftest.c -ltinfow -lncursesw -lm -ldl -lmpfr -lgmp >&5 configure:10541: $? = 0 configure:10551: result: yes configure:10558: checking how to link with libmpfr configure:10560: result: -lmpfr -lgmp It just detects the system-supplied mpfr and don't use the one, that I selected on configures command line. :-(
I don't think gdb uses mpc. For mpfr, it seems to be the same issue as bug#28500: gdb has a different set of options from the top level. prentzel. ./configure --help|grep mpfr --with-mpfr-dir=PATH this option has been REMOVED --with-mpfr=PATH specify prefix directory for installed MPFR package. Equivalent to --with-mpfr-include=PATH/include plus --with-mpfr-lib=PATH/lib --with-mpfr-include=PATH --with-mpfr-lib=PATH specify directory for the installed MPFR library prentzel. ./gdb/configure --help|grep mpfr --with-mpfr include MPFR support (auto/yes/no) --with-libmpfr-prefix[=DIR] search for libmpfr in DIR/include and DIR/lib --without-libmpfr-prefix don't search for libmpfr in includedir and libdir --with-libmpfr-type=TYPE type of library to search for (auto/static/shared) Try using the ones reported by gdb - I think that may work. I tend to think standardizing the options here would be good, but there are some caveats & problems in this thread https://sourceware.org/pipermail/gdb-patches/2020-November/173301.html
I'm arbitrarily picking one bug as the canonical one. *** This bug has been marked as a duplicate of bug 28500 ***