Imported Upstream version 5.14.0.78

Former-commit-id: 3494343bcc9ddb42b36b82dd9ae7b69e85e0229f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-05-10 08:37:03 +00:00
parent 74b74abd9f
commit 19234507ba
1776 changed files with 67755 additions and 31107 deletions

View File

@@ -1 +1 @@
2.1.0-prerelease-02403-01
2.1.0-preview2-02521-03

View File

@@ -1,5 +1,6 @@
# Build WebAssembly #
Currently, building WebAssembly is only possible on Windows.
## Build WebAssembly on Windows ##
1. Install Emscripten by following the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
2. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to the latest version.
@@ -7,15 +8,33 @@ Currently, building WebAssembly is only possible on Windows.
4. Build the WebAssembly runtime by running ```build.cmd wasm``` from the repo root.
5. Run the WebAssembly "Hello World" test by running ```C:\corert\tests\runtest.cmd wasm```.
To debug compiling WebAssembly:
## Build WebAssembly on OSX ##
1. Install Emscripten by following the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
2. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to the latest version.
3. Get CoreRT set up by installing [Prerequisites](prerequisites-for-building.md).
4. Build the WebAssembly runtime by running ```./build.sh wasm``` from the repo root.
5. Run the WebAssembly "Hello World" test by opening it in [Firefox](https://www.getfirefox.com).
## Build WebAssembly on Ubuntu 16.04.3 ##
1. Get CoreRT set up by installing [Prerequisites](prerequisites-for-building.md), except install ```libicu55``` for Ubuntu 16 instead of ```libicu52```.
2. Install Emscripten by following the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
3. Follow the instructions [here](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk) to update Emscripten to the latest version.
4. Build the WebAssembly runtime by running ```./build.sh wasm``` from the repo root.
5. Run the WebAssembly "Hello World" test by opening it in [Firefox](https://www.getfirefox.com).
# How to debug the IL->WebAssembly compilation #
This is Windows only for now.
1. Set the ILCompiler startup command line to ```@C:\corert\tests\src\Simple\HelloWasm\obj\Debug\wasm\native\HelloWasm.ilc.rsp```. That will generate HelloWasm.bc, an LLVM bitcode file.
2. To compile that to WebAssembly, run ```emcc HelloWasm.bc -s ALLOW_MEMORY_GROWTH=1 C:\corert\bin\WebAssembly.wasm.Debug\sdk\libPortableRuntime.bc C:\corert\bin\WebAssembly.wasm.Debug\sdk\libbootstrappercpp.bc -s WASM=1 -o HelloWasm.html``` (if emcc isn't on your path, you'll need to launch an Emscripten command prompt to do this). That will generate a .wasm file with your code as well as html and js files to run it.
To run a WebAssembly application
1. Ensure you have Edge 41 or above or [Firefox](https://www.getfirefox.com).
# How to run a WebAssembly application #
1. Ensure you have Edge 41 (Windows only) or above or [Firefox](https://www.getfirefox.com).
2. Open the generated html file in Edge or Firefox and look at the on-screen console for output.
Useful tips:
# Useful tips #
* To manually make ILC compile to WebAssembly, add ```--wasm``` to the command line.
* Add ```-g3``` to the emcc command line to generate more debuggable output and a .wast file with the text form of the WebAssembly.
* Omit ```-s WASM=1``` from the emcc command line to generate asm.js. Browser debuggers currently work better with asm.js and it's often a bit more readable than wast.

View File

@@ -28,8 +28,9 @@ tests\runtest.sh
You should see the below message when you build CoreRT or run the local tests manually, otherwise something is broken.
```
JIT - TOTAL: 7 PASSED: 7
JIT - TOTAL: 12 PASSED: 12
CPP - TOTAL: 2 PASSED: 2
WASM - TOTAL: 1 PASSED: 1
```
## External Tests
@@ -55,7 +56,7 @@ tests\runtest.cmd /coreclr Top200|All|KnownGood
On Linux / macOS:
**TBD**
tests/runtest.sh -coreclr Top200|All|KnownGood
### Suppress Windows Error Reporting Dialogs
It's advisable to use some sort of a dialog killer tool if you see test regressions as many tests fail with pop-ups for Windows Error Reporting. However, the following regedit scripts have also proven to be useful to mask these pop-ups.

View File

@@ -20,7 +20,7 @@ sudo apt-get update
```
```sh
sudo apt-get install cmake clang-3.9 libicu52 libunwind8 uuid-dev
sudo apt-get install cmake clang-3.9 libicu52 libunwind8 uuid-dev libcurl4-openssl-dev zlib1g-dev
```
# macOS (10.12+)
@@ -28,6 +28,23 @@ sudo apt-get install cmake clang-3.9 libicu52 libunwind8 uuid-dev
1. Install [Command Line Tools for XCode 8](https://developer.apple.com/xcode/download/) or higher.
2. Install [CMake](https://cmake.org/download/) 3.8.0 or later. Launch `/Applications/CMake.app/Contents/MacOS/CMake` GUI. Goto "OSX App Menu -> Tools -> Install For Command Line Use" and follow the steps.
# openSUSE Leap 42.3
First install llvm-3.9. This is a bit cumbersome because the LLVM that comes from the `zypper` feeds is too old.
```sh
wget http://releases.llvm.org/3.9.0/clang+llvm-3.9.0-x86_64-opensuse13.2.tar.xz
tar xf clang+llvm-3.9.0-x86_64-opensuse13.2.tar.xz
cd clang+llvm-3.9.0-x86_64-opensuse13.2
sudo cp -R * /usr/local/
```
Next install the rest of the dependencies:
```sh
sudo zypper install cmake libuuid-devel icu libcurl-devel zlib-devel
```
# Bash on Ubuntu on Windows (Windows 10 Creators Update or later)
Make sure you run with Ubuntu 16.04 Xenial userland (this is the default after Windows 10 Creators Update, but if you enabled the "Bash on Ubuntu on Windows" feature before the Creators Update, you need to [upgrade manually](https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/)). Running `lsb_release -a` will give you the version.

View File

@@ -1 +1 @@
2.0.0
2.1.2

View File

@@ -8,8 +8,7 @@
<PackageThirdPartyNoticesFile>$(ProjectDir)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
<ReleaseNotes>TODO</ReleaseNotes>
<ProjectUrl>https://dot.net</ProjectUrl>
<!-- Add a condition for this when we are able to run on .NET Core -->
<PackagingTaskDir>$(ToolsDir)net46/</PackagingTaskDir>
<PackagingTaskDir>$(BuildToolsTaskDir)</PackagingTaskDir>
<!-- defined in buildtools packaging.targets, but we need this before targets are imported -->
<PackagePlatform Condition="'$(PackagePlatform)' == ''">$(Platform)</PackagePlatform>
<PackagePlatform Condition="'$(PackagePlatform)' == 'amd64'">x64</PackagePlatform>

View File

@@ -4,8 +4,7 @@ This repo contains the .NET Core runtime optimized for AOT compilation
## Platform Support
This is a work in progress. The current state of platform support:
- Windows x64 w/ RyuJIT codegen: Simple ASP.NET apps [compile and run](https://github.com/dotnet/corert/tree/master/samples/WebApi)
- MacOS and Linux x64 w/ RyuJIT codegen: Same as Windows, the libraries are less complete.
- Windows, MacOS and Linux x64 w/ RyuJIT codegen: Simple apps. Check our [ASP.NET Core](samples/WebApi/) and [MonoGame](samples/MonoGame/) samples.
- Linux ARM w/ RyuJIT codegen: ElmSharp Hello Tizen application ([detailed status](https://github.com/dotnet/corert/issues/4856))
- CppCodeGen (targets all platforms that support C++): Simple C# programs. The big missing features are [reflection](https://github.com/dotnet/corert/issues/2035), [garbage collection](https://github.com/dotnet/corert/issues/2033) and [exception handling](https://github.com/dotnet/corert/issues/910).
- WebAssembly: Early prototype that compiles and runs very trivial programs only. Many features are [not yet implemented](https://github.com/dotnet/corert/issues?q=is%3Aissue+is%3Aopen+label%3Aarch-wasm).

View File

@@ -46,6 +46,11 @@ IF ERRORLEVEL 1 exit /b %ERRORLEVEL%
"%__DotNetCliPath%\dotnet.exe" publish "%__SourceDir%\ILCompiler\netcoreapp\ilc.csproj" -r %__NugetRuntimeId% -o "%__RootBinDir%\%__BuildOS%.%__BuildArch%.%__BuildType%\tools"
IF ERRORLEVEL 1 exit /b %ERRORLEVEL%
"%__DotNetCliPath%\dotnet.exe" restore "%__SourceDir%\ILVerify\netcoreapp\ILVerify.csproj" -r %__NugetRuntimeId%
IF ERRORLEVEL 1 exit /b %ERRORLEVEL%
"%__DotNetCliPath%\dotnet.exe" publish "%__SourceDir%\ILVerify\netcoreapp\ILVerify.csproj" -r %__NugetRuntimeId% -o "%__RootBinDir%\%__BuildOS%.%__BuildArch%.%__BuildType%\ILVerify"
IF ERRORLEVEL 1 exit /b %ERRORLEVEL%
:: Set the environment for the managed build
call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
echo Commencing build of managed components for %__BuildOS%.%__BuildArch%.%__BuildType%

View File

@@ -92,11 +92,11 @@ get_official_cross_builds()
return 0
fi
__tizenToolsRoot=${__ProjectRoot}/Tools/tizen
__corefxsite="https://ci.dot.net/job/dotnet_corefx/job/master/view/Official%20Builds/job/"
__coreclrsite="https://ci.dot.net/job/dotnet_coreclr/job/master/view/Official%20Builds/job/"
__corefxsite="https://ci.dot.net/job/dotnet_corefx/job/master/job/"
__coreclrsite="https://ci.dot.net/job/dotnet_coreclr/job/master/job/"
__buildArchiveName="build.tar.gz"
__systemNativeLibName="System.Native.a"
__systemGlobNativeLibName="libSystem.Globalization.Native.a"
__systemGlobNativeLibName="System.Globalization.Native.a"
if [ $__BuildType = "Debug" ]; then
__buildtype="debug"
else
@@ -106,7 +106,7 @@ get_official_cross_builds()
__coreclrsource="armel_cross_${__buildtype}_tizen/lastSuccessfulBuild/artifact/bin/Product/Linux.armel.${__BuildType}/${__systemGlobNativeLibName}"
mkdir -p $__tizenToolsRoot
(cd ${__tizenToolsRoot} && wget -N "${__corefxsite}${__corefxsource}")
(cd ${__tizenToolsRoot} && wget -t0 -N "${__corefxsite}${__corefxsource}")
export BUILDERRORLEVEL=$?
if [ $BUILDERRORLEVEL != 0 ]; then
exit $BUILDERRORLEVEL
@@ -114,7 +114,7 @@ get_official_cross_builds()
tar xvf ${__tizenToolsRoot}/${__buildArchiveName} -C ${__tizenToolsRoot} ./${__systemNativeLibName}
cp ${__tizenToolsRoot}/${__systemNativeLibName} $__ProjectRoot/bin/Linux.${__BuildArch}.${__BuildType}/framework
(cd ${__tizenToolsRoot} && wget -N "${__coreclrsite}${__coreclrsource}")
(cd ${__tizenToolsRoot} && wget -t0 -N "${__coreclrsite}${__coreclrsource}")
export BUILDERRORLEVEL=$?
if [ $BUILDERRORLEVEL != 0 ]; then
exit $BUILDERRORLEVEL

View File

@@ -2,6 +2,12 @@
set __BuildArch=x64
set __BuildType=Debug
set __BuildOS=Windows_NT
set __HostOS=Windows_NT
:: Disable telemetry, first time experience, and global sdk look for the CLI
set DOTNET_CLI_TELEMETRY_OPTOUT=1
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0
:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0.."
@@ -118,7 +124,7 @@ if defined VisualStudioVersion goto :RunVCVars
set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist %_VSWHERE% (
for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -prerelease -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -prerelease -property installationPath -products *`) do set _VSCOMNTOOLS=%%i\Common7\Tools
)
if not exist "%_VSCOMNTOOLS%" goto :MissingVersion
@@ -162,8 +168,8 @@ set Platform=
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)
set __NugetRuntimeId=win7-x64
if /i "%__BuildArch%" == "x86" (set __NugetRuntimeId=win7-x86)
set __NugetRuntimeId=win-x64
if /i "%__BuildArch%" == "x86" (set __NugetRuntimeId=win-x86)
:Done
set BUILDVARS_DONE=1

View File

@@ -68,8 +68,6 @@ get_current_linux_rid() {
# remove the last version digit
VERSION_ID=${VERSION_ID%.*}
rid=alpine.$VERSION_ID
elif [[ $ID == "ubuntu" ]]; then
rid=$ID.$VERSION_ID
fi
elif [ -e /etc/redhat-release ]; then
@@ -82,6 +80,10 @@ get_current_linux_rid() {
echo $rid
}
# Disable telemetry, first time experience, and global sdk look for the CLI
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_MULTILEVEL_LOOKUP=0
export __scriptpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export __ProjectRoot=$__scriptpath/..
@@ -109,6 +111,12 @@ export __CrossBuild=0
__BuildArch=$__HostArch
# Checking for any clang versions, if there is a symlink
if [ -x "$(command -v clang)" ]; then
__ClangMajorVersion="$(echo | clang -dM -E - | grep __clang_major__ | cut -f3 -d ' ')"
__ClangMinorVersion="$(echo | clang -dM -E - | grep __clang_minor__ | cut -f3 -d ' ')"
fi
while [ "$1" != "" ]; do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
@@ -171,6 +179,22 @@ while [ "$1" != "" ]; do
export __ClangMajorVersion=3
export __ClangMinorVersion=9
;;
clang4.0)
export __ClangMajorVersion=4
export __ClangMinorVersion=0
;;
clang5.0)
export __ClangMajorVersion=5
export __ClangMinorVersion=0
;;
clang6.0)
export __ClangMajorVersion=6
export __ClangMinorVersion=0
;;
clang7.0)
export __ClangMajorVersion=7
export __ClangMinorVersion=0
;;
cross)
export __CrossBuild=1
;;
@@ -193,41 +217,49 @@ done
export $__BuildArch
# Use uname to determine what the OS is.
export OSName=$(uname -s)
case $OSName in
Darwin)
export __HostOS=OSX
export __NugetRuntimeId=osx-x64
ulimit -n 2048
;;
FreeBSD)
export __HostOS=FreeBSD
# TODO: Add proper FreeBSD target
export __NugetRuntimeId=linux-x64
;;
Linux)
export __HostOS=Linux
export __NugetRuntimeId=$(get_current_linux_rid)-$__HostArch
;;
NetBSD)
export __HostOS=NetBSD
# TODO: Add proper NetBSD target
export __NugetRuntimeId=linux-x64
;;
*)
echo "Unsupported OS $OSName detected, configuring as if for Linux"
export __HostOS=Linux
export __NugetRuntimeId=linux-x64
;;
esac
# For msbuild
if [ $__HostOS != "OSX" ]; then
export CppCompilerAndLinker=clang-${__ClangMajorVersion}.${__ClangMinorVersion}
fi
export __BuildOS="$__HostOS"
# Overwrite __BuildOS with WebAssembly if wasm is target build arch, but keep the __NugetRuntimeId to match the Host OS
if [ $__BuildArch == "wasm" ]; then
export __BuildOS=WebAssembly
else
# Use uname to determine what the OS is.
export OSName=$(uname -s)
case $OSName in
Darwin)
export __BuildOS=OSX
export __NugetRuntimeId=osx.10.10-x64
ulimit -n 2048
;;
FreeBSD)
export __BuildOS=FreeBSD
# TODO: Add proper FreeBSD target
export __NugetRuntimeId=ubuntu.14.04-x64
;;
Linux)
export __BuildOS=Linux
export __NugetRuntimeId=$(get_current_linux_rid)-$__HostArch
;;
NetBSD)
export __BuildOS=NetBSD
# TODO: Add proper NetBSD target
export __NugetRuntimeId=ubuntu.14.04-x64
;;
*)
echo "Unsupported OS $OSName detected, configuring as if for Linux"
export __BuildOS=Linux
export __NugetRuntimeId=ubuntu.14.04-x64
;;
esac
fi
# If neither managed nor native are passed as arguments, default to building both

View File

@@ -9,14 +9,14 @@ add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
add_compile_options(--sysroot=${CROSS_ROOTFS})
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target arm-linux-gnueabihf")
set(CROSS_LINK_FLAGS "-target arm-linux-gnueabihf")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/arm-linux-gnueabihf")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/arm-linux-gnueabihf")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_EXE_LINKER_FLAGS" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_SHARED_LINKER_FLAGS" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_MODULE_LINKER_FLAGS" FORCE)
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

View File

@@ -7,14 +7,14 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64)
add_compile_options(-target aarch64-linux-gnu)
add_compile_options(--sysroot=${CROSS_ROOTFS})
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target aarch64-linux-gnu")
set(CROSS_LINK_FLAGS "-target aarch64-linux-gnu")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-linux-gnu")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/aarch64-linux-gnu")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_EXE_LINKER_FLAGS" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_SHARED_LINKER_FLAGS" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_MODULE_LINKER_FLAGS" FORCE)
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

View File

@@ -19,7 +19,7 @@ add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
add_compile_options(--sysroot=${CROSS_ROOTFS})
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "-target ${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
if("$ENV{__DistroRid}" MATCHES "tizen.*")
@@ -37,9 +37,9 @@ else()
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}/4.9")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_EXE_LINKER_FLAGS" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_SHARED_LINKER_FLAGS" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_MODULE_LINKER_FLAGS" FORCE)
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

View File

@@ -7,14 +7,14 @@ add_compile_options("-m32")
add_compile_options("--sysroot=${CROSS_ROOTFS}")
add_compile_options("-Wno-error=unused-command-line-argument")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
set(CROSS_LINK_FLAGS "--sysroot=${CROSS_ROOTFS}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/i686-linux-gnu")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/i386-linux-gnu")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -m32")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_EXE_LINKER_FLAGS" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_SHARED_LINKER_FLAGS" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" CACHE STRING "TOOLCHAIN_MODULE_LINKER_FLAGS" FORCE)
set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

View File

@@ -1,10 +1,10 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RyuJITVersion>2.1.0-preview1-26030-01</RyuJITVersion>
<RyuJITVersion>2.1.0-preview2-26207-13</RyuJITVersion>
<ObjectWriterVersion>1.0.19-prerelease-00001</ObjectWriterVersion>
<CoreFxVersion>4.5.0-preview1-26029-02</CoreFxVersion>
<CoreFxUapVersion>4.6.0-preview1-26029-02</CoreFxUapVersion>
<MicrosoftNETCoreNativeVersion>2.1.0-preview1-26030-01</MicrosoftNETCoreNativeVersion>
<CoreFxVersion>4.5.0-preview2-26202-05</CoreFxVersion>
<CoreFxUapVersion>4.6.0-preview2-26202-05</CoreFxUapVersion>
<MicrosoftNETCoreNativeVersion>2.1.0-preview2-26207-13</MicrosoftNETCoreNativeVersion>
<MicrosoftNETCoreAppPackageVersion>2.0.0</MicrosoftNETCoreAppPackageVersion>
<XunitNetcoreExtensionsVersion>1.0.1-prerelease-02104-02</XunitNetcoreExtensionsVersion>
</PropertyGroup>

View File

@@ -130,11 +130,11 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
fi
echo "Initializing BuildTools..."
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR $__PACKAGES_DIR" >> $__init_tools_log
# Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
chmod +x $__BUILD_TOOLS_PATH/init-tools.sh
$__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log
$__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR $__PACKAGES_DIR >> $__init_tools_log
if [ "$?" != "0" ]; then
echo "ERROR: An error occurred when trying to initialize the tools." 1>&2
display_error_message

View File

@@ -0,0 +1,92 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DefineConstants>$(DefineConstants);WINDOWS;LINUX</DefineConstants>
</PropertyGroup>
<ItemGroup>
<RdXmlFile Include="rd.xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MonoGame.Samples\NeonShooter\Game.cs">
<Link>Game.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Art.cs">
<Link>Game\Art.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\BlackHole.cs">
<Link>Game\BlackHole.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\BloomComponent.cs">
<Link>Game\BloomComponent.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\BloomSettings.cs">
<Link>Game\BloomSettings.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Bullet.cs">
<Link>Game\Bullet.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\ColorUtil.cs">
<Link>Game\ColorUtil.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Enemy.cs">
<Link>Game\Enemy.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\EnemySpawner.cs">
<Link>Game\EnemySpawner.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Entity.cs">
<Link>Game\Entity.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\EntityManager.cs">
<Link>Game\EntityManager.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Extensions.cs">
<Link>Game\Extensions.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Grid.cs">
<Link>Game\Grid.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Input.cs">
<Link>Game\Input.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\MathUtil.cs">
<Link>Game\MathUtil.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\ParticleManager.cs">
<Link>Game\ParticleManager.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\ParticleState.cs">
<Link>Game\ParticleState.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\PlayerShip.cs">
<Link>Game\PlayerShip.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\PlayerStatus.cs">
<Link>Game\PlayerStatus.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Game\Sound.cs">
<Link>Game\Sound.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\NeonShooter\Program.cs">
<Link>Program.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="MonoGame.Samples\NeonShooter\Content\NeonShooter.mgcb">
<Link>Content\NeonShooter.mgcb</Link>
</MonoGameContentReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.1" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.3" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,71 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DefineConstants>$(DefineConstants);WINDOWS;LINUX</DefineConstants>
</PropertyGroup>
<ItemGroup>
<RdXmlFile Include="rd.xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Accelerometer.cs">
<Link>Game\Accelerometer.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Animation.cs">
<Link>Game\Animation.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\AnimationPlayer.cs">
<Link>Game\AnimationPlayer.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Circle.cs">
<Link>Game\Circle.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Enemy.cs">
<Link>Game\Enemy.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Gem.cs">
<Link>Game\Gem.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Level.cs">
<Link>Game\Level.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Player.cs">
<Link>Game\Player.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\RectangleExtensions.cs">
<Link>Game\RectangleExtensions.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\Tile.cs">
<Link>Game\Tile.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\TouchCollectionExtensions.cs">
<Link>Game\TouchCollectionExtensions.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game.cs">
<Link>Game.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Game\VirtualGamePad.cs">
<Link>Game\VirtualGamePad.cs</Link>
</Compile>
<Compile Include="MonoGame.Samples\Platformer2D\Program.cs">
<Link>Program.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="MonoGame.Samples\Platformer2D\Content\Platformer2D.mgcb">
<Link>Content\Platformer2D.mgcb</Link>
</MonoGameContentReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.1" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.3" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,94 @@
# Building a MonoGame app with CoreRT
This document will guide you through compiling a .NET Core [MonoGame](http://www.monogame.net) game with CoreRT.
## Install the .NET Core SDK
CoreRT is an AOT-optimized .NET Core runtime. If you're new to .NET Core make sure to visit the [official starting page](http://dotnet.github.io). It will guide you through installing pre-requisites and building your first app.
If you're already familiar with .NET Core make sure you've [downloaded and installed the .NET Core 2 SDK](https://www.microsoft.com/net/download/core).
## Create .NET Core MonoGame project
Open a new shell/command prompt window and run the following commands.
```bash
> dotnet new --install MonoGame.Template.CSharp
> dotnet new mgdesktopgl -o MyGame
> cd MyGame
```
This will install .NET Core MonoGame template and create empty game project. .NET Core MonoGame port lives at https://github.com/cra0zy/MonoGame/tree/core currently. Thank you @cra0zy for the great work!
Verify that the empty game builds and runs. You should see blue window:
```bash
> dotnet run
```
MonoGame tools require [Mono](http://www.mono-project.com/download/) on non-Windows platforms.
## Add CoreRT to your project
Using CoreRT to compile your application is done via the ILCompiler NuGet package, which is [published to MyGet with the CoreRT daily builds](https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.DotNet.ILCompiler).
For the compiler to work, it first needs to be added to your project.
In your shell/command prompt navigate to the root directory of your project and run the command:
```bash
> dotnet new nuget
```
This will add a nuget.config file to your application. Open the file and in the ``<packageSources> `` element under ``<clear/>`` add the following:
```xml
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
```
Once you've added the package source, add a reference to the compiler by running the following command:
```bash
> dotnet add package Microsoft.DotNet.ILCompiler -v 1.0.0-alpha-*
```
## Restore and Publish your app
Once the package has been successfully added it's time to compile and publish your app! In the shell/command prompt window, run the following command:
```bash
> dotnet publish -r <RID> -c <Configuration>
```
where `<Configuration>` is your project configuration (such as Debug or Release) and `<RID>` is the runtime identifier (one of win-x64, linux-x64, osx-x64). For example, if you want to publish a release configuration of your app for a 64-bit version of Windows the command would look like:
```bash
> dotnet publish -r win-x64 -c release
```
Once completed, you can find the native executable in the root folder of your project under `/bin/x64/<Configuration>/netcoreapp2.0/publish/`. Navigate to `/bin/x64/<Configuration>/netcoreapp2.0/publish/` in your project folder and run the produced native executable.
## Try MonoGame sample game
Clone MonoGame samples from github:
```bash
> git clone https://github.com/MonoGame/MonoGame.Samples
```
MonoGame samples include project files for number of targets, but not for .NET Core yet. One has to create the project using above steps and transplant links to sample sources and assets to it. This directory contains .NET Core project for Platformer2D and NeonShooter samples that assume MonoGame.Samples is cloned under it. Build it and start playing!
```bash
> dotnet publish -r win-x64 -c release Platformer2D.csproj
> bin\x64\Release\netcoreapp2.0\publish\Platformer2D.exe
```
The NeonShooter sample works on Windows-only due to https://github.com/MonoGame/MonoGame/issues/3270.
## Using reflection
Runtime directives are XML configuration files, which specify which otherwise unreachable elements of your program are available for reflection. They are used at compile-time to enable AOT compilation in applications at runtime. The runtime directives are reference in the project via RdXmlFile item:
```xml
<ItemGroup>
<RdXmlFile Include="rd.xml" />
</ItemGroup>
```
MonoGame serialization engine uses reflection to create types representing the game assets that needs to mentioned in the [rd.xml](rd.xml) file. If you see MissingMetadataException thrown during game startup, add the missing types to the rd.xml file.
Feel free to modify the sample application and experiment. However, keep in mind some functionality might not yet be supported in CoreRT. Let us know on the [Issues page](https://github.com/dotnet/corert/issues/).

Some files were not shown because too many files have changed in this diff Show More