Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Phil Muldoon <pmuldoon@redhat.com>
Subject: [PATCH] compile: Use libcc1.so->libcc1.so.0
Date: Tue, 21 Apr 2015 21:36:00 -0000	[thread overview]
Message-ID: <20150421213616.14023.38329.stgit@host1.jankratochvil.net> (raw)

Hi,

the next [patch 3/4] will change the libcc1.so API.  I am not sure if it gets
approved in GCC land but for such case:
(1) We really need to change GCC_FE_VERSION_0 -> GCC_FE_VERSION_1, this
    feature is there for this purpose.  That is [patch 2/4].
(2) Currently GDB does only dlopen("libcc1.so") and then depending on which
    libcc1.so version it would find first it would succeed/fail.
    I guess it is more convenient to do dlopen("libcc1.so.1") instead
    (where ".1"=".x" corresponds to GCC_FE_VERSION_x).
    That is this patch (with x=0).
(3) Currently there is no backward or forward compatibility although there
    could be one implemented.  Personally I think the 'compile' feature is
    still in experimental stage so that it is OK to require last releases.
    At least in Fedora we can keep GDB<->GCC in sync.

include/* changes are here only FYI, master repository of those files is GCC.

Corresponding GCC part of the patches are going to be sent along to GCC.


Jan


gdb/ChangeLog
2015-04-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* compile/compile-c-support.c (load_libcc): Remove STRINGIFY from
	GCC_C_FE_LIBCC.

include/ChangeLog
2015-04-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gcc-c-interface.h (GCC_C_FE_LIBCC): Quote it.  Append
	GCC_FE_VERSION_0.
---
 gdb/compile/compile-c-support.c |    4 ++--
 include/gcc-c-interface.h       |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c
index 1711cda..e3c01f2 100644
--- a/gdb/compile/compile-c-support.c
+++ b/gdb/compile/compile-c-support.c
@@ -79,14 +79,14 @@ load_libcc (void)
 
    /* gdb_dlopen will call error () on an error, so no need to check
       value.  */
-  handle = gdb_dlopen (STRINGIFY (GCC_C_FE_LIBCC));
+  handle = gdb_dlopen (GCC_C_FE_LIBCC);
   func = (gcc_c_fe_context_function *) gdb_dlsym (handle,
 						  STRINGIFY (GCC_C_FE_CONTEXT));
 
   if (func == NULL)
     error (_("could not find symbol %s in library %s"),
 	   STRINGIFY (GCC_C_FE_CONTEXT),
-	   STRINGIFY (GCC_C_FE_LIBCC));
+	   GCC_C_FE_LIBCC);
   return func;
 }
 
diff --git a/include/gcc-c-interface.h b/include/gcc-c-interface.h
index 95d0fc9..7108952 100644
--- a/include/gcc-c-interface.h
+++ b/include/gcc-c-interface.h
@@ -197,7 +197,7 @@ struct gcc_c_context
 /* The name of the .so that the compiler builds.  We dlopen this
    later.  */
 
-#define GCC_C_FE_LIBCC libcc1.so
+#define GCC_C_FE_LIBCC "libcc1.so." STRINGIFY (GCC_FE_VERSION_0)
 
 /* The compiler exports a single initialization function.  This macro
    holds its name as a symbol.  */


             reply	other threads:[~2015-04-21 21:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 21:36 Jan Kratochvil [this message]
2015-04-21 21:38 ` mail dup cancel: " Jan Kratochvil
2015-04-22 21:13 ` Phil Muldoon
2015-04-23  5:29   ` Jan Kratochvil
2015-04-23 10:53     ` Phil Muldoon
2015-04-23 11:24       ` Pedro Alves
2015-04-23 11:47       ` Jan Kratochvil
2015-04-23 11:59         ` Pedro Alves
2015-04-23 11:42 ` Pedro Alves
2015-04-23 11:51   ` Jan Kratochvil
2015-04-23 11:52   ` Jan Kratochvil
2015-04-23 12:07     ` Pedro Alves
2015-04-23 12:24       ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150421213616.14023.38329.stgit@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox