public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
@ 2024-02-25 20:48 markmigm at gmail dot com
  2024-02-25 20:53 ` [Bug jit/114105] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: markmigm at gmail dot com @ 2024-02-25 20:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

            Bug ID: 114105
           Summary: --disable-bootstrap based builds vs libcc1 and gcc/jit
                    use of gcc/system.h poisoning policy
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: markmigm at gmail dot com
  Target Milestone: ---

[ Note: not limited to gcc14 : FreeBSD ports lang/gcc12 (& -devel) and
lang/gcc13
(& -devel) had to be patched for libcc1 , not just lang/gcc14-devel ]

Attempting --disable-bootstrap builds of various gcc versions under clang &
libc++
gets errors from, appearently, assuming that the sources and toolchain will
follow
the gcc internal poisoning principles. The results are errors like:

In file included from
/wrkdirs/share/dim/ports/lang/gcc13/work/gcc-13.2.0/libcc1/libcc1plugin.cc:72:
In file included from /usr/include/c++/v1/vector:321:
In file included from /usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /usr/include/c++/v1/__format/formatter_integral.h:32:
/usr/include/c++/v1/locale:289:36: error: attempt to use a poisoned identifier
  289 |         __status = (unsigned char*)malloc(__nkw);
      |                                    ^
/usr/include/c++/v1/locale:1584:28: error: attempt to use a poisoned identifier
 1584 |         __ob =
(char_type*)malloc(2*static_cast<size_t>(__nc)*sizeof(char_type));
      |                            ^

(FreeBSD patches lang/gcc12* and lang/gcc13* and lang/gcc14-devel for the
libcc1
issues involving poisoning identifiers.)

and:

In file included from
/wrkdirs/usr/ports/lang/gcc14-devel/work/gcc-14-20240218/gcc/jit/dummy-frontend.cc:23:
In file included from
/wrkdirs/usr/ports/lang/gcc14-devel/work/gcc-14-20240218/gcc/jit/jit-playback.h:26:
In file included from /usr/include/c++/v1/vector:321:
In file included from /usr/include/c++/v1/__format/formatter_bool.h:20:
In file included from /usr/include/c++/v1/__format/formatter_integral.h:32:
/usr/include/c++/v1/locale:289:36: error: attempt to use a poisoned identifier
  289 |         __status = (unsigned char*)malloc(__nkw);
      |                                    ^

(FreeBSD is still working on patching lang/gcc14-devel for its gcc/jit issues
involving poisoning identifiers. It is possible that after that is done
more issues will be exposed.)

Part of the reason FreeBSD puts effort into making --disable-bootstrap work,
despite it not being the default in the ports, is to allow builds that stay
in the bounds of the free version of, for example, cirrus.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug jit/114105] --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
  2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
@ 2024-02-25 20:53 ` pinskia at gcc dot gnu.org
  2024-02-25 20:56 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-25 20:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
`#define INCLUDE_VECTOR` should be done for jit ...
And maybe libcc1 too.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug jit/114105] --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
  2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
  2024-02-25 20:53 ` [Bug jit/114105] " pinskia at gcc dot gnu.org
@ 2024-02-25 20:56 ` pinskia at gcc dot gnu.org
  2024-02-25 21:01 ` sjames at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-25 20:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Something like:
```
diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit/dummy-frontend.cc
index dbeeacd17a8..f57fb805a5f 100644
--- a/gcc/jit/dummy-frontend.cc
+++ b/gcc/jit/dummy-frontend.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */

 #include "config.h"
+#define INCLUDE_VECTOR
 #include "system.h"
 #include "coretypes.h"
 #include "jit-playback.h"
```


>Part of the reason FreeBSD puts effort into making --disable-bootstrap work
This should not be done unless you are building with GCC itself. The reason is
only the C, C++ front-ends are supposed to be able to compile with a (non-GCC)
C++11 compiler. So FreeBSD is doing it wrong anyways.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug jit/114105] --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
  2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
  2024-02-25 20:53 ` [Bug jit/114105] " pinskia at gcc dot gnu.org
  2024-02-25 20:56 ` pinskia at gcc dot gnu.org
@ 2024-02-25 21:01 ` sjames at gcc dot gnu.org
  2024-02-25 21:02 ` sjames at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-25 21:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

--- Comment #3 from Sam James <sjames at gcc dot gnu.org> ---
I have a patch which includes those extra hunks (in addition to the PR111632
one), but didn't have a chance yet to look at iain's build failure on darwin.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug jit/114105] --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
  2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
                   ` (2 preceding siblings ...)
  2024-02-25 21:01 ` sjames at gcc dot gnu.org
@ 2024-02-25 21:02 ` sjames at gcc dot gnu.org
  2024-02-26  1:01 ` markmigm at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-25 21:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

--- Comment #4 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Sam James from comment #3)
> I have a patch which includes those extra hunks (in addition to the PR111632
> one), but didn't have a chance yet to look at iain's build failure on darwin.

(someone should feel free to do the easier bits though ofc, these things tend
to accumulate anyway)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug jit/114105] --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
  2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
                   ` (3 preceding siblings ...)
  2024-02-25 21:02 ` sjames at gcc dot gnu.org
@ 2024-02-26  1:01 ` markmigm at gmail dot com
  2024-02-26  1:08 ` pinskia at gcc dot gnu.org
  2024-02-26  1:19 ` markmigm at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: markmigm at gmail dot com @ 2024-02-26  1:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

--- Comment #5 from Mark Millard <markmigm at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> . . .
> >Part of the reason FreeBSD puts effort into making --disable-bootstrap work
> This should not be done unless you are building with GCC itself. The reason
> is only the C, C++ front-ends are supposed to be able to compile with a
> (non-GCC) C++11 compiler. So FreeBSD is doing it wrong anyways.

Thanks for that wording. I did not get that relationship from the wording
in the standard documentation that talks about --disable-bootstrap . It
might be good if that documentation did also have such wording.

I'll note that the FreeBSD lang/gcc* ports do not normally use
--disable-bootstrap .

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug jit/114105] --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
  2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
                   ` (4 preceding siblings ...)
  2024-02-26  1:01 ` markmigm at gmail dot com
@ 2024-02-26  1:08 ` pinskia at gcc dot gnu.org
  2024-02-26  1:19 ` markmigm at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-26  1:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Mark Millard from comment #5)
> (In reply to Andrew Pinski from comment #2)
> > . . .
> > >Part of the reason FreeBSD puts effort into making --disable-bootstrap work
> > This should not be done unless you are building with GCC itself. The reason
> > is only the C, C++ front-ends are supposed to be able to compile with a
> > (non-GCC) C++11 compiler. So FreeBSD is doing it wrong anyways.
> 
> Thanks for that wording. I did not get that relationship from the wording
> in the standard documentation that talks about --disable-bootstrap . It
> might be good if that documentation did also have such wording.

It is documented here:
https://gcc.gnu.org/install/prerequisites.html

"To build all languages in a cross-compiler or other configuration where
3-stage bootstrap is not performed, you need to start with an existing GCC
binary (version 4.8.3 or later) because source code for language frontends
other than C might use GCC extensions.
"

Though it should say other than `C and C++` but that is a minor thing.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug jit/114105] --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy
  2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
                   ` (5 preceding siblings ...)
  2024-02-26  1:08 ` pinskia at gcc dot gnu.org
@ 2024-02-26  1:19 ` markmigm at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: markmigm at gmail dot com @ 2024-02-26  1:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114105

--- Comment #7 from Mark Millard <markmigm at gmail dot com> ---
(In reply to Andrew Pinski from comment #6)
> . . .
> It is documented here:
> https://gcc.gnu.org/install/prerequisites.html
> 
> "To build all languages in a cross-compiler or other configuration where
> 3-stage bootstrap is not performed, you need to start with an existing GCC
> binary (version 4.8.3 or later) because source code for language frontends
> other than C might use GCC extensions.
> "
> 
> Though it should say other than `C and C++` but that is a minor thing.

Ahh, not text I can find by looking for "--disable-bootstrap" or
"disable-bootstrap" and not explicit in terms of any command line
options syntax in general for the overall issue. That probably
explains why I did not run into it.

Again: Thanks. (I do like the wording about the front-end vs. not
distinctions for --disable-bootstrap .)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-26  1:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-25 20:48 [Bug c++/114105] New: --disable-bootstrap based builds vs libcc1 and gcc/jit use of gcc/system.h poisoning policy markmigm at gmail dot com
2024-02-25 20:53 ` [Bug jit/114105] " pinskia at gcc dot gnu.org
2024-02-25 20:56 ` pinskia at gcc dot gnu.org
2024-02-25 21:01 ` sjames at gcc dot gnu.org
2024-02-25 21:02 ` sjames at gcc dot gnu.org
2024-02-26  1:01 ` markmigm at gmail dot com
2024-02-26  1:08 ` pinskia at gcc dot gnu.org
2024-02-26  1:19 ` markmigm at gmail dot com

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