NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/57083: build.sh failed to build toolchain on macOS (patch)



>Number:         57083
>Category:       lib
>Synopsis:       build.sh failed to build toolchain on macOS (patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 16 17:45:00 +0000 2022
>Originator:     Jiaxun Yang
>Release:        current
>Organization:
>Environment:
Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 arm64
>Description:
When bootstrapping toolchain on macOS, I got following error report:

time/zic.c:1204:9: warning: implicit declaration of function 'getrandom' is invalid in C99 [-Wimplicit-function-declaration]
>How-To-Repeat:
Bootstrapping on macOS with:

./build.sh -U -O ~/obj -j8 -m evbmips -a mips64el tools

>Fix:
Just don't prove sys/random.h on macOS.
Darwin would supply sys/random.h but it doesn't contains getrandon().

diff --git a/lib/libc/time/private.h b/lib/libc/time/private.h
index 314e3c994af0..6a72afa92591 100644
--- a/lib/libc/time/private.h
+++ b/lib/libc/time/private.h
@@ -75,7 +75,7 @@
 # define HAVE_GENERIC (201112 <= __STDC_VERSION__)
 #endif
 
-#if !defined HAVE_GETRANDOM && defined __has_include
+#if !defined HAVE_GETRANDOM && && !defined __APPLE__  && !defined __has_include
 # if __has_include(<sys/random.h>)
 #  define HAVE_GETRANDOM true
 # else



Home | Main Index | Thread Index | Old Index