This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] compile: Use libcc1.so->libcc1.so.0
- From: Pedro Alves <palves at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Phil Muldoon <pmuldoon at redhat dot com>
- Date: Thu, 23 Apr 2015 12:42:12 +0100
- Subject: Re: [PATCH] compile: Use libcc1.so->libcc1.so.0
- Authentication-results: sourceware.org; auth=none
- References: <20150421213616 dot 14023 dot 38329 dot stgit at host1 dot jankratochvil dot net>
On 04/21/2015 10:36 PM, Jan Kratochvil wrote:
> (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).
I don't agree with tying the so version with GCC_FE_VERSION.
The so version is supposed to indicate binary compatibility.
And the ABI is maintained as long as the ABI of the single
entry point -- gcc_c_fe_context -- is maintained.
We can bump GCC_C_FE_VERSION_x leaving the .so version alone,
and on the plugin/gcc side, add new functions at the end of
the context vtable, keeping the vtable compatible
/* The type of the initialization function. The caller passes in the
desired base version and desired C-specific version. If the
request can be satisfied, a compatible gcc_context object will be
returned. Otherwise, the function returns NULL. */
typedef struct gcc_c_context *gcc_c_fe_context_function
With that, an older gdb that requests GCC_FE_VERSION_0
should still work. A newer gdb that understands both v1
and v0 can first try GCC_FE_VERSION_1, and if that fails,
try GCC_FE_VERSION_0, etc.
It's that code that does the initialization/handshake
on both ends (gdb/gcc) that should decide which versions
each end supports. Doesn't have to be a single version.