Opened 4 years ago
Last modified 4 years ago
#62332 new defect
Cannot build gcc7 with +universal on Intel Tiger
Reported by: | Wowfunhappy (Jonathan) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | gcc7 |
Description (last modified by Wowfunhappy (Jonathan))
On a fresh install of MacPorts on Intel Tiger, with no changes made to any configuration files, when I run:
sudo port install gcc7 +universal
I am told:
Error: Cannot install gcc7 for the archs 'i386 x86_64' because Error: its dependency gmp does not build for the required archs by default Error: and the configured universal_archs 'i386 ppc' are not sufficient.
This is weird. From what I understand, on Tiger, +universal should cause ports to build as ppc and i386. So why is it trying to install gcc7 for x86_64, and not for ppc? Can I tell it to not do that?
Please feel free to tell me if I'm doing something wrong, but this feels like a bug.
Change History (9)
comment:1 Changed 4 years ago by Wowfunhappy (Jonathan)
Description: | modified (diff) |
---|
comment:2 follow-up: 6 Changed 4 years ago by kencu (Ken)
comment:3 Changed 4 years ago by kencu (Ken)
The specific reason you are seeing the universal_archs being changed on you (which was done due to the above) is this block in the Portfile:
platform powerpc { configure.universal_archs ppc ppc64 } platform i386 { configure.universal_archs i386 x86_64 }
comment:4 Changed 4 years ago by Wowfunhappy (Jonathan)
Understandable enough! I might suggest adding a less confusing message to the port file, if possible!
(I'm ultimately just trying to build one piece of software, so trying to build the whole toolchain might be overkill anyway... but I'll move this to the mailing list, because this seems like the wrong place!)
comment:5 Changed 4 years ago by kencu (Ken)
There was an attempt to revitalize cross-arch universal gcc building here <https://github.com/kencu/macportsGCCfixup> ... that's my fork of a fork of the original project :>
comment:6 follow-ups: 7 9 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to kencu:
For happiness on older systems, I suggest you set your universal_archs in macports.conf to ppc/ppc64 on a PowerPC machine, or i386/x86_64 on an Intel machine.
Depends on the reason why the user is building universal. If the purpose is to create ppc/i386 universal software, then doing what you suggest will not lead to happiness. If the purpose is just to install a port at all, then not using the universal variant would be the quickest path to happiness.
Replying to Wowfunhappy:
Understandable enough! I might suggest adding a less confusing message to the port file, if possible!
The error message comes from MacPorts base, not the portfile. What wording would you find clearer?
comment:7 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to ryandesign:
The error message comes from MacPorts base
Specifically https://github.com/macports/macports-base/blob/master/src/macports1.0/macports.tcl#L2428-L2431
comment:8 Changed 4 years ago by Wowfunhappy (Jonathan)
The error message comes from MacPorts base, not the portfile. What wording would you find clearer?
Something like "gcc7 cannot be built universal for ppc and i386." :)
The current error message led me to try installing gmp as +universal. When that worked, I got very confused.
comment:9 Changed 4 years ago by kencu (Ken)
Replying to ryandesign:
Replying to kencu:
For happiness on older systems, I suggest you set your universal_archs in macports.conf to ppc/ppc64 on a PowerPC machine, or i386/x86_64 on an Intel machine.
Depends on the reason why the user is building universal. If the purpose is to create ppc/i386 universal software, then doing what you suggest will not lead to happiness. If the purpose is just to install a port at all, then not using the universal variant would be the quickest path to happiness.
You will find many other ports that also force the universal archs in the same way as gcc7 does, for the same reason. You can fight them all if you want. Or change your universal archs as I said and you won't have to.
Of course, if what you want to do is build universal i386/ppc ports on MacPorts you are very limited in that project, as if you are trying to build any software that requires a compiler newer that apple-gcc42, you are going to be disappointed at present.
Do you want the short version of the story, or the long version :>
Short version of the story: cross-arch universal building of all gcc versions stopped working on MacPorts as of apple-gcc42, and has not worked on any newer gcc version since about 2009.
The only thing that works is same-processor-family universal building (eg ppc/ppc64 or i386/x86_64). This is because when we build gcc +universal on MacPorts, we don't actually build it +universal, we only build libgcc as having both i386 and x86_64 (or ppc/ppc64) archs in it ("multilib").
To build a fully-functional cross-arch universal gcc is a project that people lost interest in once PowerPC systems were less common (but has new enthusiasm now that arm64/x86_64 is out there). I have built one manually myself, but there is a missing component (driverdriver.c updated for newer gcc versions).
For happiness on older systems, I suggest you set your universal_archs in macports.conf to ppc/ppc64 on a PowerPC machine, or i386/x86_64 on an Intel machine. That works really quite well on Leopard systems. For Tiger systems, to be honest there were so many issues that I reduced my attempts to build +universal in Tiger and I'm happy to have non-universal builds going as well as they do.
I have Octave for Tiger PPC, clang-7.0 for Tiger Intel, gcc7 for Tiger (both PPC, Intel) and thousands more.