You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@serf.apache.org by Alexandr Miloslavskiy <al...@syntevo.com> on 2021/10/06 23:05:47 UTC

[PATCH] Fix build on macOS 11

[[
Fix build on macOS 11

This serf's commit added headers that I'm now removing:
   r1833227 by Branko Čibej, 2018-06-09 12:05:32
   Fix building with OpenSSL on Windows with non-source layout.

It is unclear why it claims to fix Windows build:
* For me, windows builds just fine, and I'm using OpenSSL 1.1
   with installed layout.
* When header is given, SCons's 'CheckFunc()' doesn't declare function
   This causes "implicit function declaration", which is an error on
   macOS 11 and warning otherwise.
* For everything except 'CRYPTO_set_locking_callback' the provided
   header was a wrong one.
* 'BIO_set_init' is a function with 2 arguments.
   If header was correct, build would fail anyway due to arguments.
   It only succeeds because header is wrong. Windows compiler warns:
	warning C4013: 'BIO_set_init' undefined; assuming extern returning int'

To summarize:
* On Windows/Linux, detection worked with warnings despite wrong header
* On macOS 11, detection failed due to wrong header

Fix this by removing incorrect headers, letting detection work again.
In absence of header, SCons's 'CheckFunc()' injects a function
declaration with 0 arguments.

This fixes the following build error on macOS 11:
   buckets/ssl_buckets.c:345:8: error: incomplete definition of type 
'struct bio_st'

The build was tested with OpenSSL 1.1.1l (installed layout) on
Win8.1 (VS2013), Ubuntu 21.04, macOS 11

* SConstruct:
   - Add code comments
   - Remove headers from functions with arguments
]]