microsoft / microsoft/mimalloc

Musl doesn't support init-exec tls

Open
#644 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

Hi!. We are studying using mimalloc as the malloc for julia. While doing this, we found an error on musl, where if you statically link mimalloc to a shared library, then dlopen it. You get `Error relocating /workspace/mimalloc/build/test.so: __errno_location: initial-exec TLS resolves to dynamic definition in /workspace/mimalloc/build/test.so`.

While the issue is simple enough to solve in our case, just build it with `-DMI_LOCAL_DYNAMIC_TLS=ON` on musl, it would be more correct if the build system detected it was targeting musl and did that automatically.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source file or test. Start by locating the build-system handling of MI_LOCAL_DYNAMIC_TLS and the target-platform detection used for musl. Reproduce the static mimalloc/shared-library dlopen case described, then verify that musl builds select dynamic TLS automatically without requiring the manual option.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.