# Please provide fully statically linked binaries of CMake

**URL:** https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299
**Category:** Development
**Tags:** os:linux
**Created:** [October 27, 2023, 3:04pm UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299 "2023-10-27T15:04:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![johndoesstuff](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johndoesstuff/32/3978_2.png) [@johndoesstuff](https://discourse.cmake.org/u/johndoesstuff)
#### Post date: [October 27, 2023, 3:04pm UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299/1 "2023-10-27T15:04:35Z")

</div>

Dear CMake team,  
The [CMake binaries for linux](https://github.com/Kitware/CMake/releases/download/v3.27.7/cmake-3.27.7-linux-x86_64.tar.gz) provided on the website have no dependencies except on GLIBC, which is linked dynamically… Is it possible to instead provide linux binaries that are **fully statically linked** to [MUSL](https://musl.libc.org)? Such binaries will work out of the box on both GLIBC and MUSL distros, and also work on distros with a GLIBC that is too old/new.  
**Note:** this goes for all binaries except `cmake-gui` which has other dependencies.  
Thank you.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 29, 2023, 12:06pm UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299/2 "2023-10-29T12:06:31Z")

</div>

This sounds reasonable to me, though I don’t know when it’d get some time invested in it. I assume a Qt-less build is sufficient for these packages?

---

<div class="post-metadata">

### Author: ![johndoesstuff](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johndoesstuff/32/3978_2.png) [@johndoesstuff](https://discourse.cmake.org/u/johndoesstuff)
#### Post date: [October 29, 2023, 3:14pm UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299/3 "2023-10-29T15:14:04Z")

</div>

> This sounds reasonable to me, though I don’t know when it’d get some time invested in it

Thank you, and take all the time you need. FWIW you could cross-compile static musl binaries from any OS using [Zig’s portable Clang wrapper](https://ziglang.org/download/):

```auto
zig cc -target x86_64-linux-musl [COMPILER_OPTIONS] [FILES] ...
zig c++ -target x86_64-linux-musl [COMPILER_OPTIONS] [FILES] ...

```

> I assume a Qt-less build is sufficient for these packages?

Sure. I don’t know if Qt can be statically linked anyway.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 29, 2023, 4:47pm UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299/4 "2023-10-29T16:47:45Z")

</div>

We do build our Qt statically, but I’m not sure how much it relies on glibc-isms (probably few if any given its portability story, but worth a quick investigation by someone on a musl-based deployment).

---

<div class="post-metadata">

### Author: ![johndoesstuff](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johndoesstuff/32/3978_2.png) [@johndoesstuff](https://discourse.cmake.org/u/johndoesstuff)
#### Post date: [November 2, 2023, 7:56pm UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299/5 "2023-11-02T19:56:33Z")

</div>

Void Linux (musl version) does offer working copies of Qt 5 and Qt 6, with patches:

[void-packages/tree/master/srcpkgs/qt5](https://github.com/void-linux/void-packages/tree/master/srcpkgs/qt5) (see also: /qt6-base)

There are multiple packages for both versions, the links above are only for the “base” package. Other qt5-\* and qt6-\* packages are available on the [Void packages page](https://voidlinux.org/packages/?arch=x86_64-musl&q=qt5).

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 2, 2023, 9:12pm UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299/6 "2023-11-02T21:12:27Z")

</div>

Thanks. Can you please submit an issue. I don’t know when it’d get worked on, but the issue tracker is a better place for the request now that we’ve hashed it out a bit here.

---

<div class="post-metadata">

### Author: ![johndoesstuff](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johndoesstuff/32/3978_2.png) [@johndoesstuff](https://discourse.cmake.org/u/johndoesstuff)
#### Post date: [November 3, 2023, 9:27am UTC](https://discourse.cmake.org/t/please-provide-fully-statically-linked-binaries-of-cmake/9299/7 "2023-11-03T09:27:34Z")

</div>

> please submit an issue

Done.

[https://gitlab.kitware.com/cmake/cmake/-/issues/25387](https://gitlab.kitware.com/cmake/cmake/-/issues/25387)
