[PATCH 2/2] libdiagnostics: work-in-progress implementation
David Malcolm
dmalcolm@redhat.com
Tue Nov 7 14:59:06 GMT 2023
On Tue, 2023-11-07 at 08:54 +0100, Simon Sobisch wrote:
> Thank you for our work and providing this patch.
>
> GCC related questions:
>
> Is it planned to change GCC diagnostics to use libdiagnostic itself?
No. GCC uses C++ internally, and the internal diagnostic API is
written in C++. libdiagnostic wraps up this C++ API in a C interface.
GCC would continue using the C++ interface internally.
>
> Is it planned to "directly" add features or would the result for GCC
> be
> identical (apart from build changes)?
>
> So far it looks like it wouldn't be possible to "just build
> libdiagnostics", and much less to "just distrubute its source" for
> that
> purpose, is it?
Correct: libdiagnostics is just an extra .cc file within the rest of
GCC, and almost all the work is being done in other .cc files.
> As building GCC does take a significant amount of resources and
> system-wide switching to a new GCC version is considered a serious
> task
> (distributions commonly stay with their major GCC version for quite
> some
> time), I'd search for an option to building a "self-contained"
> version
> that does not need the complete necessary toolset and may also be
> distributed separately.
It's possible to reduce the resources by disabling bootstrapping, and
only enabling a minimal set of languages.
I'd see libdiagnostics as coming from the distribution build of GCC. I
suppose distributions might want to have a simple build of GCC and ship
just the .so/.h file from libdiagnostics from the build.
>
> This definitely can come later, too; I _guess_ this would mean moving
> part of GCCs code in a sub-folder libdiagnostics and use it as
> subproject for configure/make, with then option to run "make dist" in
> that subfolder alone, too.
It would involve a lot of refactoring :)
>
> The main reason for that would be to allow applications move from
> their
> previous own diagnostic to libdiagnostics, if it isn't available on
> the
> system they can build and install it as subproject, too; and to be
> able
> to build libdiagnostics with a much reduced dependency list.
I can try to come up with a minimal recipe for building gcc if all you
want is libdiagnostics
>
>
> Thank you for considering that,
> Simon
Thanks
Dave
[...snip...]
More information about the Binutils
mailing list