Skip to content

Commit bc2f472

Browse files
committed
Seperate out handling of dummy glibc libraries. NFC
Split out from #14337
1 parent 974fa03 commit bc2f472

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

emcc.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3507,13 +3507,23 @@ def process_libraries(link_flags, lib_dirs, linker_inputs):
35073507
libraries = []
35083508
suffixes = STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS
35093509
system_libs_map = system_libs.Library.get_usable_variations()
3510+
# These libraries are seperate under glibc but with musl they are all rolled into
3511+
# a single libc. For compatability we silectly ignore these.
3512+
ignore_libraries = [
3513+
'm',
3514+
'rt',
3515+
'pthread',
3516+
'dl',
3517+
]
35103518

35113519
# Find library files
35123520
for i, flag in link_flags:
35133521
if not flag.startswith('-l'):
35143522
new_flags.append((i, flag))
35153523
continue
35163524
lib = strip_prefix(flag, '-l')
3525+
if lib in ignore_libraries:
3526+
continue
35173527
# We don't need to resolve system libraries to absolute paths here, we can just
35183528
# let wasm-ld handle that. However, we do want to map to the correct variant.
35193529
# For example we map `-lc` to `-lc-mt` if we are building with threading support.

tools/building.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,6 @@ def map_to_js_libs(library_name):
13401340
# Some native libraries are implemented in Emscripten as system side JS libraries
13411341
library_map = {
13421342
'c': [],
1343-
'dl': [],
13441343
'EGL': ['library_egl.js'],
13451344
'GL': ['library_webgl.js', 'library_html5_webgl.js'],
13461345
'webgl.js': ['library_webgl.js', 'library_html5_webgl.js'],
@@ -1351,10 +1350,7 @@ def map_to_js_libs(library_name):
13511350
'glfw3': ['library_glfw.js'],
13521351
'GLU': [],
13531352
'glut': ['library_glut.js'],
1354-
'm': [],
13551353
'openal': ['library_openal.js'],
1356-
'rt': [],
1357-
'pthread': [],
13581354
'X11': ['library_xlib.js'],
13591355
'SDL': ['library_sdl.js'],
13601356
'stdc++': [],

0 commit comments

Comments
 (0)