mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-01 10:22:56 +02:00
nsjail: fix *-musl
This commit is contained in:
parent
2853809f4a
commit
b2034e4a5b
3 changed files with 72 additions and 0 deletions
11
srcpkgs/nsjail/files/musl-compat.h
Normal file
11
srcpkgs/nsjail/files/musl-compat.h
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#if !defined(MUSL_COMPAT_H)
|
||||||
|
#define MUSL_COMPAT_H
|
||||||
|
|
||||||
|
# define TEMP_FAILURE_RETRY(expression) \
|
||||||
|
(__extension__ \
|
||||||
|
({ long int __result; \
|
||||||
|
do __result = (long int) (expression); \
|
||||||
|
while (__result == -1L && errno == EINTR); \
|
||||||
|
__result; }))
|
||||||
|
|
||||||
|
#endif /* !defined(MUSL_COMPAT_H) */
|
54
srcpkgs/nsjail/patches/musl-rlim64_t.patch
Normal file
54
srcpkgs/nsjail/patches/musl-rlim64_t.patch
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
--- common.h 2016-09-10 03:20:32.000000000 +0200
|
||||||
|
+++ common.h 2017-01-04 17:24:12.807104061 +0100
|
||||||
|
@@ -100,13 +100,13 @@
|
||||||
|
bool verbose;
|
||||||
|
bool keep_env;
|
||||||
|
bool keep_caps;
|
||||||
|
- __rlim64_t rl_as;
|
||||||
|
- __rlim64_t rl_core;
|
||||||
|
- __rlim64_t rl_cpu;
|
||||||
|
- __rlim64_t rl_fsize;
|
||||||
|
- __rlim64_t rl_nofile;
|
||||||
|
- __rlim64_t rl_nproc;
|
||||||
|
- __rlim64_t rl_stack;
|
||||||
|
+ rlim64_t rl_as;
|
||||||
|
+ rlim64_t rl_core;
|
||||||
|
+ rlim64_t rl_cpu;
|
||||||
|
+ rlim64_t rl_fsize;
|
||||||
|
+ rlim64_t rl_nofile;
|
||||||
|
+ rlim64_t rl_nproc;
|
||||||
|
+ rlim64_t rl_stack;
|
||||||
|
unsigned long personality;
|
||||||
|
bool clone_newnet;
|
||||||
|
bool clone_newuser;
|
||||||
|
--- cmdline.h 2016-09-10 03:20:32.000000000 +0200
|
||||||
|
+++ cmdline.h 2017-01-04 17:25:32.479110539 +0100
|
||||||
|
@@ -27,7 +27,7 @@
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
-__rlim64_t cmdlineParseRLimit(int res, const char *optarg, unsigned long mul);
|
||||||
|
+rlim64_t cmdlineParseRLimit(int res, const char *optarg, unsigned long mul);
|
||||||
|
void cmdlineLogParams(struct nsjconf_t *nsjconf);
|
||||||
|
bool cmdlineParse(int argc, char *argv[], struct nsjconf_t *nsjconf);
|
||||||
|
|
||||||
|
--- cmdline.c 2016-09-10 03:20:32.000000000 +0200
|
||||||
|
+++ cmdline.c 2017-01-04 17:26:19.346114418 +0100
|
||||||
|
@@ -137,7 +137,7 @@
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
-__rlim64_t cmdlineParseRLimit(int res, const char *optarg, unsigned long mul)
|
||||||
|
+rlim64_t cmdlineParseRLimit(int res, const char *optarg, unsigned long mul)
|
||||||
|
{
|
||||||
|
struct rlimit64 cur;
|
||||||
|
if (prlimit64(0, res, NULL, &cur) == -1) {
|
||||||
|
@@ -153,7 +153,7 @@
|
||||||
|
LOG_F("RLIMIT %d needs a numeric or 'max'/'def' value ('%s' provided)", res,
|
||||||
|
optarg);
|
||||||
|
}
|
||||||
|
- __rlim64_t val = strtoull(optarg, NULL, 0) * mul;
|
||||||
|
+ rlim64_t val = strtoull(optarg, NULL, 0) * mul;
|
||||||
|
if (val == ULLONG_MAX && errno != 0) {
|
||||||
|
PLOG_F("strtoul('%s', 0)", optarg);
|
||||||
|
}
|
|
@ -10,7 +10,14 @@ homepage="https://github.com/google/$pkgname"
|
||||||
distfiles="$homepage/archive/$version.tar.gz"
|
distfiles="$homepage/archive/$version.tar.gz"
|
||||||
checksum="9f262d56a189cf26f5c66b2c022364df979da92042f64c04300fdbb88aaba8ab"
|
checksum="9f262d56a189cf26f5c66b2c022364df979da92042f64c04300fdbb88aaba8ab"
|
||||||
|
|
||||||
|
CFLAGS="-Wno-error=format"
|
||||||
|
|
||||||
do_build() {
|
do_build() {
|
||||||
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
|
*-musl) cp ${FILESDIR}/musl-compat.h .
|
||||||
|
sed -i common.h -e '/#include <sys\/types.h>/a #include "musl-compat.h"'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
make CC=$CC
|
make CC=$CC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue