jasonacox / Build-OpenSSL-cURL

Scripts to build OpenSSL, HTTP/2 (nghttp2) and cURL (libcurl) for MacOS, iOS and tvOS devices (x86_64, armv7, armv7s, arm64, arm64e). Now Supporting Apple Silicon, OpenSSL 3.0.x with TLS 1.3 and Mac Catalyst builds.
MIT License
433 stars 132 forks source link

Build error with OpenSSL 1.1.1q #59

Closed rbright55 closed 1 year ago

rbright55 commented 2 years ago

Build error occurs when trying to build with OpenSSL 1.1.1q. The error occurs when it is attempting to build for iOS.

jasonacox commented 2 years ago

Hi @rbright55 ! Thanks for opening this!

I'll do some investigation. If anyone else has discovered the cause for the build failure, please feel free to update here (or submit a PR if you figure it out! :).

jasonacox commented 2 years ago

Posting error that is causing this to break with build.sh:

cc  -Iinclude -arch x86_64 -Os -mmacosx-version-min=11.6.8 -arch x86_64  -D_REENTRANT -DNDEBUG  -MMD -MF test/versions.d.tmp -MT test/versions.o -c -o test/versions.o test/versions.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
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

If I attempt a generic build (config and make), I'm getting the same - this could be a problem with 1.1.1q:

${LDCMD:-cc} -arch x86_64 -O3 -Wall -L. -Wl,-search_paths_first  \
        -o test/uitest test/uitest.o \
         apps/libapps.a -lssl test/libtestutil.a -lcrypto  
cc  -Iinclude -arch x86_64 -O3 -Wall -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
make: *** [all] Error 2
jasonacox commented 2 years ago

@rbright55 This is an open issue on OpenSSL: https://github.com/openssl/openssl/issues/18720

It looks like a fix has been pushed and should show up in the next version. We can keep this open until a fixed version is released. I am also going to add set -e to the build.sh script as it is difficult to spot / troubleshoot these errors when build.sh just plows on ahead.

jasonacox commented 2 years ago

Great explanation by @tom-cosgrove-arm in https://github.com/openssl/openssl/issues/18720#issuecomment-1210284214