summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjunghyuk.park <junghyuk.park@samsung.com>2018-06-25 09:47:41 (GMT)
committerAlexander Soldatov/AI Ecosystem Lab /SRR/Staff Engineer/삼성전자 <soldatov.a@samsung.com>2019-02-14 17:24:48 (GMT)
commit2dd0d192c3b1b1d49e284d2ad065105bebf03aab (patch)
tree2f612d8715216b70c62dc25a928ecfab0db572a9
parent585a595aed37ab5059251709d4db07d46d119378 (diff)
downloadcoreclr-2dd0d192c3b1b1d49e284d2ad065105bebf03aab.zip
coreclr-2dd0d192c3b1b1d49e284d2ad065105bebf03aab.tar.gz
coreclr-2dd0d192c3b1b1d49e284d2ad065105bebf03aab.tar.bz2
[Tizen] Add support for GBS
-rwxr-xr-xbuild.sh4
-rw-r--r--configurecompiler.cmake8
-rw-r--r--packaging/coreclr-rpmlintrc2
-rw-r--r--packaging/coreclr.manifest5
-rwxr-xr-xpackaging/coreclr.spec311
5 files changed, 329 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 14452ad..a2af24a 100755
--- a/build.sh
+++ b/build.sh
@@ -75,6 +75,10 @@ initHostDistroRid()
if [[ $ID == "alpine" ]]; then
__HostDistroRid="linux-musl-$__HostArch"
fi
+ if [[ $ID == "tizen" ]]; then
+ __HostArch=armel
+ export __HostDistroRid="$ID.$VERSION_ID-$__HostArch"
+ fi
elif [ -e /etc/redhat-release ]; then
local redhatRelease=$(</etc/redhat-release)
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
diff --git a/configurecompiler.cmake b/configurecompiler.cmake
index 371e6e0..803e6e4 100644
--- a/configurecompiler.cmake
+++ b/configurecompiler.cmake
@@ -490,10 +490,16 @@ if(CLR_CMAKE_PLATFORM_UNIX_ARM)
# we have to set the triple by adding a compiler argument
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
- add_compile_options(-march=armv7-a)
if(ARM_SOFTFP)
add_definitions(-DARM_SOFTFP)
add_compile_options(-mfloat-abi=softfp)
+ if("$ENV{__HostDistroRid}" MATCHES "tizen.*")
+ add_compile_options(-target armv7l-tizen-linux-gnueabi)
+ else()
+ add_compile_options(-march=armv7-a)
+ endif()
+ else()
+ add_compile_options(-march=armv7-a)
endif(ARM_SOFTFP)
endif(CLR_CMAKE_PLATFORM_UNIX_ARM)
diff --git a/packaging/coreclr-rpmlintrc b/packaging/coreclr-rpmlintrc
new file mode 100644
index 0000000..edcdd8e
--- /dev/null
+++ b/packaging/coreclr-rpmlintrc
@@ -0,0 +1,2 @@
+# This package should install an ELF binary in the /usr/share hierarchy.
+addFilter("E: arch-dependent-file-in-usr-share")
diff --git a/packaging/coreclr.manifest b/packaging/coreclr.manifest
new file mode 100644
index 0000000..017d22d
--- /dev/null
+++ b/packaging/coreclr.manifest
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/coreclr.spec b/packaging/coreclr.spec
new file mode 100755
index 0000000..3bfc587
--- /dev/null
+++ b/packaging/coreclr.spec
@@ -0,0 +1,311 @@
+%{!?dotnet_buildtype: %define dotnet_buildtype Release}
+
+%define skipnative 0
+%define skipmscorlib 0
+%ifarch %{ix86}
+%define dotnet_buildtype Release
+%endif
+
+%define dotnet_version 3.0.0
+
+Name: coreclr
+Version: 3.0.0
+Release: 0
+Summary: Microsoft .NET Runtime, Coreclr
+Group: Development/Languages
+License: MIT
+URL: http://github.com/dotnet/coreclr
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+
+
+ExcludeArch: aarch64
+
+BuildRequires: python
+BuildRequires: python-xml
+# libcoreclr.so
+BuildRequires: pkgconfig(libunwind)
+BuildRequires: pkgconfig(uuid)
+# System.Globalization.Native.so
+BuildRequires: libicu-devel
+BuildRequires: tizen-release
+# No matter what tizen-release package you use in any profile
+AutoReq: 0
+Requires: glibc
+Requires: libgcc
+Requires: libstdc++
+Requires: libunwind
+Requires: libuuid
+
+# Accelerate python, clang
+%ifarch %{arm}
+BuildRequires: python-accel-armv7l-cross-arm
+BuildRequires: clang-accel-armv7l-cross-arm
+%endif
+
+%ifarch aarch64
+BuildRequires: python-accel-aarch64-cross-aarch64
+BuildRequires: clang-accel-aarch64-cross-aarch64
+%endif
+
+BuildRequires: cmake
+BuildRequires: llvm >= 3.8
+BuildRequires: llvm-devel >= 3.8
+BuildRequires: clang >= 3.8
+BuildRequires: clang-devel >= 3.8
+BuildRequires: lldb >= 3.8
+BuildRequires: lldb-devel >= 3.8
+BuildRequires: gettext-tools
+BuildRequires: libopenssl-devel
+# C include headers
+BuildRequires: libstdc++-devel
+BuildRequires: pkgconfig(lttng-ust)
+
+%if 0%{skipmscorlib}
+%else
+%ifarch %{arm}
+BuildRequires: patchelf
+%endif
+%ifarch %{ix86}
+BuildRequires: patchelf
+BuildRequires: glibc-64bit
+BuildRequires: libgcc-64bit
+BuildRequires: libstdc++-64bit
+BuildRequires: libunwind-64bit
+BuildRequires: libuuid-64bit
+BuildRequires: zlib-64bit
+BuildRequires: libopenssl-64bit
+%endif
+%endif
+
+%description
+The CoreCLR repo contains the complete runtime implementation for .NET Core. It includes RyuJIT, the .NET GC, native interop and many other components. It is cross-platform, with multiple OS and CPU ports in progress.
+
+%package extra
+Summary: Dotnet Core Extra Files
+Requires: coreclr
+
+%description extra
+Libsosplugin and others
+
+%package test
+Summary: Dotnet Core Unit Test
+Requires: coreclr
+
+%description test
+Unit Test objs
+
+%package devel
+Summary: Dotnet Core Development package
+Requires: coreclr
+
+%description devel
+Headers and static libraries
+
+%package -n mscorlib
+Summary: Core Library for MS .NET
+Requires: coreclr
+
+%description -n mscorlib
+The MSCORLIB.DLL for .NET Core Runtime (coreclr)
+
+%prep
+%setup -q -n %{name}-%{version}
+cp %{SOURCE1} .
+
+
+%if 0%{skipmscorlib}
+%else
+%ifarch %{arm} %{ix86}
+%ifarch %{arm}
+# Detect interpreter name from cross-gcc
+LD_INTERPRETER=$(patchelf --print-interpreter /emul/usr/bin/gcc)
+LD_RPATH=$(patchelf --print-rpath /emul/usr/bin/gcc)
+for file in $( find ./Tools -name "dotnet" -type f)
+do
+ patchelf --set-interpreter ${LD_INTERPRETER} ${file}
+ patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
+done
+for file in $( find ./Tools ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
+do
+ patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
+done
+%endif
+%ifarch %{ix86}
+for file in $( find ./Tools ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
+do
+ patchelf --set-rpath %{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
+done
+%endif
+%endif
+%endif
+
+%build
+# disable asan build when global forced asan build
+%{?asan:export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS`}
+%{?asan:/usr/bin/gcc-unforce-options}
+%{?asan:export LD_LIBRARY_PATH=`pwd`/libicu-57.1}
+
+export CFLAGS=" --target=%{_host} "
+export CXXFLAGS=" --target=%{_host} "
+
+%ifarch x86_64
+# Even though build architectur is x86_64, it will be running on arm board.
+# So we need to pass the arch argument as arm.
+%define _barch %{?cross:%{cross}}%{!?cross:x64}
+%else
+%ifarch aarch64
+%define _barch arm64
+%else
+%ifarch %{ix86}
+%define _barch x86
+export CLANG_NO_LIBDIR_SUFFIX=1
+export CFLAGS=$(echo $CFLAGS | sed -e 's/--target=i686/--target=i586/')
+export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
+%else
+%ifarch %{arm}
+%define _barch armel
+export CLANG_NO_LIBDIR_SUFFIX=1
+%else
+
+%endif
+%endif
+%endif
+%endif
+
+%define _buildtype %{dotnet_buildtype}
+%define _reldir bin/Product/Linux.%{_barch}.%{_buildtype}
+%define _numproc %(getconf _NPROCESSORS_ONLN)
+
+%ifarch %{arm}
+%if %{dotnet_buildtype} == "Release"
+export CXXFLAGS+="-fstack-protector-strong -D_FORTIFY_SOURCE=2"
+%else
+export CXXFLAGS+="-fstack-protector-strong"
+%endif
+%endif
+
+%if 0%{skipmscorlib}
+%if 0%{skipnative}
+# No build native and mscorlib.
+%else
+# Build native only.
+./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -clang3.8 -skipmscorlib -skipgenerateversion -skipnuget -msbuildonunsupportedplatform cmakeargs -DFEATURE_GDBJIT=TRUE
+%endif
+%else
+%if 0%{skipnative}
+# Build mscorlib only.
+./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -skiprestore -skipnative -skipnuget -skipcrossgen -msbuildonunsupportedplatform
+%else
+# Build native and mscorlib.
+./build.sh -%{_barch} -%{_buildtype} -numproc %{_numproc} -clang3.8 -skipgenerateversion -skiprestore -skipnuget -skipcrossgen -msbuildonunsupportedplatform cmakeargs -DFEATURE_GDBJIT=TRUE
+%endif
+%endif
+
+%install
+# .NET Core Runtime
+%define dotnetdir dotnet
+%define netshareddir %{dotnetdir}/shared
+%define netcoreappdir %{netshareddir}/Microsoft.NETCore.App/%{dotnet_version}
+mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}
+
+# .NET Tizen Runtime
+%define dotnettizendir dotnet.tizen
+%define dotnetfwdir %{dotnettizendir}/framework
+%define dotnettestdir %{dotnettizendir}/test
+mkdir -p %{buildroot}%{_datadir}/%{dotnettizendir}
+mkdir -p %{buildroot}%{_datadir}/%{dotnetfwdir}
+mkdir -p %{buildroot}%{_datadir}/%{dotnettestdir}
+
+%if 0%{skipnative}
+%else
+cp %{_reldir}/corerun %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libclrjit.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libcoreclr.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libdbgshim.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libmscordaccore.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libmscordbi.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libsos.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libsosplugin.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/libcoreclrtraceptprovider.so %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/System.Globalization.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
+ln -sf ../%{netcoreappdir}/corerun %{buildroot}%{_datadir}/%{dotnetdir}/corerun
+
+# .NET Core Headers and static libraries
+mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src/
+mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
+mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/dlls/
+mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
+mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/ToolBox/SOS/
+cp -rf src/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/
+cp -rf src/pal/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
+cp -rf src/pal/prebuilt %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
+cp -rf src/debug/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
+cp -rf src/debug/shim %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
+cp -rf src/dlls/dbgshim %{buildroot}%{_datadir}/%{netcoreappdir}/src/dlls/
+cp -rf src/coreclr/hosts/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
+cp -rf src/ToolBox/SOS/Strike %{buildroot}%{_datadir}/%{netcoreappdir}/src/ToolBox/SOS
+cp -rf src/pal/src/include %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src
+cp -rf %{_reldir}/lib %{buildroot}%{_datadir}/%{netcoreappdir}
+
+# extra
+cp %{_reldir}/coreconsole %{buildroot}%{_datadir}/%{dotnetfwdir}
+cp %{_reldir}/crossgen %{buildroot}%{_datadir}/%{dotnetfwdir}
+
+# devel
+cp %{_reldir}/ilasm %{buildroot}%{_datadir}/%{dotnetfwdir}
+cp %{_reldir}/ildasm %{buildroot}%{_datadir}/%{dotnetfwdir}
+
+# test
+cp -rf bin/obj/Linux.%{_barch}.%{_buildtype}/tests/src %{buildroot}%{_datadir}/%{dotnettestdir}
+cp %{_reldir}/superpmi %{buildroot}%{_datadir}/%{dotnettestdir}
+cp %{_reldir}/mcs %{buildroot}%{_datadir}/%{dotnettestdir}
+cp %{_reldir}/libsuperpmi-shim-collector.so %{buildroot}%{_datadir}/%{dotnettestdir}
+cp %{_reldir}/libsuperpmi-shim-counter.so %{buildroot}%{_datadir}/%{dotnettestdir}
+cp %{_reldir}/libsuperpmi-shim-simple.so %{buildroot}%{_datadir}/%{dotnettestdir}
+%endif
+
+%if 0%{skipmscorlib}
+%else
+cp %{_reldir}/System.Private.CoreLib.dll %{buildroot}%{_datadir}/%{netcoreappdir}
+cp %{_reldir}/SOS.NETCore.dll %{buildroot}%{_datadir}/%{netcoreappdir}
+%endif
+
+%if 0%{skipnative}
+%else
+%files
+%manifest %{name}.manifest
+%dir %{_datadir}/%{dotnetdir}
+%dir %{_datadir}/%{netcoreappdir}
+%{_datadir}/%{netcoreappdir}/corerun
+%{_datadir}/%{netcoreappdir}/*.so
+%{_datadir}/%{dotnetdir}/corerun
+
+%files extra
+%manifest %{name}.manifest
+%dir %{_datadir}/%{dotnetfwdir}
+%{_datadir}/%{dotnetfwdir}/coreconsole
+%{_datadir}/%{dotnetfwdir}/crossgen
+
+%files test
+%manifest %{name}.manifest
+%dir %{_datadir}/%{dotnettestdir}
+%{_datadir}/%{dotnettestdir}/*
+
+%files devel
+%manifest %{name}.manifest
+%dir %{_datadir}/%{netcoreappdir}/lib
+%dir %{_datadir}/%{netcoreappdir}/src
+%dir %{_datadir}/%{dotnetfwdir}
+%{_datadir}/%{netcoreappdir}/lib/*
+%{_datadir}/%{netcoreappdir}/src/*
+%{_datadir}/%{dotnetfwdir}/ilasm
+%{_datadir}/%{dotnetfwdir}/ildasm
+%endif
+
+%if 0%{skipmscorlib}
+%else
+%files -n mscorlib
+%manifest %{name}.manifest
+%{_datadir}/%{netcoreappdir}/*.dll
+%endif