Re: [PATCH] Link to -lssp when available (fixes mingw build)

Eli Zaretskii
2020-02-15T14:06:25Z

> Date: Thu, 19 Dec 2019 17:49:27 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> CC: cbiesinger@google.com, gdb-patches@sourceware.org
>
> > That is why the top level configure was recently changed to avoid the
> > -static-libstc++/-static-libgcc:
> >
> > https://gcc.gnu.org/ml/gcc-patches/2019-08/msg00287.html
> >
> > Note that the patch added a new --with-static-standard-libraries
> > configure switch which you can use to get back the previous behavior
> > of linking with the static versions of the standard libraries.
>
> Ah, okay, so I need to use that configure option.

I've now used --with-static-standard-libraries while building GDB 9.1,
and found out that it causes a problem: it doesn't allow linking
against libsource-highlight:

checking for the source-highlight library... configure: error: source highlight is incompatible with -static-libstdc++; either use --disable-source-highlight or --without-static-standard-libraries
Makefile:9238: recipe for target `configure-gdb' failed
make[1]: *** [configure-gdb] Error 1

This is because the configure script unconditionally rejects
"--with-static-standard-libraries", although AFAIU linking statically
against libsource-highlight.a doesn't contradict static libstdc++ and
libgcc. So this sounds like a gratuitous limitation. Is it possible
to remove it, and simply force linking statically against
libsource-highlight when --with-static-standard-libraries is used?

TIA