diff mbox

Add Rust support to source highlighting

Message ID e9f0ed1e-8044-ca61-3fd3-93c9314c5e65@redhat.com
State New
Headers show

Commit Message

Pedro Alves July 17, 2019, 7:10 p.m. UTC
On 7/17/19 6:50 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> 
>>> It seems like a bit of a pain to fix at top-level.  These flags are put
>>> into the default LDFLAGS for stage1, or when not bootstrapping.
> 
> Pedro> Can you expand on why is it a pain?  I was imagining that the top-level
> Pedro> script would take in consideration whether a gcc/ subdir exists, in
> Pedro> addition to checking some --{enable,disable}-static-runtime or some such,
> Pedro> where it adds the flags to LDFLAGS.
> 
> The main problem is that the flags are passed down from the top-level
> Makefile, so it would need extra top-level Makefile.* hacking.

I'm not sure we're talking about the same thing.  See below for
what I had in mind.

> 
> Pedro> I assume it is put in LDFLAGS for the whole tree in order to
> Pedro> use -static-libcc consistently for both gcc and the libraries it
> Pedro> depends on (like libiberty).  (It'd be interesting to find the
> Pedro> rationale in the original mailing list post/patch that added it to
> Pedro> be sure.)
> 
> Pedro> With what you're suggesting it sounds like we'd build libiberty/, libbfd/,
> Pedro> etc. with -static-libgcc and gdb/ without?  That sounds like something
> Pedro> we shouldn't be doing either.
> 
> Are those even useful for libiberty or bfd?  I thought those only
> affected the link.

I'm not sure they only affect the link, but I do think so.

> 
> Or do people build a shared libiberty and/or bfd?  That seems bad.
> 

We have things like this in the top level configure:

 # Sometimes we have special requirements for the host libiberty.
 extra_host_libiberty_configure_flags=
 extra_host_zlib_configure_flags=
 case " $configdirs " in
   *" lto-plugin "* | *" libcc1 "*)
     # When these are to be built as shared libraries, the same applies to
     # libiberty.
     extra_host_libiberty_configure_flags=--enable-shared
     ;;
   *" bfd "*)
     # When bfd is to be built as a shared library, the same applies to
     # zlib.
     if test "$enable_shared" = "yes"; then
       extra_host_zlib_configure_flags=--enable-host-shared
     fi
     ;;
 esac
 AC_SUBST(extra_host_libiberty_configure_flags)
 AC_SUBST(extra_host_zlib_configure_flags)

And:

 $ ./src/configure --help | grep host-shared
   --enable-host-shared    build host code as shared libraries

So it does looks like it people do that.

From a2d01e2138a28be2a32978f38298e6b7dd99e7d4 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Wed, 17 Jul 2019 16:07:20 +0100
Subject: [PATCH] gcc

---
 configure    | 2 +-
 configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Tromey July 23, 2019, 11:43 p.m. UTC | #1
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> I'm not sure we're talking about the same thing.  See below for
Pedro> what I had in mind.

Yeah, ok.  I can do this.

I think this means changing gdb's configure to disable source highlight
when we see -static-lib*, because those are simply incompatible.

Tom
diff mbox

Patch

diff --git a/configure b/configure
index 4d111486926..f1cc1cf9e56 100755
--- a/configure
+++ b/configure
@@ -5838,7 +5838,7 @@  else
  # In stage 1, default to linking libstdc++ and libgcc statically with GCC
  # if supported.  But if the user explicitly specified the libraries to use,
  # trust that they are doing what they want.
- if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
+ if test -d ${srcdir}/gcc -a test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
    stage1_ldflags="-static-libstdc++ -static-libgcc"
  fi
 fi
diff --git a/configure.ac b/configure.ac
index 854f71a34e5..2c85b8d7374 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1614,7 +1614,7 @@  AC_ARG_WITH(stage1-ldflags,
  # In stage 1, default to linking libstdc++ and libgcc statically with GCC
  # if supported.  But if the user explicitly specified the libraries to use,
  # trust that they are doing what they want.
- if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
+ if test -d ${srcdir}/gcc -a test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
    stage1_ldflags="-static-libstdc++ -static-libgcc"
  fi])
 AC_SUBST(stage1_ldflags)