Skip to content

Document handling of glibc-compat libraries. NFC #14382

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

Merged
merged 1 commit into from
Jun 4, 2021
Merged
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
24 changes: 17 additions & 7 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,8 +1339,6 @@ def is_wasm_dylib(filename):
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'],
Expand All @@ -1351,15 +1349,27 @@ 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++': [],
'uuid': ['library_uuid.js'],
'websocket': ['library_websocket.js']
'websocket': ['library_websocket.js'],
# These 4 libraries are seperate under glibc but are all rolled into
# libc with musl. For compatibility with glibc we just ignore them
# completely.
'dl': [],
'm': [],
'rt': [],
'pthread': [],
# This is the name of GNU's C++ standard library. We ignore it here
# for compatability with GNU toolchains.
'stdc++': [],
# This means that linking against libc with `-lc` is ignored when the
# library is not found (It does work if library already exists in the
# sysroot because that case is handled before we call (map_to_js_libs).
# TODO(sbc): We should probably remove this and allow `-lc` to make it all
# the way to the linker.
'c': [],
}

if library_name in library_map:
Expand Down