[GH-ISSUE #91] build: add support for musl libc #54

Closed
opened 2026-05-05 04:54:19 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @Duncaen on GitHub (Oct 23, 2015).
Original GitHub issue: https://github.com/netblue30/firejail/issues/91

It would be nice if we can get musl libc support for firejail.
We currently have a dirty patch/hack to be able to compile libtrace.

# XXX: dirty hack - very limited stdio.h definitions
# to avoid redefinition of intercepted libc functions
# Include our header instead of stdio.h and sys/stat.h
# Use struct stat instead of struct stat64 (they are equal)
sed -i ${wrksrc}/src/libtrace/libtrace.c \
    -e 's;#include <stdio.h>;#include "musl_defs.h";' \
    -e 's;#include <sys/stat.h>;;' \
    -e 's;struct stat64;struct stat;g' 

https://github.com/voidlinux/void-packages/blob/master/srcpkgs/firejail/template#L57

And the musl_defs.h file is located here https://github.com/voidlinux/void-packages/blob/master/srcpkgs/firejail/files/musl_defs.h

Originally created by @Duncaen on GitHub (Oct 23, 2015). Original GitHub issue: https://github.com/netblue30/firejail/issues/91 It would be nice if we can get musl libc support for firejail. We currently have a dirty patch/hack to be able to compile libtrace. ``` # XXX: dirty hack - very limited stdio.h definitions # to avoid redefinition of intercepted libc functions # Include our header instead of stdio.h and sys/stat.h # Use struct stat instead of struct stat64 (they are equal) sed -i ${wrksrc}/src/libtrace/libtrace.c \ -e 's;#include <stdio.h>;#include "musl_defs.h";' \ -e 's;#include <sys/stat.h>;;' \ -e 's;struct stat64;struct stat;g' ``` https://github.com/voidlinux/void-packages/blob/master/srcpkgs/firejail/template#L57 And the musl_defs.h file is located here https://github.com/voidlinux/void-packages/blob/master/srcpkgs/firejail/files/musl_defs.h
gitea-mirror 2026-05-05 04:54:19 -06:00
Author
Owner

@netblue30 commented on GitHub (Oct 25, 2015):

I have the fix in, add --enable-musl-libc when you ./configure:

$ ./configure --enable-musl-libc --prefix=/usr
<!-- gh-comment-id:150923395 --> @netblue30 commented on GitHub (Oct 25, 2015): I have the fix in, add --enable-musl-libc when you ./configure: ``` $ ./configure --enable-musl-libc --prefix=/usr ```
Author
Owner

@netblue30 commented on GitHub (Mar 17, 2026):

Should work fine in 0.9.80

<!-- gh-comment-id:4075254383 --> @netblue30 commented on GitHub (Mar 17, 2026): Should work fine in 0.9.80
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#54
No description provided.