@@ -834,7 +834,6 @@ def get_files(self):
834
834
'proxying.c' ,
835
835
'pthread_create.c' ,
836
836
'pthread_kill.c' ,
837
- 'emscripten_proxy_main.c' ,
838
837
'emscripten_thread_init.c' ,
839
838
'emscripten_thread_state.S' ,
840
839
'emscripten_futex_wait.c' ,
@@ -1170,6 +1169,20 @@ def can_use(self):
1170
1169
return super ().can_use () and settings .STANDALONE_WASM
1171
1170
1172
1171
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
+
1173
1186
class crtbegin (MuslInternalLibrary ):
1174
1187
name = 'crtbegin'
1175
1188
cflags = ['-sUSE_PTHREADS' ]
@@ -1825,11 +1838,14 @@ def add_library(libname):
1825
1838
if settings .SHARED_MEMORY :
1826
1839
add_library ('crtbegin' )
1827
1840
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' )
1833
1849
1834
1850
if settings .SIDE_MODULE :
1835
1851
return libs_to_link
0 commit comments