Skip to content

Commit ce52e32

Browse files
committed
Define sigsetjmp and siglongjmp in musl and Remove the Emscripten patch in the setjmp.h
1 parent c1c862b commit ce52e32

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

system/lib/libc/musl/include/setjmp.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,9 @@ typedef struct __jmp_buf_tag {
2626
|| defined(_BSD_SOURCE)
2727
typedef jmp_buf sigjmp_buf;
2828
/* XXX EMSCRIPTEN: No signals support, alias sigsetjmp and siglongjmp to their non-signals counterparts. */
29-
#if __EMSCRIPTEN__ && !defined(LLVM_LIBC)
30-
#define sigsetjmp(buf, x) setjmp((buf))
31-
#define siglongjmp(buf, val) longjmp(buf, val)
32-
#else
3329
int sigsetjmp (sigjmp_buf, int) __setjmp_attr;
3430
_Noreturn void siglongjmp (sigjmp_buf, int);
3531
#endif
36-
#endif
3732

3833
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
3934
|| defined(_BSD_SOURCE)

system/lib/libc/musl/src/setjmp/longjmp.c

Lines changed: 0 additions & 3 deletions
This file was deleted.

system/lib/libc/musl/src/setjmp/setjmp.c

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <setjmp.h>
2+
3+
_Noreturn void siglongjmp(jmp_buf buf, int val) {
4+
longjmp(buf, val);
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include <setjmp.h>
2+
3+
int sigsetjmp(jmp_buf sigjmp_buf, int savesigs) {
4+
return setjmp(sigjmp_buf);
5+
}

tools/system_libs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ def get_files(self):
10241024

10251025

10261026
class libc(MuslInternalLibrary,
1027+
libcompiler_rt,
10271028
DebugLibrary,
10281029
AsanInstrumentedLibrary,
10291030
MTLibrary):
@@ -1136,7 +1137,7 @@ def get_files(self):
11361137
# musl modules
11371138
ignore = [
11381139
'ipc', 'passwd', 'signal', 'sched', 'time', 'linux',
1139-
'aio', 'exit', 'legacy', 'mq', 'setjmp',
1140+
'aio', 'exit', 'legacy', 'mq',
11401141
'ldso', 'malloc',
11411142
]
11421143

@@ -1365,6 +1366,7 @@ def get_files(self):
13651366
filenames=['thread_profiler.c'])
13661367

13671368
libc_files += glob_in_path('system/lib/libc/compat', '*.c')
1369+
libc_files += glob_in_path('system/lib/libc/musl/setjmp', '*.c')
13681370

13691371
# Check for missing file in non_lto_files list. Do this here
13701372
# rather than in the constructor so it only happens when the

0 commit comments

Comments
 (0)