@@ -57,9 +57,14 @@ def read_symbols(path):
57
57
58
58
# XXX we should disable EMCC_DEBUG when building libs, just like in the relooper
59
59
60
+ def musl_internal_includes ():
61
+ return [
62
+ '-I' , shared .path_from_root ('system' , 'lib' , 'libc' , 'musl' , 'src' , 'internal' ),
63
+ '-I' , shared .path_from_root ('system' , 'lib' , 'libc' , 'musl' , 'arch' , 'js' ),
64
+ ]
65
+
60
66
def build_libc (lib_filename , files , lib_opts ):
61
67
o_s = []
62
- musl_internal_includes = ['-I' , shared .path_from_root ('system' , 'lib' , 'libc' , 'musl' , 'src' , 'internal' ), '-I' , shared .path_from_root ('system' , 'lib' , 'libc' , 'musl' , 'arch' , 'js' )]
63
68
commands = []
64
69
# Hide several musl warnings that produce a lot of spam to unit test build server logs.
65
70
# TODO: When updating musl the next time, feel free to recheck which of their warnings might have been fixed, and which ones of these could be cleaned up.
@@ -68,7 +73,7 @@ def build_libc(lib_filename, files, lib_opts):
68
73
c_opts .append ('-Wno-error=absolute-value' )
69
74
for src in files :
70
75
o = in_temp (os .path .basename (src ) + '.o' )
71
- commands .append ([shared .PYTHON , shared .EMCC , shared .path_from_root ('system' , 'lib' , src ), '-o' , o ] + musl_internal_includes + default_opts + c_opts + lib_opts )
76
+ commands .append ([shared .PYTHON , shared .EMCC , shared .path_from_root ('system' , 'lib' , src ), '-o' , o ] + musl_internal_includes () + default_opts + c_opts + lib_opts )
72
77
o_s .append (o )
73
78
run_commands (commands )
74
79
shared .Building .link (o_s , in_temp (lib_filename ))
@@ -300,7 +305,10 @@ def create_wasm_rt_lib(libname, files):
300
305
o = in_temp (os .path .basename (src ) + '.o' )
301
306
# Use clang directly instead of emcc. Since emcc's intermediate format (produced by -S) is LLVM IR, there's no way to
302
307
# get emcc to output wasm .s files, which is what we archive in compiler_rt.
303
- commands .append ([shared .CLANG_CC , '--target=wasm32' , '-mthread-model' , 'single' , '-S' , shared .path_from_root ('system' , 'lib' , src ), '-O2' , '-o' , o ] + shared .EMSDK_OPTS )
308
+ commands .append ([
309
+ shared .CLANG_CC , '--target=wasm32' , '-mthread-model' , 'single' ,
310
+ '-S' , shared .path_from_root ('system' , 'lib' , src ),
311
+ '-O2' , '-o' , o ] + musl_internal_includes () + shared .EMSDK_OPTS )
304
312
o_s .append (o )
305
313
run_commands (commands )
306
314
lib = in_temp (libname )
@@ -332,7 +340,11 @@ def create_wasm_libc_rt(libname):
332
340
# that gets included at the same time as compiler-rt.
333
341
math_files = files_in_path (
334
342
path_components = ['system' , 'lib' , 'libc' , 'musl' , 'src' , 'math' ],
335
- filenames = ['fmaxf.c' , 'fminf.c' , 'fmax.c' , 'fmin.c' ])
343
+ filenames = [
344
+ 'fmin.c' , 'fminf.c' , 'fminl.c' ,
345
+ 'fmax.c' , 'fmaxf.c' , 'fmaxl.c' ,
346
+ 'fmod.c' , 'fmodf.c' , 'fmodl.c' ,
347
+ ])
336
348
string_files = files_in_path (
337
349
path_components = ['system' , 'lib' , 'libc' , 'musl' , 'src' , 'string' ],
338
350
filenames = ['memcpy.c' , 'memset.c' , 'memmove.c' ])
0 commit comments