Skip to content

Commit a28eb98

Browse files
authored
Document handling of glibc-compat libraries. NFC (#14382)
1 parent 5d42afd commit a28eb98

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

tools/building.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,8 +1339,6 @@ def is_wasm_dylib(filename):
13391339
def map_to_js_libs(library_name):
13401340
# Some native libraries are implemented in Emscripten as system side JS libraries
13411341
library_map = {
1342-
'c': [],
1343-
'dl': [],
13441342
'EGL': ['library_egl.js'],
13451343
'GL': ['library_webgl.js', 'library_html5_webgl.js'],
13461344
'webgl.js': ['library_webgl.js', 'library_html5_webgl.js'],
@@ -1351,15 +1349,27 @@ def map_to_js_libs(library_name):
13511349
'glfw3': ['library_glfw.js'],
13521350
'GLU': [],
13531351
'glut': ['library_glut.js'],
1354-
'm': [],
13551352
'openal': ['library_openal.js'],
1356-
'rt': [],
1357-
'pthread': [],
13581353
'X11': ['library_xlib.js'],
13591354
'SDL': ['library_sdl.js'],
1360-
'stdc++': [],
13611355
'uuid': ['library_uuid.js'],
1362-
'websocket': ['library_websocket.js']
1356+
'websocket': ['library_websocket.js'],
1357+
# These 4 libraries are seperate under glibc but are all rolled into
1358+
# libc with musl. For compatibility with glibc we just ignore them
1359+
# completely.
1360+
'dl': [],
1361+
'm': [],
1362+
'rt': [],
1363+
'pthread': [],
1364+
# This is the name of GNU's C++ standard library. We ignore it here
1365+
# for compatability with GNU toolchains.
1366+
'stdc++': [],
1367+
# This means that linking against libc with `-lc` is ignored when the
1368+
# library is not found (It does work if library already exists in the
1369+
# sysroot because that case is handled before we call (map_to_js_libs).
1370+
# TODO(sbc): We should probably remove this and allow `-lc` to make it all
1371+
# the way to the linker.
1372+
'c': [],
13631373
}
13641374

13651375
if library_name in library_map:

0 commit comments

Comments
 (0)