Skip to content

undefined symbol: wcsftime #16113

Closed
Closed
@tiran

Description

@tiran

Please include the following in your bug report:

Emscripten's libc is missing wcsftime function although the source file https://github.com/emscripten-core/emscripten/blob/3.1.1/system/lib/libc/musl/src/time/wcsftime.c is shipped with emsdk. A similar issue was reported in #7057, but the bug was auto-closed.

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.1 (1934a98e709b57d3592b8272d3f1264a72c089e4)
clang version 14.0.0 (https://github.com/llvm/llvm-project f142c45f1e494f8dbdcc1bcf14122d128ac8f3fe)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin

Failing command line in full:

configure:13727: /emsdk/upstream/emscripten/emcc -o conftest    conftest.c -ldl  >&5
error: undefined symbol: wcsftime (referenced by top-level compiled C/C++ code)
warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _wcsftime may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
emcc: error: '/emsdk/node/14.18.2_64bit/bin/node /emsdk/upstream/emscripten/src/compiler.js /tmp/tmplokibpqr.json' failed (returned 1)
configure:13727: $? = 1

I noticed that libc.a does not include the object file for wcsftime.c:

# /emsdk/upstream/bin/llvm-ar t /emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libc.a | grep wcsftime
# echo $?
1
# /emsdk/upstream/bin/llvm-ar t /emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libc.a | grep wcs
mbsnrtowcs.o
mbsrtowcs.o
mbstowcs.o
wcscasecmp.o
wcscasecmp_l.o
wcscat.o
wcschr.o
wcscmp.o
wcscoll.o
wcscpy.o
wcscspn.o
wcsdup.o
wcslen.o
wcsncasecmp.o
wcsncasecmp_l.o
wcsncat.o
wcsncmp.o
wcsncpy.o
wcsnlen.o
wcsnrtombs.o
wcspbrk.o
wcsrchr.o
wcsrtombs.o
wcsspn.o
wcsstr.o
wcstod.o
wcstok.o
wcstol.o
wcstombs.o
wcswcs.o
wcswidth.o
wcsxfrm.o


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions