23
submitted 5 months ago by maf@szmer.info to c/linux@lemmy.ml

Has anybody been able to build a statically linked binary that shows a Vulkan surface? I've put some context around this problem in the video. I understand that the vulkan driver has to be loaded dynamically - so it's more of a question whether a statically built app can reliably load and talk with it. I think it should be possible but haven't actually seen anyone make it work. I'm aware of "static-window9" by Andrew Kelley but sadly it doesn't work any more (at least on my Gentoo machine T_T).

(I'm also aware of AppImages but I don't think they're the "proper" solution to this problem - more like a temporary bandaid - better than Docker but still far from perfect)

top 7 comments
sorted by: hot top controversial new old
[-] bjoern_tantau@swg-empire.de 29 points 5 months ago
[-] merthyr1831@lemmy.ml 7 points 5 months ago

You know it's bad when Linux YouTubers are arguing against Linux ports because Proton is just so much more functional for Linux gamers.

[-] maf@szmer.info 5 points 5 months ago

I'll also add that I'm aware of glibc's stance on dynamic linking from static binaries. I don't buy the whole NSS argument. It's easily solvable by a basic request/response protocol through some local socket. IMO that argument is just a cheap excuse to justify status quo.

[-] tiddy@sh.itjust.works 5 points 5 months ago

Can't see why you dislike appimages, sure not 100% size efficient - but for one off binaries youre probably not spending much time optimizing anyways.

Not that you couldnt make an appimage 2.0 solving all your issues, but we'd just be back to that package manager xkcd all over again

[-] maf@szmer.info 4 points 5 months ago

Oh, I don't dislike them. I love them actually. I just wish that vulkan drivers loved them as much as I do :P

[-] ReversalHatchery@beehaw.org 5 points 5 months ago* (last edited 5 months ago)

Rewrite It In Rust ™, and then it'll work everywhere.

joking of course. you still need different builds for glibc and musl

[-] Ephera@lemmy.ml 4 points 5 months ago* (last edited 5 months ago)

I have no experience with this, but I figured a Rust library might have tried to solve it (static linking is very much the norm here) and I found that ash can statically link the "Vulkan loader". I don't know, what that actually means, for example whether it would still load libxcb at runtime. Might be worth looking into what they do...

See the "Optional linking" section here for their description: https://crates.io/crates/ash#optional-linking

this post was submitted on 15 Apr 2025
23 points (100.0% liked)

Linux

58791 readers
441 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS