public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
@ 2022-08-30 16:30 todd_richmond at hotmail dot com
  2022-08-30 16:33 ` [Bug bootstrap/106779] " todd_richmond at hotmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: todd_richmond at hotmail dot com @ 2022-08-30 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106779
           Summary: GCC 12.2 fails to compile in libiberty - uknown symbol
                    PTR - requires later patch
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: todd_richmond at hotmail dot com
  Target Milestone: ---

I have been able to build every gcc release from 8 to 12.2 on both CentOS6 and
CentOS 7 w/o problem including 12.1. However, 12.2 fails to compile
libiberty/objdump.c due to "PTR" not being defined. I tried compiling with
10.2, 11.3 and 12.1 w/o success

However, a big change was recently checked into libiberty that eliminates the
PTR macro, but 12.2 does not include it. I can confirm that this diff works
correctly

https://github.com/gcc-mirror/gcc/commit/50b009c5daef92bc60fc26fcc4c495e117667387.patch

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
@ 2022-08-30 16:33 ` todd_richmond at hotmail dot com
  2022-08-30 17:12 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: todd_richmond at hotmail dot com @ 2022-08-30 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Todd Richmond <todd_richmond at hotmail dot com> ---
filename is likely wrong - I did this 2 days ago and lost the log output. 100%
consistent on 2 different build systems/OS though

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
  2022-08-30 16:33 ` [Bug bootstrap/106779] " todd_richmond at hotmail dot com
@ 2022-08-30 17:12 ` jakub at gcc dot gnu.org
  2022-08-30 17:59 ` todd_richmond at hotmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-08-30 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Without seeing a build log on what exactly fails there is nothing we can do
about it, applying the [PATCH] libiberty: stop using PTR macro change is not
the right fix if anything needs to be fixed at all.
Note, there were no changes whatsoever in include/ or libiberty/ directories
except for a 12.2.0 release added ChangeLog entry, so I somehow can't believe
12.1 worked fine and 12.2 doesn't if nothing else changed.

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
  2022-08-30 16:33 ` [Bug bootstrap/106779] " todd_richmond at hotmail dot com
  2022-08-30 17:12 ` jakub at gcc dot gnu.org
@ 2022-08-30 17:59 ` todd_richmond at hotmail dot com
  2022-08-30 18:00 ` todd_richmond at hotmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: todd_richmond at hotmail dot com @ 2022-08-30 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Todd Richmond <todd_richmond at hotmail dot com> ---
We have been using the same build setup for the last 20 years and this is the
1st gcc failure :) We build EVERYTHING in a self contained fashion and don't
rely on any OS libraries except libc.so.
I don't know what file normally defines PTR, but someone else must have run
into this for the patch to have been checked in
Below log is from a CentOS 7 compile using gcc 12.1

/tools/arch/Linux_3.10.0-x86_64/gcc-12.1.0-bootstrap/bin/gcc -c -DHAVE_CONFIG_H
-fPIC -pipe -DNDEBUG -Wno-error=unused-value -Wno-unused-variable 
-I/tools/arch/Linux_3.10.0-x86_64/gcc-12.1.0-bootstrap//include    -I.
-I/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/../include  -W -Wall
-Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic 
-D_GNU_SOURCE -fcf-protection
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c -o objalloc.o

/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c: In function
‘objalloc_create’:
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c:95:18: error:
‘PT’ undeclared (first use in this function)
   95 |   ret->chunks = (PTR) malloc (CHUNK_SIZE);
      |                  ^~~
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c:95:18: note: each
undeclared identifier is reported only once for each function it appears in
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c:95:22: error:
expected ‘;’ before ‘malloc’
   95 |   ret->chunks = (PTR) malloc (CHUNK_SIZE);
      |                      ^~~~~~~
      |                      ;
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c: At top level:
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c:114:1: error:
unknown type name ‘PTR’
  114 | PTR
      | ^~~
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c:115:1: error:
conflicting types for ‘_objalloc_alloc’; have ‘int(struct objalloc *, long
unsigned int)’
  115 | _objalloc_alloc (struct objalloc *o, unsigned long original_len)
      | ^~~~~~~~~~~~~~~

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
                   ` (2 preceding siblings ...)
  2022-08-30 17:59 ` todd_richmond at hotmail dot com
@ 2022-08-30 18:00 ` todd_richmond at hotmail dot com
  2022-08-30 18:04 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: todd_richmond at hotmail dot com @ 2022-08-30 18:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Todd Richmond <todd_richmond at hotmail dot com> ---
one other comment. all the gcc prereqs are the latest available releases -
every 3rd party package is built by us from the most up-to-date versions

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
                   ` (3 preceding siblings ...)
  2022-08-30 18:00 ` todd_richmond at hotmail dot com
@ 2022-08-30 18:04 ` jakub at gcc dot gnu.org
  2022-08-30 18:10 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-08-30 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
include/ansidecl.h has:
#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined
(__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
...
#define PTR             void *
...
#else   /* Not ANSI C.  */
#define PTR             char *
...
#endif
So, can you rerun the above command line with -E -dD instead of -c and
-o objalloc.i instead of -o objalloc.o ?

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
                   ` (4 preceding siblings ...)
  2022-08-30 18:04 ` jakub at gcc dot gnu.org
@ 2022-08-30 18:10 ` jakub at gcc dot gnu.org
  2022-08-30 19:07 ` todd_richmond at hotmail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-08-30 18:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Where does the:
-I/tools/arch/Linux_3.10.0-x86_64/gcc-12.1.0-bootstrap//include
come there?  If it e.g. contains glibc fixincluded ansidecl.h, then that could
explain why it breaks.
But you don't want to use your build compiler's include directories in
preference over the build tree ones.

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
                   ` (5 preceding siblings ...)
  2022-08-30 18:10 ` jakub at gcc dot gnu.org
@ 2022-08-30 19:07 ` todd_richmond at hotmail dot com
  2022-08-30 23:42 ` egallager at gcc dot gnu.org
  2022-08-31  7:48 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: todd_richmond at hotmail dot com @ 2022-08-30 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Todd Richmond <todd_richmond at hotmail dot com> ---
i was playing w/ cmdline and had deleted an extra arg. the 12.2 path is before
the 12.1 path.  However, our build scripts include the correct gcc header dir
to all configure lines to ensure we don't pull in the system gcc headers. This
causes 12.2 to include the source include dir (var/tmp...) last instead of
first

It is strange that this only fails for 12.2. I rebuilt 12.1 yesterday w/o issue
so did something change in Makefile.in or a configure script that changed the
include order?

I can confirm that removing the original gcc include paths from the compile
works correctly

fail:

/tools/arch/Linux_3.10.0-x86_64/gcc-12.1.0-bootstrap/bin/gcc -c -DHAVE_CONFIG_H
-fPIC -O3 -pipe -DNDEBUG -Wno-error=unused-value -Wno-unused-variable 
-I/tools/arch/Linux_3.10.0-x86_64/gcc-12.2.0-bootstrap/include
-I/tools/arch/Linux_3.10.0-x86_64/gcc-12.1.0-bootstrap//include    -I.
-I/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/../include  -W -Wall
-Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic 
-D_GNU_SOURCE -fcf-protection
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c -o objalloc.o

succeed:
/tools/arch/Linux_3.10.0-x86_64/gcc-12.1.0-bootstrap/bin/gcc -c -DHAVE_CONFIG_H
-fPIC -O3 -pipe -ffunction-sections -fdata-sections -march=nehalem
-mtune=broadwell -DNDEBUG -Wno-error=unused-value -Wno-unused-variable   -I.
-I/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/../include  -W -Wall
-Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic 
-D_GNU_SOURCE -fcf-protection
/var/tmp/gcc-12.2.0-bootstrap/gcc-12.2.0/libiberty/objalloc.c -o objalloc.o

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
                   ` (6 preceding siblings ...)
  2022-08-30 19:07 ` todd_richmond at hotmail dot com
@ 2022-08-30 23:42 ` egallager at gcc dot gnu.org
  2022-08-31  7:48 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-08-30 23:42 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
           Keywords|                            |build

--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Todd Richmond from comment #0)
> I have been able to build every gcc release from 8 to 12.2 on both CentOS6
> and CentOS 7 w/o problem including 12.1. However, 12.2 fails to compile
> libiberty/objdump.c due to "PTR" not being defined. I tried compiling with
> 10.2, 11.3 and 12.1 w/o success
> 
> However, a big change was recently checked into libiberty that eliminates
> the PTR macro, but 12.2 does not include it. I can confirm that this diff
> works correctly
> 
> https://github.com/gcc-mirror/gcc/commit/
> 50b009c5daef92bc60fc26fcc4c495e117667387.patch

cc-ing author of this patch

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

* [Bug bootstrap/106779] GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch
  2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
                   ` (7 preceding siblings ...)
  2022-08-30 23:42 ` egallager at gcc dot gnu.org
@ 2022-08-31  7:48 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-08-31  7:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So this is a clear bug in your build scripts then.
You just can't add -I options that to configure/make variables where it will
override -I paths added during the build, the build compilers paths need to
always come after the other paths (and that is what happens by default,
compiler always searches its own paths unless -nostdinc or -nostdinc++).
Don't do it and it will build fine.

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

end of thread, other threads:[~2022-08-31  7:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 16:30 [Bug bootstrap/106779] New: GCC 12.2 fails to compile in libiberty - uknown symbol PTR - requires later patch todd_richmond at hotmail dot com
2022-08-30 16:33 ` [Bug bootstrap/106779] " todd_richmond at hotmail dot com
2022-08-30 17:12 ` jakub at gcc dot gnu.org
2022-08-30 17:59 ` todd_richmond at hotmail dot com
2022-08-30 18:00 ` todd_richmond at hotmail dot com
2022-08-30 18:04 ` jakub at gcc dot gnu.org
2022-08-30 18:10 ` jakub at gcc dot gnu.org
2022-08-30 19:07 ` todd_richmond at hotmail dot com
2022-08-30 23:42 ` egallager at gcc dot gnu.org
2022-08-31  7:48 ` jakub 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).