Skip to content

localtime is defined in the header, but has no implementation #20

@zhuowei

Description

@zhuowei

the localtime function is present in wasi-sysroot's headers, but not in the actual libc library, so programs calling localtime fails during linking:

#include <time.h>

int main() {
	time_t a;
	localtime(&a);
}
zhuowei@zhuowei-laptop:~/wasi-sdk/bin$ ./clang-8 localtime.c 
wasm-ld: error: /tmp/localtime-230b9c.o: undefined symbol: localtime
clang-8: error: lld command failed with exit code 1 (use -v to see invocation)

Either the localtime function should be removed from the header, or an implementation should be added to the libc.

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