Skip to content

Commit 4734c0e

Browse files
authored
ClusterFuzz: Bundle mimalloc (#7450)
The emsdk's linux builds now include mimalloc, so we must bundle it for ClusterFuzz, same as we already do for libc++.
1 parent 63186dc commit 4734c0e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/bundle_clusterfuzz.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
up). Note that these may take longer to show up than 1 and 2.
7171
'''
7272

73+
import glob
7374
import os
7475
import subprocess
7576
import sys
@@ -135,11 +136,15 @@
135136
tar.add(libbinaryen, arcname=f'lib/libbinaryen{suffix}')
136137

137138
# The emsdk build also includes some more necessary files.
138-
for name in [f'libc++{suffix}', f'libc++{suffix}.2', f'libc++{suffix}.2.0']:
139-
path = os.path.join(binaryen_lib, name)
140-
if os.path.exists(path):
141-
print(f' ......... : {path}')
142-
tar.add(path, arcname=f'lib/{name}')
139+
for lib in ['libc++', 'libmimalloc']:
140+
# Include the main name plus any NAME.2.0 and such.
141+
# TODO: Using ldd/otool would be better, to find the actual
142+
# dependencies of libbinaryen. Using glob like this will
143+
# pick up stale contents in the directory.
144+
full_lib = os.path.join(binaryen_lib, lib) + suffix
145+
for path in glob.glob(f'{full_lib}*'):
146+
print(f' ............. : {path}')
147+
tar.add(path, arcname=f'lib/{os.path.basename(path)}')
143148

144149
# Add tests we will use as initial content under initial/. We put all the
145150
# tests from the test suite there.

0 commit comments

Comments
 (0)