<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>Unfortunately you’re not the only developer facing these build errors.</div><div>They've been reported in <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/23810">#23810</a> and <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/23789">#23789</a>.</div><div><br></div><div>It might be worth pasting your workaround there too.</div><div><br></div><div>Thanks,</div><div>Rodrigo</div><div><div><div><br><blockquote type="cite"><div>On 8 Aug 2023, at 16:33, Viktor Dukhovni <ietf-dane@dukhovni.org> wrote:</div><br class="Apple-interchange-newline"><div><div>The build was failing, because rts/OSThreads.h via Rts.h from<br>libraries/bytestring/cbits/is-valid-utf8.c had no definition of<br>`clockid_t`.  This type is not exposed with _POSIX_C_SOURCE is<br>not defined to a sufficiently high value:<br><br>    SYNOPSIS<br>           #include <time.h><br><br>           int clock_getres(clockid_t clockid, struct timespec *res);<br><br>           int clock_gettime(clockid_t clockid, struct timespec *tp);<br>           int clock_settime(clockid_t clockid, const struct timespec *tp);<br><br>           Link with -lrt (only for glibc versions before 2.17).<br><br>       Feature Test Macro Requirements for glibc (see feature_test_macros(7)):<br><br>           clock_getres(), clock_gettime(), clock_settime():<br>               _POSIX_C_SOURCE >= 199309L<br><br>I quick-and-dirty work-around was:<br><br>--- a/libraries/bytestring/cbits/is-valid-utf8.c<br>+++ b/libraries/bytestring/cbits/is-valid-utf8.c<br>@@ -27,6 +27,10 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY<br> OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br> SUCH DAMAGE.<br> */<br>+#undef _POSIX_C_SOURCE<br>+#define _POSIX_C_SOURCE 200809L<br>+#undef _XOPEN_SOURCE<br>+#define _XOPEN_SOURCE   700<br> #pragma GCC push_options<br> #pragma GCC optimize("-O2")<br> #include <stdbool.h><br><br><br>There's surely a better solution.<br><br>-- <br>    Viktor.<br>_______________________________________________<br>ghc-devs mailing list<br>ghc-devs@haskell.org<br>http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br></div></div></blockquote></div><br></div></div></body></html>