1 %{!?dotnet_buildtype: %define dotnet_buildtype Release}
2 %{!?skiptests: %define skiptests 1}
3 %{!?skipfxtests: %define skipfxtests 1}
4 %{!?skipmscorlib: %define skipmscorlib 0}
5 %{!?skipmanaged: %define skipmanaged 0}
7 %define dotnet_buildtype_clr %{dotnet_buildtype}
8 %define dotnet_buildtype_fx %{dotnet_buildtype}
9 %define dotnet_buildtype_host %{dotnet_buildtype}
11 %if "%{?dotnet_buildtype}" == "Checked"
12 %define dotnet_buildtype_fx Debug
15 %define _binaries_in_noarch_packages_terminate_build 0
16 %define _unpackaged_files_terminate_build 0
18 %define skipmanagedtools 0
21 %define skipmanagedtools 1
24 %ifarch %{arm} aarch64 %{ix86} x86_64 riscv64
30 %define pgo_instrument 0
31 %define pgo_optimize 0
33 %define dotnet_version 8.0.0
38 Summary: Microsoft .NET Runtime with Microsoft .NET foundation class libraries (CoreCLR and CoreFX)
39 Group: Development/Languages
41 URL: http://github.com/dotnet/runtime
42 Source0: %{name}-%{version}.tar.gz
43 Source1: %{name}.manifest
46 BuildRequires: python-xml
48 BuildRequires: pkgconfig(libunwind)
49 BuildRequires: pkgconfig(uuid)
50 # System.Globalization.Native.so
51 BuildRequires: libicu-devel
52 BuildRequires: tizen-release
53 # System.Net.Security.Native.so
54 # System.Net.Http.Native.so
55 BuildRequires: krb5-devel
56 BuildRequires: libcurl-devel
57 # No matter what tizen-release package you use in any profile
65 # Accelerate python, clang
67 BuildRequires: python-accel-armv7l-cross-arm
68 BuildRequires: clang-accel-armv7l-cross-arm
72 BuildRequires: python-accel-armv7hl-cross-arm
73 BuildRequires: clang-accel-armv7hl-cross-arm
77 BuildRequires: python-accel-aarch64-cross-aarch64
78 BuildRequires: clang-accel-aarch64-cross-aarch64
82 BuildRequires: python-accel-riscv64-cross-riscv64
83 BuildRequires: clang-accel-riscv64-cross-riscv64
87 BuildRequires: llvm >= 3.8
88 BuildRequires: llvm-devel >= 3.8
89 BuildRequires: clang >= 3.8
90 BuildRequires: clang-devel >= 3.8
93 # lldb is not available for RISC-V right now
94 BuildRequires: lldb >= 3.8
95 BuildRequires: lldb-devel >= 3.8
97 BuildRequires: gettext-tools
98 BuildRequires: pkgconfig(openssl3)
101 BuildRequires: libstdc++-devel
102 BuildRequires: pkgconfig(lttng-ust)
104 BuildRequires: libatomic
105 BuildRequires: gcc-devel-static
107 %if 0%{skipmscorlib} && 0%{skipmanaged} && 0%{skipmanagedtools}
109 %ifarch %{arm} aarch64 riscv64
110 BuildRequires: patchelf
113 BuildRequires: patchelf
114 BuildRequires: glibc-64bit
115 BuildRequires: libgcc-64bit
116 BuildRequires: libstdc++-64bit
117 BuildRequires: libunwind-64bit
118 BuildRequires: libuuid-64bit
119 BuildRequires: zlib-64bit
120 BuildRequires: libopenssl3-64bit
124 %if 0%{pgo_instrument} || 0%{pgo_optimize}
125 BuildRequires: binutils-gold
126 BuildRequires: compiler-rt
130 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. The .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.
132 %package -n coreclr-test
133 Summary: Dotnet Core Unit Test
136 %description -n coreclr-test
139 %package -n coreclr-devel
140 Summary: Dotnet Core Development package
143 %description -n coreclr-devel
144 Headers and static libraries
147 Summary: Core Library for MS .NET
150 %description -n mscorlib
151 The System.Private.CoreLib.dll for .NET Core Runtime (coreclr)
153 %package -n corefx-native
154 Summary: Core foundational native libraries
158 %description -n corefx-native
159 The native part (.so) of dotnet core foundational libraries
161 %package -n corefx-managed
162 Summary: Core foundational managed libraries
165 Requires: corefx-native
168 %description -n corefx-managed
169 The managed part (.dll) of dotnet core foundational class libraries
171 %package -n corefx-managed-devel
172 Summary: Core foundational managed libraries for debugging (.pdb)
173 Requires: corefx-managed
176 %description -n corefx-managed-devel
177 The managed debugging files (.pdb) of dotnet core fundational class libraries
179 %package -n corefx-managed-ref
180 Summary: Core foundational managed class libraries for developer
183 %description -n corefx-managed-ref
184 The managed part (.dll) of dotnet core foundational class libraries for developer
188 %package -n corefx-test
189 Summary: Dotnet Libraries Unit Test
190 Requires: corefx-native
191 Requires: corefx-managed
194 %description -n corefx-test
198 %package -n corefx-test-native
199 Summary: Dotnet Libraries Unit Test, native part
200 Requires: corefx-native
201 Requires: corefx-managed
203 %description -n corefx-test-native
204 Unit Test objs, native part
207 %package -n crossgen2-mic
208 Summary: Publish crossgen2 as a single file with self-contained
212 %description -n crossgen2-mic
213 Publish crossgen2 as a single file with self-contained
217 %setup -q -n %{name}-%{version}
222 %if 0%{skipmscorlib} && 0%{skipmanaged} && 0%{skipmanagedtools}
224 %ifarch %{arm} aarch64 riscv64
225 # Detect interpreter name from cross-gcc
226 LD_INTERPRETER=$(patchelf --print-interpreter /emul/usr/bin/gcc)
227 LD_LOCAL_INTERPRETER=$(patchelf --print-interpreter ./.dotnet/dotnet)
229 if [ "$LD_INTERPRETER" == "$LD_LOCAL_INTERPRETER" ]; then
232 LD_RPATH=$(patchelf --print-rpath /emul/usr/bin/gcc)
233 for file in $( find ./.dotnet ./.packages -name "dotnet" -type f -o -name "ilasm" -type f -o -name "ilc" -type f)
235 patchelf --set-interpreter ${LD_INTERPRETER} ${file}
236 patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
238 for file in $( find ./.dotnet ./.packages ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
240 patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
246 for file in $( find ./.dotnet ./.packages ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
248 patchelf --set-rpath %{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
253 # disable asan build when global forced asan build
255 export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS`
256 /usr/bin/gcc-unforce-options
257 export LD_LIBRARY_PATH=`pwd`/libicu-57.1
258 export CPPFLAGS+=" -DHAS_ADDRESS_SANITIZER "
261 BASE_FLAGS=" --target=%{_host} -gdwarf-4 "
273 export CLANG_NO_LIBDIR_SUFFIX=1
274 export DOTNET_GCHeapHardLimit=1C0000000
275 BASE_FLAGS="$(echo $BASE_FLAGS | sed -e 's/--target=i686/--target=i586/')"
276 BASE_FLAGS="$BASE_FLAGS -mstackrealign"
281 export CLANG_NO_LIBDIR_SUFFIX=1
286 export CLANG_NO_LIBDIR_SUFFIX=1
290 %define _barch riscv64
306 %define _tarch riscv64
309 %define _reldir_clr artifacts/bin/coreclr/linux.%{_barch}.%{dotnet_buildtype_clr}
310 %define _reldir_fx_native artifacts/bin/native/net8.0-linux-%{dotnet_buildtype_fx}-%{_barch}
311 %define _reldir_fx_managed artifacts/bin/microsoft.netcore.app.runtime.linux-%{_barch}/%{dotnet_buildtype_fx}/runtimes/linux-%{_barch}/lib/net8.0/
312 %define _reldir_fx_withoob artifacts/bin/runtime/net8.0-linux-%{dotnet_buildtype_fx}-%{_barch}
313 %define _reldir_fx_dotnet_host artifacts/bin/testhost/net8.0-linux-%{dotnet_buildtype_fx}-%{_barch}
314 %define _reldir_crossgen2_publish %{_reldir_clr}/crossgen2/linux-%{_barch}/publish
316 export CFLAGS="${BASE_FLAGS}"
317 export CXXFLAGS="${BASE_FLAGS}"
318 export ASMFLAGS="${BASE_FLAGS}"
321 %if %{dotnet_buildtype} == "Release"
322 export CXXFLAGS+="-fstack-protector-strong -D_FORTIFY_SOURCE=2"
324 export CXXFLAGS+="-fstack-protector-strong"
328 %if 0%{pgo_instrument}
329 %define _pgo_flags --pgoinstrument
332 # pgo optimization is enabled by default
333 %define _pgo_flags ""
335 %define _pgo_flags --nopgooptimize
339 %define _native_opts ""
340 %define _managed_opts ""
341 %define _source_version_flags /p:EnableSourceLink=false /p:DisableSourceLink=true /p:EnableSourceControlManagerQueries=false /p:EmbedUntrackedSources=false
342 %define _build_args --keepnativesymbols true --arch %{_barch} --runtimeConfiguration %{dotnet_buildtype_clr} --librariesConfiguration %{dotnet_buildtype_fx} --hostConfiguration %{dotnet_buildtype_host} %{_source_version_flags} %{_native_opts} %{_managed_opts}
343 %define _build_args_release --keepnativesymbols true --arch %{_barch} --runtimeConfiguration Release --librariesConfiguration Release --hostConfiguration Release %{_source_version_flags} %{_native_opts} %{_managed_opts}
345 export NUGET_PACKAGES=%{_builddir}/%{name}-%{version}/.packages/
346 export DOTNET_CLI_HOME=%{_builddir}/%{name}-%{version}/.dotnet_cli_home/
347 export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/
349 sed -i "s,TIZEN_NUGET_PACKAGES_DIR,${NUGET_PACKAGES}," %{_builddir}/%{name}-%{version}/NuGet.config
350 sed -i "s,TIZEN_NUGET_PACKAGES_DIR,${NUGET_PACKAGES}," ${DOTNET_CLI_HOME}/.dotnet/toolResolverCache/1/coverlet.console
351 sed -i "s,TIZEN_NUGET_PACKAGES_DIR,${NUGET_PACKAGES}," ${DOTNET_CLI_HOME}/.dotnet/toolResolverCache/1/dotnet-format
352 sed -i "s,TIZEN_NUGET_PACKAGES_DIR,${NUGET_PACKAGES}," ${DOTNET_CLI_HOME}/.dotnet/toolResolverCache/1/dotnet-reportgenerator-globaltool
353 sed -i "s,TIZEN_NUGET_PACKAGES_DIR,${NUGET_PACKAGES}," ${DOTNET_CLI_HOME}/.dotnet/toolResolverCache/1/microsoft.dotnet.xharness.cli
354 sed -i "s,TIZEN_NUGET_PACKAGES_DIR,${NUGET_PACKAGES}," ${DOTNET_CLI_HOME}/.dotnet/toolResolverCache/1/microsoft.visualstudio.slngen.tool
356 # Build native CoreCLR, native CoreFX and native host
357 # TODO: add --cmakeargs -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true
358 ./build.sh --portablebuild false %{_build_args} --subset clr.runtime+clr.spmi+libs.native+host.native --cmakeargs -DFEATURE_IBCLOGGER=true --cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro %{_pgo_flags}
361 # TODO: add --cmakeargs -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true
362 ./build.sh --portablebuild false %{_build_args} --subset clr.alljits --cmakeargs -DFEATURE_IBCLOGGER=true --cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro %{_pgo_flags}
367 # Build mscorlib (System.Private.CoreLib.dll)
368 ./build.sh --portablebuild false %{_build_args} --subset clr.corelib
373 # Build managed CoreFX
374 ./build.sh %{_build_args} --subset libs.sfx+libs.oob
376 %if 0%{skipmanagedtools}
378 # Build managed tools
379 ./build.sh %{_build_args} --subset clr.tools
382 ./build.sh %{_build_args} --subset libs.pretest
383 # Publish crossgen2 as a single file with self-contained
384 ./.dotnet/dotnet publish --self-contained true -r linux-%{_barch} ./src/coreclr/tools/aot/crossgen2/crossgen2.csproj -c %{dotnet_buildtype_clr} -p:PublishSingleFile=true %{_managed_opts}
390 # Build CoreFX managed tests, which are arch specific
391 # TODO: check if /p:DisableImplicitFSharpCoreReference=true is needed
392 ./build.sh --portablebuild false %{_build_args} --subset libs.pretest+libs.tests --testscope all /p:UseLocalAppHostPack=true
398 # Build CoreCLR tests
400 %if %{dotnet_buildtype} != "Release"
401 # Build Release CoreCLR & CoreFX (these are required for some tests)
403 # Build native CoreCLR and native CoreFX
404 # TODO: add --cmakeargs -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true
405 ./build.sh --portablebuild false %{_build_args_release} --subset clr.runtime+clr.spmi+libs.native+host.native --cmakeargs -DFEATURE_IBCLOGGER=true --cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro %{_pgo_flags}
407 # Build mscorlib (System.Private.CoreLib.dll)
408 ./build.sh --portablebuild false %{_build_args_release} --subset clr.corelib
410 # Build managed CoreFX
411 ./build.sh %{_build_args_release} --subset libs.sfx+libs.oob
414 # Build native part of tests as non-portable (i.e. for Tizen)
415 BuildAsStandalone=true ./src/tests/build.sh -%{dotnet_buildtype_clr} portablebuild=false -%{_barch} -priority1 skipmanaged skipgeneratelayout skiprestorepackages /p:__SkipPackageRestore=true
417 # Build managed part of tests
418 BuildAsStandalone=true ./src/tests/build.sh -%{dotnet_buildtype_clr} -%{_barch} -priority1 copynativeonly skiprestorepackages /p:__SkipPackageRestore=true
419 # TODO: check if /p:DisableImplicitFSharpCoreReference=true is needed
420 BuildAsStandalone=true ./src/tests/build.sh -%{dotnet_buildtype_clr} -%{_barch} -priority1 skipnative skipgeneratelayout skiptestwrappers
421 BuildAsStandalone=true ./src/tests/build.sh -%{dotnet_buildtype_clr} -%{_barch} -priority1 generatelayoutonly skiprestorepackages /p:__SkipPackageRestore=true
425 # .NET Core Runtime dir
426 %define dotnetdir dotnet
427 %define netshareddir %{dotnetdir}/shared
428 %define netcoreappdir %{netshareddir}/Microsoft.NETCore.App/%{dotnet_version}
429 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}
432 %define clrtestdir /opt/usr/coreclr-tc
433 %define fxtestdir /opt/usr/corefx-tc
434 mkdir -p %{buildroot}/%{clrtestdir}
435 mkdir -p %{buildroot}/%{fxtestdir}
436 mkdir -p %{buildroot}/%{fxtestdir}/coreroot
438 # .NET Tizen Runtime dir
439 %define dotnettizendir dotnet.tizen
440 %define dotnetfwdir %{dotnettizendir}/framework
441 mkdir -p %{buildroot}%{_datadir}/%{dotnettizendir}
442 mkdir -p %{buildroot}%{_datadir}/%{dotnetfwdir}
443 ln -sf %{_datadir}/%{netcoreappdir} %{buildroot}%{_datadir}/%{dotnettizendir}/netcoreapp
447 %define dotnetmicdir /opt/usr/dotnet/mic
448 mkdir -p %{buildroot}/%{dotnetmicdir}
451 # symlink to .NET version for compatibility
452 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.0.0
453 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.0
454 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.1
455 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.4
456 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.0.0
457 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.1.3
458 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/6.0.0
459 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/6.0.9
462 cp %{_reldir_clr}/corerun %{buildroot}%{_datadir}/%{netcoreappdir}
463 cp %{_reldir_clr}/libclrjit.so %{buildroot}%{_datadir}/%{netcoreappdir}
464 cp %{_reldir_clr}/libclrgc.so %{buildroot}%{_datadir}/%{netcoreappdir}
465 cp %{_reldir_clr}/libcoreclr.so %{buildroot}%{_datadir}/%{netcoreappdir}
466 cp %{_reldir_clr}/libmscordaccore.so %{buildroot}%{_datadir}/%{netcoreappdir}
467 cp %{_reldir_clr}/libmscordbi.so %{buildroot}%{_datadir}/%{netcoreappdir}
468 cp %{_reldir_clr}/libcoreclrtraceptprovider.so %{buildroot}%{_datadir}/%{netcoreappdir}
469 cp %{_reldir_clr}/libjitinterface_%{_tarch}.so %{buildroot}%{_datadir}/%{netcoreappdir}
470 cp %{_reldir_clr}/ilasm %{buildroot}%{_datadir}/%{netcoreappdir}
471 cp %{_reldir_clr}/ildasm %{buildroot}%{_datadir}/%{netcoreappdir}
472 cp %{_reldir_clr}/createdump %{buildroot}%{_datadir}/%{netcoreappdir}
473 cp %{_reldir_clr}/libdnetmemoryenum.so %{buildroot}%{_datadir}/%{netcoreappdir}
476 cp %{_reldir_fx_native}/libSystem.Globalization.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
477 cp %{_reldir_fx_native}/libSystem.IO.Compression.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
478 cp %{_reldir_fx_native}/libSystem.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
479 cp %{_reldir_fx_native}/libSystem.Net.Security.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
480 cp %{_reldir_fx_native}/libSystem.Security.Cryptography.Native.OpenSsl.so %{buildroot}%{_datadir}/%{netcoreappdir}
483 cp %{_reldir_fx_native}/libSystem.IO.Ports.Native.so %{buildroot}/%{fxtestdir}/coreroot
485 # .NET Core Headers and static libraries
486 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src/
487 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
488 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/dlls/
489 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
490 cp -rf src/coreclr/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/
491 cp -rf src/coreclr/pal/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
492 cp -rf src/coreclr/pal/prebuilt %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
493 cp -rf src/coreclr/debug/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
494 cp -rf src/coreclr/hosts/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
495 cp -rf src/coreclr/pal/src/include %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src
496 cp -rf %{_reldir_clr}/lib %{buildroot}%{_datadir}/%{netcoreappdir}
498 # System.Private.CoreLib.dll
501 cp %{_reldir_clr}/IL/System.Private.CoreLib.dll %{buildroot}%{_datadir}/%{netcoreappdir}
502 cp %{_reldir_clr}/IL/System.Private.CoreLib.pdb %{buildroot}%{_datadir}/%{netcoreappdir}
505 # Managed tools and managed CoreFX
509 %if 0%{skipmanagedtools}
513 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
514 cp %{_reldir_clr}/crossgen2/crossgen2.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
515 cp %{_reldir_clr}/crossgen2/ILCompiler.Diagnostics.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
516 cp %{_reldir_clr}/crossgen2/ILCompiler.ReadyToRun.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
517 cp %{_reldir_clr}/crossgen2/ILCompiler.TypeSystem.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
518 cp %{_reldir_clr}/crossgen2/ILCompiler.DependencyAnalysisFramework.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
519 cp %{_reldir_clr}/crossgen2/Microsoft.DiaSymReader.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
520 cp %{_reldir_clr}/crossgen2/System.CommandLine.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
521 cp %{_reldir_clr}/crossgen2/*.pdb %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
523 cp %{_reldir_clr}/libjitinterface_%{_tarch}.so %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
527 cp %{_reldir_fx_managed}/*.dll %{buildroot}%{_datadir}/%{netcoreappdir}
528 cp %{_reldir_fx_managed}/*.pdb %{buildroot}%{_datadir}/%{netcoreappdir}
530 # Copy files for test rpm
534 mkdir artifacts/corefx_tests
535 mkdir artifacts/corefx_tests/tests
536 mkdir artifacts/corefx_tests/coreroot
537 mkdir artifacts/corefx_tests/dotnet_host
538 mkdir -p artifacts/corefx_tests/dotnet_host/host/fxr/%{dotnet_version}
539 mkdir -p artifacts/corefx_tests/dotnet_host/shared/Microsoft.NETCore.App/
541 # Copy corefx tests with only required files to keep size smaller
542 for test_dir in `find ./artifacts/bin -type d -name "*.Tests"`; do
543 test=$(basename $test_dir)
544 mkdir artifacts/corefx_tests/tests/$test
546 for FILE in `find $test_dir \( -name "*dll" -or -name "*.json" -or -name "*.resources" -or -name "*.pdb" -or -name "*.xml" -or -name "*.exe" -or -name "*.cs" -or -name "*.docx" -or -name "*.pfx" -or -name "*.so" -or -name "*.h" -or -name "*.config" -or -name "*.props" -or -name "ibm-fpgen.txt" \)`
548 cp $FILE artifacts/corefx_tests/tests/$test/
551 for DIR in `find $test_dir -type d \( -name "*TestFiles" -or -name "*TestData" -or -name "*NetworkFiles" -or -name "*Utils" -or -name "*Mono" -or -name "*TestFeeds" -or -name "*bitmaps" -or -name "*TestDataCertificates" -or -name "*live-ref-pack" -or -name "*tar" -or -name "*targz" -or -name "*strange" -or -name "*unarchived" -or -name "*XmlDocument" -or -name "*XmlSchema" -or -name "*Baselines" -or -name "*TestClasses" -or -name "*SqlXml.CreateReader" -or -name "*testroot" \)`
553 cp -r $DIR artifacts/corefx_tests/tests/$test/
557 # Some tests require all files
558 for test in System.Runtime.Loader.Tests System.Resources.ResourceManager.Tests System.IO.Packaging.Tests; do
559 test_dir=$(find ./artifacts/bin -type d -name $test)
560 file_dir=$(find $test_dir -name $test.dll)
561 file_dir=$(dirname $file_dir)
562 cp -r $file_dir/* artifacts/corefx_tests/tests/$test/
565 for test_dir in `find artifacts/corefx_tests/tests/ -type d -name "*.Tests"`; do
566 test=$(basename $test_dir)
567 sed "s/COREFX_TEST_NAME/${test}/g" RunTests.sh > ${test_dir}/RunTests.sh
568 chmod +x ${test_dir}/RunTests.sh
571 for test_dir in `find artifacts/corefx_tests/tests/ -type d -name "Invariant.Tests"`; do
572 file=$(find ${test_dir} -name RunTests.sh)
574 sed "s/\$RUNTIME_PATH\/corerun xunit.console.dll/CORECLR_GLOBAL_INVARIANT=1 \$RUNTIME_PATH\/corerun xunit.console.dll/g" $file > $file.bak
579 # This is a workaround for incorrect System.Data.SqlClient.dll packed for System.Data.Common.Tests (correct System.Data.SqlClient.dll is used when "dotnet build" and "dotnet run" commands are used).
580 sql_version=$(ls ./.packages/system.data.sqlclient/ | tail -n 1)
581 cp ./.packages/system.data.sqlclient/$sql_version/runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll artifacts/corefx_tests/tests/System.Data.Common.Tests/
583 # There are no tests in Microsoft.Extensions.DependencyInjection.Specification.Tests
584 rm -rf artifacts/corefx_tests/tests/Microsoft.Extensions.DependencyInjection.Specification.Tests
586 source /etc/os-release
588 cp %{_reldir_fx_withoob}/*.dll artifacts/corefx_tests/coreroot/
589 cp artifacts/bin/tizen.${VERSION_ID}-%{_barch}.%{dotnet_buildtype_host}/corehost/dotnet artifacts/corefx_tests/dotnet_host
590 cp artifacts/bin/tizen.${VERSION_ID}-%{_barch}.%{dotnet_buildtype_host}/corehost/libhostfxr.so artifacts/corefx_tests/dotnet_host/host/fxr/%{dotnet_version}
591 cp artifacts/bin/tizen.${VERSION_ID}-%{_barch}.%{dotnet_buildtype_host}/corehost/libhostpolicy.so artifacts/corefx_tests/coreroot/
592 ln -s ../../../coreroot/ artifacts/corefx_tests/dotnet_host/shared/Microsoft.NETCore.App/%{dotnet_version}
593 ln -s ../dotnet_host/dotnet artifacts/corefx_tests/coreroot/dotnet
594 cp %{_reldir_fx_dotnet_host}/shared/Microsoft.NETCore.App/%{dotnet_version}/Microsoft.NETCore.App.deps.json artifacts/corefx_tests/coreroot
596 mv artifacts/corefx_tests/tests %{buildroot}/%{fxtestdir}/
597 mv artifacts/corefx_tests/coreroot/* %{buildroot}/%{fxtestdir}/coreroot/
598 mv artifacts/corefx_tests/dotnet_host %{buildroot}/%{fxtestdir}/
599 cp runtest_fx.sh %{buildroot}/%{fxtestdir}/runtest.sh
600 chmod +x %{buildroot}/%{fxtestdir}/runtest.sh
608 crossgen2_self_contained=("crossgen2" "libjitinterface_x64.so" "libclrjit_universal_arm_x64.so" "libclrjit_universal_arm64_x64.so")
609 for name in "${crossgen2_self_contained[@]}";
611 cp %{_reldir_crossgen2_publish}/$name %{buildroot}%{dotnetmicdir}
614 result_list=("ld-linux-x86-64.so.2" "libssl.so.1.1")
617 local library_list=$2
618 if [ -f $path ]; then
619 ldd_result=$(/usr/bin/ldd $path)
620 echo "$ldd_result" | while read line;
622 if [[ "$line" != *"GLIBC_"* ]] && [[ "$line" != *"linux-vdso.so.1"* ]] &&
623 [[ "$line" != *"ld-linux-x86-64.so.2"* ]]; then
624 cut_path=`echo $line | cut -d ' ' -f3`
625 cut_name=`echo $line | cut -d ' ' -f1`
626 library_list+=($cut_name)
627 echo "${library_list[@]}"
628 if [ -f $cut_path ]; then
629 result_list+=$(search_ldd $cut_path $library_list)
636 for name in "${crossgen2_self_contained[@]}";
638 result_list+=$(search_ldd %{_reldir_crossgen2_publish}/$name)
639 echo $name: | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
640 /usr/bin/ldd %{_reldir_crossgen2_publish}/$name | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
642 result_list+=$(search_ldd %{buildroot}/../../../../../lib64/libssl.so.1.1)
644 unique_result=($(echo "${result_list[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
645 for name in "${unique_result[@]}";
647 cp %{buildroot}/../../../../../lib64/$name %{buildroot}%{dotnetmicdir}/$name
648 echo $name: | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
649 /usr/bin/ldd %{buildroot}/../../../../../lib64/$name | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
657 cp runtest_clr.sh %{buildroot}/%{clrtestdir}/runtest.sh
658 chmod +x %{buildroot}/%{clrtestdir}/runtest.sh
659 cp unsupportedCrossgenLibs.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedCrossgenLibs.txt | true
660 cp unsupportedCrossgenTests.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedCrossgenTests.txt | true
661 cp unsupportedTests.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedTests.txt | true
662 cp unsupportedGCStressTests.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedGCStressTests.txt | true
664 %define _tcreldir artifacts/tests/coreclr/linux.%{_barch}.%{dotnet_buildtype_clr}
665 cp -r %{_tcreldir}/* %{buildroot}/%{clrtestdir}
666 find %{buildroot}/%{clrtestdir} -name "*.pdb" -exec rm {} \;
667 find %{buildroot}/%{clrtestdir} -name "*.cmd" -exec rm {} \;
668 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/in
669 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/sharedFramework
670 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/PDB
671 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/x64
672 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/gcinfo
673 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/inc
674 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/lib
675 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/IL
676 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/crossgen2
678 %ifarch %{arm} aarch64 riscv64
679 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/R2RDump/Microsoft.DiaSymReader.Native.x86.dll
680 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/R2RDump/Microsoft.DiaSymReader.Native.amd64.dll
683 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/ILCompiler.*.dll
684 rm -rf %{buildroot}/%{clrtestdir}/build/
685 rm %{buildroot}/%{clrtestdir}/Tests/Core_Root/{superpmi,SOS_README.md,mcs,*.a,*.so,ilasm,ildasm}
687 cp %{buildroot}/%{clrtestdir}/bin/*.so %{buildroot}/%{clrtestdir}/Tests/Core_Root
688 mv %{buildroot}/%{clrtestdir}/Tests/Core_Root %{buildroot}/%{clrtestdir}/coreroot
692 mkdir -p %{buildroot}/%{clrtestdir}/bin
693 cp %{_reldir_clr}/superpmi %{buildroot}/%{clrtestdir}/bin
694 cp %{_reldir_clr}/mcs %{buildroot}/%{clrtestdir}/bin
695 cp %{_reldir_clr}/libsuperpmi-shim-collector.so %{buildroot}/%{clrtestdir}/bin
696 cp %{_reldir_clr}/libsuperpmi-shim-counter.so %{buildroot}/%{clrtestdir}/bin
697 cp %{_reldir_clr}/libsuperpmi-shim-simple.so %{buildroot}/%{clrtestdir}/bin
700 ### Copy nupkg to nuget directory
702 mkdir -p %{buildroot}/nuget
703 cp ./nuget/*.nupkg %{buildroot}/nuget
707 %manifest %{name}.manifest
708 %dir %{_datadir}/%{dotnetdir}
709 %dir %{_datadir}/%{netcoreappdir}
710 %dir %{_datadir}/%{dotnettizendir}
711 %{_datadir}/%{netcoreappdir}/corerun
712 %{_datadir}/%{netcoreappdir}/libclrjit.so
713 %{_datadir}/%{netcoreappdir}/libclrgc.so
714 %{_datadir}/%{netcoreappdir}/libcoreclr.so
715 %{_datadir}/%{netcoreappdir}/libmscordaccore.so
716 %{_datadir}/%{netcoreappdir}/libmscordbi.so
717 %{_datadir}/%{netcoreappdir}/libcoreclrtraceptprovider.so
718 %{_datadir}/%{netcoreappdir}/libjitinterface_%{_tarch}.so
719 %{_datadir}/%{dotnettizendir}/netcoreapp
720 %{_datadir}/%{netcoreappdir}/ilasm
721 %{_datadir}/%{netcoreappdir}/ildasm
722 %{_datadir}/%{netcoreappdir}/createdump
723 %{_datadir}/%{netcoreappdir}/libdnetmemoryenum.so
727 %if 0%{skipmanagedtools}
730 %dir %{_datadir}/%{netcoreappdir}/crossgen2
731 %{_datadir}/%{netcoreappdir}/crossgen2/crossgen2.dll
732 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.Diagnostics.dll
733 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.ReadyToRun.dll
734 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.TypeSystem.dll
735 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.DependencyAnalysisFramework.dll
736 %{_datadir}/%{netcoreappdir}/crossgen2/Microsoft.DiaSymReader.dll
737 %{_datadir}/%{netcoreappdir}/crossgen2/System.CommandLine.dll
739 %{_datadir}/%{netcoreappdir}/crossgen2/libjitinterface_%{_tarch}.so
744 # symlink to .NET version for compatibility
745 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.0.0
746 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.0
747 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.1
748 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.4
749 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.0.0
750 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.1.3
751 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/6.0.0
752 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/6.0.9
754 %files -n coreclr-test
755 %manifest %{name}.manifest
759 %files -n coreclr-devel
760 %manifest %{name}.manifest
761 %dir %{_datadir}/%{netcoreappdir}/lib
762 %dir %{_datadir}/%{netcoreappdir}/src
763 %dir %{_datadir}/%{netcoreappdir}
764 %{_datadir}/%{netcoreappdir}/lib/*
765 %{_datadir}/%{netcoreappdir}/src/*
769 %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.pdb
774 %if 0%{skipmanagedtools}
776 %{_datadir}/%{netcoreappdir}/crossgen2/*.pdb
783 %manifest %{name}.manifest
784 %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.dll
787 %files -n corefx-native
788 %manifest %{name}.manifest
789 %{_datadir}/%{netcoreappdir}/libSystem.Globalization.Native.so
790 %{_datadir}/%{netcoreappdir}/libSystem.IO.Compression.Native.so
791 %{_datadir}/%{netcoreappdir}/libSystem.Native.so
792 %{_datadir}/%{netcoreappdir}/libSystem.Net.Security.Native.so
793 %{_datadir}/%{netcoreappdir}/libSystem.Security.Cryptography.Native.OpenSsl.so
795 %files -n corefx-test-native
796 %manifest %{name}.manifest
797 %{fxtestdir}/coreroot/libSystem.IO.Ports.Native.so
800 %{fxtestdir}/coreroot/Microsoft.NETCore.App.deps.json
801 %{fxtestdir}/coreroot/dotnet
802 %{fxtestdir}/coreroot/libhostpolicy.so
803 %{fxtestdir}/dotnet_host/*
809 %files -n corefx-managed
810 %manifest %{name}.manifest
811 %{_datadir}/%{netcoreappdir}/*.dll
812 %exclude %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.dll
814 %files -n corefx-managed-devel
815 %manifest %{name}.manifest
816 %{_datadir}/%{netcoreappdir}/*.pdb
817 %exclude %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.pdb
821 %files -n corefx-test
822 %manifest %{name}.manifest
824 %{fxtestdir}/coreroot/*.dll
825 %{fxtestdir}/runtest.sh
830 %files -n corefx-managed-ref
831 %manifest %{name}.manifest
835 %files -n crossgen2-mic
836 %manifest %{name}.manifest
844 rm -f %{_datadir}/%{netcoreappdir}/*.Backup
847 %post -p /sbin/ldconfig
849 %postun -p /sbin/ldconfig