@@ -751,6 +751,61 @@ def get_files(self):
751
751
path_components = ['system' , 'lib' , 'libc' ],
752
752
filenames = ['extras.c' , 'wasi-helpers.c' ])
753
753
754
+ libc_files += files_in_path (
755
+ path_components = ['system' , 'lib' , 'pthread' ],
756
+ filenames = ['emscripten_atomic.c' ])
757
+
758
+ libc_files += files_in_path (
759
+ path_components = ['system' , 'lib' , 'libc' , 'musl' , 'src' , 'thread' ],
760
+ filenames = ['pthread_self.c' ])
761
+
762
+ if self .is_mt :
763
+ libc_files += files_in_path (
764
+ path_components = ['system' , 'lib' , 'libc' , 'musl' , 'src' , 'thread' ],
765
+ filenames = [
766
+ 'pthread_attr_destroy.c' , 'pthread_condattr_setpshared.c' ,
767
+ 'pthread_mutex_lock.c' , 'pthread_spin_destroy.c' , 'pthread_attr_get.c' ,
768
+ 'pthread_cond_broadcast.c' , 'pthread_mutex_setprioceiling.c' ,
769
+ 'pthread_spin_init.c' , 'pthread_attr_init.c' , 'pthread_cond_destroy.c' ,
770
+ 'pthread_mutex_timedlock.c' , 'pthread_spin_lock.c' ,
771
+ 'pthread_attr_setdetachstate.c' , 'pthread_cond_init.c' ,
772
+ 'pthread_mutex_trylock.c' , 'pthread_spin_trylock.c' ,
773
+ 'pthread_attr_setguardsize.c' , 'pthread_cond_signal.c' ,
774
+ 'pthread_mutex_unlock.c' , 'pthread_spin_unlock.c' ,
775
+ 'pthread_attr_setinheritsched.c' , 'pthread_cond_timedwait.c' ,
776
+ 'pthread_once.c' , 'sem_destroy.c' , 'pthread_attr_setschedparam.c' ,
777
+ 'pthread_cond_wait.c' , 'pthread_rwlockattr_destroy.c' , 'sem_getvalue.c' ,
778
+ 'pthread_attr_setschedpolicy.c' , 'pthread_equal.c' , 'pthread_rwlockattr_init.c' ,
779
+ 'sem_init.c' , 'pthread_attr_setscope.c' , 'pthread_getspecific.c' ,
780
+ 'pthread_rwlockattr_setpshared.c' , 'sem_open.c' , 'pthread_attr_setstack.c' ,
781
+ 'pthread_key_create.c' , 'pthread_rwlock_destroy.c' , 'sem_post.c' ,
782
+ 'pthread_attr_setstacksize.c' , 'pthread_mutexattr_destroy.c' ,
783
+ 'pthread_rwlock_init.c' , 'sem_timedwait.c' , 'pthread_barrierattr_destroy.c' ,
784
+ 'pthread_mutexattr_init.c' , 'pthread_rwlock_rdlock.c' , 'sem_trywait.c' ,
785
+ 'pthread_barrierattr_init.c' , 'pthread_mutexattr_setprotocol.c' ,
786
+ 'pthread_rwlock_timedrdlock.c' , 'sem_unlink.c' ,
787
+ 'pthread_barrierattr_setpshared.c' , 'pthread_mutexattr_setpshared.c' ,
788
+ 'pthread_rwlock_timedwrlock.c' , 'sem_wait.c' , 'pthread_barrier_destroy.c' ,
789
+ 'pthread_mutexattr_setrobust.c' , 'pthread_rwlock_tryrdlock.c' ,
790
+ '__timedwait.c' , 'pthread_barrier_init.c' , 'pthread_mutexattr_settype.c' ,
791
+ 'pthread_rwlock_trywrlock.c' , 'vmlock.c' , 'pthread_barrier_wait.c' ,
792
+ 'pthread_mutex_consistent.c' , 'pthread_rwlock_unlock.c' , '__wait.c' ,
793
+ 'pthread_condattr_destroy.c' , 'pthread_mutex_destroy.c' ,
794
+ 'pthread_rwlock_wrlock.c' , 'pthread_condattr_init.c' ,
795
+ 'pthread_mutex_getprioceiling.c' , 'pthread_setcanceltype.c' ,
796
+ 'pthread_condattr_setclock.c' , 'pthread_mutex_init.c' ,
797
+ 'pthread_setspecific.c' , 'pthread_setcancelstate.c' ,
798
+ ])
799
+ libc_files += files_in_path (
800
+ path_components = ['system' , 'lib' , 'pthread' ],
801
+ filenames = [
802
+ 'library_pthread.c' ,
803
+ 'emscripten_tls_init.c' ,
804
+ 'emscripten_thread_state.s' ,
805
+ ])
806
+ else :
807
+ libc_files += [shared .path_from_root ('system' , 'lib' , 'pthread' , 'library_pthread_stub.c' )]
808
+
754
809
return libc_files
755
810
756
811
@@ -1152,67 +1207,6 @@ class libhtml5(Library):
1152
1207
src_glob = '*.c'
1153
1208
1154
1209
1155
- class libpthread (AsanInstrumentedLibrary , MuslInternalLibrary , MTLibrary ):
1156
- name = 'libpthread'
1157
- cflags = ['-O2' ]
1158
-
1159
- def get_files (self ):
1160
- files = [shared .path_from_root ('system' , 'lib' , 'pthread' , 'emscripten_atomic.c' )]
1161
- files += files_in_path (
1162
- path_components = ['system' , 'lib' , 'libc' , 'musl' , 'src' , 'thread' ],
1163
- filenames = ['pthread_self.c' ])
1164
- if self .is_mt :
1165
- files += files_in_path (
1166
- path_components = ['system' , 'lib' , 'libc' , 'musl' , 'src' , 'thread' ],
1167
- filenames = [
1168
- 'pthread_attr_destroy.c' , 'pthread_condattr_setpshared.c' ,
1169
- 'pthread_mutex_lock.c' , 'pthread_spin_destroy.c' , 'pthread_attr_get.c' ,
1170
- 'pthread_cond_broadcast.c' , 'pthread_mutex_setprioceiling.c' ,
1171
- 'pthread_spin_init.c' , 'pthread_attr_init.c' , 'pthread_cond_destroy.c' ,
1172
- 'pthread_mutex_timedlock.c' , 'pthread_spin_lock.c' ,
1173
- 'pthread_attr_setdetachstate.c' , 'pthread_cond_init.c' ,
1174
- 'pthread_mutex_trylock.c' , 'pthread_spin_trylock.c' ,
1175
- 'pthread_attr_setguardsize.c' , 'pthread_cond_signal.c' ,
1176
- 'pthread_mutex_unlock.c' , 'pthread_spin_unlock.c' ,
1177
- 'pthread_attr_setinheritsched.c' , 'pthread_cond_timedwait.c' ,
1178
- 'pthread_once.c' , 'sem_destroy.c' , 'pthread_attr_setschedparam.c' ,
1179
- 'pthread_cond_wait.c' , 'pthread_rwlockattr_destroy.c' , 'sem_getvalue.c' ,
1180
- 'pthread_attr_setschedpolicy.c' , 'pthread_equal.c' , 'pthread_rwlockattr_init.c' ,
1181
- 'sem_init.c' , 'pthread_attr_setscope.c' , 'pthread_getspecific.c' ,
1182
- 'pthread_rwlockattr_setpshared.c' , 'sem_open.c' , 'pthread_attr_setstack.c' ,
1183
- 'pthread_key_create.c' , 'pthread_rwlock_destroy.c' , 'sem_post.c' ,
1184
- 'pthread_attr_setstacksize.c' , 'pthread_mutexattr_destroy.c' ,
1185
- 'pthread_rwlock_init.c' , 'sem_timedwait.c' , 'pthread_barrierattr_destroy.c' ,
1186
- 'pthread_mutexattr_init.c' , 'pthread_rwlock_rdlock.c' , 'sem_trywait.c' ,
1187
- 'pthread_barrierattr_init.c' , 'pthread_mutexattr_setprotocol.c' ,
1188
- 'pthread_rwlock_timedrdlock.c' , 'sem_unlink.c' ,
1189
- 'pthread_barrierattr_setpshared.c' , 'pthread_mutexattr_setpshared.c' ,
1190
- 'pthread_rwlock_timedwrlock.c' , 'sem_wait.c' , 'pthread_barrier_destroy.c' ,
1191
- 'pthread_mutexattr_setrobust.c' , 'pthread_rwlock_tryrdlock.c' ,
1192
- '__timedwait.c' , 'pthread_barrier_init.c' , 'pthread_mutexattr_settype.c' ,
1193
- 'pthread_rwlock_trywrlock.c' , 'vmlock.c' , 'pthread_barrier_wait.c' ,
1194
- 'pthread_mutex_consistent.c' , 'pthread_rwlock_unlock.c' , '__wait.c' ,
1195
- 'pthread_condattr_destroy.c' , 'pthread_mutex_destroy.c' ,
1196
- 'pthread_rwlock_wrlock.c' , 'pthread_condattr_init.c' ,
1197
- 'pthread_mutex_getprioceiling.c' , 'pthread_setcanceltype.c' ,
1198
- 'pthread_condattr_setclock.c' , 'pthread_mutex_init.c' ,
1199
- 'pthread_setspecific.c' , 'pthread_setcancelstate.c' ,
1200
- ])
1201
- files += files_in_path (
1202
- path_components = ['system' , 'lib' , 'pthread' ],
1203
- filenames = [
1204
- 'library_pthread.c' ,
1205
- 'emscripten_tls_init.c' ,
1206
- 'emscripten_thread_state.s' ,
1207
- ])
1208
- else :
1209
- files += [shared .path_from_root ('system' , 'lib' , 'pthread' , 'library_pthread_stub.c' )]
1210
- return files
1211
-
1212
- def get_base_name_prefix (self ):
1213
- return 'libpthread' if self .is_mt else 'libpthread_stub'
1214
-
1215
-
1216
1210
class CompilerRTLibrary (Library ):
1217
1211
cflags = ['-O2' , '-fno-builtin' ]
1218
1212
# compiler_rt files can't currently be part of LTO although we are hoping to remove this
@@ -1540,7 +1534,6 @@ def add_library(lib):
1540
1534
add_library (system_libs_map ['libunwind' ])
1541
1535
if shared .Settings .MALLOC != 'none' :
1542
1536
add_library (system_libs_map ['libmalloc' ])
1543
- add_library (system_libs_map ['libpthread' ])
1544
1537
if shared .Settings .STANDALONE_WASM :
1545
1538
add_library (system_libs_map ['libstandalonewasm' ])
1546
1539
add_library (system_libs_map ['libc_rt_wasm' ])
0 commit comments