Unfortunately you’re not the only developer facing these build errors.
They've been reported in #23810 and #23789.

It might be worth pasting your workaround there too.

Thanks,
Rodrigo

On 8 Aug 2023, at 16:33, Viktor Dukhovni <ietf-dane@dukhovni.org> wrote:

The build was failing, because rts/OSThreads.h via Rts.h from
libraries/bytestring/cbits/is-valid-utf8.c had no definition of
`clockid_t`.  This type is not exposed with _POSIX_C_SOURCE is
not defined to a sufficiently high value:

   SYNOPSIS
          #include <time.h>

          int clock_getres(clockid_t clockid, struct timespec *res);

          int clock_gettime(clockid_t clockid, struct timespec *tp);
          int clock_settime(clockid_t clockid, const struct timespec *tp);

          Link with -lrt (only for glibc versions before 2.17).

      Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

          clock_getres(), clock_gettime(), clock_settime():
              _POSIX_C_SOURCE >= 199309L

I quick-and-dirty work-around was:

--- a/libraries/bytestring/cbits/is-valid-utf8.c
+++ b/libraries/bytestring/cbits/is-valid-utf8.c
@@ -27,6 +27,10 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
+#undef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE   700
#pragma GCC push_options
#pragma GCC optimize("-O2")
#include <stdbool.h>


There's surely a better solution.

--
   Viktor.
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs