mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Fix compilation of quickjs-libc under emscripten (#773)
This commit is contained in:
parent
482291286b
commit
8d88f320fb
2 changed files with 9 additions and 3 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -398,7 +398,7 @@ jobs:
|
|||
run: emcc -v
|
||||
- name: build
|
||||
run: |
|
||||
emcmake cmake -B build
|
||||
emcmake cmake -B build -DBUILD_QJS_LIBC=ON
|
||||
emmake make -C build qjs_wasm -j$(getconf _NPROCESSORS_ONLN)
|
||||
- name: result
|
||||
run: ls -lh build
|
||||
|
|
|
@ -3035,15 +3035,19 @@ static int my_execvpe(const char *filename, char **argv, char **envp)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static js_once_t js_os_exec_once = JS_ONCE_INIT;
|
||||
|
||||
static void (*js_os_exec_closefrom)(int);
|
||||
|
||||
#if !defined(EMSCRIPTEN) && !defined(__wasi__)
|
||||
|
||||
static js_once_t js_os_exec_once = JS_ONCE_INIT;
|
||||
|
||||
static void js_os_exec_once_init(void)
|
||||
{
|
||||
js_os_exec_closefrom = dlsym(RTLD_DEFAULT, "closefrom");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* exec(args[, options]) -> exitcode */
|
||||
static JSValue js_os_exec(JSContext *ctx, JSValue this_val,
|
||||
int argc, JSValue *argv)
|
||||
|
@ -3163,9 +3167,11 @@ static JSValue js_os_exec(JSContext *ctx, JSValue this_val,
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(EMSCRIPTEN) && !defined(__wasi__)
|
||||
// should happen pre-fork because it calls dlsym()
|
||||
// and that's not an async-signal-safe function
|
||||
js_once(&js_os_exec_once, js_os_exec_once_init);
|
||||
#endif
|
||||
|
||||
pid = fork();
|
||||
if (pid < 0) {
|
||||
|
|
Loading…
Reference in a new issue