-
Notifications
You must be signed in to change notification settings - Fork 4.9k
[release/2.1] Fix build errors in some build configurations #35805
Conversation
This was a mistake in e4bcbd5 (dotnet#34443) made when backporting it to the release branches. All other uses of NEED_OPENSSL_1_0 are guarded by an #ifdef, not an #if. This one should be too. The warning is seen when building corefx using source-build. I couldn't observe it directly: source-build/src/corefx/src/Native/Unix/System.Security.Cryptography.Native/pal_asn1_print.cpp:34:5: error: 'NEED_OPENSSL_1_0' is not defined, evaluates to 0 [-Werror,-Wundef] #if NEED_OPENSSL_1_0 ^
Do both |
No, |
When OpenSSL 1.0 development headers and libraries are installed: both When OpenSSL 1.1 development headers and libraries installed: |
…hy.Native When building in non-portable mode, some OpenSSL 1.1 function defnitions that are marked as unused can be picked up by our build. When those functions are called, clang reports a warning and fails the build: src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:432:12: error: 'sk_ASN1_OBJECT_num' was marked unused but was used [-Werror,-Wused-but-marked-unused] return sk_ASN1_OBJECT_num(eku); ^ This 'unused' attribute was recently added to sk_* methods in OpenSSL 1.1: openssl/openssl#8246
Annoying re-verifying: Do both the portable and non-portable |
Yes, both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @danmosemsft
Tested with OpenSSL 1.0 installed: both |
Approved for 2.1.10 and 2.2.4. |
There's two issues that cause different build warnings, breaking the build under certain conditions:
Issue 1
This was a mistake in e4bcbd5 (#34443) made when backporting it to the release branches. All other uses of NEED_OPENSSL_1_0 are guarded by an
#ifdef
, not an#if
. This one should be too.The warning is seen when building corefx using source-build. I couldn't observe it directly:
Issue 2
When building in non-portable mode, some OpenSSL 1.1 function definitions that are marked as unused can be picked up by our build. When those functions are called, clang reports a warning and fails the build:
This 'unused' attribute was recently added to
sk_*
methods in OpenSSL 1.1: openssl/openssl#8246cc @bartonjs