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

B S Magnet

macrumors 603
Original poster
I am just putting together some final touches, so that when people try this they have a good experience, with as much as possible, no pitfalls.

I know gcc7 builds on this system, and for many years, libgcc7 was the basic gcc library for the newer gcc ports on MacPorts. I changed that, ironically, a couple of months ago to libgcc11, and so now I have to make libgcc11 work on a PPC SnowLeopard system that bootstraps without clang. Or I can consider rolling it back to libgcc7 for this system, but if I do that, the divergence between this and MacPorts grows, which is always a cause for trouble. So currently getting to bootstrap to libgcc11 if I can is the plan.

It will never be perfect, of course. So far my "tweak rate" to install ports on PPC SnowLeopard is about 25% of ports need something. The tweaks are all reasonably minor to me, but may not be so obvious to someone who has not spent the many years fixing non-building ports on MacPorts that I have. ld64-127 had an interesting issue with missing symbols in the older libSystem.B.dylib, that was in the end a simple one-digit change, easy enough once you know just what digit needs changing.

I'll focus on the toolchain at the beginning, so people don't build broken infrastructure off the bat.

There will always be a portfile overlay needed to make this work, as few of the PPC SnowLeopard fixes would ever be appropriate to upstream to MacPorts. If a portfile overlay is too overwhelming for someone to consider, then I would say this project is likely over the head of such a user.

You know, it might be a bit easier for the community in general if you just walked us through, step by step, what you did.

Doing so extends a gesture of overall good will, and it also makes you a good teacher along the way. There’s no need to make this more arcane than it needs to be, nor is it going to be terribly productive to pre-judge the aptitude of members who’ve been on here and sharing their knowledge as they also come here to learn more.

Transparency and clarity, not opacity, wins the day for all.
 

kencu

macrumors member
Jan 23, 2019
92
110
To minimize the difference between the current MacPorts setup and whatever this might turn out to be, I have been hoping to get libgcc11 / gcc11 to build, as that is what I have set up MacPorts to use for SnowLeopard and that is how the current base/infrastructure/Portfiles are written. To allow that to happen, I am trying to work through an ICE with gcc11 that is being a bit tenacious (below).

Rolling back to the pre-libgcc11 on SnowLeopard version of the portfile tree, using gcc7/libgcc7 is working fine, and all the software that needs c++11 or greater seems happy with that.

That is what I have currently set up in MP for the systems < 10.6 to use (that is what is used on Tiger and Leopard PPC). So that is easy enough for me to do, but that then requires more configuration differences from a basic MacPorts that I am hoping to avoid, to minimize confusion.

I will try a bit longer to see if the gcc11 ICE is fixable, and if not, give in and fall back to gcc7/libgcc7 and leave it there until (if) that can be straightened out.

Code:
Process:         cc1 [71435]
Path:            /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc11/libgcc11/work/build/./gcc/cc1
Identifier:      cc1
Version:         ??? (???)
Code Type:       PPC (Native)
Parent Process:  xgcc [71433]

Date/Time:       2021-08-27 23:52:06.046 -0700
OS Version:      Mac OS X 10.6 (10A190)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread:  0

Thread 0 Crashed:
0   cc1                               0x0000fd60 bool simple_hashmap_traits<default_hash_traits<rdwr_access_hash>, attr_access>::is_empty<hash_map<rdwr_access_hash, attr_access, simple_hashmap_traits<default_hash_traits<rdwr_access_hash>, attr_access> >::hash_entry>(hash_map<rdwr_access_hash, attr_access, simple_hashmap_traits<default_hash_traits<rdwr_access_hash>, attr_access> >::hash_entry const&) + 28 (hash-map-traits.h:75)

Thread 0 crashed with PPC Thread State 32:
  srr0: 0x0000fd60  srr1: 0x0200f030   dar: 0x00000000 dsisr: 0x40000000
    r0: 0x0000fda8    r1: 0xbfff6a80    r2: 0x00000000    r3: 0x00000000
    r4: 0x00000010    r5: 0x00000001    r6: 0x444fc098    r7: 0x00000000
    r8: 0x444fc094    r9: 0x00000000   r10: 0x00000020   r11: 0x42000072
   r12: 0x0000fd44   r13: 0x8fe37930   r14: 0x8fe336bc   r15: 0x8fe37930
   r16: 0x00003ce0   r17: 0x8fe34d60   r18: 0x8fe2b954   r19: 0x00000013
   r20: 0x8fe36ff4   r21: 0x00000002   r22: 0x000016e0   r23: 0x00001268
   r24: 0x8fe33ca0   r25: 0x00000032   r26: 0x0273f260   r27: 0x8fe33c48
   r28: 0x0000136c   r29: 0x0000000d   r30: 0xbfff6a80   r31: 0x02742b30
    cr: 0x42000072   xer: 0x00000000    lr: 0x0000fda8   ctr: 0x0000fd44
vrsave: 0x00000000
 
  • Like
Reactions: ChrisCharman

kencu

macrumors member
Jan 23, 2019
92
110
for anyone who stumbles over this and would like to know how to get a reasonably working MacPorts setup with an actually functional gcc7 going on this bootleg system, I posted the complete information here:

 

ervus

macrumors 6502
Apr 3, 2020
415
312
The advantage, really, is being able to build newer code bases that require C11 / c++11 or greater.

The talospace blog mentions that LTO and PGO make a noticeable improvement to firefox builds, so I was wondering if TFF could be compiled with a newer gcc to achieve some improvements as well.
 
  • Like
Reactions: ChrisCharman

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
The talospace blog mentions that LTO and PGO make a noticeable improvement to firefox builds, so I was wondering if TFF could be compiled with a newer gcc to achieve some improvements as well.

The problem is that so far no one has been able to build anything above gcc7 on PowerPC MacOS, apparently.
 
  • Like
Reactions: ChrisCharman

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
Not exactly. The goal, described in the opening post, was to ultimately get irssi running on the PowerPC Mac running Snow Leopard 10A96.

What I have done since the other day is the following:
  1. I made a list of all the source code tarballs I compiled from scratch last week (back when I was still working with the first compile-build of Macports2.7.1, and I also added to that list all the source code tarballs I couldn’t compile.
  2. Next, I used Macports on another PowerPC Mac running Leopard (and thus, Darwin9) to run “port pkg [portname_of_tarball_from_#1]” on each item in that list. I chose overkill to err on the side of the precautionary principle.
  3. Then, I installed each of those, individually, on the PowerPC Mac running Darwin10/10A96. I installed each of the three items you listed in addition to everything I had built — or tried to build — in #1.
  4. Because I learnt earlier how the current irssi_1.2.3 is having basic functionality issues across all my PowerPC Macs — at least, as installed via Macports (on Darwin8, Darwin9, and Darwin10 PowerPC Macs, with Darwin10 install failing following a “port mpkg irssi” made on the Darwin9 Mac) — I manually compiled its predecessor, irssi_1.2.2, on the Darwin10 PPC earlier today.
So in short:

The only method I can see which affords a reasonable ability to build anything more substantial than standalone “noarch” ports on Snow Leopard for PowerPC (Darwin10) is to first use Macports on a PowerPC Mac running Leopard to generate .pkg installs for each individual component required to build a target-something/application. This isn’t what I wanted ideally, but the Macports team never foresaw the possibility of PowerPC Macs successfully running a version of Snow Leopard and, thus, never made ports available for use on Darwin10/PPC.

Sure, that something could also be installed from a .pkg generated by a Leopard Macports instance, but given the problems of using the port pkg of irssi_1.2.3 — the ultimate thing I wanted to build here — I chose to configure and make that application manually on the SL-PPC Mac so that I could rule out that aforementioned flaw in a pre-made port or a buggy version being the culprit.

And so, as connected to an ngircd instance on another Mac in my LAN, minutes ago:

View attachment 1821174

Where I’m from, that’s good enough for now.

How did you make Macports on 10.6 to see installed via pkgs ports (from 10.5.8)?

I have tried that with mpich-gcc7, which compiles on 10.5.8 without issues, but has been persistently failing to compile on 10.6, pkg installs and all files are placed in needed directories, but Macports do not see mpich as installed port, and therefore it remains useless – ports that require mpich as dependency still ask to build it anew.

P. S. I have found a solution for mpich-gcc7 to build successfully, but it is a crazy workaround.
 

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
sh-4.3# ./configure --with-arch-32=powerpc --without-arch-64 --without-cpu-64

Have you ever tried the reverse: to force 10.6 PPC compile for ppc64? Might be impossible though. Procedure that works for me on 10.5.8 to force upgrade ports to build as universal (ppc + ppc64) does nothing on 10.6.
 

ChrisCharman

macrumors 6502a
May 10, 2020
517
675
Bournemouth, UK
Have you ever tried the reverse: to force 10.6 PPC compile for ppc64? Might be impossible though. Procedure that works for me on 10.5.8 to force upgrade ports to build as universal (ppc + ppc64) does nothing on 10.6.
Compiling for ppc64 works fine on the command line in 10A190, so it’s probably an issue with macports. May be worth looking at the macports source code and modifying that to achieve what you’re looking to do.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
Compiling for ppc64 works fine on the command line in 10A190, so it’s probably an issue with macports. May be worth looking at the macports source code and modifying that to achieve what you’re looking to do.

Well, I have found the way to force Macports pass -arch ppc64 to compiler, however compiler breaks down on that with array of errors. The same compiler builds the same port with no issues for ppc.

It has been also pointed out to me that 10.6 PPC lacks ppc64 support in system dylibs, where 10.5.8 has it. As an example, /usr/lib/libSystem.B.dylib has 3 archs on 10.6 PPC and 4 archs on 10.5.8.

@ChrisCharman If you could let me know what you have compiled on 10A190 for ppc64 (and using which compiler), I would try reproducing it, since as of now I can build for ppc64 on 10.5.8 but not on 10.6.
 
  • Like
Reactions: ChrisCharman

ChrisCharman

macrumors 6502a
May 10, 2020
517
675
Bournemouth, UK
Well, I have found the way to force Macports pass -arch ppc64 to compiler, however compiler breaks down on that with array of errors. The same compiler builds the same port with no issues for ppc.

It has been also pointed out to me that 10.6 PPC lacks ppc64 support in system dylibs, where 10.5.8 has it. As an example, /usr/lib/libSystem.B.dylib has 3 archs on 10.6 PPC and 4 archs on 10.5.8.

@ChrisCharman If you could let me know what you have compiled on 10A190 for ppc64 (and using which compiler), I would try reproducing it, since as of now I can build for ppc64 on 10.5.8 but not on 10.6.
That is interesting, i’ll have to double check - perhaps I’m incorrect and confusing some builds that were compiled on the MacBook? It’s hard to remember which machines i’ve used for what at this point. I haven’t needed to build anything as specifically ppc64 as i’ve been focused on the internal projects for a good while, not building third party apps to run on 10A190. I will attempt to build something as ppc64 when i get time and report back. Will most likely be after xmas though.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
That is interesting, i’ll have to double check - perhaps I’m incorrect and confusing some builds that were compiled on the MacBook? It’s hard to remember which machines i’ve used for what at this point. I haven’t needed to build anything as specifically ppc64 as i’ve been focused on the internal projects for a good while, not building third party apps to run on 10A190. I will attempt to build something as ppc64 when i get time and report back. Will most likely be after xmas though.

Thank you! Please let me know.

It is crucial to understand if 10.6 PPC supports ppc64 in principle. It could be the case that 10.6 SDK is the problem, but so far it looks to me that ppc64 support is missing altogether – which is sad, since 10.5.8 supports it.
 
  • Like
Reactions: ChrisCharman

ChrisCharman

macrumors 6502a
May 10, 2020
517
675
Bournemouth, UK
Thank you! Please let me know.

It is crucial to understand if 10.6 PPC supports ppc64 in principle. It could be the case that 10.6 SDK is the problem, but so far it looks to me that ppc64 support is missing altogether – which is sad, since 10.5.8 supports it.
It is possible it was removed, as it would be one less architecture to worry about given that the G5 can run ppc binaries. We’ll have to keep experimenting to find out.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
It is possible it was removed, as it would be one less architecture to worry about given that the G5 can run ppc binaries. We’ll have to keep experimenting to find out.

Yes, but if yes, then at what point? If we could locate needed components to bring back ppc64 support, that would be awesome. Otherwise 10.5.8 turns superior LOL
 
  • Like
Reactions: ChrisCharman

ChrisCharman

macrumors 6502a
May 10, 2020
517
675
Bournemouth, UK
Worst case scenario we just diff the leopard source code when we know what we need and replace the removed code, though it’s possible it broke and they decided not to fix it and just removed it instead.
 

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
Worst case scenario we just diff the leopard source code when we know what we need and replace the removed code, though it’s possible it broke and they decided not to fix it and just removed it instead.

We might be out of luck since libSystem.B does not support ppc64 on either 10A190 or 10.6.8, and replacing it with the one from 10.5.8 makes OS unbootable (white screen with Apple logo, fans to full speed).

Building for ppc64 on 10.6 should be possible though if 10.5 SDK is used.
 

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
It’s unfortunate. Rene Rebe of T2 SDE has managed to cross compile GCC 11.2.0 on PowerPC Linux here.

We have gcc10 and gcc11 now on 10.5.8, both for ppc/ppc64.
I have also built gcc10 as ppc32 on 10.6.8. (Will try repeating the same on 10.6 PPC, as well as building gcc11 there.)
 

B S Magnet

macrumors 603
Original poster
Have you compiled it btw?

No. I wrote it off indefinitely.

The person who claimed it could be done couldn’t describe in plain language what to do whilst being condescending about it in the process (it’s entirely possible he, a developer, simply didn’t know how because he lacked the technical writing skills). His responding to the thread as if I was no longer a thread participant, much less the thread’s original poster, got to be disruptive, petty and, for me, waste of time. Dealing with that was a thoroughly discouraging experience — a rarity for the PPC and early Intel forums. He came and he went. Time to move on.

That’s why I flagged the topic as “Resolved”.

Unless others in this thread are personally trying to compile irssi or install it with macports on SL-PPC, then this thread is dead and topics like compiling gcc higher than version 7 deserve fresh threads all their own.
 

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
No. I wrote it off indefinitely.

The person who claimed it could be done couldn’t describe in plain language what to do whilst being condescending about it in the process (it’s entirely possible he, a developer, simply didn’t know how because he lacked the technical writing skills). His responding to the thread as if I was no longer a thread participant, much less the thread’s original poster, got to be disruptive, petty and, for me, waste of time. Dealing with that was a thoroughly discouraging experience — a rarity for the PPC and early Intel forums. He came and he went. Time to move on.

That’s why I flagged the topic as “Resolved”.

Unless others in this thread are personally trying to compile irssi or install it with macports on SL-PPC, then this thread is dead and topics like compiling gcc higher than version 7 deserve fresh threads all their own.

Ah I see. Let me try to build it. (I can confirm it fails to build as-is, but fix may not be hard.)
 
  • Like
Reactions: B S Magnet

ChrisCharman

macrumors 6502a
May 10, 2020
517
675
Bournemouth, UK
We might be out of luck since libSystem.B does not support ppc64 on either 10A190 or 10.6.8, and replacing it with the one from 10.5.8 makes OS unbootable (white screen with Apple logo, fans to full speed).

Building for ppc64 on 10.6 should be possible though if 10.5 SDK is used.
No, i mean if Libsystem, and other system libraries in 10.5.8, support ppc64 and it was then removed in 10.6 but you want to restore that functionality for what you’re personally doing (which isn’t something that’s on my todo list as i’m just trying to recreate vanilla SL for ppc which is a mammoth task on its own) then the most logical plan of action would be to review the source code for the Leopard version vs the Snow Leopard version and restore the code that was removed as an addition to the Snow Leopard libraries then build you’re modified version. Simply replacing them with the Leopard versions will not work as Libsystem is the main system framework and there are many changes that are necessary for Snow Leopard to function that don’t exist in the Leopard version. I find all of your posts fascinating and definitely a worthwhile read, however i do agree with @B S Magnet that you should start a dedicated thread for MacPorts and/or adding ppc64 support to Snow Leopard. This will encourage others to engage specifically with the issues you’re having and be easier to follow along and understand the steps you’ve taken already for others wanting to support or play along at home.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68020
Sep 3, 2021
2,327
1,536
No, i mean if Libsystem, and other system libraries in 10.5.8, support ppc64 and it was then removed in 10.6 but you want to restore that functionality for what you’re personally doing (which isn’t something that’s on my todo list as i’m just trying to recreate vanilla SL for ppc which is a mammoth task on its own) then the most logical plan of action would be to review the source code for the Leopard version vs the Snow Leopard version and restore the code that was removed as an addition to the Snow Leopard libraries then build you’re modified version. Simply replacing them with the Leopard versions will not work as Libsystem is the main system framework and there are many changes that are necessary for Snow Leopard to function that don’t exist in the Leopard version. I find all of your posts fascinating and definitely a worthwhile read, however i do agree with @B S Magnet that you should start a dedicated thread for MacPorts and/or adding ppc64 support to Snow Leopard. This will encourage others to engage specifically with the issues you’re having and be easier to follow along and understand the steps you’ve taken already for others wanting to support or play along at home.

After discussing the matter with Iain, I came to conclusion that ppc64 for 10.6 is a lost case: https://github.com/iains/darwin-toolchains-start-here/discussions/5#discussioncomment-1953839

What he instead suggested is trying to make 10.6.8 bootable and working on ppc, since it has full support for ppc32 for Rosetta. (If I don’t mistake, you want to do something like that?)

As for MP, I will write a post, probably soon. Need to figure out some stuff.
 
  • Like
Reactions: ChrisCharman
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.