Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

unilock

macrumors member
Oct 21, 2019
41
19
I managed to get llvm-powerpc, ld64-97 +llvmppc, and cctools +llvmppc installed from your MacPorts repository. So there's that, at least.

Unfortunately, many ports (or their dependencies) still want gcc7, which appears to be impossible to get working... is there a way to force all ports to use gcc10-bootstrap as their compiler by default?
Is that even a good way to go about it...?
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,324
1,534
I managed to get llvm-powerpc, ld64-97 +llvmppc, and cctools +llvmppc installed from your MacPorts repository. So there's that, at least.

Unfortunately, many ports (or their dependencies) still want gcc7, which appears to be impossible to get working... is there a way to force all ports to use gcc10-bootstrap as their compiler by default?
Is that even a good way to go about it...?

I think gcc7 should be completely avoided, especially on ppc64, since it has unfixed bugs plus does not support some features which are needed too often now (say, filesystem, or C++20).

In principle, gcc10-bootstrap is simply the “normal” gcc, like it is built outside of MacPorts (without extracting libgcc into a standalone thing). So there is no reason why it should not work as the main compiler.
Now, MacPorts environment assumes a different setup, so here and there some changes will be needed.

To really force it MacPorts-wide, you probably need to insert related code into tlc files of the base itself. Less intrusive approach would be to make a portgroup and use that.
Take a look where MacPorts picks compilers according to C/C++ standards. We only need modern gcc with C/C++11 and higher. So there the choice should be tweaked to use gcc10-bootstrap.

However, at the moment at least I believe the correct thing is to fix building gcc14 for ppc64, and then let MacPorts pick compilers normally. (Well, 10.5 needs minimal changes to use gcc14 instead of gcc7, but those are trivial, just pick them from my repo branch.)
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,324
1,534
I managed to build gcc10-bootstrap for ppc64 overnight, but it doesn't look like I can use it to compile llvm-7.0 directly, since it (or one of its dependencies) depends on ld64-97, which in turn requires LLVM in the first place...

Would my best bet be trying to use your llvm-powerpc port at this point?

Alternatively, for going the "circular dependency" route, I would need to:
  1. Compile all of llvm-3.3 and ld64-97's dependencies as +universal
  2. Install those two packages for ppc
  3. Install gcc7 as +universal
  4. Install llvm-3.7 for ppc64
  5. Re-install ld64-97 for ppc64
Correct?

(as an aside, it's sudo port install <package> build_arch="ppc", not sudo port install <package> build.arch="ppc")

This is all very confusing 😅

Any success ever since, what is the current status?
 

unilock

macrumors member
Oct 21, 2019
41
19
Any success ever since, what is the current status?

Unfortunately, I haven't done much more with my PPC system since my last update. It's only a hobby for me, but it's quickly becoming rather overwhelming 😅

Maybe I could just symlink gcc10-bootstrap to wherever MacPorts expects gcc7 to be? Though I feel like that may have unexpected consequences...
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,324
1,534
Unfortunately, I haven't done much more with my PPC system since my last update. It's only a hobby for me, but it's quickly becoming rather overwhelming 😅

Maybe I could just symlink gcc10-bootstrap to wherever MacPorts expects gcc7 to be? Though I feel like that may have unexpected consequences...

I don’t think symlinking gonna work (and certainly will leave fortran broken, since gcc10-bootstrap does not build it at all), but you could clone the system and make an experiment :)
Keep in mind, MacPorts base expects libgcc port to provide the runtime for gcc compilers. gcc10-bootstrap is not built that way, it has everything inside it. So while compiler should work, you will probably need to replace libgcc with a stub port (to cheat MacPorts). Then just try and see what happens.

I think we should rather fix it properly. That worked, as a matter of fact, when gcc11 was the main compiler. Unfortunately, I nuked everything libgcc* I had, and apparently also cctools and ld64. I have a prebuilt llvm5 and gcc11, both as ppc+ppc64, but without libgcc it is unusable. I might have old portfiles somewhere, but I wouldn't really count on that.
From a quick look into gcc11 portfile which I used to build it for ppc+ppc64 it seems that the only two significant changes are a block to use gcc10-bootstrap and disabling jit (this may be important; for ppc it builds fine, perhaps not for ppc64 and therefore universal). Here is the portfile extracted from the tarball:
 

Attachments

  • gcc11.3.0_ppc_ppc64_PORTFILE.txt
    19.2 KB · Views: 8

pc297

macrumors 6502
Sep 26, 2015
337
207
Quick question, can ppc64 and ppc ports co-exist in a ppc-only macports installation (built with build_arch ppc) or would said installation would have to be started from scratch with build_arch ppc64 ? Is universal_archs ppc64 ppc then required to allow ppc ports?

And, finally, does anyone here have an unofficial repo for ppc64 ports :D?
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,324
1,534
Quick question, can ppc64 and ppc ports co-exist in a ppc-only macports installation (built with build_arch ppc) or would said installation would have to be started from scratch with build_arch ppc64 ? Is universal_archs ppc64 ppc then required to allow ppc ports?

And, finally, does anyone here have an unofficial repo for ppc64 ports :D?

1. Yes, in fact any combo of archs can co-exist, MacPorts do not confuse those. You can also switch the main build arch on the go (either on command line or in settings), turn +universal on/off etc. To use one arch port for a build for another arch use `depends_skip_archcheck` option (for example, it does not matter what arch xz or cmake are, as long as they are build dependencies and nothing links to them).

What cannot co-exist is C++ runtime: it should either be `libstdc++` or `libc++`, but not a mixture of the two.

2. You can start one :)
I could probably sort out the toolchain once my 10.6 ppc fork is finalized, but got no time to build 10k ports for ppc64 in addition to maintaining them on ppc.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.