Skip to content

Make longjmp/exceptions helpers thread-safe #12056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Sep 26, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5786570
Make asm.js threading globals thread-safe
kripken Aug 25, 2020
0faaddd
make compiler-rt an MT library?
kripken Aug 26, 2020
0ae338f
fix
kripken Aug 26, 2020
e4f69ed
Merge remote-tracking branch 'origin/master' into exc
kripken Aug 26, 2020
3cba11a
Merge remote-tracking branch 'origin/master' into exc
kripken Aug 26, 2020
fccf48c
feedback: refactor into a side file
kripken Aug 26, 2020
a9741ea
add a test
kripken Aug 26, 2020
c4d680f
Merge remote-tracking branch 'origin/master' into exc
kripken Aug 26, 2020
daff2df
add a test that can't pass yet without a wasm backend fix [ci skip]
kripken Aug 26, 2020
5a4ea53
Merge remote-tracking branch 'origin/master' into exc
kripken Sep 24, 2020
faa03bc
use threads.h [ci skip]
kripken Sep 24, 2020
06ab316
add a compiler-rt mt variant [ci skip]
kripken Sep 24, 2020
b3db6a9
review feedback [ci skip]
kripken Sep 24, 2020
7955ce2
Also build libc_rt_wasm with -mt when needed
kripken Sep 25, 2020
96cbf74
fix test
kripken Sep 25, 2020
af889b0
Merge remote-tracking branch 'origin/master' into exc
kripken Sep 25, 2020
0629608
Revert "Disable tests to allow LLVM to roll in (#12337)"
kripken Sep 25, 2020
9e6193e
[ci skip]
kripken Sep 25, 2020
586767e
Merge remote-tracking branch 'origin/master' into exc
kripken Sep 25, 2020
e55647a
revert the extra disabled test too [ci skip]
kripken Sep 25, 2020
c76b122
comment
kripken Sep 25, 2020
d42e148
embind and asan_js libraries now also need to be built with -mt
kripken Sep 25, 2020
36c0ee0
-mt
kripken Sep 25, 2020
05257b8
Revert "-mt"
kripken Sep 25, 2020
5657df5
Revert "embind and asan_js libraries now also need to be built with -mt"
kripken Sep 25, 2020
b312b57
Revert "Also build libc_rt_wasm with -mt when needed"
kripken Sep 25, 2020
44b8dda
fix comment
kripken Sep 25, 2020
704a676
cleaner [ci skip]
kripken Sep 25, 2020
84ab45b
remove unneeded change after the llvm change
kripken Sep 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions system/lib/compiler-rt/extras.c

This file was deleted.

12 changes: 12 additions & 0 deletions system/lib/libc/extras.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ long* _get_timezone() {
void __lock(void* ptr) {}
void __unlock(void* ptr) {}

/* References to these longjmp- and exceptions-supporting things are generated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why move into this file?

These symbols seems to live more logically in compiler-rt, which is a library that hold internal symbols that the compiler can generate during codegee.

Copy link
Member Author

@kripken kripken Aug 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason is that compiler-rt doesn't have a multithreaded variation atm, and adding one just for this seemed silly to me. Given libc already had a kind of "misc" file, this seemed reasonable. But I don't feel strongly, what do you prefer?

in the llvm backend so they cannot be static */

int _Thread_local __THREW__ = 0;
int _Thread_local __threwValue = 0;

void setThrew(int threw, int value) {
if (__THREW__ == 0) {
__THREW__ = threw;
__threwValue = value;
}
}
1 change: 0 additions & 1 deletion tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ class libcompiler_rt(Library):
cflags = ['-O2', '-fno-builtin']
src_dir = ['system', 'lib', 'compiler-rt', 'lib', 'builtins']
src_files = glob_in_path(src_dir, '*.c')
src_files.append(shared.path_from_root('system', 'lib', 'compiler-rt', 'extras.c'))
src_files.append(shared.path_from_root('system', 'lib', 'compiler-rt', 'stack_ops.s'))
src_files.append(shared.path_from_root('system', 'lib', 'compiler-rt', 'emscripten_setjmp.c'))

Expand Down