Skip to content

Commit 7aca930

Browse files
committed
Fix hardcoded FEATURE_DISTRO_AGNOSTIC_SSL
Backport dotnet/runtime#42415 and carry it as a patch for now.
1 parent 26531ea commit 7aca930

File tree

2 files changed

+60
-26
lines changed

2 files changed

+60
-26
lines changed

patches/runtime/0014-Attempt-workaround-for-https-github.com-dotnet-runti.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From eac34237f8ee3e85a42af772fa37671c1dbfee73 Mon Sep 17 00:00:00 2001
2+
From: Omair Majid <[email protected]>
3+
Date: Wed, 23 Sep 2020 10:48:12 -0400
4+
Subject: [PATCH] Fix singlefilehost build in non-portable mode (#42415)
5+
6+
The singilefilehost needs to follow the libraries build in terms of how
7+
it links to OpenSSL: if it's a non-portable build, the singlefilehost
8+
needs to link to OpenSSL via linker arguments.
9+
10+
The installer also needs to have FEATURE_DISTRO_AGNOSTIC_SSL defined
11+
just like it is defined for the libraries build.
12+
13+
Fixes: #41768
14+
---
15+
src/installer/corehost/build.sh | 1 +
16+
.../corehost/cli/apphost/static/CMakeLists.txt | 12 ++++++++++++
17+
2 files changed, 13 insertions(+)
18+
19+
diff --git a/src/installer/corehost/build.sh b/src/installer/corehost/build.sh
20+
index c0bbce8e591..bd789c6f34f 100755
21+
--- a/src/installer/corehost/build.sh
22+
+++ b/src/installer/corehost/build.sh
23+
@@ -92,6 +92,7 @@ export __BinDir __IntermediatesDir __CoreClrArtifacts __NativeLibsArtifacts
24+
__CMakeArgs="-DCLI_CMAKE_HOST_VER=\"$__host_ver\" -DCLI_CMAKE_COMMON_HOST_VER=\"$__apphost_ver\" -DCLI_CMAKE_HOST_FXR_VER=\"$__fxr_ver\" $__CMakeArgs"
25+
__CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\"$__DistroRid\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs"
26+
__CMakeArgs="-DCORECLR_ARTIFACTS=\"$__CoreClrArtifacts\" -DNATIVE_LIBS_ARTIFACTS=\"$__NativeLibsArtifacts\" $__CMakeArgs"
27+
+__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs"
28+
29+
if [[ "$__PortableBuild" == 1 ]]; then
30+
__CMakeArgs="-DCLI_CMAKE_PORTABLE_BUILD=1 $__CMakeArgs"
31+
diff --git a/src/installer/corehost/cli/apphost/static/CMakeLists.txt b/src/installer/corehost/cli/apphost/static/CMakeLists.txt
32+
index e6369f6b9ad..fd2508ea0f9 100644
33+
--- a/src/installer/corehost/cli/apphost/static/CMakeLists.txt
34+
+++ b/src/installer/corehost/cli/apphost/static/CMakeLists.txt
35+
@@ -191,6 +191,11 @@ else()
36+
# )
37+
endif ()
38+
39+
+ # Additional requirements for System.Security.Cryptography.Native.OpenSsl
40+
+ if(NOT FEATURE_DISTRO_AGNOSTIC_SSL)
41+
+ find_package(OpenSSL)
42+
+ endif()
43+
+
44+
if(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD OR CLR_CMAKE_TARGET_SUNOS)
45+
# These options are used to force every object to be included even if it's unused.
46+
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
47+
@@ -213,3 +218,10 @@ target_link_libraries(singlefilehost
48+
${NATIVE_LIBS_EXTRA}
49+
50+
)
51+
+
52+
+if(NOT FEATURE_DISTRO_AGNOSTIC_SSL)
53+
+ target_link_libraries(singlefilehost
54+
+ ${OPENSSL_CRYPTO_LIBRARY}
55+
+ ${OPENSSL_SSL_LIBRARY}
56+
+ )
57+
+endif()
58+
--
59+
2.26.2
60+

0 commit comments

Comments
 (0)