Closed belaviyo closed 1 year ago
We have a polyfill for those two functions in the codebase in blink/preadv.c but it's currently only enabled for Cygwin and Haiku. We don't have a ./configure
script yet sadly. We rely on preprocessor macros for feature detection. What's most likely happening is your software is out of date. Try upgrading to the latest MacOS and/or XCode. You can alternatively just manually edit the #ifdef
we have in the above file. Soon we'll hopefully have a configure script to do better. Thanks for using Blink!
I'm having the same issue.
Enabling the preadv implementation like this:
diff --git a/blink/preadv.c b/blink/preadv.c
index 5779aa7..c206c9c 100644
--- a/blink/preadv.c
+++ b/blink/preadv.c
@@ -16,7 +16,7 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#if defined(__CYGWIN__) || defined(__HAIKU__)
+#if defined(__CYGWIN__) || defined(__HAIKU__) || defined(__APPLE__)
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Causes other issues, like these:
make clean && make
o//blink/blink build/bootstrap/mkdeps.com -o o//depend.host -r o// @o//srcs.txt @o//hdrs.txt 2>/dev/null
rm -f o//third_party/zlib/adler32.o o//third_party/zlib/compress.o o//third_party/zlib/crc32.o o//third_party/zlib/deflate.o o//third_party/zlib/gzclose.o o//third_party/zlib/gzlib.o o//third_party/zlib/gzread.o o//third_party/zlib/gzwrite.o o//third_party/zlib/infback.o o//third_party/zlib/inffast.o o//third_party/zlib/inflate.o o//third_party/zlib/inftrees.o o//third_party/zlib/trees.o o//third_party/zlib/uncompr.o o//third_party/zlib/zutil.o o//x86_64/test/func/lock_test.o o//x86_64/test/func/mem64_test.o o//x86_64/test/func/mmap4096_test.o o//x86_64/test/func/mmap_test.o o//x86_64/test/func/preadv_test.o o//x86_64/test/func/robust_exit_test.o o//x86_64/test/func/robust_kill_test.o o//x86_64/test/func/socket_test.o o//test/blink/disinst_test.o o//test/blink/divmul_test.o o//test/blink/ldbl_test.o o//test/blink/modrm_test.o o//test/blink/x86_test.o o//blink/blink o//blink/blinkenlights o//blink/blink.a
o//blink/blink build/bootstrap/mkdeps.com -o o//depend.host -r o// @o//srcs.txt @o//hdrs.txt 2>/dev/null
cc -g -O2 -fpie -fno-ident -fno-common -fstrict-aliasing -fstrict-overflow -pthread -U_FORTIFY_SOURCE -isystem third_party/zlib -iquote. -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -D__BSD_VISIBLE -c -o o//blink/preadv.o blink/preadv.c
blink/preadv.c:29:37: warning: declaration of 'struct iovec' will not be visible outside of
this function [-Wvisibility]
ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset) {
^
blink/preadv.c:38:16: error: subscript of pointer to incomplete type 'const struct iovec'
t = n + iov[i].iov_len;
~~~^
blink/preadv.c:29:37: note: forward declaration of 'struct iovec'
ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset) {
^
blink/preadv.c:49:18: error: subscript of pointer to incomplete type 'const struct iovec'
m = MIN(iov[i].iov_len, rc - j);
~~~^
[... a lot more ...]
Env
$ clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
You have to edit the ifdef in blink/preadv.h too:
https://github.com/jart/blink/blob/767d3eec80dfba52d85e8b95ce21e06a3d11361e/blink/preadv.h#L3-L9
Hi,
I am getting the following errors when compiling the latest commit on macOS (make -j4)