Repository navigation
Description
Source build is trying to build preview8 and we're running into linker errors in coreclr installer with what looks like OpenSSL:
RHEL7
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/artifacts/bin/native/net5.0-Linux-Release-x64/libSystem.Security.Cryptography.Native.OpenSsl.a(apibridge.c.o): In function `local_X509_get_version':
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.c:65: undefined reference to `ASN1_INTEGER_get'
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/artifacts/bin/native/net5.0-Linux-Release-x64/libSystem.Security.Cryptography.Native.OpenSsl.a(apibridge.c.o): In function `local_OpenSSL_version_num':
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.c:146: undefined reference to `SSLeay'
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/artifacts/bin/native/net5.0-Linux-Release-x64/libSystem.Security.Cryptography.Native.OpenSsl.a(apibridge.c.o): In function `local_DSA_set0_pqg':
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.c:214: undefined reference to `BN_free'
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.c:220: undefined reference to `BN_free'
/home/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.c:226: undefined reference to `BN_free'
RHEL8:
/usr/bin/ld: /mnt/sdc/chris/dotnet_source-build/artifacts/src/runtime.bf456654f9a4f9a86c15d9d50095ff29cde5f0a4/artifacts/bin/native/net5.0-Linux-Release-x64/libSystem.Security.Cryptography.Native.OpenSsl.a(pal_evp_cipher.c.o): undefined reference to symbol 'EVP_des_ecb@@OPENSSL_1_1_0'
//usr/lib64/libcrypto.so.1.1: error adding symbols: DSO missing from command line
Full logs are attached. It seems like this might be related to https://github.com/dotnet/runtime/pull/39490/files. Any ideas what could be going on? cc @jeffschwMSFT @VSadov @safern @ViktorHofer @vitek-karas @swaroop-sridhar @agocke @omajid
rhel7-Linux.x64.Release-CMakeError.log
rhel7-Linux.x64.Release-CMakeOutput.log
rhel7-net5.0-Linux-Release-x64-CMakeError.log
rhel7-net5.0-Linux-Release-x64-CMakeOutput.log
rhel7-runtime.log
rhel.7-x64.Release-CMakeError.log
rhel.7-x64.Release-CMakeOutput.log
rhel8-net5.0-Linux-Release-x64-CMakeError.log
rhel8-net5.0-Linux-Release-x64-CMakeOutput.log
rhel8-runtime.log
rhel.8-x64.Release-CMakeError.log
rhel.8-x64.Release-CMakeOutput.log
rhel8-Linux.x64.Release-CMakeError.log
rhel8-Linux.x64.Release-CMakeOutput.log
Activity
VSadov commentedon Sep 2, 2020
CC: @janvorli - in case this looks familiar.
janvorli commentedon Sep 2, 2020
I think the source build doesn't use shim for OpenSSL and we are linking to it directly. This looks like we are missing libcrypto from the list of libraries. I wonder if we somehow incorrectly set the FEATURE_DISTRO_AGNOSTIC_SSL to true for source build on RHEL 8. That would cause the libcrypto and libssl to not to be included.
crummel commentedon Sep 3, 2020
Thanks, I think that might be related:
runtime/src/libraries/Native/build-native.sh
Line 69 in 5183c6e
We set PortableBuild both true and false so I'll try forcing
FEATURE_DISTRO_AGNOSTIC_SSLto false for both.Test fix for dotnet/runtime#41768
crummel commentedon Sep 3, 2020
Oh, I think this might actually go the other way. Setting it to true seems to fix the problem, although I haven't built all the way through yet.
janvorli commentedon Sep 3, 2020
Portable build is a build that supports all Linux distros. I have thought that source build is used to build just for a single specific distro. In that case, we don't need to search for SSL version (1.0.0, 1.0.2, 1.1 or version specified explicitly by CLR_OPENSSL_VERSION_OVERRIDE) at runtime, as it is known at build time. Thus the FEATURE_DISTRO_AGNOSTIC_SSL should be false.
dagood commentedon Sep 3, 2020
Source-build needs to support both types: we (Microsoft) need(-ish) to produce a source tarball that is runnable on a variety of potentially unknown distros, so we should be as portable as we can. When a distro then runs that tarball, it will build non-portable, using the same sources but different flags. (However, someone building their own tarball for a specific distro--rather than using our tarball--can also I believe choose to build it non-portable.)
(At a high level, this is complicated because the tarball contains a prebuilt SDK and some other artifacts to bootstrap the process if the build is being done offline.)
In any case... dotnet/runtime should be able to rely on the infra passing in portable build params correctly. There's some more discussion at dotnet/source-build#1529 about the tarball scenarios wrt. portable/non-portable.
omajid commentedon Sep 16, 2020
It looks like the single file host simply forgot to check for the distro-agnostic-ssl mode and to link with the system OpenSSL if it's false.
Test that the system-version of OpenSSL is used directly
Test that the system-version of OpenSSL is used directly
Fix singlefilehost build in non-portable mode
Fix singlefilehost build in non-portable mode (#42415)