Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rdparty/mimalloc error: storage size of 'info' isn't known #1688

Open
barracuda156 opened this issue Mar 21, 2022 · 4 comments
Open

3rdparty/mimalloc error: storage size of 'info' isn't known #1688

barracuda156 opened this issue Mar 21, 2022 · 4 comments

Comments

@barracuda156
Copy link
Contributor

I tried to build MoarVM @2022.2 on 10.6, and it fails on the following:

: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
@MasterDuke17
Copy link
Contributor

I guess mimalloc doesn't support 10.6. Until we check for that when running Configure.pl, you can just build with --no-mimalloc (i.e, perl Configure.pl --no-mimalloc for MoarVM, if you're having Rakudo build MoarVM for you you'll need perl Configure.pl --gen-moar --moar-option='--no-mimalloc').

@barracuda156
Copy link
Contributor Author

@MasterDuke17 Thank you. I used that, the build proceeded, but failed here:

/opt/local/bin/perl5.28 build/mk-moar-pc.pl pkgconfig/moar.pc
linking 3rdparty/cmp/libcmp.a
linking 3rdparty/tinymt/libtinymt.a
linking 3rdparty/sha1/libsha1.a
linking 3rdparty/libtommath/libtommath.a
src/strings/shiftjis.c: At top level:
cc1: note: unrecognized command-line option '-Wno-logical-op-parentheses' may have been intended to silence earlier diagnostics
linking libmoar.dylib
Undefined symbols:
  "_arc4random_buf", referenced from:
      _MVM_getrandom_urandom in random.o
  "_strnlen", referenced from:
      _MVM_io_resolve_host_name in syncsocket.o
ld: symbol(s) not found
collect2: error: ld returned 1 exit status
make: *** [libmoar.dylib] Error 1

@MasterDuke17
Copy link
Contributor

Then it looks like MoarVM won't build on 10.6 without some work done. 10.7 will probably be fine if you can upgrade.

@barracuda156
Copy link
Contributor Author

Then it looks like MoarVM won't build on 10.6 without some work done. 10.7 will probably be fine if you can upgrade.

I have built it in fact. Wasted an hour looking for manual solutions just to figure out all I needed was to add legacysupport port group to the port file.

Thank you!

P. S. I cannot upgrade, 10.6 is the last available for PowerPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants