@@ -6007,9 +6007,9 @@ def test_bad_lookup(self):
60076007 # partial list, but ok since we grab them as needed
60086008 'parial': [{'EMCC_FORCE_STDLIBS': 'libc++'}, False],
60096009 # fail! not enough stdlibs
6010- 'partial_only': [{'EMCC_FORCE_STDLIBS': 'libc++,libc,libc++abi', 'EMCC_ONLY_FORCED_STDLIBS': '1'}, True],
6010+ 'partial_only': [{'EMCC_FORCE_STDLIBS': 'libc++,libc,libpthread, libc++abi', 'EMCC_ONLY_FORCED_STDLIBS': '1'}, True],
60116011 # force all the needed stdlibs, so this works even though we ignore the input file
6012- 'full_only': [{'EMCC_FORCE_STDLIBS': 'libc,libc++abi,libc++,libmalloc', 'EMCC_ONLY_FORCED_STDLIBS': '1'}, False],
6012+ 'full_only': [{'EMCC_FORCE_STDLIBS': 'libc,libpthread, libc++abi,libc++,libmalloc', 'EMCC_ONLY_FORCED_STDLIBS': '1'}, False],
60136013 })
60146014 def test_only_force_stdlibs(self, env, fail):
60156015 cmd = [EMXX, test_file('hello_libcxx.cpp')]
@@ -6040,7 +6040,7 @@ def test_only_force_stdlibs_2(self):
60406040 }
60416041}
60426042''')
6043- with env_modify({'EMCC_FORCE_STDLIBS': 'libc,libc++abi,libc++,libmalloc', 'EMCC_ONLY_FORCED_STDLIBS': '1'}):
6043+ with env_modify({'EMCC_FORCE_STDLIBS': 'libc,libpthread, libc++abi,libc++,libmalloc', 'EMCC_ONLY_FORCED_STDLIBS': '1'}):
60446044 self.run_process([EMXX, 'src.cpp', '-sDISABLE_EXCEPTION_CATCHING=0'])
60456045 self.assertContained('Caught exception: std::exception', self.run_js('a.out.js'))
60466046
@@ -12286,10 +12286,10 @@ def test_nostdlib(self):
1228612286 self.assertContained(err, self.expect_fail([EMCC, test_file('unistd/close.c'), '-nodefaultlibs']))
1228712287
1228812288 # Build again but with explit system libraries
12289- libs = ['-lc', '-lcompiler_rt']
12289+ libs = ['-lc', '-lpthread', '- lcompiler_rt']
1229012290 self.run_process([EMCC, test_file('unistd/close.c'), '-nostdlib'] + libs)
1229112291 self.run_process([EMCC, test_file('unistd/close.c'), '-nodefaultlibs'] + libs)
12292- self.run_process([EMCC, test_file('unistd/close.c'), '-nolibc', '-lc'])
12292+ self.run_process([EMCC, test_file('unistd/close.c'), '-nolibc', '-lc', '-lpthread' ])
1229312293 self.run_process([EMCC, test_file('unistd/close.c'), '-nostartfiles'])
1229412294
1229512295 def test_argument_match(self):
@@ -13183,12 +13183,13 @@ def test_offset_convertor_plus_wasm2js(self):
1318313183
1318413184 def test_standard_library_mapping(self):
1318513185 # Test the `-l` flags on the command line get mapped the correct libraries variant
13186- libs = ['-lc', '-lbulkmemory', '-lcompiler_rt', '-lmalloc']
13186+ libs = ['-lc', '-lpthread', '- lbulkmemory', '-lcompiler_rt', '-lmalloc']
1318713187 err = self.run_process([EMCC, test_file('hello_world.c'), '-pthread', '-nodefaultlibs', '-v'] + libs, stderr=PIPE).stderr
1318813188
1318913189 # Check that the linker was run with `-mt` variants because `-pthread` was passed.
1319013190 self.assertContained(' -lc-mt-debug ', err)
1319113191 self.assertContained(' -ldlmalloc-mt ', err)
13192+ self.assertContained(' -lpthread-debug ', err)
1319213193 self.assertContained(' -lcompiler_rt-mt ', err)
1319313194
1319413195 def test_explicit_gl_linking(self):
0 commit comments