Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
The first post of this thread is a WikiPost and can be edited by anyone with the appropiate permissions. Your edits will be public.

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Some updates:

libcxx – building fixed for pcc, usability to be tested
libomp – WIP, probably will be fixed in a while.

libfido2 – building fixed
libaacs – building fixed

glib2 – latest version fixed for ppc
gegl – fixed building with the latest mpeg

transmission-x11 @3.0 – changed port to cmake build system, building fixed for ppc, usability to be tested

gnutls, miniupnpc, gupnp and few other ports updated to the latest versions (ahead of Macports), patches updated, everything builds.

openmpi now builds with macports-gcc-10/11.
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
It is advisable to make two installations of Macports in order to set up the main one to use curl from another (since OS curl is too outdated and cannot submit stats).

Here is the code (build and flags added for 10.6.8 case, on 10A190 unneeded):

Code:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
cd [path to source folder]
./configure --prefix=/opt/bootstrap --build=powerpc-apple-darwin10 --with-applications-dir=/opt/bootstrap/Applications --without-startupitems CC='gcc-4.2 -m32 -arch ppc' CXX='g++-4.2 -m32 -arch ppc'
make && sudo make install
cd /opt/bootstrap/bin
sudo ./port -v sync
sudo ./port -v -N install curl

After everything is built in /opt/bootstrap, you make default installation in /opt/local with newly built curl:

Code:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
cd [path to source folder]
./configure --build=powerpc-apple-darwin10 --with-curlprefix=/opt/bootstrap CC='gcc-4.2 -m32 -arch ppc' CXX='g++-4.2 -m32 -arch ppc'
make && sudo make install
sudo port -v sync
sudo port -v install mpstats

After make install and before port sync it is advisable to follow steps described earlier (ref link above):
1. Edit /opt/local/etc/macports/macports.conf
2. Edit /opt/local/etc/macports/sources.conf
3. Edit /opt/local/etc/macports/archive_sites.conf

UPD: PLEASE CONSIDER BUILDING MACPORTS IN MAIN PREFIX AGAINST A NEW CURL AND THEN INSTALL MPSTATS. WE NEED THAT TO SHOW DEVELOPERS THAT PORTS ARE IN DEMAND FOR OUR CONFIG.

The latest update to curl port makes life unnecessarily hard: dependencies on nghttp2 and brotli has been sneakily added, and it result a simple procedure suggested above will lead to installation of gcc7 and cmake (!).

The way it has been done will require to manually get rid of these in the portfile. Basically you need to revert this commit: https://github.com/macports/macports-ports/commit/e1ed418961c5919aacfeb582bb0baa2d74243a8f

I will make an update for the overlay repo soon, hopefully, and will include curl without these dependencies.
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
This is still WIP stage, but it looks like I almost fixed ocaml for PPC: https://github.com/macports/macports-ports/pull/14691

If anyone can test it, please, that would be very helpful in fact.

P. S. Currently only world target is confirmed to build, world.opt fails. Some ocaml tools are therefore missing.

ocaml.png
 
Last edited:

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Assuming you have gcc10-bootstrap built, this is the patch needed for the latest gcc11 (11.3.0) to build on 10A190:

Code:
--- gcc/config/darwin.h.orig    2022-04-21 15:58:52.000000000 +0800
+++ gcc/config/darwin.h    2022-04-24 14:01:07.000000000 +0800
@@ -331,7 +331,7 @@
 */
 
 #define DARWIN_NOCOMPACT_UNWIND \
-" %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) "
+" %:version-compare(>= 10.7 mmacosx-version-min= -no_compact_unwind) "
 
 /* In Darwin linker specs we can put -lcrt0.o and ld will search the library
    path for crt0.o or -lcrtx.a and it will search for for libcrtx.a.  As for
@@ -371,7 +371,7 @@
       %{%:sanitize(address): -lasan } \
       %{%:sanitize(undefined): -lubsan } \
       %(link_ssp) \
-      %:version-compare(>< 10.6 10.7 mmacosx-version-min= -ld10-uwfef) \
+      %:version-compare(>< 10.7 10.7 mmacosx-version-min= -ld10-uwfef) \
       %(link_gcc_c_sequence) \
       %{!nodefaultexport:%{dylib|dynamiclib|bundle: \
     %:version-compare(>= 10.11 asm_macosx_version_min= -U) \
@@ -504,14 +504,14 @@
 #undef REAL_LIBGCC_SPEC
 #define REAL_LIBGCC_SPEC \
 "%{static-libgcc|static:                          \
-    %:version-compare(!> 10.6 mmacosx-version-min= -lgcc_eh)          \
-    %:version-compare(>= 10.6 mmacosx-version-min= -lemutls_w);          \
+    %:version-compare(!> 10.7 mmacosx-version-min= -lgcc_eh)          \
+    %:version-compare(>= 10.7 mmacosx-version-min= -lemutls_w);          \
    shared-libgcc|fexceptions|fobjc-exceptions|fgnu-runtime:          \
     %:version-compare(!> 10.11 mmacosx-version-min= -lgcc_s.1.1)      \
     %:version-compare(>= 10.11 mmacosx-version-min= -lemutls_w)          \
     %:version-compare(!> 10.3.9 mmacosx-version-min= -lgcc_eh)          \
     %:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4)   \
-    %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5);      \
+    %:version-compare(>< 10.5 10.7 mmacosx-version-min= -lgcc_s.10.5);      \
    : -lemutls_w                                  \
   } -lgcc "
 
@@ -547,8 +547,8 @@
 
 #define DARWIN_CRT1_SPEC                        \
   "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o)        \
-   %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o)    \
-   %:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o)    \
+   %:version-compare(>< 10.5 10.7 mmacosx-version-min= -lcrt1.10.5.o)    \
+   %:version-compare(>< 10.7 10.8 mmacosx-version-min= -lcrt1.10.6.o)    \
    %{fgnu-tm: -lcrttms.o}"
 
 #define DARWIN_CRT2_SPEC ""
@@ -563,10 +563,10 @@
 
 #define DARWIN_DYLIB1_SPEC                        \
   "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o)        \
-   %:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)"
+   %:version-compare(>< 10.5 10.7 mmacosx-version-min= -ldylib1.10.5.o)"
 
 #define DARWIN_BUNDLE1_SPEC \
-"%{!static:%:version-compare(< 10.6 mmacosx-version-min= -lbundle1.o)    \
+"%{!static:%:version-compare(< 10.7 mmacosx-version-min= -lbundle1.o)    \
        %{fgnu-tm: -lcrttms.o}}"
 
 #ifdef HAVE_AS_MMACOSX_VERSION_MIN_OPTION


--- gcc/config/darwin.c.orig    2021-07-28 14:55:07.000000000 +0800
+++ gcc/config/darwin.c    2022-03-08 16:22:34.000000000 +0800
@@ -3574,7 +3574,7 @@
 darwin_fold_builtin (tree fndecl, int n_args, tree *argp,
              bool ARG_UNUSED (ignore))
 {
-  unsigned int fcode = DECL_MD_FUNCTION_CODE (fndecl);
+  int fcode = DECL_MD_FUNCTION_CODE (fndecl);
 
   if (fcode == darwin_builtin_cfstring)
     {

And obviously add this into the Portfile:

Code:
depends_lib-append      port:gcc10-bootstrap
configure.cc            ${prefix}/libexec/gcc10-bootstrap/bin/gcc
configure.cxx           ${prefix}/libexec/gcc10-bootstrap/bin/g++

patchfiles-append patch-darwin.c.diff patch-darwin.h.diff (or whatever you name them)

P. S. Make sure to use the latest version of the Portfile (sudo port sync), because the early one had an error that led to a broken libgcc11.
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
This is still WIP stage, but it looks like I almost fixed ocaml for PPC: https://github.com/macports/macports-ports/pull/14691

If anyone can test it, please, that would be very helpful in fact.

P. S. Currently only world target is confirmed to build, world.opt fails. Some ocaml tools are therefore missing.

View attachment 1998367

UPD. It is not yet clear if PPC assembler part is fixable, so ocamlopt does not yet build, but bytecode compiler appears to be fully functional. Just build the world target.
 
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
I have found a solution for building gobject-introspection @1.72.0 on 10.6.8 Rosetta.

In /opt/local/share/meson/cross modify ppc-darwin to (make sure to update Meson to 0.62.1 in Macports):
Code:
[host_machine]
system = 'darwin'
cpu_family = 'ppc'
cpu = 'ppc'
endian = 'big'

[binaries]
pkgconfig = '/opt/local/bin/pkg-config'
cmake = '/opt/local/bin/cmake'
ar = '/opt/local/bin/ar'
strip = '/opt/local/bin/strip'

[built-in options]
c_link_args = ['-arch', 'ppc']

Open portfile of gobject-introspection and add cross-file arg to:
Code:
configure.args      -Ddoctool=enabled \
                    -Dpython=${configure.python} \
                    --cross-file=ppc-darwin

Modify the setting below to:
Code:
build.env-append    CC=/Developer/usr/bin/powerpc-apple-darwin10-gcc-4.2.1

Now sudo port -v upgrade gobject-introspection or sudo port -v install gobject-introspection.

P. S. On 10A190 you do not need this tweaks.
 
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Last edited:
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
A number of Python ports will fail now, complaining about "Wno-unused-result" flag: https://trac.macports.org/ticket/65179
Until this problem is somehow addressed, finally, what you can do is:
Code:
sudo port clean PORT
sudo port -v install PORT configure.compiler=macports-gcc-11
or whatever recent gcc you got.
 
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Assuming you have gcc10-bootstrap built, this is the patch needed for the latest gcc11 (11.3.0) to build on 10A190:

Code:
--- gcc/config/darwin.h.orig    2022-04-21 15:58:52.000000000 +0800
+++ gcc/config/darwin.h    2022-04-24 14:01:07.000000000 +0800
@@ -331,7 +331,7 @@
 */
 
 #define DARWIN_NOCOMPACT_UNWIND \
-" %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) "
+" %:version-compare(>= 10.7 mmacosx-version-min= -no_compact_unwind) "
 
 /* In Darwin linker specs we can put -lcrt0.o and ld will search the library
    path for crt0.o or -lcrtx.a and it will search for for libcrtx.a.  As for
@@ -371,7 +371,7 @@
       %{%:sanitize(address): -lasan } \
       %{%:sanitize(undefined): -lubsan } \
       %(link_ssp) \
-      %:version-compare(>< 10.6 10.7 mmacosx-version-min= -ld10-uwfef) \
+      %:version-compare(>< 10.7 10.7 mmacosx-version-min= -ld10-uwfef) \
       %(link_gcc_c_sequence) \
       %{!nodefaultexport:%{dylib|dynamiclib|bundle: \
     %:version-compare(>= 10.11 asm_macosx_version_min= -U) \
@@ -504,14 +504,14 @@
 #undef REAL_LIBGCC_SPEC
 #define REAL_LIBGCC_SPEC \
 "%{static-libgcc|static:                          \
-    %:version-compare(!> 10.6 mmacosx-version-min= -lgcc_eh)          \
-    %:version-compare(>= 10.6 mmacosx-version-min= -lemutls_w);          \
+    %:version-compare(!> 10.7 mmacosx-version-min= -lgcc_eh)          \
+    %:version-compare(>= 10.7 mmacosx-version-min= -lemutls_w);          \
    shared-libgcc|fexceptions|fobjc-exceptions|fgnu-runtime:          \
     %:version-compare(!> 10.11 mmacosx-version-min= -lgcc_s.1.1)      \
     %:version-compare(>= 10.11 mmacosx-version-min= -lemutls_w)          \
     %:version-compare(!> 10.3.9 mmacosx-version-min= -lgcc_eh)          \
     %:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4)   \
-    %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5);      \
+    %:version-compare(>< 10.5 10.7 mmacosx-version-min= -lgcc_s.10.5);      \
    : -lemutls_w                                  \
   } -lgcc "
 
@@ -547,8 +547,8 @@
 
 #define DARWIN_CRT1_SPEC                        \
   "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o)        \
-   %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o)    \
-   %:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o)    \
+   %:version-compare(>< 10.5 10.7 mmacosx-version-min= -lcrt1.10.5.o)    \
+   %:version-compare(>< 10.7 10.8 mmacosx-version-min= -lcrt1.10.6.o)    \
    %{fgnu-tm: -lcrttms.o}"
 
 #define DARWIN_CRT2_SPEC ""
@@ -563,10 +563,10 @@
 
 #define DARWIN_DYLIB1_SPEC                        \
   "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o)        \
-   %:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)"
+   %:version-compare(>< 10.5 10.7 mmacosx-version-min= -ldylib1.10.5.o)"
 
 #define DARWIN_BUNDLE1_SPEC \
-"%{!static:%:version-compare(< 10.6 mmacosx-version-min= -lbundle1.o)    \
+"%{!static:%:version-compare(< 10.7 mmacosx-version-min= -lbundle1.o)    \
        %{fgnu-tm: -lcrttms.o}}"
 
 #ifdef HAVE_AS_MMACOSX_VERSION_MIN_OPTION


--- gcc/config/darwin.c.orig    2021-07-28 14:55:07.000000000 +0800
+++ gcc/config/darwin.c    2022-03-08 16:22:34.000000000 +0800
@@ -3574,7 +3574,7 @@
 darwin_fold_builtin (tree fndecl, int n_args, tree *argp,
              bool ARG_UNUSED (ignore))
 {
-  unsigned int fcode = DECL_MD_FUNCTION_CODE (fndecl);
+  int fcode = DECL_MD_FUNCTION_CODE (fndecl);
 
   if (fcode == darwin_builtin_cfstring)
     {

And obviously add this into the Portfile:

Code:
depends_lib-append      port:gcc10-bootstrap
configure.cc            ${prefix}/libexec/gcc10-bootstrap/bin/gcc
configure.cxx           ${prefix}/libexec/gcc10-bootstrap/bin/g++

patchfiles-append patch-darwin.c.diff patch-darwin.h.diff (or whatever you name them)

P. S. Make sure to use the latest version of the Portfile (sudo port sync), because the early one had an error that led to a broken libgcc11.

UPD. Apparently, jit builds fine in fact. (Previously I have excluded it from all ppc builds due to one-time failure – cannot remember for sure now, but maybe with previous version of gcc10.) Rebuilding now gcc11 @11.3.0 on 10A190 with JIT and TLS enabled, now stage 3, so presumably it should be all good.

UPD2. JIT confirmed to build fine, TLS fails, do not enable the latter.
 
Last edited:
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
By the way, do not use ld64-127. Use ld64-97, it works far better for ppc. In particular, a build of libgcc11 failed for me with ld64-127. Once I rebuilt ld64 with ld64-97, I was able to restart the build successfully (not from scratch, just resume).

If you built ld64-127 initially, do this:
Code:
sudo port -v install ld64-97
sudo port -v upgrade --enforce-variants ld64 -ld64_127 +ld64_97
 
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
This is still WIP stage, but it looks like I almost fixed ocaml for PPC: https://github.com/macports/macports-ports/pull/14691

If anyone can test it, please, that would be very helpful in fact.

P. S. Currently only world target is confirmed to build, world.opt fails. Some ocaml tools are therefore missing.

View attachment 1998367

PowerPC fixes for OCaml are now in Macports.

Ocamlfind and Ocamlbuild tools modified accordingly, so they will also build on PowerPC.
 
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
sbcl compiler somewhat fixed for PPC. You can find portfiles for it in two versions in this thread: https://trac.macports.org/ticket/65188

We were able to get 2.0.9 running, which is not too bad.

My initial PPC fixes for ruby31 are now in the source (GitHub, not yet Macports). It may or may not build however. I have it on 10.6 PPC, but Leopard so far fails.
 
  • Like
Reactions: sasho648

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
It is advisable to make two installations of Macports in order to set up the main one to use curl from another (since OS curl is too outdated and cannot submit stats).

Here is the code (build and flags added for 10.6.8 case, on 10A190 unneeded):

Code:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
cd [path to source folder]
./configure --prefix=/opt/bootstrap --build=powerpc-apple-darwin10 --with-applications-dir=/opt/bootstrap/Applications --without-startupitems CC='gcc-4.2 -m32 -arch ppc' CXX='g++-4.2 -m32 -arch ppc'
make && sudo make install
cd /opt/bootstrap/bin
sudo ./port -v sync
sudo ./port -v -N install curl

After everything is built in /opt/bootstrap, you make default installation in /opt/local with newly built curl:

Code:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
cd [path to source folder]
./configure --build=powerpc-apple-darwin10 --with-curlprefix=/opt/bootstrap CC='gcc-4.2 -m32 -arch ppc' CXX='g++-4.2 -m32 -arch ppc'
make && sudo make install
sudo port -v sync
sudo port -v install mpstats

After make install and before port sync it is advisable to follow steps described earlier (ref link above):
1. Edit /opt/local/etc/macports/macports.conf
2. Edit /opt/local/etc/macports/sources.conf
3. Edit /opt/local/etc/macports/archive_sites.conf

UPD: PLEASE CONSIDER BUILDING MACPORTS IN MAIN PREFIX AGAINST A NEW CURL AND THEN INSTALL MPSTATS. WE NEED THAT TO SHOW DEVELOPERS THAT PORTS ARE IN DEMAND FOR OUR CONFIG.

Just to confirm: for Rosetta in order to build curl all needed fixes are available here: https://github.com/barracuda156/macports-ports/tree/Rosetta-Ports
I have just installed 10.6.8 Server in Parallels from scratch and went through Macports bootstrapping. On Big Sur you will likely need this for Parallels to work properly: https://qdmana.com/2022/04/202204121836140678.html and boot into Safe Mode first if you begin with 10.6.0.
Sandbox fix is not required for Rosetta.
 

sasho648

macrumors member
Feb 19, 2020
82
38
It was about time for macports to rise and shine but of-course it must be done by someone so kudos to you guys.

For llvm and clang (since I needed them once upon a time) - there were the actual functionality of creating mach-o ppc big endian executable files but it was mis-configured - I did try to hack it but in the end I don't believe I did.
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
It was about time for macports to rise and shine but of-course it must be done by someone so kudos to you guys.

For llvm and clang (since I needed them once upon a time) - there were the actual functionality of creating mach-o ppc big endian executable files but it was mis-configured - I did try to hack it but in the end I don't believe I did.

You are correct, clang is broken for PPC. Iain has done some work to fix llvm here: https://github.com/iains/LLVM-7-branch

However Macports requires at least an old llvm – llvm33 or llvm34 – to use it for LTO with ld64. It is not used for anything else in a standalone manner, but unless you have it built, you are in trouble. (Variant that uses Xcode ld with ld64 does not work correctly.)
On 10.4.11, 10.5.8 and 10.6 PPC (10A190) both these llvm versions build with no trickery. On 10.6.8 Rosetta both fail, as they are. While llvm5 builds fine, it is non-trivial to get to build it from scratch (gcc-4.2 cannot build it). Earlier I used a pre-built llvm34 from 10.6 PPC to borrow a specific file into 10.6.8 Rosetta. Now, finally, that is not needed.
 
  • Like
Reactions: G4fanboy

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
By the way, my port of GHC for PowerPC is in the base now: https://ports.macports.org/port/ghc-ppc-bootstrap/

Caveats:
Rosetta will not work. 10.5.8 and 10A190 should work (for ppc32).
– It is an old version, but the last available from Haskell (and never been in Macports so far).
– You can build GHC 7.6.3 with it, but not anything beyond, unfortunately.
– GHC 7.6.3 requires fixes for PPC in its portfile, to be made available later next month (I have it working, but need extra testing).

If you could install and test the port, please provide a feedback, that will be very helpful.
 
  • Like
Reactions: Mirage256

Mirage256

macrumors newbie
Jul 8, 2022
27
24
Hawaii
Certainly, I'll add it to the list of stuff to build. I'm not very familiar with Haskell though - are there any particular Haskell programs you recommend to try compiling? If you don't have any in mind, I'll see if I can find someone's Project Euler solutions, or maybe some Rosetta Code samples, and see if it works on them.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Certainly, I'll add it to the list of stuff to build. I'm not very familiar with Haskell though - are there any particular Haskell programs you recommend to try compiling? If you don't have any in mind, I'll see if I can find someone's Project Euler solutions, or maybe some Rosetta Code samples, and see if it works on them.

So far I was struggling with fixing Haskell itself for PPC. If you find any good test cases, please update me.

If you are interested, here are two GHC-related threads:

And here is my fix for nhc98: https://trac.macports.org/ticket/64996
This one already in the Macports base, and works for Leopard, 10.6 PPC and apparently Tiger.
 
  • Like
Reactions: Mirage256

Mirage256

macrumors newbie
Jul 8, 2022
27
24
Hawaii
I built the port! I tried out a handful of simple programs, walking through some early sections of Learn You a Haskell as well as some sample Project Euler solutions, and they all worked perfectly, without any issues. I then tried running the GHC 7.0.4 test suite in fast mode, and got these results:

Code:
OVERALL SUMMARY for test run started at Wed Jul 20 21:50:46 HST 2022
    2611 total tests, which gave rise to
   14403 test cases, of which
       0 caused framework failures
   12060 were skipped

    2245 expected passes
      89 expected failures
       0 unexpected passes
       9 unexpected failures

Unexpected failures:
   4850(normal)
   T1969(normal)
   T3294(normal)
   T4113(normal)
   T4801(normal)
   cabal04(normal)
   divbyzero(normal)
   dynHelloWorld(dyn)
   ghci032(ghci)

I don't know enough about Haskell or GHC to know how meaningful the failures are, but at the very least, the vast majority of them completed successfully, so the compiler seems to be working as intended. I can run the full test suite if it would help, though even the fast mode took quite a while, so it's something I'd probably need to run over night.

I noticed that the binaries aren't placed in a PATH location by default, and I had to put some symlinks in ~/bin to allow fish to pick them up. However, given that this is a bootstrap port, I assume that's intentional, since it's meant to build another version of GHC that will actually go (or at least have symlinks) into /opt/local/bin?
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
I built the port! I tried out a handful of simple programs, walking through some early sections of Learn You a Haskell as well as some sample Project Euler solutions, and they all worked perfectly, without any issues. I then tried running the GHC 7.0.4 test suite in fast mode, and got these results:

Code:
OVERALL SUMMARY for test run started at Wed Jul 20 21:50:46 HST 2022
    2611 total tests, which gave rise to
   14403 test cases, of which
       0 caused framework failures
   12060 were skipped

    2245 expected passes
      89 expected failures
       0 unexpected passes
       9 unexpected failures

Unexpected failures:
   4850(normal)
   T1969(normal)
   T3294(normal)
   T4113(normal)
   T4801(normal)
   cabal04(normal)
   divbyzero(normal)
   dynHelloWorld(dyn)
   ghci032(ghci)

I don't know enough about Haskell or GHC to know how meaningful the failures are, but at the very least, the vast majority of them completed successfully, so the compiler seems to be working as intended. I can run the full test suite if it would help, though even the fast mode took quite a while, so it's something I'd probably need to run over night.

I noticed that the binaries aren't placed in a PATH location by default, and I had to put some symlinks in ~/bin to allow fish to pick them up. However, given that this is a bootstrap port, I assume that's intentional, since it's meant to build another version of GHC that will actually go (or at least have symlinks) into /opt/local/bin?

1. Yeah, few test failures are generally normal, especially given that this is an ancient version of GHC on an old OS.

2. My initial idea was to use ghc-ppc-bootstrap to build existing Macports port ghc-bootstrap (which lacks ppc at the moment), updating it to 7.6.3, and then use the latter to build a newer version of GHC, whichever feasible. However the last part failed, there are some bugs in GHC source code, which I dunno how to fix, and upstream won’t bother to.
So the current idea is to update ghc-bootstrap, adding ppc, and leave it at that.
A somewhat separate project is to restore Darwin PPC in the current version of GHC. That will require cross-building from 10.6 Intel, which has also to be fixed in the first place.

I will check the logic ghc-bootstrap uses, we can perhaps borrow that. And yes, placing binaries in opt/local/share is intended (I used that because ghc-bootstrap uses it; alternative may be opt/local/libexec, like it is done for gcc10-bootstrap).
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Some updates of my recent fixes for Macports:

qt4-mac, fixed for Rosetta (and likely 10.6 PPC): https://github.com/macports/macports-ports/commit/d2ee104eb1b87c18238508b6b220d0700a29bb84

qtiplot, been failing across the board for ages, fixed for PPC and Intel: https://github.com/macports/macports-ports/commit/5699ea0b3d9e610e8f8b913b75123141f5cdbf75

rsync, latest version fixed for Rosetta: https://github.com/macports/macports-ports/commit/5a1fbec36fba3b9c35eb265f5eed08bed0ed433f

Akumuli, been forever broken, fixed for Intel and provisionally for PPC: https://github.com/macports/macports-ports/commit/3da501d9ddf1b6cb3a5bc1de6558ffe4f0d0e519
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.