Opened 17 months ago

Closed 12 months ago

Last modified 12 months ago

#67412 closed defect (fixed)

gcc12 @12.3.0_0+stdlib_flag on MacOS Catalina: libiberty/objalloc.c:198:42: error: unknown type name 'PTR'

Reported by: dbl001 (dbl) Owned by: Chris Jones <jonesc@…>
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: gcc12

Description

gcc12 builds on MacOS Ventura, but fails on Catalina.

Attachments (2)

main.log (347.2 KB) - added by dbl001 (dbl) 17 months ago.
gcc12_install_build_from_source_fails.log.bz2 (20.3 KB) - added by kwolcott 17 months ago.

Download all attachments as: .zip

Change History (20)

Changed 17 months ago by dbl001 (dbl)

Attachment: main.log added

comment:1 Changed 17 months ago by kencu (Ken)

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc12/gcc12/work/gcc-12.3.0/libiberty/objalloc.c:198:42: error: unknown type name 'PTR'
:info:build objalloc_free_block (struct objalloc *o, PTR block)
:info:build                                          ^

comment:2 Changed 17 months ago by kencu (Ken)

Summary: Error building gcc12 on MacOS Catalinagcc12 @12.3.0_0+stdlib_flag on MacOS Catalina: libiberty/objalloc.c:198:42: error: unknown type name 'PTR'

Changed 17 months ago by kwolcott

comment:3 Changed 17 months ago by kwolcott

gcc12 build from source fails for me on Ventura 13.3.1(a); looks like the same PTR issue. I have a compressed log file.

comment:4 Changed 16 months ago by jmroot (Joshua Root)

Do you have binutils installed?

comment:5 Changed 16 months ago by dbl001 (dbl)

 % port list binutils
binutils                       @2.39           devel/binutils

comment:6 Changed 16 months ago by jmroot (Joshua Root)

That doesn't answer the question; try port installed binutils.

comment:7 Changed 16 months ago by dbl001 (dbl)

% port installed binutils
None of the specified ports are installed.

comment:8 in reply to:  4 Changed 16 months ago by Gandoon (Erik Hedlund)

Replying to jmroot:

Do you have binutils installed?

As far as I know it is not possible to install lib/gcc12 with binutils active. The build system will complain and die with an error.

Nevertheless, neither libgcc12 nor gcc12 @12.3.0_0 builds on 10.15 and it has been that way for weeks now. The most irritating bit is that around the same time an upgrade somewhere broke also opencv4 and it also fails to build cleanly past around 78% according to the build progress meter. Opencv4 seems to depend on this port for the build, but the old libgcc12/gcc12 @12.2.0_2 does not seem to do the trick. If these two issues are even related is to me still a mystery.

comment:9 Changed 16 months ago by kencu (Ken)

It is apparently not a general issue, because it appears that gcc12/libgcc12 builds on every supported OS system and version when built by the buildbot <http://packages.macports.com/gcc12/>

Presumably some port you have installed is killing the build.

comment:10 Changed 16 months ago by dbl001 (dbl)

It's installed now ... did something change?

(ai) davidlaxer@macbook-pro ~ % port installed gcc12
The following ports are currently installed:
  gcc12 @12.3.0_0+stdlib_flag (active)
(ai) davidlaxer@macbook-pro ~ % port installed libgcc12
The following ports are currently installed:
  libgcc12 @12.1.0_0+enable_stdlib_flag
  libgcc12 @12.1.0_1+enable_stdlib_flag
  libgcc12 @12.1.0_2+enable_stdlib_flag
  libgcc12 @12.1.0_3+stdlib_flag
  libgcc12 @12.1.0_4+stdlib_flag
  libgcc12 @12.1.0_6+stdlib_flag
  libgcc12 @12.2.0_0+stdlib_flag
  libgcc12 @12.2.0_1+stdlib_flag
  libgcc12 @12.2.0_2+stdlib_flag
  libgcc12 @12.3.0_0+stdlib_flag (active)           

comment:11 in reply to:  9 ; Changed 16 months ago by Gandoon (Erik Hedlund)

Replying to kencu:

It is apparently not a general issue, because it appears that gcc12/libgcc12 builds on every supported OS system and version when built by the buildbot <http://packages.macports.com/gcc12/>

Presumably some port you have installed is killing the build.

Not to be rude, but that is exactly why the ticket exists. We are several people here who have issues on several OS versions. The previous version built just fine, so something has changed somewhere. We are hoping for a solution, e.g. a port to disable to make the build work.

I just now tried to disable gdb and the build worked… There, that's a potential solution.

comment:12 in reply to:  11 Changed 16 months ago by kencu (Ken)

Replying to kencu:

Presumably some port you have installed is killing the build.

gdb would be the sort of port that might trip up the gcc build.

If that turns out to be a consistent finding, perhaps someone might sort out exactly why and upstream the issue.

Last edited 16 months ago by kencu (Ken) (previous) (diff)

comment:13 Changed 16 months ago by jmroot (Joshua Root)

This is ultimately an include ordering issue, as -I/opt/local/include comes before -I. in the compile commands.

comment:14 Changed 13 months ago by dbl001 (dbl)

I am trying to migrate from MacOS 13 to MacOS 14. gcc12 does not build. Many of my ports depend upon gcc12 (R, Octave, fftw, hdf5, etc.). This was working on MacOS 13. Suggestions?

Last edited 13 months ago by dbl001 (dbl) (previous) (diff)

comment:15 in reply to:  14 Changed 12 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to dbl001:

I am trying to migrate from MacOS 13 to MacOS 14. gcc12 does not build. Many of my ports depend upon gcc12 (R, Octave, fftw, hdf5, etc.). This was working on MacOS 13. Suggestions?

Well, this ticket is about a build failure of gcc12 caused by having binutils or gdb installed. If that is what you are experiencing now, deactivate binutils or gdb, clean gcc12 and try again. If that is not what you are experiencing now, file a new ticket.

comment:16 Changed 12 months ago by dbl001 (dbl)

On Catalina, deactivating port 'gdb' solved the problem.

Last edited 12 months ago by dbl001 (dbl) (previous) (diff)

comment:17 Changed 12 months ago by Chris Jones <jonesc@…>

Owner: set to Chris Jones <jonesc@…>
Resolution: fixed
Status: newclosed

In 3e0462586a8b994abea328119be2d93f9690020c/macports-ports (master):

gcc12: add gdb to build conflicts

closes: #67412

comment:18 Changed 12 months ago by jmroot (Joshua Root)

That's a workaround not a fix, as explained in comment:13.

Note: See TracTickets for help on using tickets.