Skip to content

Separate out handling of dummy glibc libraries. NFC #14380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 10 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
@@ -3507,13 +3507,23 @@ def process_libraries(link_flags, lib_dirs, linker_inputs):
libraries = []
suffixes = STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS
system_libs_map = system_libs.Library.get_usable_variations()
# These libraries are seperate under glibc but with musl they are all rolled into
# a single libc. For compatability we silectly ignore these.
ignore_libraries = [
'm',
'rt',
'pthread',
'dl',
]

# Find library files
for i, flag in link_flags:
if not flag.startswith('-l'):
new_flags.append((i, flag))
continue
lib = strip_prefix(flag, '-l')
if lib in ignore_libraries:
continue
# We don't need to resolve system libraries to absolute paths here, we can just
# let wasm-ld handle that. However, we do want to map to the correct variant.
# For example we map `-lc` to `-lc-mt` if we are building with threading support.
4 changes: 0 additions & 4 deletions tools/building.py
Original file line number Diff line number Diff line change
@@ -1340,7 +1340,6 @@ def map_to_js_libs(library_name):
# Some native libraries are implemented in Emscripten as system side JS libraries
library_map = {
'c': [],
'dl': [],
'EGL': ['library_egl.js'],
'GL': ['library_webgl.js', 'library_html5_webgl.js'],
'webgl.js': ['library_webgl.js', 'library_html5_webgl.js'],
@@ -1351,10 +1350,7 @@ def map_to_js_libs(library_name):
'glfw3': ['library_glfw.js'],
'GLU': [],
'glut': ['library_glut.js'],
'm': [],
'openal': ['library_openal.js'],
'rt': [],
'pthread': [],
'X11': ['library_xlib.js'],
'SDL': ['library_sdl.js'],
'stdc++': [],