Opened 3 years ago

Closed 3 years ago

#64587 closed defect (fixed)

MoarVM proposed fix for ppc

Reported by: barracuda156 Owned by: evanmiller (Evan Miller)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: powerpc, snowleopard, rosetta Cc: evanmiller (Evan Miller)
Port: MoarVM

Description

--->  Configuring MoarVM
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_MoarVM/MoarVM/work/MoarVM-2021.07" && /opt/local/bin/perl Configure.pl --prefix=/opt/local --cc=/opt/local/bin/gcc-mp-6 --has-dyncall --has-libatomic_ops --has-libuv 
Welcome to MoarVM!

Configuring native build environment ................... 
Binary file /opt/local/bin/gcc-mp-6 matches
Binary file /opt/local/bin/gcc-mp-6 matches

GNU tools detected, despite this not being a GNU-oriented build.
 Please correct this and retry. See README.markdown for more details.

Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_MoarVM/MoarVM/work/MoarVM-2021.07" && /opt/local/bin/perl Configure.pl --prefix=/opt/local --cc=/opt/local/bin/gcc-mp-6 --has-dyncall --has-libatomic_ops --has-libuv 
Exit code: 255
Error: Failed to configure MoarVM: configure failure: command execution failed

Attachments (1)

main.log (62.4 KB) - added by barracuda156 3 years ago.

Download all attachments as: .zip

Change History (12)

Changed 3 years ago by barracuda156

Attachment: main.log added

comment:1 Changed 3 years ago by evanmiller (Evan Miller)

Cc: evanmiller added

comment:2 Changed 3 years ago by barracuda156

The same happens when trying to use gcc11.

  1. S. I have found the following and will try that: https://github.com/MoarVM/MoarVM/issues/1149

Config error is solved but the build fails on:

:info:build compiling src/platform/malloc_trim.o
:info:build In file included from 3rdparty/mimalloc/src/static.c:17:0:
:info:build 3rdparty/mimalloc/include/mimalloc-internal.h: In function '_mi_ptr_segment':
:info:build 3rdparty/mimalloc/include/mimalloc-internal.h:427:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
:info:build    return (mi_segment_t*)((uintptr_t)p & ~MI_SEGMENT_MASK);
:info:build           ^
:info:build compiling src/moar.o
:info:build In file included from 3rdparty/mimalloc/src/static.c:23:0:
:info:build 3rdparty/mimalloc/src/stats.c: In function 'mi_stat_process_info':
:info:build 3rdparty/mimalloc/src/stats.c:534:31: error: storage size of 'info' isn't known
:info:build    struct mach_task_basic_info info;
:info:build                                ^~~~
:info:build 3rdparty/mimalloc/src/stats.c:535:38: error: 'MACH_TASK_BASIC_INFO_COUNT' undeclared (first use in this function)
:info:build    mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
:info:build                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build 3rdparty/mimalloc/src/stats.c:535:38: note: each undeclared identifier is reported only once for each function it appears in
:info:build 3rdparty/mimalloc/src/stats.c:536:35: error: 'MACH_TASK_BASIC_INFO' undeclared (first use in this function)
:info:build    if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&info, &infoCount) == KERN_SUCCESS) {
:info:build                                    ^~~~~~~~~~~~~~~~~~~~
:info:build compiling src/platform/posix/mmap.o
:info:build In file included from 3rdparty/mimalloc/src/static.c:24:0:
:info:build 3rdparty/mimalloc/src/random.c: In function 'os_random_buf':
:info:build 3rdparty/mimalloc/src/random.c:198:3: warning: implicit declaration of function 'arc4random_buf' [-Wimplicit-function-declaration]
:info:build    arc4random_buf(buf, buf_len);
:info:build    ^~~~~~~~~~~~~~
:info:build In file included from 3rdparty/mimalloc/src/static.c:29:0:
:info:build 3rdparty/mimalloc/src/segment.c: In function 'mi_tagged_segment_ptr':
:info:build 3rdparty/mimalloc/src/segment.c:1081:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
:info:build    return (mi_segment_t*)(ts & ~MI_TAGGED_MASK);
:info:build           ^
:info:build 3rdparty/mimalloc/src/static.c: At top level:
:info:build cc1: warning: unrecognized command line option '-Wno-logical-op-parentheses'
:info:build In file included from src/moar.h:90:0,
:info:build                  from src/moar.c:2:
:info:build src/core/nativecall.h: In function 'MVM_nativecall_find_thread_context':
:info:build src/platform/threads.h:19:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
:info:build  #define MVM_platform_thread_id() (MVMint64)uv_thread_self()
:info:build                                   ^
:info:build src/core/nativecall.h:146:19: note: in expansion of macro 'MVM_platform_thread_id'
:info:build                    MVM_platform_thread_id());
:info:build                    ^~~~~~~~~~~~~~~~~~~~~~
:info:build make: *** [3rdparty/mimalloc/src/static.o] Error 1
Last edited 3 years ago by barracuda156 (previous) (diff)

comment:3 in reply to:  1 Changed 3 years ago by barracuda156

Replying to evanmiller:

I have fixed it:

36-73% port -v installed moarvm
The following ports are currently installed:
  MoarVM @2022.02_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-03-22T08:10:05+0800'

The following changes are needed for ppc. Add this to portfile:

PortGroup legacysupport 1.0
legacysupport.newest_darwin_requires_legacy 10

if {${os.platform} eq "darwin" && ${os.arch} eq "powerpc"} {
    configure.args-append --no-mimalloc
}

And add this patch:

--- Configure.pl.orig	2021-07-24 18:24:40.000000000 +0800
+++ Configure.pl	2022-03-21 18:14:42.000000000 +0800
@@ -187,20 +187,6 @@
             $gnu_count += 1;
         }
     }
-
-    ## For a GNU toolchain, make sure that they're all GNU.
-    if ($gnu_toolchain && $gnu_count != scalar @check_tools) {
-        print "\nNot all tools in the toolchain are GNU. Please correct this and retry.\n"
-            . "See README.markdown for more details.\n\n";
-        exit -1;
-    }
-
-    ## Otherwise, make sure that none of them are GNU
-    elsif (!$gnu_toolchain && $gnu_count != 0) {
-        print "\nGNU tools detected, despite this not being a GNU-oriented build.\n"
-            ." Please correct this and retry. See README.markdown for more details.\n\n";
-        exit -1;
-    }
 }
 
 # Probe the compiler.

The first addresses a lack of strnlen, arc4random_buf and mimalloc, the latter fixes configure failure.

comment:4 Changed 3 years ago by barracuda156

Summary: MoarVM configure failure for ppc: GNU tools detected, despite this not being a GNU-oriented buildMoarVM proposed fix for ppc

comment:5 Changed 3 years ago by barracuda156

And now I have nqp and rakudo built:

36-73% port -v installed rakudo
The following ports are currently installed:
  rakudo @2022.02_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-03-22T09:02:19+0800'
36-73% port -v installed nqp
The following ports are currently installed:
  nqp @2022.02_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-03-22T08:43:03+0800'

comment:6 Changed 3 years ago by evanmiller (Evan Miller)

Very cool! I will propose the legacysupport stuff first since that affects Intel. Then I'll try your changes on PPC.

comment:7 Changed 3 years ago by evanmiller (Evan Miller)

In c84fd38c39ff621a3fe1086bdaf79141e05c8bef/macports-ports (master):

MoarVM: fix build on Snow Leopard

See: #64587

Credit to @barracuda156

comment:8 in reply to:  6 ; Changed 3 years ago by barracuda156

Replying to evanmiller:

Very cool! I will propose the legacysupport stuff first since that affects Intel. Then I'll try your changes on PPC.

Did it work for you on PPC without a patch to configure?

comment:9 in reply to:  8 ; Changed 3 years ago by evanmiller (Evan Miller)

Replying to barracuda156:

Replying to evanmiller:

Very cool! I will propose the legacysupport stuff first since that affects Intel. Then I'll try your changes on PPC.

Did it work for you on PPC without a patch to configure?

A configure patch is needed for PPC. It is also needed for 10.7/10.8:

https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/83899

I'll see if I can put together a PR this morning.

comment:10 in reply to:  9 Changed 3 years ago by barracuda156

Replying to evanmiller:

Replying to barracuda156:

Replying to evanmiller:

Very cool! I will propose the legacysupport stuff first since that affects Intel. Then I'll try your changes on PPC.

Did it work for you on PPC without a patch to configure?

A configure patch is needed for PPC. It is also needed for 10.7/10.8:

https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/83899

I'll see if I can put together a PR this morning.

Yes, it fails on Leopard otherwise:

--->  Configuring MoarVM
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_MoarVM/MoarVM/work/MoarVM-2021.07" && /opt/local/bin/perl Configure.pl --prefix=/opt/local --cc=/opt/local/bin/gcc-mp-6 --has-dyncall --has-libatomic_ops --has-libuv 
Welcome to MoarVM!

Configuring native build environment ................... 
Binary file /opt/local/bin/gcc-mp-6 matches
Binary file /opt/local/bin/gcc-mp-6 matches

GNU tools detected, despite this not being a GNU-oriented build.
 Please correct this and retry. See README.markdown for more details.

Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_MoarVM/MoarVM/work/MoarVM-2021.07" && /opt/local/bin/perl Configure.pl --prefix=/opt/local --cc=/opt/local/bin/gcc-mp-6 --has-dyncall --has-libatomic_ops --has-libuv 
Exit code: 255
Error: Failed to configure MoarVM: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_MoarVM/MoarVM/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port moarvm failed

comment:11 Changed 3 years ago by evanmiller (Evan Miller)

Owner: set to evanmiller
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.