diff options
author | Geunsik Lim <geunsik.lim@samsung.com> | 2016-03-16 22:42:14 +0900 |
---|---|---|
committer | Geunsik Lim <geunsik.lim@samsung.com> | 2016-03-18 22:17:16 +0900 |
commit | 27a646569f549173c4a846a2283228d4f863b422 (patch) | |
tree | c7bf700e411963945c4bf0881295dc655aa4ffd2 /build.sh | |
parent | 4d060bd77a034249459224487ebdb6a8ff1e6fd9 (diff) | |
download | coreclr-27a646569f549173c4a846a2283228d4f863b422.tar.gz coreclr-27a646569f549173c4a846a2283228d4f863b422.tar.bz2 coreclr-27a646569f549173c4a846a2283228d4f863b422.zip |
Architecture of host must be compitable architecture with target.
Let's make exception handling for different architecture between
host pc and target board during build-time.
V3:
- Simplify the existing 'if' statement
V2:
- Added $HostArch variable to handle the required architectures.
V1:
- Handle "time ./build.sh arm debug clean verbose" command
in case that generate only mscorlib.dll for Linux/ARM as well as the
existing case of if [ $__CrossBuild != 1 ]
In this case, we need to add additional if statements because the
architecture of host pc must be same architecture with target.
Signed-off-by: Geunsik Lim geunsik.lim@samsung.com
Signed-off-by: Prajwal A N an.prajwal@samsung.com
Signed-off-by: MyungJoo Ham myungjoo.ham@samsung.com
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 35 |
1 files changed, 28 insertions, 7 deletions
@@ -222,6 +222,18 @@ isMSBuildOnNETCoreSupported() fi } +build_mscorlib_ni() +{ + if [ $__SkipCoreCLR == 0 -a -e $__BinDir/crossgen ]; then + echo "Generating native image for mscorlib." + $__BinDir/crossgen $__BinDir/mscorlib.dll + if [ $? -ne 0 ]; then + echo "Failed to generate native image for mscorlib." + exit 1 + fi + fi +} + build_mscorlib() { @@ -251,17 +263,21 @@ build_mscorlib() # The cross build generates a crossgen with the target architecture. if [ $__CrossBuild != 1 ]; then - if [ $__SkipCoreCLR == 0 -a -e $__BinDir/crossgen ]; then - echo "Generating native image for mscorlib." - $__BinDir/crossgen $__BinDir/mscorlib.dll - if [ $? -ne 0 ]; then - echo "Failed to generate native image for mscorlib." - exit 1 - fi + # The architecture of host pc must be same architecture with target. + if [[ ( "$__HostArch" == "$__BuildArch" ) ]]; then + build_mscorlib_ni + elif [[ ( "$__HostArch" == "x64" ) && ( "$__BuildArch" == "x86" ) ]]; then + build_mscorlib_ni + elif [[ ( "$__HostArch" == "arm64" ) && ( "$__BuildArch" == "arm" ) ]]; then + build_mscorlib_ni + else + exit 1 fi fi } + + generate_NugetPackages() { # We can only generate nuget package if we also support building mscorlib as part of this build. @@ -315,25 +331,30 @@ case $CPUName in i686) echo "Unsupported CPU $CPUName detected, build might not succeed!" __BuildArch=x86 + __HostArch=x86 ;; x86_64) __BuildArch=x64 + __HostArch=x64 ;; armv7l) echo "Unsupported CPU $CPUName detected, build might not succeed!" __BuildArch=arm + __HostArch=arm ;; aarch64) echo "Unsupported CPU $CPUName detected, build might not succeed!" __BuildArch=arm64 + __HostArch=arm64 ;; *) echo "Unknown CPU $CPUName detected, configuring as if for x64" __BuildArch=x64 + __HostArch=x64 ;; esac |