public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Simon Sobisch <simonsobisch@gnu.org>
To: David Malcolm <dmalcolm@redhat.com>,
	gcc-patches@gcc.gnu.org, binutils@sourceware.org
Cc: Nick Clifton <nickc@redhat.com>
Subject: Re: [PATCH 2/2] libdiagnostics: work-in-progress implementation
Date: Tue, 7 Nov 2023 16:35:38 +0100	[thread overview]
Message-ID: <6b3c08d6-b0da-4702-ab67-e1b9c5a85370@gnu.org> (raw)
In-Reply-To: <64cd524041c8552373103b7b4e16342ccbc2543e.camel@redhat.com>



Am 07.11.2023 um 15:59 schrieb David Malcolm:
> 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.

Why not providing both a C and C++ API in libdiagnostics?
GNU programs (and also others) are written in both.

The benefit of using it withing GCC itself "eat your own dogfood" would 
be that more or less any need that GCC has is also found in the 
library... thinking again, this may also make it "too heavy" - not sure.

>>
>> 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.

Maybe call that "status quo - initial patch"? ;-)

>> 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.

Agreed. But I'm as a "user" would like to have that "easy" option, too.
As a maintainer that plans to move to libdiagnostics it would be _very_ 
helpful to be able to use it as a sub-project, in case it isn't available.

>> 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 :)

Something to "consider along, do later", I guess.
> 
>>
>> 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

Thanks, that already helps a lot.

Simon

  reply	other threads:[~2023-11-07 15:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 22:29 [PATCH/RFC] libdiagnostics: a shared library for emitting diagnostics David Malcolm
2023-11-06 22:29 ` [PATCH 1/2] libdiagnostics: header and examples David Malcolm
2023-11-06 22:29 ` [PATCH 2/2] libdiagnostics: work-in-progress implementation David Malcolm
2023-11-07  7:54   ` Simon Sobisch
2023-11-07 14:59     ` David Malcolm
2023-11-07 15:35       ` Simon Sobisch [this message]
2023-11-06 22:29 ` [PATCH] binutils: experimental use of libdiagnostics in gas David Malcolm
2023-11-07  7:04   ` Simon Sobisch
2023-11-07 14:51     ` David Malcolm
2023-11-07  9:21   ` Clément Chigot
2023-11-07 14:09     ` David Malcolm
2023-11-07 15:57       ` Clément Chigot
2023-11-07 16:18         ` David Malcolm
2023-11-07 10:03   ` Jan Beulich
2023-11-07 14:32     ` David Malcolm
2023-11-07 14:59       ` Jan Beulich
2023-11-21 22:20 ` [PATCH 0/6] v2 of libdiagnostics David Malcolm
2023-11-21 22:20   ` [PATCH 1/5] libdiagnostics v2: header and examples David Malcolm
2023-11-21 22:20   ` [PATCH 2/5] libdiagnostics v2: work-in-progress implementation David Malcolm
2023-11-21 22:20   ` [PATCH 3/5] libdiagnostics v2: add C++ wrapper API David Malcolm
2023-11-21 22:20   ` [PATCH 4/5] diagnostics: add diagnostic_context::get_location_text David Malcolm
2023-11-28  1:25     ` David Malcolm
2023-11-21 22:20   ` [PATCH 5/5] diagnostics: don't print annotation lines when there's no column info David Malcolm
2023-11-28  1:25     ` David Malcolm
2023-11-21 22:20   ` [PATCH] binutils: v2: experimental use of libdiagnostics in gas David Malcolm
2023-11-22  7:36     ` Jan Beulich
2023-11-21 22:35   ` [PATCH 0/6] v2 of libdiagnostics Simon Sobisch
2023-11-23 17:36   ` Pedro Alves
2024-01-27 23:28     ` Simon Sobisch

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=6b3c08d6-b0da-4702-ab67-e1b9c5a85370@gnu.org \
    --to=simonsobisch@gnu.org \
    --cc=binutils@sourceware.org \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nickc@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).