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

barracuda156

macrumors 68000
Original poster
Sep 3, 2021
1,782
1,299
I dunno if this info is gonna be of value for anyone, but just in case: if you want to build software on Leopard for ppc64 with Macports or otherwise, you will likely bump into a problem with llvm, which is required for ld64 (native Xcode one won't work for new stuff) and has to be of the same architecture (so you can't just skip arch-check).

llvm-3.3 and llvm-3.4 fail to build for ppc+ppc64 and even just ppc64. Anyone interested, see: https://trac.macports.org/ticket/64760
I spend several days on that, went past ranlib errors, but it still failed.

However what I found is that llvm-3.7 (and also llvm-3.8) builds for ppc64 easily with no tweaks to settings or code. Then it allows to rebuild ld64-97 as +llvm37 (again, a standard variant, no need to tweak port file) and then rebuild ld64 for ppc64. In result you get ppc64 linker.

The caveat: llvm-3.7 does not build with gcc-4.2. So you will need to first build llvm-3.4 as ppc32, then ld64 as ppc32, then build gcc6 or gcc7 as universal, then build llvm-3.7 as ppc64, then rebuild ld64.
(Or if you know a better way, please advise me.)
 

alex_free

macrumors 65816
Feb 24, 2020
1,060
2,245
Somewhat relevant, I just built gcc6 on Intel Tiger for my new SM64EXCreator.app without any issues. Last time I did this maybe 7 months ago for PowerPC it just worked so something changed since then.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68000
Original poster
Sep 3, 2021
1,782
1,299
Somewhat relevant, I just built gcc6 on Intel Tiger for my new SM64EXCreator.app without any issues. Last time I did this maybe 7 months ago for PowerPC it just worked so something changed since then.

I don't think there is much use of having llvm and ld64 built as ppc64 on Tiger tbh. Any machine capable of running ppc64 binaries will be better off with Leopard.
 
  • Like
Reactions: alex_free

alex_free

macrumors 65816
Feb 24, 2020
1,060
2,245
I don't think there is much use of having llvm and ld64 built as ppc64 on Tiger tbh. Any machine capable of running ppc64 binaries will be better off with Leopard.
Kencu recently merged his tigerports and leopardports forks into macports AFAIK which is super nice!
 

barracuda156

macrumors 68000
Original poster
Sep 3, 2021
1,782
1,299
Quick update: llvm-5.0 builds for ppc64, but portfile lacks universal variant. I will try to add it.

P. S. Looks like llvm-3.7 and llvm-3.8 are in the same boat: they are built for ppc64, but universal missing. Apparently it just got ignored.
 

unilock

macrumors member
Oct 21, 2019
34
17
Did you get anywhere with this? I'm trying to compile TenFourFox on Leopard 10.5.8 (ppc64), but I run into the same Failed to build llvm-3.3: command execution failed.

I'm following the instructions exactly as described at HowToBuildFPR, so it's possible I'm doing something very wrong (as that's written for Tiger 10.4, asks for GCC 4.8, etc.)

(I'm actually trying to build ccache first, but that also requires llvm-3.3.)
 

barracuda156

macrumors 68000
Original poster
Sep 3, 2021
1,782
1,299
Did you get anywhere with this? I'm trying to compile TenFourFox on Leopard 10.5.8 (ppc64), but I run into the same Failed to build llvm-3.3: command execution failed`.

Honestly I forgot and cannot check atm (away from my PPC hardware for a couple of weeks to come). You could try adding this to portfile and see if it works:
Code:
PortGroup muniversal 1.0
You may also try muniversal 1.1, if the first one fails.

Keep in mind, you can always open a ticket for anything Leopard-related at: https://trac.macports.org (check earlier opened tickets first).

However, according to TFF developer, ppc64 build is not supported. So I am unsure if it is even feasible. You may try asking him on GitHub (tag me too in such a case, @barracuda156).
From what I understand, you would also need to build gcc48 (yeah, an ancient one), which again may not build as universal (but likely will build as ppc64).
 

unilock

macrumors member
Oct 21, 2019
34
17
(Sorry, I edited my reply immediately after posting it, as I hit "Post reply" too early :) )

I'm keeping track of the ticket you've already filed: https://trac.macports.org/ticket/64253

What does PortGroup muniversal 1.0 do? Would I put it in the llvm-3.3 portfile specifically? (I've rarely touched MacPorts until now.)
 
Last edited:

barracuda156

macrumors 68000
Original poster
Sep 3, 2021
1,782
1,299
(Sorry, I edited my reply immediately after posting it, as I hit "Post reply" too early :) )

I'm keeping track of the ticket you've already filed: https://trac.macports.org/ticket/64253

What does PortGroup muniversal 1.0 do? Would I put it in the llvm-3.3 portfile specifically? (I've rarely touched MacPorts before now.)

muniversal PG does magic to build universal ports LOL

Generally speaking, you would require it in cases when non-Apple gcc is used for a build. (Because only Apple gcc42 can take multiple arch flags at once, any later gcc needs to build archs separately and the lipo them together.)

Check some portfile examples, where muniversal is been used. You just add that line to portfile heading, usually that’s enough (though not always, in some cases more fancy code is needed to be added).

To be clear, I am not sure you can build llvm33 as universal. Please update us here, and if it fails, we can try doing something about it. I wanna add also that the latest revision on llvm5–llvm7 changed something which makes PPC build fail (I did not try fixing that yet, but at least a standard procedure failed for me). You may want to go to GitHub history and pick an earlier portfile version (from 2021). Those ones have built for me with no issues.

What you will need:
1. Open portfile and comment out/remove libcxx part for darwin9. (It will fail to build, as of now, though I have a fix for libcxx for PPC, but it is untested.)
2. Either add ppc/ppc64 into enabled archs in portfile or use a command line like: sudo port -v install llvm-5.0 supported_archs="ppc ppc64" build_arch="ppc64" configure.compiler=macports-gcc-10. You need at least gcc6 to build those, itself built as universal (!).
 

unilock

macrumors member
Oct 21, 2019
34
17
muniversal PG does magic to build universal ports LOL

Generally speaking, you would require it in cases when non-Apple gcc is used for a build. (Because only Apple gcc42 can take multiple arch flags at once, any later gcc needs to build archs separately and the lipo them together.)

Check some portfile examples, where muniversal is been used. You just add that line to portfile heading, usually that’s enough (though not always, in some cases more fancy code is needed to be added).

To be clear, I am not sure you can build llvm33 as universal. Please update us here, and if it fails, we can try doing something about it. I wanna add also that the latest revision on llvm5–llvm7 changed something which makes PPC build fail (I did not try fixing that yet, but at least a standard procedure failed for me). You may want to go to GitHub history and pick an earlier portfile version (from 2021). Those ones have built for me with no issues.

What you will need:
1. Open portfile and comment out/remove libcxx part for darwin9. (It will fail to build, as of now, though I have a fix for libcxx for PPC, but it is untested.)
2. Either add ppc/ppc64 into enabled archs in portfile or use a command line like: sudo port -v install llvm-5.0 supported_archs="ppc ppc64" build_arch="ppc64" configure.compiler=macports-gcc-10. You need at least gcc6 to build those, itself built as universal (!).
Ah, I don't think I'm building llvm-3.3 as universal - at least, I haven't explicitly specified the +universal option. (Actually, that's going to cause issues when building 104fx for PPC < G5, won't it...)

Here are the changes I've made to the default macports.conf, if at all relevant:
Code:
build_arch = ppc64
buildfromsource = always
configureccache = yes
universal_archs = ppc ppc64
(I'm not able to get the full file at the moment.)

You mention building with a compiler other than Apple's - might the problem be that I don't have any compiler other than Apple's gcc-4.2 installed?
On that note, do you know whether 104fx compile with a compiler other than gcc-4.8 and/or a version of llvm other than 3.3?
 

barracuda156

macrumors 68000
Original poster
Sep 3, 2021
1,782
1,299
Ah, I don't think I'm building llvm-3.3 as universal - at least, I haven't explicitly specified the +universal option. (Actually, that's going to cause issues when building 104fx for PPC < G5, won't it...)

Here are the changes I've made to the default macports.conf, if at all relevant:
Code:
build_arch = ppc64
buildfromsource = always
configureccache = yes
universal_archs = ppc ppc64
(I'm not able to get the full file at the moment.)

You mention building with a compiler other than Apple's - might the problem be that I don't have any compiler other than Apple's gcc-4.2 installed?
On that note, do you know whether 104fx compile with a compiler other than gcc-4.8 and/or a version of llvm other than 3.3?

1. I cannot say much re TFF, since I have not yet fixed its portfile for PPC. Here is an Intel version from @kencu: https://github.com/kencu/tenfourfox-macports
From what I know, it does require a specific version of gcc (4.8), and newer ones won’t build it. Not tested personally though.

2. If you don’t have a G5 machine, don’t build for ppc64, G4 cannot run these.

3. I would recommend to build everything for ppc (ppc32) first, since some stuff is/may be broken for ppc64 (including TFF itself). ppc32 should be smooth, you can just go with sudo port -v install, Macports gonna take care of the rest.

4. Having anything as universal won’t create problems. If a) you have G5 machine and b) ports in question do build as universal, it is better to build them as universal, since then you can build dependencies for either arch or as universal too. Having said that, you may have a hard time building everything as universal. In particular, Pythons are broken (I fixed them, but it is not in Macports), LLVM will be hard, many ports require some manual adjustments.
I also have no idea if gcc48 builds as universal, you will have to experiment here.

5. I don’t think you need this: configureccache = yes, unless you added that for a reason.

6. For compilers, in a case of Leopard you should be generally good using a default selection. If a port does not ask for a specific gcc, then it gonna build with an Apple one. This is not always true for building universal.
However, llvm-5.0 is not officially supported on Leopard, as well as gcc10–gcc11, so to get these you do need manual tweaks.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.