# Performance penalty from the Static Linux SDK

**URL:** <https://forums.swift.org/t/performance-penalty-from-the-static-linux-sdk/75003>\
**Category:** Using Swift\
**Tags:** linux, static-sdk\
**Created:** [September 28, 2024, 4:25pm UTC](https://forums.swift.org/t/performance-penalty-from-the-static-linux-sdk/75003 "2024-09-28T16:25:12Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![asdf\_bro](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@asdf\_bro](https://forums.swift.org/u/asdf_bro)\
**Post date:** [October 4, 2024, 5:05pm UTC](https://forums.swift.org/t/performance-penalty-from-the-static-linux-sdk/75003/8 "2024-10-04T17:05:09Z")

</div>

A much simpler solution:

Build `mimalloc` into a single object file, either via `cmake` or `src/static.c` in its repository. Then place it in the root directory of your swift package (next to `Package.swift`) and add `linkerSettings: [.unsafeFlags(["mimalloc.o"])]` to your executable target.

This works for me, but it would be great for the Swift core team to comment on this method. LLVM linker documentation states that object files are linked before library files, in this case, `mimalloc.o` before `libc.a`. The `microsoft/mimalloc` repository also prescribes this method for static overriding.

---

_[View the full topic](https://forums.swift.org/t/performance-penalty-from-the-static-linux-sdk/75003)._
