summaryrefslogtreecommitdiff
path: root/opt/firejail/musl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'opt/firejail/musl.patch')
-rw-r--r--opt/firejail/musl.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/opt/firejail/musl.patch b/opt/firejail/musl.patch
new file mode 100644
index 0000000..43473ea
--- /dev/null
+++ b/opt/firejail/musl.patch
@@ -0,0 +1,83 @@
+--- a/src/libtrace/libtrace.c
++++ b/src/libtrace/libtrace.c
+@@ -447,7 +447,7 @@
+ return rv;
+ }
+
+-#ifndef stat64
++#ifdef HAVE_STAT64
+ typedef int (*orig_stat64_t)(const char *pathname, struct stat64 *statbuf);
+ static orig_stat64_t orig_stat64 = NULL;
+ int stat64(const char *pathname, struct stat64 *statbuf) {
+@@ -472,7 +472,7 @@
+ return rv;
+ }
+
+-#ifndef lstat64
++#ifdef HAVE_STAT64
+ typedef int (*orig_lstat64_t)(const char *pathname, struct stat64 *statbuf);
+ static orig_lstat64_t orig_lstat64 = NULL;
+ int lstat64(const char *pathname, struct stat64 *statbuf) {
+--- a/src/libtracelog/libtracelog.c
++++ b/src/libtracelog/libtracelog.c
+@@ -565,7 +565,7 @@
+ return rv;
+ }
+
+-#ifndef stat64
++#ifdef HAVE_STAT64
+ typedef int (*orig_stat64_t)(const char *pathname, struct stat64 *buf);
+ static orig_stat64_t orig_stat64 = NULL;
+ int stat64(const char *pathname, struct stat64 *buf) {
+@@ -601,7 +601,7 @@
+ return rv;
+ }
+
+-#ifndef lstat64
++#ifdef HAVE_STAT64
+ typedef int (*orig_lstat64_t)(const char *pathname, struct stat64 *buf);
+ static orig_lstat64_t orig_lstat64 = NULL;
+ int lstat64(const char *pathname, struct stat64 *buf) {
+--- a/config.mk.in
++++ b/config.mk.in
+@@ -22,6 +22,8 @@
+ localstatedir=@localstatedir@
+ sysconfdir=@sysconfdir@
+
++HAVE_STAT64=@HAVE_STAT64@
++
+ # Misc flags
+ BUSYBOX_WORKAROUND=@BUSYBOX_WORKAROUND@
+ HAVE_CONTRIB_INSTALL=@HAVE_CONTRIB_INSTALL@
+@@ -99,7 +101,7 @@
+ -fstack-protector-all \
+ -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/$(TARNAME)"' \
+ -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' \
+- -DVARDIR='"$(localstatedir)/lib/$(TARNAME)"'
++ -DVARDIR='"$(localstatedir)/lib/$(TARNAME)"' $(HAVE_STAT64)
+
+ PROG_CFLAGS = \
+ $(COMMON_CFLAGS) \
+--- a/configure.ac
++++ b/configure.ac
+@@ -298,6 +298,10 @@
+ AC_CHECK_HEADER([linux/seccomp.h], [],
+ [AC_MSG_ERROR([*** SECCOMP support is not installed (/usr/include/linux/seccomp.h missing) ***])])
+
++AC_SUBST([HAVE_STAT64])
++AC_CHECK_FUNC(stat64, [
++ HAVE_STAT64="-DHAVE_STAT64"],)
++
+ # set sysconfdir
+ if test "$prefix" = /usr; then
+ test "$sysconfdir" = '${prefix}/etc' && sysconfdir="/etc"
+--- a/src/fbwrap/main.c
++++ b/src/fbwrap/main.c
+@@ -23,7 +23,6 @@
+ #include <unistd.h>
+ #include <string.h>
+ #include <sys/stat.h>
+-#include <linux/prctl.h>
+ #include <sys/prctl.h>
+ #include <signal.h>
+