public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers
@ 2023-04-21 15:56 seurer at gcc dot gnu.org
  2023-04-21 17:48 ` [Bug other/109589] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-04-21 15:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109589
           Summary: [14 regression] r14-35-g278f8f567b5470 breaks build
                    with older gcc build compilers
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:278f8f567b5470e87e2e6482ee385d61c7f45a5d, r14-35-g278f8f567b5470

This update is causing build failures on a couple of our old RHEL 7.9 systems
if I use the system compiler.  If I use a newer build compiler it works fine.

gcc -v
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 


Is gcc 4.8.5 no longer suitable for builds?


make[2]: Entering directory '/home/seurer/gcc/git/build/gcc-test/gcc'
g++ -std=gnu++11 -c   -g -O2     -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H  -DGENERATOR_FILE -I. -Ibuild
-I/home/seurer/gcc/git/gcc-test/gcc -I/home/seurer/gcc/git/gcc-test/gcc/build
-I/home/seurer/gcc/git/gcc-test/gcc/../include 
-I/home/seurer/gcc/git/gcc-test/gcc/../libcpp/include  \
        -o build/genmodes.o /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc
In file included from ./bconfig.h:3:0,
                 from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:20:
./auto-host.h:2637:16: error: declaration does not declare anything
[-fpermissive]
 #define rlim_t long
                ^
In file included from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:21:0:
/home/seurer/gcc/git/gcc-test/gcc/system.h:500:23: error: declaration of C
function 'void* sbrk(int)' conflicts with
 extern void *sbrk (int);
                       ^
In file included from /home/seurer/gcc/git/gcc-test/gcc/system.h:302:0,
                 from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:21:
/usr/include/unistd.h:1065:14: error: previous declaration 'void*
sbrk(intptr_t)' here
 extern void *sbrk (intptr_t __delta) __THROW;
              ^
In file included from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:21:0:
/home/seurer/gcc/git/gcc-test/gcc/system.h:508:48: error: new declaration
'char* strstr(const char*, const char*)'
 extern char *strstr (const char *, const char *);
                                                ^
In file included from /usr/include/c++/4.8.2/cstring:42:0,
                 from /home/seurer/gcc/git/gcc-test/gcc/system.h:241,
                 from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:21:
/usr/include/string.h:331:1: error: ambiguates old declaration 'const char*
strstr(const char*, const char*)'
 strstr (const char *__haystack, const char *__needle) __THROW
 ^
In file included from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:21:0:
/home/seurer/gcc/git/gcc-test/gcc/system.h:556:34: error: declaration of C
function 'const char* strsignal(int)' conflicts with
 extern const char *strsignal (int);
                                  ^
In file included from /usr/include/c++/4.8.2/cstring:42:0,
                 from /home/seurer/gcc/git/gcc-test/gcc/system.h:241,
                 from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:21:
/usr/include/string.h:562:14: error: previous declaration 'char*
strsignal(int)' here
 extern char *strsignal (int __sig) __THROW;
              ^
In file included from ./bconfig.h:5:0,
                 from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:20:
/home/seurer/gcc/git/gcc-test/gcc/../include/ansidecl.h:128:64: error: new
declaration 'char* basename(const char*)'
 #  define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
                                                                ^
/home/seurer/gcc/git/gcc-test/gcc/../include/libiberty.h:112:64: note: in
expansion of macro 'ATTRIBUTE_NONNULL'
 extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL
ATTRIBUTE_NONNULL(1);
                                                                ^
In file included from /usr/include/c++/4.8.2/cstring:42:0,
                 from /home/seurer/gcc/git/gcc-test/gcc/system.h:241,
                 from /home/seurer/gcc/git/gcc-test/gcc/genmodes.cc:21:
/usr/include/string.h:599:26: error: ambiguates old declaration 'const char*
basename(const char*)'
 extern "C++" const char *basename (const char *__filename)
                          ^
make[2]: *** [Makefile:2860: build/genmodes.o] Error 1



commit 278f8f567b5470e87e2e6482ee385d61c7f45a5d
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Mar 6 11:06:38 2023 +0100

    RAII auto_mpfr and autp_mpz

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

* [Bug other/109589] [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers
  2023-04-21 15:56 [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers seurer at gcc dot gnu.org
@ 2023-04-21 17:48 ` pinskia at gcc dot gnu.org
  2023-04-21 18:10 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-21 17:48 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
           Keywords|                            |build

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

* [Bug other/109589] [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers
  2023-04-21 15:56 [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers seurer at gcc dot gnu.org
  2023-04-21 17:48 ` [Bug other/109589] " pinskia at gcc dot gnu.org
@ 2023-04-21 18:10 ` jakub at gcc dot gnu.org
  2023-04-21 18:16 ` [Bug bootstrap/109589] " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-04-21 18:10 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2023-04-21
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I believe the problem is that only since r5-2699-g5d9607f0ee036a aka PR62101
fix
we accept those
   friend void mpz_clear (auto_mpz&) = delete;
   friend void mpz_init (auto_mpz&) = delete;
lines in system.h and realmpfr.h, errors on this break various configure tests
and so
we end up with e.g. typedef __rlim_t long; because #define rlim_t long.
So, either we need to say 4.8.5 and 4.9.x are unsupported, or perhaps could
these
friend deletions be not done for (GCC_VERSION >= 4008 && GCC_VERSION < 5000)?

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

* [Bug bootstrap/109589] [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers
  2023-04-21 15:56 [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers seurer at gcc dot gnu.org
  2023-04-21 17:48 ` [Bug other/109589] " pinskia at gcc dot gnu.org
  2023-04-21 18:10 ` jakub at gcc dot gnu.org
@ 2023-04-21 18:16 ` jakub at gcc dot gnu.org
  2023-04-22 18:14 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-04-21 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Untested workaround, going to test it momentarily:

2023-04-21  Jakub Jelinek  <jakub@redhat.com>

        PR bootstrap/109589
        * system.h (class auto_mpz): Workaround PR62101 bug in GCC 4.8 and 4.9.
        * realmpfr.h (class auto_mpfr): Likewise.

--- gcc/system.h.jj     2023-04-20 09:36:09.097375720 +0200
+++ gcc/system.h        2023-04-21 20:13:09.212049563 +0200
@@ -714,8 +714,11 @@ public:
   auto_mpz (const auto_mpz &) = delete;
   auto_mpz &operator= (const auto_mpz &) = delete;

+#if GCC_VERSION < 4008 || GCC_VERSION >= 5000
+  /* GCC 4.8 and 4.9 don't support this, only fixed in PR62101 for 5.0.  */
   friend void mpz_clear (auto_mpz&) = delete;
   friend void mpz_init (auto_mpz&) = delete;
+#endif

 private:
   mpz_t m_mpz;
--- gcc/realmpfr.h.jj   2023-04-20 09:36:09.066376175 +0200
+++ gcc/realmpfr.h      2023-04-21 20:13:36.191663089 +0200
@@ -37,9 +37,12 @@ public:
   auto_mpfr (const auto_mpfr &) = delete;
   auto_mpfr &operator= (const auto_mpfr &) = delete;

+#if GCC_VERSION < 4008 || GCC_VERSION >= 5000
+  /* GCC 4.8 and 4.9 don't support this, only fixed in PR62101 for 5.0.  */
   friend void mpfr_clear (auto_mpfr&) = delete;
   friend void mpfr_init (auto_mpfr&) = delete;
   friend void mpfr_init2 (auto_mpfr&, mpfr_prec_t) = delete;
+#endif

 private:
   mpfr_t m_mpfr;

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

* [Bug bootstrap/109589] [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers
  2023-04-21 15:56 [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-04-21 18:16 ` [Bug bootstrap/109589] " jakub at gcc dot gnu.org
@ 2023-04-22 18:14 ` cvs-commit at gcc dot gnu.org
  2023-04-22 18:17 ` jakub at gcc dot gnu.org
  2023-04-24 14:01 ` seurer at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-22 18:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:195270d28a534cc1f08478c6e0136f4fc13d247a

commit r14-165-g195270d28a534cc1f08478c6e0136f4fc13d247a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Apr 22 20:14:06 2023 +0200

    Fix up bootstrap with GCC 4.[89] after RAII auto_mpfr and autp_mpz
[PR109589]

    On Tue, Apr 18, 2023 at 03:39:41PM +0200, Richard Biener via Gcc-patches
wrote:
    > The following adds two RAII classes, one for mpz_t and one for mpfr_t
    > making object lifetime management easier.  Both formerly require
    > explicit initialization with {mpz,mpfr}_init and release with
    > {mpz,mpfr}_clear.

    This unfortunately broke bootstrap when using GCC 4.8.x or 4.9.x as
    it uses deleted friends which weren't supported until PR62101 fixed
    them in 2014 for GCC 5.

    The following patch adds an workaround, not deleting those friends
    for those old versions.
    While it means if people add those mp*_{init{,2},clear} calls on auto_mp*
    objects they won't notice when doing non-bootstrap builds using
    very old system compilers, people should be bootstrapping their changes
    and it will be caught during bootstraps even when starting with those
    old compilers, plus most people actually use much newer compilers
    when developing.

    2023-04-22  Jakub Jelinek  <jakub@redhat.com>

            PR bootstrap/109589
            * system.h (class auto_mpz): Workaround PR62101 bug in GCC 4.8 and
4.9.
            * realmpfr.h (class auto_mpfr): Likewise.

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

* [Bug bootstrap/109589] [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers
  2023-04-21 15:56 [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-04-22 18:14 ` cvs-commit at gcc dot gnu.org
@ 2023-04-22 18:17 ` jakub at gcc dot gnu.org
  2023-04-24 14:01 ` seurer at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-04-22 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be worked around now.

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

* [Bug bootstrap/109589] [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers
  2023-04-21 15:56 [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-04-22 18:17 ` jakub at gcc dot gnu.org
@ 2023-04-24 14:01 ` seurer at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-04-24 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from seurer at gcc dot gnu.org ---
I've seen some successful builds go by on the old systems.  Thanks!

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

end of thread, other threads:[~2023-04-24 14:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21 15:56 [Bug other/109589] New: [14 regression] r14-35-g278f8f567b5470 breaks build with older gcc build compilers seurer at gcc dot gnu.org
2023-04-21 17:48 ` [Bug other/109589] " pinskia at gcc dot gnu.org
2023-04-21 18:10 ` jakub at gcc dot gnu.org
2023-04-21 18:16 ` [Bug bootstrap/109589] " jakub at gcc dot gnu.org
2023-04-22 18:14 ` cvs-commit at gcc dot gnu.org
2023-04-22 18:17 ` jakub at gcc dot gnu.org
2023-04-24 14:01 ` seurer at gcc dot gnu.org

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