Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ commands:
- run:
name: embuilder (LTO)
command: |
python3 ./embuilder.py build libcompiler_rt libc libc++abi libc++abi-noexcept libc++ libc++-noexcept libal libdlmalloc libpthreads_stub libcompiler_rt_wasm libc_rt_wasm struct_info libc-wasm --lto
python3 ./embuilder.py build libcompiler_rt libc libc++abi libc++abi-noexcept libc++ libc++-noexcept libal libdlmalloc libpthreads_stub libc_rt_wasm struct_info libc-wasm --lto
python3 tests/runner.py test_hello_world
- run:
name: embuilder (PIC)
Expand All @@ -52,7 +52,7 @@ commands:
- run:
name: embuilder (PIC+LTO)
command: |
python3 ./embuilder.py build libcompiler_rt libc libc++abi libc++abi-noexcept libc++ libc++-noexcept libal libdlmalloc libpthreads_stub libcompiler_rt_wasm libc_rt_wasm struct_info libc-wasm --pic --lto
python3 ./embuilder.py build libcompiler_rt libc libc++abi libc++abi-noexcept libc++ libc++-noexcept libal libdlmalloc libpthreads_stub libc_rt_wasm struct_info libc-wasm --pic --lto
python3 tests/runner.py test_hello_world
- run:
name: freeze cache
Expand Down
37 changes: 14 additions & 23 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,23 @@ def get_ext(self):

class libcompiler_rt(Library):
name = 'libcompiler_rt'
depends = ['libc']

cflags = ['-O2']
cflags = ['-O2', '-fno-builtin']
src_dir = ['system', 'lib', 'compiler-rt', 'lib', 'builtins']
src_files = ['divdc3.c', 'divsc3.c', 'muldc3.c', 'mulsc3.c']
if shared.Settings.WASM_BACKEND:
src_files += ['addtf3.c', 'ashlti3.c', 'ashrti3.c', 'atomic.c', 'comparetf2.c',
'divtf3.c', 'divti3.c', 'udivmodti4.c',
'extenddftf2.c', 'extendsftf2.c',
'fixdfti.c', 'fixsfti.c', 'fixtfdi.c', 'fixtfsi.c', 'fixtfti.c',
'fixunsdfti.c', 'fixunssfti.c', 'fixunstfdi.c', 'fixunstfsi.c', 'fixunstfti.c',
'floatditf.c', 'floatsitf.c', 'floattidf.c', 'floattisf.c',
'floatunditf.c', 'floatunsitf.c', 'floatuntidf.c', 'floatuntisf.c', 'lshrti3.c',
'modti3.c', 'multc3.c', 'multf3.c', 'multi3.c', 'subtf3.c', 'udivti3.c', 'umodti3.c', 'ashrdi3.c',
'ashldi3.c', 'fixdfdi.c', 'floatdidf.c', 'lshrdi3.c', 'moddi3.c',
'trunctfdf2.c', 'trunctfsf2.c', 'umoddi3.c', 'fixunsdfdi.c', 'muldi3.c',
'divdi3.c', 'divmoddi4.c', 'udivdi3.c', 'udivmoddi4.c']
src_files.append(shared.path_from_root('system', 'lib', 'compiler-rt', 'extras.c'))


class libc(AsanInstrumentedLibrary, MuslInternalLibrary, MTLibrary):
Expand Down Expand Up @@ -1059,26 +1071,6 @@ def can_build(self):
return shared.Settings.WASM_BACKEND


class libcompiler_rt_wasm(CompilerRTWasmLibrary):
name = 'libcompiler_rt_wasm'

src_dir = ['system', 'lib', 'compiler-rt', 'lib', 'builtins']
src_files = ['addtf3.c', 'ashlti3.c', 'ashrti3.c', 'atomic.c', 'comparetf2.c',
'divtf3.c', 'divti3.c', 'udivmodti4.c',
'extenddftf2.c', 'extendsftf2.c',
'fixdfti.c', 'fixsfti.c', 'fixtfdi.c', 'fixtfsi.c', 'fixtfti.c',
'fixunsdfti.c', 'fixunssfti.c', 'fixunstfdi.c', 'fixunstfsi.c', 'fixunstfti.c',
'floatditf.c', 'floatsitf.c', 'floattidf.c', 'floattisf.c',
'floatunditf.c', 'floatunsitf.c', 'floatuntidf.c', 'floatuntisf.c', 'lshrti3.c',
'modti3.c', 'multc3.c', 'multf3.c', 'multi3.c', 'subtf3.c', 'udivti3.c', 'umodti3.c', 'ashrdi3.c',
'ashldi3.c', 'fixdfdi.c', 'floatdidf.c', 'lshrdi3.c', 'moddi3.c',
'trunctfdf2.c', 'trunctfsf2.c', 'umoddi3.c', 'fixunsdfdi.c', 'muldi3.c',
'divdi3.c', 'divmoddi4.c', 'udivdi3.c', 'udivmoddi4.c']

def get_files(self):
return super(libcompiler_rt_wasm, self).get_files() + [shared.path_from_root('system', 'lib', 'compiler-rt', 'extras.c')]


class libc_rt_wasm(AsanInstrumentedLibrary, CompilerRTWasmLibrary, MuslInternalLibrary):
name = 'libc_rt_wasm'

Expand Down Expand Up @@ -1320,7 +1312,6 @@ def add_library(lib):
add_library(lib)

if shared.Settings.WASM_BACKEND:
add_library(system_libs_map['libcompiler_rt_wasm'])
add_library(system_libs_map['libc_rt_wasm'])

if shared.Settings.UBSAN_RUNTIME == 1:
Expand Down