From 4c03660c6b2e8f212559de2f6531d7b648413ca4 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 1 Oct 2019 12:48:27 -0700 Subject: [PATCH] Support __assert_fail in standalone wasm --- tools/system_libs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/system_libs.py b/tools/system_libs.py index a0d271ccda2d3..b0e73289585fd 100755 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -1189,14 +1189,20 @@ def get_files(self): base_files = files_in_path( path_components=['system', 'lib'], filenames=['standalone_wasm.c']) - musl_files = files_in_path( + # It is more efficient to use JS methods for time, normally. + time_files = files_in_path( path_components=['system', 'lib', 'libc', 'musl', 'src', 'time'], filenames=['strftime.c', '__month_to_secs.c', '__tm_to_secs.c', '__tz.c', '__year_to_secs.c']) - return base_files + musl_files + # It is more efficient to use JS for __assert_fail, as it avoids always + # including fprintf etc. + exit_files = files_in_path( + path_components=['system', 'lib', 'libc', 'musl', 'src', 'exit'], + filenames=['assert.c']) + return base_files + time_files + exit_files def can_build(self): return shared.Settings.WASM_BACKEND