From c9d96aeae713206754eb9e506aa0d0fbde3e52f7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 19 Jan 2020 12:40:04 -0500 Subject: [PATCH] work around gcc libstdc++ time64 incompatibility with the default --enable-libstdcxx-time, libstdc++'s configure probes for the existence of a clock_gettime syscall and sets up the time API implementation to make direct syscalls, presumably as a workaround for old glibc tucking away the clock_gettime function in librt, which in turn depends on libpthread. this breaks since struct timespec does not match the syscall's interface on 32-bit archs. passing --enable-libstdcxx-time=rt forces different configure paths that correctly use the public clock_gettime function and librt if needed. this issue should be patched in gcc rather than worked around via configure options, but I'd rather wait to patch until I understand how to fix it correctly and produce a patch that's acceptable to upstream and distros. --- litecross/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litecross/Makefile b/litecross/Makefile index 1d35b93..a3431b2 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -76,7 +76,7 @@ FULL_GCC_CONFIG = --enable-languages=c,c++ \ --disable-libmudflap --disable-libsanitizer \ --disable-gnu-indirect-function \ --disable-libmpx \ - --enable-libstdcxx-time + --enable-libstdcxx-time=rt FULL_MUSL_CONFIG = $(MUSL_CONFIG) \ --prefix= --host=$(TARGET)