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

old_printer

macrumors newbie
Apr 14, 2024
7
8
What is the latest version of clang we've successfully built on macports so far?

Edit: on powerpc
 
Last edited:

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
What is the latest version of clang we've successfully built on macports so far?

You mean on ppc? There is no point to build any, they do not work. There is no general advantage either even if they did work: in many cases older systems with gcc perform better than < 10.9 with clangs (if not later).

LLVM and libc++ could be more sensible, but for both the best we got at the moment is 7.x.
 
  • Like
Reactions: old_printer

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
What is the latest version of clang we've successfully built on macports so far?

Edit: on powerpc

To the question itself: I think Ken has built clang-5.0 on 10.5 back then (and concluded it is useless), and the latest which is buildable is arguably Iain’s 7.1.1, but he also says in REAME of the repo that it produces wrong code for PPC.

With this in mind, I never bothered to build these: it will take effort to sort the build out, and in result you get ABI-inconsistent compiler which is unusable, at the very best :)

Iain planned to release llvm-11 with his fixes (maybe clang-11 too, I do not remember exactly), so if that happens, maybe something of utility will be there. This is not something I am ready to deal with on my own.

What can be potentially useful – but gonna require a lot of testing – is switching to libc++ on PowerPC. It will not work out of the box now, but if anyone wants to experiment, you will need the following:
1. Install libcxx-powerpc port. This corresponds to libc++ from llvm-7 with some improvements. So it is pretty old, though it is newer than what Macports installs on 10.6.8 Intel now.
2. Install https://github.com/barracuda156/macports-ports-powerpc/tree/Snow-PowerPC/lang/gcc-powerpc
Or gcc12, but modify stdlib_flag variant to use libcxx-powerpc headers.
Do not use gcc13, including that from my repo, it will not work now with libc++ (it does not work on Intel either due to a bug in gcc13, which has been fixed since then, but not in Macports).
If you use gcc-powerpc, update Macports base to https://github.com/barracuda156/macports-base-10A190/tree/gcc-powerpc
And pick fixed portgoups from https://github.com/barracuda156/macports-ports-powerpc/tree/gcc_move
3. Modify macports.conf to use libc++.
4. Either make sure to pass flags to link to libc++ and libc++abi where libcxx-powerpc installs them (see portfile) or move those to /opt/local/lib or /usr/lib (make sure you understand what you are doing here).
5. Have fun, you are the first person on the planet to use libc++ on macOS PowerPC :)
(Well, I did verify it can work in a simple isolated case, but AFAIK nobody tried to switch to libc++ for the port-tree as such.)
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Does anyone happen to have a working Macports for ppc64 at the moment? I need to test something. At least gcc7 is required.
 

PowermacSuperuser

macrumors newbie
Jun 25, 2024
15
1
I've been trying to get mono 6 working on my powermac g5 running 10.5/leopard with macports. It fails to compile at the moment, tho I was able to fix some of the compile errors. But I'm stumped on the next problem. I get these weird "Parameter syntax error (parameter 1)" errors, which this post leads me to believe are assembler errors. Would appreciate any help on this.

Here is the patch I made to get past some compile errors. You also have to add
Code:
-I$(top_srcdir)/libatomic_ops/src
compile flag to bdwgc's Makefile for that to build (I didn't include it in the diff because it has a lot of other crap in it).
Code:
--- a/mono/utils/mono-proclib.c    2022-06-14 13:36:03.000000000 -0700
+++ b/mono/utils/mono-proclib.c    2024-06-25 18:58:11.000000000 -0700
@@ -447,6 +447,64 @@
 get_process_stat_item (int pid, int pos, int sum, MonoProcessError *error)
 {
 #if defined(__APPLE__)
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+    double process_user_time = 0, process_system_time = 0;//, process_percent = 0;
+    task_t task;
+
+    if (task_for_pid(mach_task_self(), pid, &task) != KERN_SUCCESS)
+        RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+   
+    struct task_basic_info t_info;
+    mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT, th_count;
+
+    if (task_info(task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count) != KERN_SUCCESS) {
+        mach_port_deallocate (mach_task_self (), task);
+        RET_ERROR (MONO_PROCESS_ERROR_OTHER);
+    }
+   
+    thread_array_t th_array;
+
+    if (task_threads(task, &th_array, &th_count) != KERN_SUCCESS) {
+        mach_port_deallocate (mach_task_self (), task);
+        RET_ERROR (MONO_PROCESS_ERROR_OTHER);
+    }
+       
+    size_t i;
+
+    for (i = 0; i < th_count; i++) {
+        double thread_user_time, thread_system_time;//, thread_percent;
+       
+        struct thread_basic_info th_info;
+        mach_msg_type_number_t th_info_count = THREAD_BASIC_INFO_COUNT;
+        if (thread_info(th_array[i], THREAD_BASIC_INFO, (thread_info_t)&th_info, &th_info_count) == KERN_SUCCESS) {
+            thread_user_time = th_info.user_time.seconds + th_info.user_time.microseconds / 1e6;
+            thread_system_time = th_info.system_time.seconds + th_info.system_time.microseconds / 1e6;
+            //thread_percent = (double)th_info.cpu_usage / TH_USAGE_SCALE;
+           
+            process_user_time += thread_user_time;
+            process_system_time += thread_system_time;
+            //process_percent += th_percent;
+        }
+    }
+   
+    for (i = 0; i < th_count; i++)
+        mach_port_deallocate(task, th_array[i]);
+
+    mach_port_deallocate (mach_task_self (), task);
+
+    process_user_time += t_info.user_time.seconds + t_info.user_time.microseconds / 1e6;
+    process_system_time += t_info.system_time.seconds + t_info.system_time.microseconds / 1e6;
+   
+    if (pos == 10 && sum == TRUE)
+        return (gint64)((process_user_time + process_system_time) * 10000000);
+    else if (pos == 10)
+        return (gint64)(process_user_time * 10000000);
+    else if (pos == 11)
+        return (gint64)(process_system_time * 10000000);
+       
+    return 0;
+
+#else
     double process_user_time = 0, process_system_time = 0;//, process_percent = 0;
     task_t task;
     struct task_basic_info t_info;
@@ -524,6 +582,7 @@
         return (gint64)(process_system_time * 10000000);
        
     return 0;
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
 #else
     char buf [512];
     char *s, *end;
@@ -604,6 +663,34 @@
 get_pid_status_item (int pid, const char *item, MonoProcessError *error, int multiplier)
 {
 #if defined(__APPLE__)
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+    // ignore the multiplier
+   
+    gint64 ret;
+    task_t task;
+    if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+        RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+
+    struct task_basic_info t_info;
+    mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
+   
+    if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
+        mach_port_deallocate (mach_task_self (), task);
+        RET_ERROR (MONO_PROCESS_ERROR_OTHER);
+    }
+
+    if (strcmp (item, "VmRSS") == 0 || strcmp (item, "VmHWM") == 0)
+        ret = t_info.resident_size;
+    else if (strcmp (item, "VmSize") == 0 || strcmp (item, "VmPeak") == 0)
+        ret = t_info.virtual_size;
+    else if (strcmp (item, "Threads") == 0)
+        ret = th_count;
+
+    mach_port_deallocate (mach_task_self (), task);
+   
+    return ret;
+#else
+
     // ignore the multiplier
    
     gint64 ret;
@@ -664,6 +751,7 @@
         mach_port_deallocate (mach_task_self (), task);
    
     return ret;
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
 #else
     char buf [64];
     char *s;
--- a/mono/utils/mono-threads-mach.c    2022-06-14 13:36:03.000000000 -0700
+++ b/mono/utils/mono-threads-mach.c    2024-06-25 19:09:48.000000000 -0700
@@ -282,9 +282,13 @@
 guint64
 mono_native_thread_os_id_get (void)
 {
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+    return pthread_self (); // ?
+#else // MacOS 10.6 and above.
     uint64_t tid;
     pthread_threadid_np (pthread_self (), &tid);
     return tid;
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
 }
 
 #else
--- a/mono/utils/mono-threads.c    2022-06-14 13:36:03.000000000 -0700
+++ b/mono/utils/mono-threads.c    2024-06-25 18:58:11.000000000 -0700
@@ -292,10 +292,10 @@
 
     FOREACH_THREAD_SAFE_ALL (info) {
 #ifdef TARGET_MACH
-        char thread_name [256] = { 0 };
-        pthread_getname_np (mono_thread_info_get_tid (info), thread_name, 255);
+        //char thread_name [256] = { 0 };
+        //pthread_getname_np (mono_thread_info_get_tid (info), thread_name, 255);
 
-


Here are the final lines of my macports log:

Code:
:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mono/mono/work/mono-6.12.0.182/mono/metadata'
:info:build   CC       libmonoruntimesgen_la-sgen-stw.lo
:info:build {standard input}:340:Parameter syntax error (parameter 1)
:info:build {standard input}:341:Parameter syntax error (parameter 1)
:info:build {standard input}:342:Parameter syntax error (parameter 1)
:info:build {standard input}:343:Parameter syntax error (parameter 1)
:info:build {standard input}:344:Parameter syntax error (parameter 1)
:info:build {standard input}:345:Parameter syntax error (parameter 1)
:info:build {standard input}:346:Parameter syntax error (parameter 1)
:info:build {standard input}:347:Parameter syntax error (parameter 1)
:info:build {standard input}:348:Parameter syntax error (parameter 1)
:info:build {standard input}:349:Parameter syntax error (parameter 1)
:info:build {standard input}:350:Parameter syntax error (parameter 1)
:info:build {standard input}:351:Parameter syntax error (parameter 1)
:info:build {standard input}:352:Parameter syntax error (parameter 1)
:info:build {standard input}:353:Parameter syntax error (parameter 1)
:info:build {standard input}:354:Parameter syntax error (parameter 1)
:info:build {standard input}:355:Parameter syntax error (parameter 1)
:info:build {standard input}:356:Parameter syntax error (parameter 1)
:info:build {standard input}:357:Parameter syntax error (parameter 1)
:info:build {standard input}:358:Parameter syntax error (parameter 1)
:info:build {standard input}:359:Parameter syntax error (parameter 1)
:info:build {standard input}:360:Parameter syntax error (parameter 1)
:info:build {standard input}:361:Parameter syntax error (parameter 1)
:info:build {standard input}:362:Parameter syntax error (parameter 1)
:info:build {standard input}:363:Parameter syntax error (parameter 1)
:info:build {standard input}:364:Parameter syntax error (parameter 1)
:info:build {standard input}:365:Parameter syntax error (parameter 1)
:info:build {standard input}:366:Parameter syntax error (parameter 1)
:info:build {standard input}:367:Parameter syntax error (parameter 1)
:info:build {standard input}:368:Parameter syntax error (parameter 1)
:info:build {standard input}:369:Parameter syntax error (parameter 1)
:info:build {standard input}:370:Parameter syntax error (parameter 1)
:info:build {standard input}:371:Parameter syntax error (parameter 1)
:info:build {standard input}:372:Parameter syntax error (parameter 1)
:info:build {standard input}:373:Parameter syntax error (parameter 1)
:info:build {standard input}:374:Parameter syntax error (parameter 1)
:info:build {standard input}:375:Parameter syntax error (parameter 1)
:info:build {standard input}:376:Parameter syntax error (parameter 1)
:info:build {standard input}:377:Parameter syntax error (parameter 1)
:info:build {standard input}:378:Parameter syntax error (parameter 1)
:info:build {standard input}:379:Parameter syntax error (parameter 1)
:info:build {standard input}:380:Parameter syntax error (parameter 1)
:info:build {standard input}:381:Parameter syntax error (parameter 1)
:info:build {standard input}:382:Parameter syntax error (parameter 1)
:info:build {standard input}:383:Parameter syntax error (parameter 1)
:info:build {standard input}:384:Parameter syntax error (parameter 1)
:info:build {standard input}:385:Parameter syntax error (parameter 1)
:info:build {standard input}:386:Parameter syntax error (parameter 1)
:info:build {standard input}:387:Parameter syntax error (parameter 1)
:info:build {standard input}:388:Parameter syntax error (parameter 1)
:info:build {standard input}:389:Parameter syntax error (parameter 1)
:info:build {standard input}:390:Parameter syntax error (parameter 1)
:info:build {standard input}:391:Parameter syntax error (parameter 1)
:info:build {standard input}:392:Parameter syntax error (parameter 1)
:info:build {standard input}:393:Parameter syntax error (parameter 1)
:info:build {standard input}:394:Parameter syntax error (parameter 1)
:info:build {standard input}:395:Parameter syntax error (parameter 1)
:info:build {standard input}:396:Parameter syntax error (parameter 1)
:info:build {standard input}:397:Parameter syntax error (parameter 1)
:info:build {standard input}:398:Parameter syntax error (parameter 1)
:info:build {standard input}:399:Parameter syntax error (parameter 1)
:info:build {standard input}:400:Parameter syntax error (parameter 1)
:info:build {standard input}:401:Parameter syntax error (parameter 1)
:info:build {standard input}:402:Parameter syntax error (parameter 1)
:info:build {standard input}:403:Parameter syntax error (parameter 1)
:info:build {standard input}:404:Parameter syntax error (parameter 1)
:info:build {standard input}:405:Parameter syntax error (parameter 1)
:info:build make[3]: *** [libmonoruntimesgen_la-sgen-stw.lo] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mono/mono/work/mono-6.12.0.182/mono/metadata'
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
I've been trying to get mono 6 working on my powermac g5 running 10.5/leopard with macports. It fails to compile at the moment, tho I was able to fix some of the compile errors. But I'm stumped on the next problem. I get these weird "Parameter syntax error (parameter 1)" errors, which this post leads me to believe are assembler errors. Would appreciate any help on this.

Here is the patch I made to get past some compile errors. You also have to add
Code:
-I$(top_srcdir)/libatomic_ops/src
compile flag to bdwgc's Makefile for that to build (I didn't include it in the diff because it has a lot of other crap in it).
Code:
--- a/mono/utils/mono-proclib.c    2022-06-14 13:36:03.000000000 -0700
+++ b/mono/utils/mono-proclib.c    2024-06-25 18:58:11.000000000 -0700
@@ -447,6 +447,64 @@
 get_process_stat_item (int pid, int pos, int sum, MonoProcessError *error)
 {
 #if defined(__APPLE__)
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+    double process_user_time = 0, process_system_time = 0;//, process_percent = 0;
+    task_t task;
+
+    if (task_for_pid(mach_task_self(), pid, &task) != KERN_SUCCESS)
+        RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+  
+    struct task_basic_info t_info;
+    mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT, th_count;
+
+    if (task_info(task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count) != KERN_SUCCESS) {
+        mach_port_deallocate (mach_task_self (), task);
+        RET_ERROR (MONO_PROCESS_ERROR_OTHER);
+    }
+  
+    thread_array_t th_array;
+
+    if (task_threads(task, &th_array, &th_count) != KERN_SUCCESS) {
+        mach_port_deallocate (mach_task_self (), task);
+        RET_ERROR (MONO_PROCESS_ERROR_OTHER);
+    }
+      
+    size_t i;
+
+    for (i = 0; i < th_count; i++) {
+        double thread_user_time, thread_system_time;//, thread_percent;
+      
+        struct thread_basic_info th_info;
+        mach_msg_type_number_t th_info_count = THREAD_BASIC_INFO_COUNT;
+        if (thread_info(th_array[i], THREAD_BASIC_INFO, (thread_info_t)&th_info, &th_info_count) == KERN_SUCCESS) {
+            thread_user_time = th_info.user_time.seconds + th_info.user_time.microseconds / 1e6;
+            thread_system_time = th_info.system_time.seconds + th_info.system_time.microseconds / 1e6;
+            //thread_percent = (double)th_info.cpu_usage / TH_USAGE_SCALE;
+          
+            process_user_time += thread_user_time;
+            process_system_time += thread_system_time;
+            //process_percent += th_percent;
+        }
+    }
+  
+    for (i = 0; i < th_count; i++)
+        mach_port_deallocate(task, th_array[i]);
+
+    mach_port_deallocate (mach_task_self (), task);
+
+    process_user_time += t_info.user_time.seconds + t_info.user_time.microseconds / 1e6;
+    process_system_time += t_info.system_time.seconds + t_info.system_time.microseconds / 1e6;
+  
+    if (pos == 10 && sum == TRUE)
+        return (gint64)((process_user_time + process_system_time) * 10000000);
+    else if (pos == 10)
+        return (gint64)(process_user_time * 10000000);
+    else if (pos == 11)
+        return (gint64)(process_system_time * 10000000);
+      
+    return 0;
+
+#else
     double process_user_time = 0, process_system_time = 0;//, process_percent = 0;
     task_t task;
     struct task_basic_info t_info;
@@ -524,6 +582,7 @@
         return (gint64)(process_system_time * 10000000);
       
     return 0;
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
 #else
     char buf [512];
     char *s, *end;
@@ -604,6 +663,34 @@
 get_pid_status_item (int pid, const char *item, MonoProcessError *error, int multiplier)
 {
 #if defined(__APPLE__)
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+    // ignore the multiplier
+  
+    gint64 ret;
+    task_t task;
+    if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+        RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+
+    struct task_basic_info t_info;
+    mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
+  
+    if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
+        mach_port_deallocate (mach_task_self (), task);
+        RET_ERROR (MONO_PROCESS_ERROR_OTHER);
+    }
+
+    if (strcmp (item, "VmRSS") == 0 || strcmp (item, "VmHWM") == 0)
+        ret = t_info.resident_size;
+    else if (strcmp (item, "VmSize") == 0 || strcmp (item, "VmPeak") == 0)
+        ret = t_info.virtual_size;
+    else if (strcmp (item, "Threads") == 0)
+        ret = th_count;
+
+    mach_port_deallocate (mach_task_self (), task);
+  
+    return ret;
+#else
+
     // ignore the multiplier
   
     gint64 ret;
@@ -664,6 +751,7 @@
         mach_port_deallocate (mach_task_self (), task);
   
     return ret;
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
 #else
     char buf [64];
     char *s;
--- a/mono/utils/mono-threads-mach.c    2022-06-14 13:36:03.000000000 -0700
+++ b/mono/utils/mono-threads-mach.c    2024-06-25 19:09:48.000000000 -0700
@@ -282,9 +282,13 @@
 guint64
 mono_native_thread_os_id_get (void)
 {
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+    return pthread_self (); // ?
+#else // MacOS 10.6 and above.
     uint64_t tid;
     pthread_threadid_np (pthread_self (), &tid);
     return tid;
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
 }
 
 #else
--- a/mono/utils/mono-threads.c    2022-06-14 13:36:03.000000000 -0700
+++ b/mono/utils/mono-threads.c    2024-06-25 18:58:11.000000000 -0700
@@ -292,10 +292,10 @@
 
     FOREACH_THREAD_SAFE_ALL (info) {
 #ifdef TARGET_MACH
-        char thread_name [256] = { 0 };
-        pthread_getname_np (mono_thread_info_get_tid (info), thread_name, 255);
+        //char thread_name [256] = { 0 };
+        //pthread_getname_np (mono_thread_info_get_tid (info), thread_name, 255);
 
-


Here are the final lines of my macports log:

Code:
:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mono/mono/work/mono-6.12.0.182/mono/metadata'
:info:build   CC       libmonoruntimesgen_la-sgen-stw.lo
:info:build {standard input}:340:Parameter syntax error (parameter 1)
:info:build {standard input}:341:Parameter syntax error (parameter 1)
:info:build {standard input}:342:Parameter syntax error (parameter 1)
:info:build {standard input}:343:Parameter syntax error (parameter 1)
:info:build {standard input}:344:Parameter syntax error (parameter 1)
:info:build {standard input}:345:Parameter syntax error (parameter 1)
:info:build {standard input}:346:Parameter syntax error (parameter 1)
:info:build {standard input}:347:Parameter syntax error (parameter 1)
:info:build {standard input}:348:Parameter syntax error (parameter 1)
:info:build {standard input}:349:Parameter syntax error (parameter 1)
:info:build {standard input}:350:Parameter syntax error (parameter 1)
:info:build {standard input}:351:Parameter syntax error (parameter 1)
:info:build {standard input}:352:Parameter syntax error (parameter 1)
:info:build {standard input}:353:Parameter syntax error (parameter 1)
:info:build {standard input}:354:Parameter syntax error (parameter 1)
:info:build {standard input}:355:Parameter syntax error (parameter 1)
:info:build {standard input}:356:Parameter syntax error (parameter 1)
:info:build {standard input}:357:Parameter syntax error (parameter 1)
:info:build {standard input}:358:Parameter syntax error (parameter 1)
:info:build {standard input}:359:Parameter syntax error (parameter 1)
:info:build {standard input}:360:Parameter syntax error (parameter 1)
:info:build {standard input}:361:Parameter syntax error (parameter 1)
:info:build {standard input}:362:Parameter syntax error (parameter 1)
:info:build {standard input}:363:Parameter syntax error (parameter 1)
:info:build {standard input}:364:Parameter syntax error (parameter 1)
:info:build {standard input}:365:Parameter syntax error (parameter 1)
:info:build {standard input}:366:Parameter syntax error (parameter 1)
:info:build {standard input}:367:Parameter syntax error (parameter 1)
:info:build {standard input}:368:Parameter syntax error (parameter 1)
:info:build {standard input}:369:Parameter syntax error (parameter 1)
:info:build {standard input}:370:Parameter syntax error (parameter 1)
:info:build {standard input}:371:Parameter syntax error (parameter 1)
:info:build {standard input}:372:Parameter syntax error (parameter 1)
:info:build {standard input}:373:Parameter syntax error (parameter 1)
:info:build {standard input}:374:Parameter syntax error (parameter 1)
:info:build {standard input}:375:Parameter syntax error (parameter 1)
:info:build {standard input}:376:Parameter syntax error (parameter 1)
:info:build {standard input}:377:Parameter syntax error (parameter 1)
:info:build {standard input}:378:Parameter syntax error (parameter 1)
:info:build {standard input}:379:Parameter syntax error (parameter 1)
:info:build {standard input}:380:Parameter syntax error (parameter 1)
:info:build {standard input}:381:Parameter syntax error (parameter 1)
:info:build {standard input}:382:Parameter syntax error (parameter 1)
:info:build {standard input}:383:Parameter syntax error (parameter 1)
:info:build {standard input}:384:Parameter syntax error (parameter 1)
:info:build {standard input}:385:Parameter syntax error (parameter 1)
:info:build {standard input}:386:Parameter syntax error (parameter 1)
:info:build {standard input}:387:Parameter syntax error (parameter 1)
:info:build {standard input}:388:Parameter syntax error (parameter 1)
:info:build {standard input}:389:Parameter syntax error (parameter 1)
:info:build {standard input}:390:Parameter syntax error (parameter 1)
:info:build {standard input}:391:Parameter syntax error (parameter 1)
:info:build {standard input}:392:Parameter syntax error (parameter 1)
:info:build {standard input}:393:Parameter syntax error (parameter 1)
:info:build {standard input}:394:Parameter syntax error (parameter 1)
:info:build {standard input}:395:Parameter syntax error (parameter 1)
:info:build {standard input}:396:Parameter syntax error (parameter 1)
:info:build {standard input}:397:Parameter syntax error (parameter 1)
:info:build {standard input}:398:Parameter syntax error (parameter 1)
:info:build {standard input}:399:Parameter syntax error (parameter 1)
:info:build {standard input}:400:Parameter syntax error (parameter 1)
:info:build {standard input}:401:Parameter syntax error (parameter 1)
:info:build {standard input}:402:Parameter syntax error (parameter 1)
:info:build {standard input}:403:Parameter syntax error (parameter 1)
:info:build {standard input}:404:Parameter syntax error (parameter 1)
:info:build {standard input}:405:Parameter syntax error (parameter 1)
:info:build make[3]: *** [libmonoruntimesgen_la-sgen-stw.lo] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_mono/mono/work/mono-6.12.0.182/mono/metadata'

You have seen my fixes for Mono, right?

However, it does not build with those still LOL. I think they are needed, we just need to fix something else.

P. S. Re your patch: `pthread_threadid_np` is unavailable on PowerPC in general (including 10.6.8), so should be excluded accordingly. `pthread_getname_np` should be available in 10.6 ppc/Rosetta (though may or may not work correctly, from experience).
 

PowermacSuperuser

macrumors newbie
Jun 25, 2024
15
1
You have seen my fixes for Mono, right?

However, it does not build with those still LOL. I think they are needed, we just need to fix something else.

P. S. Re your patch: `pthread_threadid_np` is unavailable on PowerPC in general (including 10.6.8), so should be excluded accordingly. `pthread_getname_np` should be available in 10.6 ppc/Rosetta (though may or may not work correctly, from experience).
... I searched google several times for mono on powerpc macs and got nothing... thanks for showing me this! I'll investigate to see what I can do.
 

Jazzzny

macrumors regular
Mar 23, 2021
122
243
I'm pretty sure that any line containing "{standard input}" is referring to inline assembly. I've had issues where software defaulted to x86 assembly on PPC, which lead to illegal assembly syntax (and compiler errors that looked like that).
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
I'm pretty sure that any line containing "{standard input}" is referring to inline assembly. I've had issues where software defaulted to x86 assembly on PPC, which lead to illegal assembly syntax (and compiler errors that looked like that).

It is likely a broken `mono/utils/mono-context.h` which uses unprefixed register numbers (fixed in my branch).
Or somewhere else the same silly error.
 

PowermacSuperuser

macrumors newbie
Jun 25, 2024
15
1
To make building easier how do you build with Macport's legacysupport without building with macports/portfile? Is there a way I can get autogen to find it? I checked the github page and the portfiles tutorial and didn't see anything.
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
To make building easier how do you build with Macport's legacysupport without building with macports/portfile? Is there a way I can get autogen to find it? I checked the github page and the portfiles tutorial and didn't see anything.

Does it not work to just pass flags to the compiler? I see no reason why something which works inside MacPorts won’t work outside it, provided you replicate the needed settings manually.
Fancy codes sits in the portgroup: https://github.com/barracuda156/mac...resources/port1.0/group/legacysupport-1.1.tcl

But simply passing cppflag and ldflag will normally do.
 

Jazzzny

macrumors regular
Mar 23, 2021
122
243
c++ flags
-isystem/opt/local/include/LegacySupport
ld flags
-lMacportsLegacySupport -L/opt/local/lib

This works fine outside of the MacPorts environment.
 

PowermacSuperuser

macrumors newbie
Jun 25, 2024
15
1
Thanks. I had assumed macports was doing some type of black magic with the autotools.

I applied my changes and and it got stuck at the same point: sgen-stw.c where I got these errors:

Code:
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3295:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3296:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3297:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3298:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3299:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3300:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3301:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3302:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3303:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3304:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3305:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3306:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3307:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3308:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3309:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3310:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3311:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3312:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3313:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3314:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3315:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3316:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3317:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3318:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3319:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3320:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3321:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3322:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3323:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3324:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3325:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3326:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3327:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3328:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3329:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3330:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3331:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3332:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3333:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3334:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3335:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3336:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3337:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3338:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3339:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3340:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3341:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3342:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3343:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3344:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3345:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3346:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3347:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3348:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3349:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3350:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3351:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3352:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3353:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3354:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3355:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3356:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3357:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3358:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3359:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3360:Parameter syntax error (parameter 1)

So I had gcc output assembly for sgen-stw.c and I got the attached file. Of note is:

Code:
stw 1, 4(r2)
stw 0, 4*0+8(r2)
stw 1, 4*1+8(r2)
stw 2, 4*2+8(r2)
stw 3, 4*3+8(r2)
stw 4, 4*4+8(r2)
stw 5, 4*5+8(r2)
stw 6, 4*6+8(r2)
stw 7, 4*7+8(r2)
stw 8, 4*8+8(r2)
stw 9, 4*9+8(r2)
stw 10, 4*10+8(r2)
stw 11, 4*11+8(r2)
stw 12, 4*12+8(r2)
stw 13, 4*13+8(r2)
stw 14, 4*14+8(r2)
stw 15, 4*15+8(r2)
stw 16, 4*16+8(r2)
stw 17, 4*17+8(r2)
stw 18, 4*18+8(r2)
stw 19, 4*19+8(r2)
stw 20, 4*20+8(r2)
stw 21, 4*21+8(r2)
stw 22, 4*22+8(r2)
stw 23, 4*23+8(r2)
stw 24, 4*24+8(r2)
stw 25, 4*25+8(r2)
stw 26, 4*26+8(r2)
stw 27, 4*27+8(r2)
stw 28, 4*28+8(r2)
stw 29, 4*29+8(r2)
stw 30, 4*30+8(r2)
stw 31, 4*31+8(r2)

The other
Code:
stw
's in file look like this:
Code:
    stw r0,8(r1)
where the first argument has an 'r'. So I guess the assembly format is incorrect for this assembler? I can't imagine gcc is generating those lines, so probably there's inline assembly that's wrong (probably assumes a different assembler for ppc?).

Time for me to learn assembly. I've got my weeked cut out for me!
 

Attachments

  • sgen-stw.s.txt
    651.1 KB · Views: 19

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Thanks. I had assumed macports was doing some type of black magic with the autotools.

I applied my changes and and it got stuck at the same point: sgen-stw.c where I got these errors:

Code:
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3295:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3296:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3297:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3298:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3299:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3300:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3301:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3302:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3303:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3304:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3305:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3306:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3307:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3308:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3309:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3310:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3311:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3312:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3313:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3314:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3315:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3316:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3317:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3318:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3319:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3320:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3321:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3322:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3323:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3324:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3325:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3326:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3327:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3328:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3329:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3330:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3331:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3332:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3333:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3334:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3335:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3336:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3337:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3338:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3339:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3340:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3341:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3342:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3343:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3344:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3345:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3346:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3347:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3348:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3349:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3350:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3351:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3352:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3353:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3354:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3355:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3356:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3357:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3358:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3359:Parameter syntax error (parameter 1)
/var/folders/k2/k2nLA8q5GWCFggSE5TzuDk+++TI/-Tmp-//ccducw8N.s:3360:Parameter syntax error (parameter 1)

So I had gcc output assembly for sgen-stw.c and I got the attached file. Of note is:

Code:
stw 1, 4(r2)
stw 0, 4*0+8(r2)
stw 1, 4*1+8(r2)
stw 2, 4*2+8(r2)
stw 3, 4*3+8(r2)
stw 4, 4*4+8(r2)
stw 5, 4*5+8(r2)
stw 6, 4*6+8(r2)
stw 7, 4*7+8(r2)
stw 8, 4*8+8(r2)
stw 9, 4*9+8(r2)
stw 10, 4*10+8(r2)
stw 11, 4*11+8(r2)
stw 12, 4*12+8(r2)
stw 13, 4*13+8(r2)
stw 14, 4*14+8(r2)
stw 15, 4*15+8(r2)
stw 16, 4*16+8(r2)
stw 17, 4*17+8(r2)
stw 18, 4*18+8(r2)
stw 19, 4*19+8(r2)
stw 20, 4*20+8(r2)
stw 21, 4*21+8(r2)
stw 22, 4*22+8(r2)
stw 23, 4*23+8(r2)
stw 24, 4*24+8(r2)
stw 25, 4*25+8(r2)
stw 26, 4*26+8(r2)
stw 27, 4*27+8(r2)
stw 28, 4*28+8(r2)
stw 29, 4*29+8(r2)
stw 30, 4*30+8(r2)
stw 31, 4*31+8(r2)

The other
Code:
stw
's in file look like this:
Code:
    stw r0,8(r1)
where the first argument has an 'r'. So I guess the assembly format is incorrect for this assembler? I can't imagine gcc is generating those lines, so probably there's inline assembly that's wrong (probably assumes a different assembler for ppc?).

Time for me to learn assembly. I've got my weeked cut out for me!

Could you add a link to the exact source file?

Registers must be prefixed, so it should be `stw rX …`.

If something generates non-prefixed register numbers, that should be fixed.

I assume you have used patches from my tree (at least those related to assembler)?
 

PowermacSuperuser

macrumors newbie
Jun 25, 2024
15
1
Could you add a link to the exact source file?

Registers must be prefixed, so it should be `stw rX …`.

If something generates non-prefixed register numbers, that should be fixed.

I assume you have used patches from my tree (at least those related to assembler)?
I should probably not do this in the middle of my lunch break at work... I was using your project on github but I didn't have the right branch selected.

Ok... I tried again with the right branch this time..

Just to see how far the compilation would go I changed


Code:
static void G_GNUC_UNUSED
sgen_client_binary_protocol_empty (gpointer start, size_t size)
{
#if 0
    if (sgen_ptr_in_nursery (start))
        MONO_GC_NURSERY_SWEPT ((mword)start, size);
    else
        MONO_GC_MAJOR_SWEPT ((mword)start, size);
#endif
}

and in


Code:
static void
dump_threads (void)
{
    MonoThreadInfo *cur = mono_thread_info_current ();

    g_async_safe_printf ("STATE CUE CARD: (? means a positive number, usually 1 or 2, * means any number)\n");
    g_async_safe_printf ("\t0x0\t- starting (GOOD, unless the thread is running managed code)\n");
    g_async_safe_printf ("\t0x1\t- detached (GOOD, unless the thread is running managed code)\n");
    g_async_safe_printf ("\t0x2\t- running (BAD, unless it's the gc thread)\n");
    g_async_safe_printf ("\t0x?03\t- async suspended (GOOD)\n");
    g_async_safe_printf ("\t0x?04\t- self suspended (GOOD)\n");
    g_async_safe_printf ("\t0x?05\t- async suspend requested (BAD)\n");
    g_async_safe_printf ("\t0x6\t- blocking (BAD, unless there's no suspend initiator)\n");
    g_async_safe_printf ("\t0x?07\t- blocking async suspended (GOOD)\n");
    g_async_safe_printf ("\t0x?08\t- blocking self suspended (GOOD)\n");
    g_async_safe_printf ("\t0x?09\t- blocking suspend requested (BAD in coop; GOOD in hybrid)\n");

    FOREACH_THREAD_SAFE_ALL (info) {
#ifdef TARGET_MACH
        //char thread_name [256] = { 0 };
        //pthread_getname_np (mono_thread_info_get_tid (info), thread_name, 255);

        //g_async_safe_printf ("--thread %p id %p [%p] (%s) state %x  %s\n", info, (void *) mono_thread_info_get_tid (info), (void*)(size_t)info->native_handle, thread_name, info->thread_state, info == cur ? "GC INITIATOR" : "" );
#else
        g_async_safe_printf ("--thread %p id %p [%p] state %x  %s\n", info, (void *) mono_thread_info_get_tid (info), (void*)(size_t)info->native_handle, info->thread_state, info == cur ? "GC INITIATOR" : "" );
#endif
    } FOREACH_THREAD_SAFE_END
}

And I get this error:
Code:
/bin/sh ../../libtool  --tag=CC   --mode=link /opt/local/bin/gcc-mp-7 -I../.. -I../../mono/eglib -I../../mono/eglib     -fvisibility=hidden  -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -I/opt/local/include/LegacySupport -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wno-format-zero-length -Wc++-compat -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Werror=incompatible-pointer-types -Werror=return-type -Werror-implicit-function-declaration    -framework CoreFoundation -framework Foundation  -L/opt/local/lib -lMacportsLegacySupport -latomic -Wl,-bind_at_load -o mono-boehm  libmain_a-main.o libmini.la libmono-ee-interp.la libmono-dbg.la ../../mono/metadata/libmonoruntime.la ../../mono/utils/libmonoutils.la ../../mono/eglib/libeglib.la ../../external/bdwgc/libgc.la ../../mono/eglib/libeglib.la     -lm  -lpthread
libtool: link: /opt/local/bin/gcc-mp-7 -I../.. -I../../mono/eglib -I../../mono/eglib -fvisibility=hidden -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -I/opt/local/include/LegacySupport -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wno-format-zero-length -Wc++-compat -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Werror=incompatible-pointer-types -Werror=return-type -Werror-implicit-function-declaration -Wl,-bind_at_load -o mono-boehm libmain_a-main.o  -framework CoreFoundation -framework Foundation -L/opt/local/lib ./.libs/libmini.a ./.libs/libmono-ee-interp.a ./.libs/libmono-dbg.a ../../mono/metadata/.libs/libmonoruntime.a -lz ../../mono/utils/.libs/libmonoutils.a ../../external/bdwgc/.libs/libgc.a ../../mono/eglib/.libs/libeglib.a -lMacportsLegacySupport /opt/local/lib/gcc7/libatomic.dylib -lm -lpthread -pthread
error: Could not compile reconstructed dtrace script:

typedef int uintptr_t;

provider mono {
    probe ves__init__begin();
    probe ves__init__end();
    probe gc__world__stop__begin();
    probe gc__world__stop__end();
    probe gc__world__restart__begin(int);
    probe gc__world__restart__end(int);
    probe gc__begin(int);
    probe gc__end(int);
    probe gc__finalize__invoke(uintptr_t,uintptr_t,char *,char *);
    probe method__compile__begin(char *,char *,char *);
    probe method__compile__end(char *,char *,char *,int);
};

#pragma D attributes EVOLVING/EVOLVING/COMMON provider mono provider
#pragma D attributes PRIVATE/PRIVATE/UNKNOWN provider mono module
#pragma D attributes PRIVATE/PRIVATE/UNKNOWN provider mono function
#pragma D attributes EVOLVING/EVOLVING/COMMON provider mono name
#pragma D attributes EVOLVING/EVOLVING/COMMON provider mono args


ld: error creating dtrace DOF section
collect2: error: ld returned 1 exit status
make[4]: *** [mono-boehm] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

So it seems like a dtrace issue. The commented out lines in sgen-client-mono.h are two macros that are defined in mono-dtrace.h as:
Code:
#define    MONO_GC_MAJOR_SWEPT(arg0, arg1) \
{ \
    __asm__ volatile(".reference " MONO_TYPEDEFS); \
    __dtrace_probe$mono$gc__major__swept$v1$75696e747074725f74$75696e747074725f74(arg0, arg1); \
    __asm__ volatile(".reference " MONO_STABILITY); \
}


#define    MONO_GC_NURSERY_SWEPT(arg0, arg1) \
{ \
    __asm__ volatile(".reference " MONO_TYPEDEFS); \
    __dtrace_probe$mono$gc__nursery__swept$v1$75696e747074725f74$75696e747074725f74(arg0, arg1); \
    __asm__ volatile(".reference " MONO_STABILITY); \
}



and in https://github.com/barracuda156/mono/blob/ppc-fix1/mono/utils/dtrace.h as:
Code:
#define MONO_GC_NURSERY_SWEPT(addr,len)
#define MONO_GC_NURSERY_SWEPT_ENABLED()    (0)


#define MONO_GC_MAJOR_SWEPT(addr,len)
#define MONO_GC_MAJOR_SWEPT_ENABLED()    (0)

If those lines aren't commented out I get this error:

Code:
/bin/sh ../../libtool  --tag=CC   --mode=compile /opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../mono -I../../external/bdwgc/include -I../../external/bdwgc/libatomic_ops/src -I../../mono/eglib -I../../mono/eglib -fvisibility=hidden -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes  -D_THREAD_SAFE -DGC_MACOSX_THREADS -DUSE_MMAP -DUSE_MUNMAP -g  -D__mono_ppc__ -DUSE_COMPILER_TLS -DHAVE_SGEN_GC -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -I/opt/local/include/LegacySupport -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wno-format-zero-length -Wc++-compat -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Werror=incompatible-pointer-types -Werror=return-type -Werror-implicit-function-declaration  -MT libmonosgen_la-sgen-alloc.lo -MD -MP -MF .deps/libmonosgen_la-sgen-alloc.Tpo -c -o libmonosgen_la-sgen-alloc.lo `test -f 'sgen-alloc.c' || echo './'`sgen-alloc.c
libtool: compile:  /opt/local/bin/gcc-mp-7 -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../mono -I../../external/bdwgc/include -I../../external/bdwgc/libatomic_ops/src -I../../mono/eglib -I../../mono/eglib -fvisibility=hidden -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -D_THREAD_SAFE -DGC_MACOSX_THREADS -DUSE_MMAP -DUSE_MUNMAP -g -D__mono_ppc__ -DUSE_COMPILER_TLS -DHAVE_SGEN_GC -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -I/opt/local/include/LegacySupport -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wno-format-zero-length -Wc++-compat -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Werror=incompatible-pointer-types -Werror=return-type -Werror-implicit-function-declaration -MT libmonosgen_la-sgen-alloc.lo -MD -MP -MF .deps/libmonosgen_la-sgen-alloc.Tpo -c sgen-alloc.c  -fno-common -DPIC -o .libs/libmonosgen_la-sgen-alloc.o
In file included from ../../mono/utils/dtrace.h:15:0,
                 from ../../mono/metadata/sgen-client-mono.h:62,
                 from ../../mono/sgen/sgen-gc.h:847,
                 from sgen-alloc.c:34:
../../mono/metadata/sgen-client-mono.h: In function 'mono_binary_protocol_alloc_generic':
../../mono/metadata/sgen-client-mono.h:390:49: warning: passing argument 3 of '__dtrace_probe$mono$gc__nursery__obj__alloc$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    MONO_GC_NURSERY_OBJ_ALLOC ((mword)obj, size, name_space, name);
                                                 ^
../../mono/utils/mono-dtrace.h:109:125: note: in definition of macro 'MONO_GC_NURSERY_OBJ_ALLOC'
  __dtrace_probe$mono$gc__nursery__obj__alloc$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                             ^~~~
../../mono/utils/mono-dtrace.h:274:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__nursery__obj__alloc$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:390:61: warning: passing argument 4 of '__dtrace_probe$mono$gc__nursery__obj__alloc$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    MONO_GC_NURSERY_OBJ_ALLOC ((mword)obj, size, name_space, name);
                                                             ^
../../mono/utils/mono-dtrace.h:109:131: note: in definition of macro 'MONO_GC_NURSERY_OBJ_ALLOC'
  __dtrace_probe$mono$gc__nursery__obj__alloc$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                                   ^~~~
../../mono/utils/mono-dtrace.h:274:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__nursery__obj__alloc$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:394:54: warning: passing argument 3 of '__dtrace_probe$mono$gc__major__obj__alloc__large$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     MONO_GC_MAJOR_OBJ_ALLOC_LARGE ((mword)obj, size, name_space, name);
                                                      ^
../../mono/utils/mono-dtrace.h:85:130: note: in definition of macro 'MONO_GC_MAJOR_OBJ_ALLOC_LARGE'
  __dtrace_probe$mono$gc__major__obj__alloc__large$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                                  ^~~~
../../mono/utils/mono-dtrace.h:268:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__major__obj__alloc__large$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:394:66: warning: passing argument 4 of '__dtrace_probe$mono$gc__major__obj__alloc__large$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     MONO_GC_MAJOR_OBJ_ALLOC_LARGE ((mword)obj, size, name_space, name);
                                                                  ^
../../mono/utils/mono-dtrace.h:85:136: note: in definition of macro 'MONO_GC_MAJOR_OBJ_ALLOC_LARGE'
  __dtrace_probe$mono$gc__major__obj__alloc__large$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                                        ^~~~
../../mono/utils/mono-dtrace.h:268:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__major__obj__alloc__large$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:396:54: warning: passing argument 3 of '__dtrace_probe$mono$gc__major__obj__alloc__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    MONO_GC_MAJOR_OBJ_ALLOC_PINNED ((mword)obj, size, name_space, name);
                                                      ^
../../mono/utils/mono-dtrace.h:93:131: note: in definition of macro 'MONO_GC_MAJOR_OBJ_ALLOC_PINNED'
  __dtrace_probe$mono$gc__major__obj__alloc__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                                   ^~~~
../../mono/utils/mono-dtrace.h:270:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__major__obj__alloc__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:396:66: warning: passing argument 4 of '__dtrace_probe$mono$gc__major__obj__alloc__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    MONO_GC_MAJOR_OBJ_ALLOC_PINNED ((mword)obj, size, name_space, name);
                                                                  ^
../../mono/utils/mono-dtrace.h:93:137: note: in definition of macro 'MONO_GC_MAJOR_OBJ_ALLOC_PINNED'
  __dtrace_probe$mono$gc__major__obj__alloc__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                                         ^~~~
../../mono/utils/mono-dtrace.h:270:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__major__obj__alloc__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_alloc_degraded':
../../mono/metadata/sgen-client-mono.h:417:54: warning: passing argument 3 of '__dtrace_probe$mono$gc__major__obj__alloc__degraded$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED ((mword)obj, size, sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable));
                                                      ^
../../mono/utils/mono-dtrace.h:77:133: note: in definition of macro 'MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED'
  __dtrace_probe$mono$gc__major__obj__alloc__degraded$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                                     ^~~~
../../mono/utils/mono-dtrace.h:266:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__major__obj__alloc__degraded$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:417:107: warning: passing argument 4 of '__dtrace_probe$mono$gc__major__obj__alloc__degraded$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED ((mword)obj, size, sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable));
                                                                                                           ^
../../mono/utils/mono-dtrace.h:77:139: note: in definition of macro 'MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED'
  __dtrace_probe$mono$gc__major__obj__alloc__degraded$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                                           ^~~~
../../mono/utils/mono-dtrace.h:266:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__major__obj__alloc__degraded$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_pin':
../../mono/metadata/sgen-client-mono.h:443:5: warning: passing argument 3 of '__dtrace_probe$mono$gc__obj__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable), gen);
     ^
../../mono/utils/mono-dtrace.h:149:124: note: in definition of macro 'MONO_GC_OBJ_PINNED'
  __dtrace_probe$mono$gc__obj__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(arg0, arg1, arg2, arg3, arg4); \
                                                                                                                            ^~~~
../../mono/utils/mono-dtrace.h:284:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__obj__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(uintptr_t, uintptr_t, char *, char *, int);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:443:58: warning: passing argument 4 of '__dtrace_probe$mono$gc__obj__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable), gen);
                                                          ^
../../mono/utils/mono-dtrace.h:149:130: note: in definition of macro 'MONO_GC_OBJ_PINNED'
  __dtrace_probe$mono$gc__obj__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(arg0, arg1, arg2, arg3, arg4); \
                                                                                                                                  ^~~~
../../mono/utils/mono-dtrace.h:284:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__obj__pinned$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(uintptr_t, uintptr_t, char *, char *, int);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_cement':
../../mono/metadata/sgen-client-mono.h:484:5: warning: passing argument 3 of '__dtrace_probe$mono$gc__obj__cemented$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable));
     ^
../../mono/utils/mono-dtrace.h:133:119: note: in definition of macro 'MONO_GC_OBJ_CEMENTED'
  __dtrace_probe$mono$gc__obj__cemented$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                       ^~~~
../../mono/utils/mono-dtrace.h:280:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__obj__cemented$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:484:58: warning: passing argument 4 of '__dtrace_probe$mono$gc__obj__cemented$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable));
                                                          ^
../../mono/utils/mono-dtrace.h:133:125: note: in definition of macro 'MONO_GC_OBJ_CEMENTED'
  __dtrace_probe$mono$gc__obj__cemented$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3); \
                                                                                                                             ^~~~
../../mono/utils/mono-dtrace.h:280:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__obj__cemented$v1$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_copy':
../../mono/metadata/sgen-client-mono.h:496:71: warning: passing argument 6 of '__dtrace_probe$mono$gc__obj__moved$v1$75696e747074725f74$75696e747074725f74$696e74$696e74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   MONO_GC_OBJ_MOVED ((mword)to, (mword)from, dest_gen, src_gen, size, sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable));
                                                                       ^
../../mono/utils/mono-dtrace.h:141:167: note: in definition of macro 'MONO_GC_OBJ_MOVED'
  __dtrace_probe$mono$gc__obj__moved$v1$75696e747074725f74$75696e747074725f74$696e74$696e74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
                                                                                                                                                                       ^~~~
../../mono/utils/mono-dtrace.h:282:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__obj__moved$v1$75696e747074725f74$75696e747074725f74$696e74$696e74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, int, int, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:496:124: warning: passing argument 7 of '__dtrace_probe$mono$gc__obj__moved$v1$75696e747074725f74$75696e747074725f74$696e74$696e74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   MONO_GC_OBJ_MOVED ((mword)to, (mword)from, dest_gen, src_gen, size, sgen_client_vtable_get_namespace ((GCVTable)vtable), sgen_client_vtable_get_name ((GCVTable)vtable));
                                                                                                                            ^
../../mono/utils/mono-dtrace.h:141:173: note: in definition of macro 'MONO_GC_OBJ_MOVED'
  __dtrace_probe$mono$gc__obj__moved$v1$75696e747074725f74$75696e747074725f74$696e74$696e74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
                                                                                                                                                                             ^~~~
../../mono/utils/mono-dtrace.h:282:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__obj__moved$v1$75696e747074725f74$75696e747074725f74$696e74$696e74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, int, int, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_global_remset':
../../mono/metadata/sgen-client-mono.h:507:5: warning: passing argument 4 of '__dtrace_probe$mono$gc__global__remset__add$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     sgen_client_vtable_get_namespace ((GCVTable)value_vtable), sgen_client_vtable_get_name ((GCVTable)value_vtable));
     ^
../../mono/utils/mono-dtrace.h:69:150: note: in definition of macro 'MONO_GC_GLOBAL_REMSET_ADD'
  __dtrace_probe$mono$gc__global__remset__add$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3, arg4); \
                                                                                                                                                      ^~~~
../../mono/utils/mono-dtrace.h:264:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__global__remset__add$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:507:64: warning: passing argument 5 of '__dtrace_probe$mono$gc__global__remset__add$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     sgen_client_vtable_get_namespace ((GCVTable)value_vtable), sgen_client_vtable_get_name ((GCVTable)value_vtable));
                                                                ^
../../mono/utils/mono-dtrace.h:69:156: note: in definition of macro 'MONO_GC_GLOBAL_REMSET_ADD'
  __dtrace_probe$mono$gc__global__remset__add$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(arg0, arg1, arg2, arg3, arg4); \
                                                                                                                                                            ^~~~
../../mono/utils/mono-dtrace.h:264:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__global__remset__add$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a(uintptr_t, uintptr_t, uintptr_t, char *, char *);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_dislink_update':
../../mono/metadata/sgen-client-mono.h:541:5: warning: passing argument 4 of '__dtrace_probe$mono$gc__weak__update$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     obj ? sgen_client_vtable_get_namespace (vt) : NULL,
     ^
../../mono/utils/mono-dtrace.h:181:150: note: in definition of macro 'MONO_GC_WEAK_UPDATE'
  __dtrace_probe$mono$gc__weak__update$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(arg0, arg1, arg2, arg3, arg4, arg5); \
                                                                                                                                                      ^~~~
../../mono/utils/mono-dtrace.h:292:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__weak__update$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(uintptr_t, uintptr_t, uintptr_t, char *, char *, int);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../mono/metadata/sgen-client-mono.h:542:5: warning: passing argument 5 of '__dtrace_probe$mono$gc__weak__update$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     obj ? sgen_client_vtable_get_name (vt) : NULL,
     ^
../../mono/utils/mono-dtrace.h:181:156: note: in definition of macro 'MONO_GC_WEAK_UPDATE'
  __dtrace_probe$mono$gc__weak__update$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(arg0, arg1, arg2, arg3, arg4, arg5); \
                                                                                                                                                            ^~~~
../../mono/utils/mono-dtrace.h:292:13: note: expected 'char *' but argument is of type 'const char *'
 extern void __dtrace_probe$mono$gc__weak__update$v1$75696e747074725f74$75696e747074725f74$75696e747074725f74$63686172202a$63686172202a$696e74(uintptr_t, uintptr_t, uintptr_t, char *, char *, int);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../mono/sgen/sgen-gc.h:847:0,
                 from sgen-alloc.c:34:
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_empty':
../../mono/metadata/sgen-client-mono.h:558:2: error: 'else' without a previous 'if'
  else
  ^~~~
make[3]: *** [libmonosgen_la-sgen-alloc.lo] Error 1
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
I should probably not do this in the middle of my lunch break at work... I was using your project on github but I didn't have the right branch selected.

Ok... I tried again with the right branch this time..

I need to try building it, I remember nothing now about the issue LOL, and perhaps the code changed since then.

I would avoid using gcc7 though, it has issues. gcc13 works fine on PowerPC (MacPorts version), otherwise you could even try gcc upstream.
If you do not want to use MacPorts, then the easy way would be to build gcc10 from Iain’s repo: https://github.com/iains/gcc-10-branch (it is somewhat outdated, but it works fine, I just used it to build gcc15 a few weeks ago).
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
Code:
../../mono/metadata/sgen-client-mono.h: In function 'sgen_client_binary_protocol_empty':
../../mono/metadata/sgen-client-mono.h:558:2: error: 'else' without a previous 'if'
  else
  ^~~~
make[3]: *** [libmonosgen_la-sgen-alloc.lo] Error 1

This looks like a messed-up patch.
 

PowermacSuperuser

macrumors newbie
Jun 25, 2024
15
1
I need to try building it, I remember nothing now about the issue LOL, and perhaps the code changed since then.

I would avoid using gcc7 though, it has issues. gcc13 works fine on PowerPC (MacPorts version), otherwise you could even try gcc upstream.
If you do not want to use MacPorts, then the easy way would be to build gcc10 from Iain’s repo: https://github.com/iains/gcc-10-branch (it is somewhat outdated, but it works fine, I just used it to build gcc15 a few weeks ago).
I just tried building mono with gcc13, just to make sure previous errors aren't the result of a bug in gcc7, and it fails on the exact same step.

Thanks for the advice tho. I was only using gcc7 because macports installed it to build a package, I didn't know such recent gccs still worked on legacy osx.
 

barracuda156

macrumors 68020
Original poster
Sep 3, 2021
2,322
1,534
I just tried building mono with gcc13, just to make sure previous errors aren't the result of a bug in gcc7, and it fails on the exact same step.

Thanks for the advice tho. I was only using gcc7 because macports installed it to build a package, I didn't know such recent gccs still worked on legacy osx.

I dropped gcc7 two years back and using whatever latest version MacPorts has, they work fine and certainly better than gcc7 (there were a number of ppc-specific bugs fixed recently, and fixes were not back-ported to gcc7).
Right now built gcc15 from the current master and running Fortran test suite :)

I will try building Mono over the weekend. I remember it did not build for me earlier but not sure the failure was identical.

For the record, did you change anything as compared to my branch? (I mean, you could also have fixed something which is unfixed there, that will be useful.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.