@@ -834,7 +834,6 @@ def get_files(self):
834834 'proxying.c' ,
835835 'pthread_create.c' ,
836836 'pthread_kill.c' ,
837- 'emscripten_proxy_main.c' ,
838837 'emscripten_thread_init.c' ,
839838 'emscripten_thread_state.S' ,
840839 'emscripten_futex_wait.c' ,
@@ -1170,6 +1169,20 @@ def can_use(self):
11701169 return super ().can_use () and settings .STANDALONE_WASM
11711170
11721171
1172+ class crt1_proxy_main (MuslInternalLibrary ):
1173+ name = 'crt1_proxy_main'
1174+ src_dir = 'system/lib/libc'
1175+ src_files = ['crt1_proxy_main.c' ]
1176+
1177+ force_object_files = True
1178+
1179+ def get_ext (self ):
1180+ return '.o'
1181+
1182+ def can_use (self ):
1183+ return super ().can_use () and settings .PROXY_TO_PTHREAD
1184+
1185+
11731186class crtbegin (MuslInternalLibrary ):
11741187 name = 'crtbegin'
11751188 cflags = ['-sUSE_PTHREADS' ]
@@ -1825,11 +1838,14 @@ def add_library(libname):
18251838 if settings .SHARED_MEMORY :
18261839 add_library ('crtbegin' )
18271840
1828- if settings .STANDALONE_WASM :
1829- if settings .EXPECT_MAIN :
1830- add_library ('crt1' )
1831- else :
1832- add_library ('crt1_reactor' )
1841+ if not settings .SIDE_MODULE :
1842+ if settings .STANDALONE_WASM :
1843+ if settings .EXPECT_MAIN :
1844+ add_library ('crt1' )
1845+ else :
1846+ add_library ('crt1_reactor' )
1847+ elif settings .PROXY_TO_PTHREAD :
1848+ add_library ('crt1_proxy_main' )
18331849
18341850 if settings .SIDE_MODULE :
18351851 return libs_to_link
0 commit comments