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

Support building with mimalloc crate #32

Open
polarathene opened this issue Nov 21, 2023 · 1 comment
Open

Support building with mimalloc crate #32

polarathene opened this issue Nov 21, 2023 · 1 comment
Assignees

Comments

@polarathene
Copy link
Contributor

polarathene commented Nov 21, 2023

This is extracted from #27 (comment) to track when Eyra has implemented the necessary support for using mimalloc as the global allocator and can successfully build:


mimalloc builds successfully with both -gnu and -musl targets.

However when adding Eyra, the dep to libmimalloc-sys fails to build:

error: linking with `cc` failed: exit status: 1

...

  = note: /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `_mi_fputs':
          static.c:(.text._mi_fputs+0x1d): undefined reference to `stdout'
          /usr/bin/ld: static.c:(.text._mi_fputs+0x29): undefined reference to `stderr'
          /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `mi_vfprintf.part.0':
          static.c:(.text.mi_vfprintf.part.0+0x48): undefined reference to `__vsnprintf_chk'
          /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `mi_printf_amount.constprop.0':
          static.c:(.text.mi_printf_amount.constprop.0+0xa5): undefined reference to `__snprintf_chk'
          /usr/bin/ld: static.c:(.text.mi_printf_amount.constprop.0+0x142): undefined reference to `__snprintf_chk'
          /usr/bin/ld: static.c:(.text.mi_printf_amount.constprop.0+0x172): undefined reference to `__snprintf_chk'
          /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `mi_vfprintf_thread.constprop.0':
          static.c:(.text.mi_vfprintf_thread.constprop.0+0x6b): undefined reference to `__snprintf_chk'
          /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `_mi_prim_numa_node_count':
          static.c:(.text._mi_prim_numa_node_count+0x4d): undefined reference to `__snprintf_chk'
          /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `_mi_prim_process_info':
          static.c:(.text._mi_prim_process_info+0x28): undefined reference to `getrusage'
          /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `_mi_prim_out_stderr':
          static.c:(.text._mi_prim_out_stderr+0x7): undefined reference to `stderr'
          /usr/bin/ld: static.c:(.text._mi_prim_out_stderr+0xf): undefined reference to `fputs'
          /usr/bin/ld: /tmp/rustc5zEoNy/liblibmimalloc_sys-4ddef3846abe8639.rlib(static.o): in function `mi_option_get':
          static.c:(.text.mi_option_get+0x193): undefined reference to `strtol'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link

I'm just reporting this because I encountered it when experimenting with #27 , no actual need for this support any time soon 👍

@sunfishcode
Copy link
Owner

sunfishcode commented Dec 5, 2023

fputs, stdout, stderr, __snprintf_chk, __vsnprintf_chk, are now implemented.

That leaves:

@sunfishcode sunfishcode self-assigned this Dec 30, 2023
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