microsoft / microsoft/mimalloc

Multiple definitions of *alloc when compiling with -static

Open
#243 1 comment 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, I'm compiling using a musl toolchain on Fedora 32. Dynamic linking is no problem, but when I try to link statically with -static, I get the following error on GCC 10.1:

```multiple definition of `malloc'; /data/compiles/x86_64-linux-musl-native/lib/mimalloc-1.6/libmimalloc.a(alloc.c.o):alloc.c:(.text+0x1c0): first defined here```

Is there something I can do about this?

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

Reproduce the static link failure with the musl toolchain and GCC 10.1, then inspect libmimalloc.a(alloc.c.o) and the conflicting malloc definition. Done means establishing a supported way to link statically without the duplicate definition, or documenting that this toolchain combination is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.