Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#54949 closed defect (fixed)

gcc5 @5.4.0_2 fails to build on macOS 10.13

Reported by: matteopuel (Matteo Puel) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: highsierra Cc:
Port: gcc5

Description


Attachments (4)

main_gcc5_v5_4_0_2.log (64.2 KB) - added by matteopuel (Matteo Puel) 7 years ago.
I am sorry, I forgot my log file
Portfile (9.9 KB) - added by nortcele 7 years ago.
draft Portfile for gcc 5.5 release candidate
gcc5.5-java.diff (3.5 KB) - added by nortcele 7 years ago.
Diff for gcc-5.5 and java support
gcc5.5.diff (1.9 KB) - added by nortcele 7 years ago.
Diff for gcc-5.5 without java support

Download all attachments as: .zip

Change History (20)

comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Yeah, I noticed that too. Here's the log from the buildbot:

https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/1170

We've already marked gcc49 and earlier incompatible with High Sierra. Simplest would be to mark gcc5 incompatible too. gcc6 and later build fine on High Sierra.

comment:3 Changed 7 years ago by kencu (Ken)

Changed 7 years ago by matteopuel (Matteo Puel)

Attachment: main_gcc5_v5_4_0_2.log added

I am sorry, I forgot my log file

comment:4 in reply to:  3 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

Also this is relevant <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81037>

Ok, so from that bug report, this is what they committed to fix it:

https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=253181

comment:5 in reply to:  1 Changed 7 years ago by BYUMcKay

Replying to ryandesign:

Yeah, I noticed that too. Here's the log from the buildbot:

https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/1170

We've already marked gcc49 and earlier incompatible with High Sierra. Simplest would be to mark gcc5 incompatible too. gcc6 and later build fine on High Sierra.

Right now pdftk breaks because of gcc5. I did a (very simple) test and could not get pdftk to compile using gcc6 because gcj is no longer present. So, this is a request not to mark it as incompatible, but rather to apply the changes to fix gcc5 for now. I have reached out to the author of pdftk as to whether it is possible to compile using gcc6, but have not had a response yet.

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

The fix for this appears to be in the gcc5 trunk code already, and we are presumably awaiting a new gcc5 release that includes this.

I took a look to see if it was easy to add the patches right now to this port, but it did not seem to be - I couldn't locate one or two simple patches, at any rate - a bunch of different files were individually patched.

Last edited 7 years ago by kencu (Ken) (previous) (diff)

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

Having said all that, this seems to be homebrew's one and only patchhttps://github.com/Homebrew/homebrew-core/pull/17569/commits/2cff2c2c1f80c56b6eda1e5137a92a5a6493c565, which seems far less impressive that the one in gcc's bug report. Would you care to give this a try? Looks like it would take 10 seconds to do:

diff -pur a/gcc/system.h b/gcc/system.h
--- a/gcc/system.h	2015-01-05 13:33:28.000000000 +0100
+++ b/gcc/system.h	2017-09-03 18:28:15.000000000 +0200
@@ -216,6 +216,7 @@ extern int errno;
 
 #ifdef __cplusplus
 # include <algorithm>
+# include <map>
 # include <cstring>
 # include <utility>
 #endif

comment:8 Changed 7 years ago by nortcele

I compiled the gcc 5.5.0 release candidate on high sierra and that worked fine. I attach the Portfile I used (craft version).

Changed 7 years ago by nortcele

Attachment: Portfile added

draft Portfile for gcc 5.5 release candidate

comment:9 Changed 7 years ago by raimue (Rainer Müller)

Please attach a unified diff instead of full a Portfile. That makes it easier to see what you actually changed. Also, please do not leave commented lines without explanation in the Portfile and avoid to make unnecessary changes. Note you cannot remove epoch, it needs to stay forever.

comment:10 Changed 7 years ago by nortcele

Oops, sorry. It was just a working copy. I've made some housekeeping in my file and test it again.

Here is a first version of the diffs. This diff contains changes for gcc-5.5 and changes to make the java compiler working again.

After modification and test, I'll post a second version without java support.

Changed 7 years ago by nortcele

Attachment: gcc5.5-java.diff added

Diff for gcc-5.5 and java support

Changed 7 years ago by nortcele

Attachment: gcc5.5.diff added

Diff for gcc-5.5 without java support

comment:11 Changed 7 years ago by kencu (Ken)

This is to confirm that the patch in comment:7 allows gcc5 to build through to completion, and it appears to work as 5.4.0 did before, on highsierra.

That is a trivial patch to apparently get the same functionality we had before.

The update to 5.5.0 seems near; whether there is a need to install the RC version, or wait for the official 5.5.0 release I leave up to Ryan etc.

The additions to the Port to bring in the java stuff from gcc4.9 and other changes by nortcele are noted, and would need some further review.

Last edited 7 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:12 Changed 7 years ago by ken-cunningham-webuse

In 1e1ee55c3e8eebf2eb6756fae5c1872ba2481b2c/macports-ports:

gcc5: fix build with xcode 9+

see: #54949

comment:13 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Ken, is there a specific reason why this patch is not safe to apply for all versions of Xcode?

BYUMcKay, pdftk doesn't attempt to use gcc5; it attempt to use gcc47, and fails as described in #48528.

nortcele, please file a new ticket for the Java issues. If you've really found a way to make gcj work with gcc5, that would be great, since it might let me finally fix the pdftk port. To my knowledge, we only have working gcj in gcc45 and gcc47 now, and those don't work on the latest macOS versions.

comment:14 in reply to:  13 Changed 7 years ago by kencu (Ken)

Replying to ryandesign:

Ken, is there a specific reason why this patch is not safe to apply for all versions of Xcode?

I suspect it probably could apply to all versions, but it seemed like it might take a week to build them all to find out ;> I thought I'd fix the broken versions, leave the known working ones alone, and then we'd update gcc5 to 5.5.0 soonish and run the gauntlet with all mac versions then.

comment:15 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

comment:16 in reply to:  13 Changed 7 years ago by BYUMcKay

Replying to ryandesign:

BYUMcKay, pdftk doesn't attempt to use gcc5; it attempt to use gcc47, and fails as described in #48528.

Not that it matters, since it looks like it will get fixed, but when I try to install pdftk, it tells me it needs gcc5, not gcc47. I'm wondering why it says gcc5 if it's really looking for gcc47? I'm just looking for clarification so I don't get bitten the next time.

Note: See TracTickets for help on using tickets.