build icon indicating copy to clipboard operation
build copied to clipboard

zlib: HAVE_UNISTD_H is required for successful build on Apple Silicon

Open k15tfu opened this issue 5 years ago • 5 comments

^^

Otherwise, some functions will be undefined and zlib devs insist that there are no errors when building with ./configure (https://github.com/madler/zlib/pull/509). So from this point of view we have to pass the right flags if we don't use this script.

k15tfu avatar Jul 13 '20 20:07 k15tfu

This is totally unrelated to b2.

grafikrobot avatar Sep 12 '20 21:09 grafikrobot

@grafikrobot Why? The code you use for building zlib is incorrect because HAVE_UNISTD_H define is missing: https://github.com/boostorg/build/blob/003a3c29c12427c5a424f2332aa4ba00a8554a88/src/tools/zlib.jam#L203

k15tfu avatar Nov 30 '20 15:11 k15tfu

@k15tfu ah, I see. Thanks for the clarification.

grafikrobot avatar Nov 30 '20 15:11 grafikrobot

Thank you for your contributions. Main development of B2 has moved to https://github.com/bfgroup/b2 This issue has been automatically marked as "transition" to indicate the potential for needing transition to the new B2 development project.

stale[bot] avatar May 29 '21 16:05 stale[bot]

@grafikrobot Hi! Is there anything I can help with? Locally we use this patch to get it to build on Apple Silicon, and I can make a PR for this:

% diff -uar ./tools/build/src/tools/zlib.jam.orig ./tools/build/src/tools/zlib.jam
--- ./tools/build/src/tools/zlib.jam    2020-07-13 22:21:52.000000000 +0200
+++ ./tools/build/src/tools/zlib.jam    2020-07-13 22:21:13.000000000 +0200
@@ -200,6 +200,7 @@
                 <include>$(source-path)
                 <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
                 <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
+                <toolset>clang:<define>HAVE_UNISTD_H=1
                 <link>shared:<define>ZLIB_DLL
               :
               : <include>$(source-path) ] ;```

k15tfu avatar Jun 14 '22 15:06 k15tfu