@@ -1339,8 +1339,6 @@ def is_wasm_dylib(filename):
1339
1339
def map_to_js_libs (library_name ):
1340
1340
# Some native libraries are implemented in Emscripten as system side JS libraries
1341
1341
library_map = {
1342
- 'c' : [],
1343
- 'dl' : [],
1344
1342
'EGL' : ['library_egl.js' ],
1345
1343
'GL' : ['library_webgl.js' , 'library_html5_webgl.js' ],
1346
1344
'webgl.js' : ['library_webgl.js' , 'library_html5_webgl.js' ],
@@ -1351,15 +1349,27 @@ def map_to_js_libs(library_name):
1351
1349
'glfw3' : ['library_glfw.js' ],
1352
1350
'GLU' : [],
1353
1351
'glut' : ['library_glut.js' ],
1354
- 'm' : [],
1355
1352
'openal' : ['library_openal.js' ],
1356
- 'rt' : [],
1357
- 'pthread' : [],
1358
1353
'X11' : ['library_xlib.js' ],
1359
1354
'SDL' : ['library_sdl.js' ],
1360
- 'stdc++' : [],
1361
1355
'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' : [],
1363
1373
}
1364
1374
1365
1375
if library_name in library_map :
0 commit comments