openssl: 1.1.1q test/v3ext.c fails to compile on MacOS (missing string.h include)
Building using: ./Configure no-shared no-gost darwin64-arm64-cc -g -fPIC -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.1 fails with:
clang -Iinclude -arch arm64 -O3 -Wall -g -fPIC -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.1 -D_REENTRANT -DNDEBUG -MMD -MF test/v3ext.d.tmp -MT test/v3ext.o -c -o test/v3ext.o test/v3ext.c
test/v3ext.c:201:24: error: implicitly declaring library function 'memcmp' with type 'int (const void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
if (!TEST_true(memcmp(ip1->data, ip2->data, ip1->length) <= 0))
^
test/v3ext.c:201:24: note: include the header <string.h> or explicitly provide a declaration for 'memcmp'
1 error generated.
make[1]: *** [test/v3ext.o] Error 1
Adding #include <string.h> to test/v3ext.c resolves the error (other tests already explicitly include string.h)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 33
- Comments: 37 (11 by maintainers)
Commits related to this issue
- (PA-4551) Add a patch for openssl-1.1.1q for macos https://github.com/openssl/openssl/issues/18720 ^^ Above issue causes failures on macos, this PR patches a fix for that. Future openssl should fix t... — committed to cthorn42/puppet-runtime by cthorn42 2 years ago
- patches for fixing https://github.com/openssl/openssl/issues/18720 — committed to shogo82148/actions-setup-mysql by shogo82148 2 years ago
- bump OpenSSL v1.1.1q (#623) * bump OpenSSL v1.1.1q * patches for fixing https://github.com/openssl/openssl/issues/18720 * fix patches for windows — committed to shogo82148/actions-setup-mysql by shogo82148 2 years ago
- static-build: bump openssl from 1.1.1n to 1.1.1q Just regular update to bring openssl security fixes into tarantool. Added a patch for Mac OS to fix a build failure, see https://github.com/openssl/o... — committed to Totktonada/tarantool by Totktonada 2 years ago
- static-build: bump openssl from 1.1.1n to 1.1.1q Just regular update to bring openssl security fixes into tarantool. Added a patch for Mac OS to fix a build failure, see https://github.com/openssl/o... — committed to tarantool/tarantool by Totktonada 2 years ago
- static-build: bump openssl from 1.1.1n to 1.1.1q Just regular update to bring openssl security fixes into tarantool. Added a patch for Mac OS to fix a build failure, see https://github.com/openssl/o... — committed to tarantool/tarantool by Totktonada 2 years ago
- static-build: bump openssl from 1.1.1n to 1.1.1q Just regular update to bring openssl security fixes into tarantool. Added a patch for Mac OS to fix a build failure, see https://github.com/openssl/o... — committed to mkokryashkin/tarantool by Totktonada 2 years ago
- Fix macOS, windows builds - Adopted suggested macOS patch from https://github.com/openssl/openssl/issues/18720 - Removed our nasm configuration patch, as we have nasm > v2 - Dedupe path before callin... — committed to secondlife/3p-openssl by bennettgoble 2 years ago
- Fix compilation error when building OpenSSL 1.1.1q in MacOS 11+ "error: implicitly declaring library function 'memcmp'" Downstream backport of https://github.com/openssl/openssl/issues/18720 — committed to native-api/pyenv by native-api 2 years ago
- Fix compilation error when building OpenSSL 1.1.1q in MacOS 11+ "error: implicitly declaring library function 'memcmp'" Downstream backport of https://github.com/openssl/openssl/issues/18720 — committed to 0xkag/pyenv by native-api 2 years ago
OPENSSL_CFLAGS=-Wno-error=implicit-function-declarationshould help for rbenv / ruby-build. (https://github.com/rbenv/ruby-build/issues/1998)I was trying to install
rbenv install 2.7.6. Having this issue now:(Either wait until 1.1.1r is out or apply the patch yourself, it is not that hard.
mac asdf peeps that have ended up in this thread: (openssl 1.1.1q preventing install)
Intel:
M1:
(thank you @frozen92) (thank you @captain-enjoyable for digging into this and finding this thread)
you can download older version from git (v20220630) or use asdf ASDF_RUBY_BUILD_VERSION=v20220630 asdf install ruby 2.7.6
OPENSSL_CFLAGS=-Wno-error=implicit-function-declaration rbenv install 2.7.6worked for meFound a workaround here, helped me
How can I do, to install this patch ?
Yes, it is a genuine issue with
1.1.1q. A fix has already been committed to theOpenSSL_1_1_1-stablebranch and should be in the next version of1.1.1.To fix is to add a line
#include <string.h>at the top oftest/v3ext.c, if you don’t want to use the stable branch or wait for the next1.1.1release.Waiting for the new release with the fix.
@pplmx Yes, the issue is present in the 1.1.1q release, and the 1.1.1q release won’t be changed. It is fixed in the
OpenSSL_1_1_1-stablebranch, and the next 1.1.1 release won’t have the issue.This is fixed in git repo, keeping it open until next release to avoid duplicate reports.
@jasonacox Yes, it is a “generic” bug and not related to the architecture you build for. It causes a build error only on macOS because the clang on macOS implicitly adds
-Wimplicit-function-declarationin-Wall, which it doesn’t on Linux. The fix is in theOpenSSL_1_1_1-stablebranch and will be in the next release of1.1.1- in the filetest/v3ext.c, after the line#include <stdio.h>near the top, add a line that saysHi I also kept running into this on ‘Mac OS X 10.15.7 using ruby-build’ I had to set both of the following variables at the same time before the rbenv install 3.0.1 command:
OPENSSL_CFLAGS=-Wno-error=implicit-function-declaration RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 3.0.1make testruns them. Doing this is recommended.Installing previous version and linking it for ruby install helped me https://github.com/rbenv/ruby-build/discussions/1940#discussioncomment-2663209
Also hit this bug. Further confirmed via CI: https://github.com/openssl/openssl/runs/7190875851?check_suite_focus=true