public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dimitry Andric <dimitry@andric.com>
To: Iain Sandoe <iain@sandoe.co.uk>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix libcc1plugin and libc1plugin to avoid poisoned identifiers
Date: Wed, 13 Mar 2024 13:10:42 +0100	[thread overview]
Message-ID: <06120356-49F7-4A4A-AA99-33ECEB30E272@andric.com> (raw)
In-Reply-To: <ADF20A0C-91FD-422B-9C18-06D8E769BFE0@sandoe.co.uk>

On 13 Mar 2024, at 12:30, Iain Sandoe <iain@sandoe.co.uk> wrote:
> 
>> On 7 Mar 2024, at 16:48, Dimitry Andric <dimitry@andric.com> wrote:
>> 
>> Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111632
>> 
>> Use INCLUDE_VECTOR before including system.h, instead of directly
>> including <vector>, to avoid running into poisoned identifiers.
> 
> I would say that the patch itself is obvious, but you have not mentioned how
> it was tested?

This was tested by doing a --disable-bootstrap build, on a FreeBSD
system where llvm-project's libc++ is the default C++ library
(specifically 15.0-CURRENT, which has llvm-project 17.0.6), against both
the lang/gcc14-devel port, and against gcc master as of
gcc-14-9346-g74e8cc28eda. This also required gcc-14-9360-g9970b576b7e to
be applied, before it was committed to master.

Note that if you do a fully bootstrapped build, there aren't any compile
errors, since it will compile the plugins against a freshly built
libstdc++: it has already transitively included <vector> via other
standard headers, so the #include <vector> statement after #include
"system.h" effectively does nothing, and won't run into poisoned
identifiers.

You would only get compile errors on those poisoned identifiers with the
non-bootstrapped, single-stage build which compiles everything against
the host system's C++ headers.

-Dimitry


  reply	other threads:[~2024-03-13 12:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 16:48 Dimitry Andric
2024-03-13 11:30 ` Iain Sandoe
2024-03-13 12:10   ` Dimitry Andric [this message]
2024-03-16  8:53 FX Coudert

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=06120356-49F7-4A4A-AA99-33ECEB30E272@andric.com \
    --to=dimitry@andric.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    /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).