runtime: dotnet/runtime fails to build on Ubuntu 22.04 with /p:PortableBuild=false

When following the build requirements for Ubuntu 22.04, I get the following issue when building without PortableBuild true:

./build.sh -c Release /p:PortableBuild=false

ld.lld : error : undefined symbol: OpenSSL_version_num [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: OPENSSL_init_ssl [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: CRYPTO_get_ex_new_index [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: OCSP_RESPONSE_free [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: ERR_peek_last_error [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: ERR_clear_error [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: ERR_error_string_n [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_MD_CTX_new [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_md5 [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_MD_CTX_set_flags [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_DigestInit_ex [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_MD_CTX_free [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_DigestUpdate [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_DigestFinal_ex [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_MD_get_size [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_MD_fetch [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_sha1 [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_sha256 [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_sha384 [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]
ld.lld : error : undefined symbol: EVP_sha512 [/home/vihofer/git/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (16 by maintainers)

Most upvoted comments

Non-portable AOT should just be using normal dynamic linking… as Jan said, the -lssl -lcrypto options.

I would prefer if all source build platforms built and bundled the portable versions of our runtime packs instead.

This isn’t possible because distro guidelines don’t allow including pre-compiled binaries. And, building the portable assets from source isn’t feasible because they rely on things that a distro won’t provide, like an old glibc version.

Though the resulting binaries won’t run on other OSes, they bring the feature to the OS itself by meeting the requirement of building it from source.

That said, I’m no longer worried that people will hit an unusual situation with Native AOT, compared to self-contained publish. In both cases, you would have to explicitly specify hostRid-arch in order to get a host-specific build. Specifying a RID like linux-x64 would get you appropriately portable bits.

Yes, I also find this important for the UX. The user needs to be explicit about the platform.

This is definitely https://github.com/dotnet/runtime/issues/66859.

I’m still thinking about the right fix for that.

In the meantime, I’ve realized that the crossgen_publish condition is wrong. It shouldn’t be conditioned on source build, it should be conditioned on portable. I’ll submit a fix.