#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)
Change History (20)
comment:1 follow-up: 5 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
comment:2 Changed 7 years ago by kencu (Ken)
There are some patches out there if someone is interested to fix this, it appears:
See this for gcc49:
<https://lists.freebsd.org/pipermail/freebsd-ports-bugs/2016-September/346453.html> and <https://bugs.freebsd.org/bugzilla/attachment.cgi?id=174492&action=edit>
and for gcc5:
comment:3 follow-up: 4 Changed 7 years ago by kencu (Ken)
Also this is relevant <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81037>
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 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 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.
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
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.
comment:12 Changed 7 years ago by ken-cunningham-webuse
comment:13 follow-ups: 14 16 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 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: | new → closed |
comment:16 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.
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.