Opened 4 years ago

Closed 4 years ago

#59224 closed defect (fixed)

gcc8 @8.3.0_4: build broken on Catalina or Mojave against 10.15 SDK due to unrecognized header macro __OSX_AVAILABLE_STARTING

Reported by: MaddTheSane (C.W. Betts) Owned by: Chris Jones <jonesc@…>
Priority: Normal Milestone:
Component: ports Version: 2.6.1
Keywords: catalina Cc:
Port: gcc8

Description

It looks like gcc8 gets confused by a few macros, such as __OSX_AVAILABLE_STARTING. Attaching a log file.

Attachments (1)

main.log.zip (1.7 MB) - added by MaddTheSane (C.W. Betts) 4 years ago.
Build failure log, compressed

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by MaddTheSane (C.W. Betts)

Attachment: main.log.zip added

Build failure log, compressed

comment:1 Changed 4 years ago by MaddTheSane (C.W. Betts)

I should have mentioned this is on Catalina and Xcode 11.1.

comment:2 Changed 4 years ago by kencu (Ken)

see the comments on <https://github.com/macports/macports-ports/commit/368383b4263282656853b68965c3db455333c5bd>

somebody will need to backport that fix into gcc8 -- feeling energetic?

comment:3 Changed 4 years ago by sjc999

I've a bit of a hack to fix it. The issue is that some macros are undefined - they are in /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/Availability.h

I'm not sure if this is a gcc or Xcode bug (the latter, I think). The #if's in Availability.h I think are wrong (not had time to really check - they are a little over the top with their nesting) but it can leave the macros undefined. In that file, near the top just after #include <AvailabilityInternal.h> add the three lines:

#define OSX_AVAILABLE_STARTING(_osx, _ios)

#define OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)

#define OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)

which will at least give the macros default (null) behaviour and allows gcc8 to install.

Last edited 4 years ago by sjc999 (previous) (diff)

comment:4 Changed 4 years ago by kencu (Ken)

the exact patch I referenced has it all sorted out. It just needs someone to backport it.

It's nobody's bug really. The Apple headers changed, and so gcc will change to support Apple's new reality.

But just use gcc9 on Catalina and you should be fine.

If nobody gets around to fixing gcc<9 on Catalina, we'll just disable them in a pre-fetch block. Probably should do that now, actually.

comment:5 Changed 4 years ago by kencu (Ken)

Summary: gcc8 @8.3.0_4: confused by __OSX_AVAILABLE_STARTINGgcc8 @8.3.0_4: build broken on Catalina due to unrecognized header macro __OSX_AVAILABLE_STARTING

comment:6 Changed 4 years ago by kencu (Ken)

Summary: gcc8 @8.3.0_4: build broken on Catalina due to unrecognized header macro __OSX_AVAILABLE_STARTINGgcc8 @8.3.0_4: build broken on Catalina or Mojave against 10.15 SDK due to unrecognized header macro __OSX_AVAILABLE_STARTING

comment:7 Changed 4 years ago by cjones051073 (Chris Jones)

Note the latest comments fro Jeremy in

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

Reads to me that this bug fell between the cracks somehow, but is being looked into now. So I would hope an Xcode update at some point might address it.

Until then, yes, it might be worth adding a pre fetch check and a useful message, if only to prevent more tickets in the meantime...

comment:8 Changed 4 years ago by Chris Jones <jonesc@…>

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

In 481909f1dfa28ec7cad2510d3f9827bd65132d9d/macports-ports (master):

gcc{5,6,7,8}: Add pre-fetch check for Darwin19+
Closes: #59351
Closes: #59224

Note: See TracTickets for help on using tickets.