From f253af075255e106286b8e23c4533e4f9b508665 Mon Sep 17 00:00:00 2001 From: Jacob Rice Date: Tue, 29 Mar 2022 14:56:13 +0000 Subject: [PATCH] Compile FreeType with pthreads support (#16546) Expects the runtime will support atomic access, even in single-threaded mode. See WebAssembly/threads#144 for more. --- tests/test_other.py | 4 ++++ tools/ports/freetype.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_other.py b/tests/test_other.py index e53b502b1fa4c..de9b35e97426e 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -1860,6 +1860,10 @@ def test_freetype(self): ' **** ****' self.assertContained(expectedOutput, self.run_process(config.JS_ENGINES[0] + ['a.out.js'], stdout=PIPE, stderr=PIPE).stdout) + def test_freetype_with_pthreads(self): + # Verify that freetype supports compilation requiring pthreads + self.emcc(test_file('freetype_test.c'), ['-sUSE_PTHREADS', '-sUSE_FREETYPE'], output_filename='a.out.js') + def test_icu(self): self.set_setting('USE_ICU') self.do_runf(test_file('other/test_icu.cpp')) diff --git a/tools/ports/freetype.py b/tools/ports/freetype.py index 74f0b741c1d7f..1c7ecfce091ea 100644 --- a/tools/ports/freetype.py +++ b/tools/ports/freetype.py @@ -98,7 +98,8 @@ def create(final): '-I' + dest_path + '/psaux', '-I' + dest_path + '/psnames', '-I' + dest_path + '/truetype', - '-w']) + '-w', + '-pthread']) o_s.append(o) ports.run_commands(commands)