diff options
author | Vladimir Sadov <vsadov@microsoft.com> | 2020-05-06 04:05:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 04:05:50 +0300 |
commit | f6e5219b13f4bb9d6c1c9f80fd6ca6c594c6c7f8 (patch) | |
tree | f7c07a41edfbcf6fc4315dd15ff15d31a37e2c93 /eng | |
parent | d70a2a62092f0ac86a574be81274dc50e0cbf62f (diff) |
Build an apphost with hostfxr and hostpolicy linked in (#35368)
* hostfxr: Build most of hostfxr as a static library
This is part of the work to create an apphost that bundles both hostfxr
and hostpolicy. The main distinction between the static and shared
versions of hostfxr is that the static version contains a hostpolicy
resolver that references the hostpolicy symbols directly rather than
loading them from a DLL.
* hostpolicy: Build as a static library
This change is part of the work to enable an apphost that bundles both
hostfxr and hostpolicy. There's no distinction between hostpolicy
that's built as a shared library and as a static library: the shared
library is built by linking an empty object file with the static
library.
* corehost: Allow linking of hostfxr and hostpolicy with apphost
Provide a hostfxr_iface class, that abstracts how the hostfxr functions called
by the early stage in the hosting layer is resolved.
* dotnet: Teach the muxer binary about hostfxr_iface
* apphost: Teach apphost about hostfxr_iface
This provides two implementations of hostfxr_iface: one for the static
apphost, which bundles hostfxr and hostpolicy, and another for the
conventional apphost, which loads them dynamically on startup.
* Add exports for hostfxr and policy
* Exports for unix
* EXPORTS_LINKER_OPTION
* use generateversionscript.awk from ENG
* Move fxr files out of static
* Fixes for Linux
* Fix for win-x86
* move HEADERS next to SOURCES similarly to other files.
* PR feedback (simplifying hostpolicy_resolver::try_get_dir for static host)
* Publish static_apphost to Microsoft.NETCore.App.Host
* bind to entry points without probing, when in a static host.
* Add a test case
* renamed hostfxr_iface --> hostfxr_resolver_t
* renamed shared --> standalone
* rename static_apphost --> singlefilehost
* Signing exclusions for singlefilehost
* switched StaticHost tst to a different asset (mostly a copy of StandaloneApp)
Co-authored-by: Leandro Pereira <leandro.pereira@microsoft.com>
Co-authored-by: Swaroop Sridhar <swaroop.sridhar@microsoft.com>
Diffstat (limited to 'eng')
-rw-r--r-- | eng/SignCheckExclusionsFile.txt | 1 | ||||
-rw-r--r-- | eng/Signing.props | 2 | ||||
-rw-r--r-- | eng/native/functions.cmake | 8 | ||||
-rw-r--r-- | eng/native/generateexportedsymbols.awk | 12 | ||||
-rw-r--r-- | eng/native/generateversionscript.awk | 28 |
5 files changed, 46 insertions, 5 deletions
diff --git a/eng/SignCheckExclusionsFile.txt b/eng/SignCheckExclusionsFile.txt index 2db3b79a933..a78ad401525 100644 --- a/eng/SignCheckExclusionsFile.txt +++ b/eng/SignCheckExclusionsFile.txt @@ -7,6 +7,7 @@ ;; and SCD apps. If they are signed, the file that the SDK produces has an invalid signature and ;; can't be signed again. More info at https://github.com/dotnet/core-setup/pull/7549. *apphost.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 +*singlefilehost.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 *comhost.dll;;Template, https://github.com/dotnet/core-setup/pull/7549 *apphosttemplateapphostexe.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 *comhosttemplatecomhostdll.dll;;Template, https://github.com/dotnet/core-setup/pull/7549 diff --git a/eng/Signing.props b/eng/Signing.props index 05f2a8bcb39..5ceb96ac54b 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -24,7 +24,7 @@ <BundleInstallerExeArtifact Include="$(ArtifactsPackagesDir)**/*.exe" /> <!-- apphost and comhost template files are not signed, by design. --> - <FileSignInfo Include="apphost.exe;comhost.dll" CertificateName="None" /> + <FileSignInfo Include="apphost.exe;singlefilehost.exe;comhost.dll" CertificateName="None" /> </ItemGroup> <ItemGroup Condition="'$(CrossTargetComponentFolder)' != ''"> diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index 060cff8987e..49b0064499e 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -175,8 +175,8 @@ function(generate_exports_file) add_custom_command( OUTPUT ${outputFilename} - COMMAND ${AWK} -f ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT} ${INPUT_LIST} >${outputFilename} - DEPENDS ${INPUT_LIST} ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT} + COMMAND ${AWK} -f ${CLR_ENG_NATIVE_DIR}/${AWK_SCRIPT} ${INPUT_LIST} >${outputFilename} + DEPENDS ${INPUT_LIST} ${CLR_ENG_NATIVE_DIR}/${AWK_SCRIPT} COMMENT "Generating exports file ${outputFilename}" ) set_source_files_properties(${outputFilename} @@ -196,8 +196,8 @@ function(generate_exports_file_prefix inputFilename outputFilename prefix) add_custom_command( OUTPUT ${outputFilename} - COMMAND ${AWK} -f ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT} ${AWK_VARS} ${inputFilename} >${outputFilename} - DEPENDS ${inputFilename} ${CMAKE_SOURCE_DIR}/${AWK_SCRIPT} + COMMAND ${AWK} -f ${CLR_ENG_NATIVE_DIR}/${AWK_SCRIPT} ${AWK_VARS} ${inputFilename} >${outputFilename} + DEPENDS ${inputFilename} ${CLR_ENG_NATIVE_DIR}/${AWK_SCRIPT} COMMENT "Generating exports file ${outputFilename}" ) set_source_files_properties(${outputFilename} diff --git a/eng/native/generateexportedsymbols.awk b/eng/native/generateexportedsymbols.awk new file mode 100644 index 00000000000..69a8a8e6df5 --- /dev/null +++ b/eng/native/generateexportedsymbols.awk @@ -0,0 +1,12 @@ +{ + # Remove the CR character in case the sources are mapped from + # a Windows share and contain CRLF line endings + gsub(/\r/,"", $0); + + # Skip empty lines and comment lines starting with semicolon + if (NF && !match($0, /^[[:space:]]*;/)) + { + gsub(/^#/,"", $0); + print "_" $0; + } +} diff --git a/eng/native/generateversionscript.awk b/eng/native/generateversionscript.awk new file mode 100644 index 00000000000..7efc537325a --- /dev/null +++ b/eng/native/generateversionscript.awk @@ -0,0 +1,28 @@ +BEGIN { + print "V1.0 {"; + print " global:"; +} +{ + # Remove the CR character in case the sources are mapped from + # a Windows share and contain CRLF line endings + gsub(/\r/,"", $0); + + # Skip empty lines and comment lines starting with semicolon + if (NF && !match($0, /^[ \t]*;/)) + { + # Only prefix the entries that start with "#" + if (match($0, /^#.*/)) + { + gsub(/^#/,"", $0); + print " "prefix $0 ";"; + } + else + { + print " "$0 ";"; + } + } +} +END { + print " local: *;" + print "};"; +} |