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
213 %description -n crossgen2-mic
214 Publish crossgen2 as a single file with self-contained
218 %setup -q -n %{name}-%{version}
223 %if 0%{skipmscorlib} && 0%{skipmanaged} && 0%{skipmanagedtools}
225 %ifarch %{arm} aarch64 riscv64
226 # Detect interpreter name from cross-gcc
227 LD_INTERPRETER=$(patchelf --print-interpreter /emul/usr/bin/gcc)
228 LD_LOCAL_INTERPRETER=$(patchelf --print-interpreter ./.dotnet/dotnet)
230 if [ "$LD_INTERPRETER" == "$LD_LOCAL_INTERPRETER" ]; then
233 LD_RPATH=$(patchelf --print-rpath /emul/usr/bin/gcc)
234 for file in $( find ./.dotnet ./.packages -name "dotnet" -type f -o -name "ilasm" -type f -o -name "ilc" -type f)
236 patchelf --set-interpreter ${LD_INTERPRETER} ${file}
237 patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
239 for file in $( find ./.dotnet ./.packages ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
241 patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
247 for file in $( find ./.dotnet ./.packages ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
249 patchelf --set-rpath %{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
254 # disable asan build when global forced asan build
256 export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS`
257 /usr/bin/gcc-unforce-options
258 export LD_LIBRARY_PATH=`pwd`/libicu-57.1
259 export CPPFLAGS+=" -DHAS_ADDRESS_SANITIZER "
262 BASE_FLAGS=" --target=%{_host} -gdwarf-4 "
274 export CLANG_NO_LIBDIR_SUFFIX=1
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}
475 cp %{_reldir_fx_native}/libSystem.Globalization.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
476 cp %{_reldir_fx_native}/libSystem.IO.Compression.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
477 cp %{_reldir_fx_native}/libSystem.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
478 cp %{_reldir_fx_native}/libSystem.Net.Security.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
479 cp %{_reldir_fx_native}/libSystem.Security.Cryptography.Native.OpenSsl.so %{buildroot}%{_datadir}/%{netcoreappdir}
482 cp %{_reldir_fx_native}/libSystem.IO.Ports.Native.so %{buildroot}/%{fxtestdir}/coreroot
484 # .NET Core Headers and static libraries
485 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src/
486 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
487 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/dlls/
488 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
489 cp -rf src/coreclr/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/
490 cp -rf src/coreclr/pal/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
491 cp -rf src/coreclr/pal/prebuilt %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
492 cp -rf src/coreclr/debug/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
493 cp -rf src/coreclr/hosts/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
494 cp -rf src/coreclr/pal/src/include %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src
495 cp -rf %{_reldir_clr}/lib %{buildroot}%{_datadir}/%{netcoreappdir}
497 # System.Private.CoreLib.dll
500 cp %{_reldir_clr}/IL/System.Private.CoreLib.dll %{buildroot}%{_datadir}/%{netcoreappdir}
501 cp %{_reldir_clr}/IL/System.Private.CoreLib.pdb %{buildroot}%{_datadir}/%{netcoreappdir}
504 # Managed tools and managed CoreFX
508 %if 0%{skipmanagedtools}
512 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
513 cp %{_reldir_clr}/crossgen2/crossgen2.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
514 cp %{_reldir_clr}/crossgen2/ILCompiler.Diagnostics.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
515 cp %{_reldir_clr}/crossgen2/ILCompiler.ReadyToRun.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
516 cp %{_reldir_clr}/crossgen2/ILCompiler.TypeSystem.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
517 cp %{_reldir_clr}/crossgen2/ILCompiler.DependencyAnalysisFramework.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
518 cp %{_reldir_clr}/crossgen2/Microsoft.DiaSymReader.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
519 cp %{_reldir_clr}/crossgen2/System.CommandLine.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
520 cp %{_reldir_clr}/crossgen2/*.pdb %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
522 cp %{_reldir_clr}/libjitinterface_%{_tarch}.so %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
526 cp %{_reldir_fx_managed}/*.dll %{buildroot}%{_datadir}/%{netcoreappdir}
527 cp %{_reldir_fx_managed}/*.pdb %{buildroot}%{_datadir}/%{netcoreappdir}
529 # Copy files for test rpm
533 mkdir artifacts/corefx_tests
534 mkdir artifacts/corefx_tests/tests
535 mkdir artifacts/corefx_tests/coreroot
536 mkdir artifacts/corefx_tests/dotnet_host
537 mkdir -p artifacts/corefx_tests/dotnet_host/host/fxr/%{dotnet_version}
538 mkdir -p artifacts/corefx_tests/dotnet_host/shared/Microsoft.NETCore.App/
540 # Copy corefx tests with only required files to keep size smaller
541 for test_dir in `find ./artifacts/bin -type d -name "*.Tests"`; do
542 test=$(basename $test_dir)
543 mkdir artifacts/corefx_tests/tests/$test
545 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" \)`
547 cp $FILE artifacts/corefx_tests/tests/$test/
550 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" \)`
552 cp -r $DIR artifacts/corefx_tests/tests/$test/
556 # Some tests require all files
557 for test in System.Runtime.Loader.Tests System.Resources.ResourceManager.Tests System.IO.Packaging.Tests; do
558 test_dir=$(find ./artifacts/bin -type d -name $test)
559 file_dir=$(find $test_dir -name $test.dll)
560 file_dir=$(dirname $file_dir)
561 cp -r $file_dir/* artifacts/corefx_tests/tests/$test/
564 for test_dir in `find artifacts/corefx_tests/tests/ -type d -name "*.Tests"`; do
565 test=$(basename $test_dir)
566 sed "s/COREFX_TEST_NAME/${test}/g" RunTests.sh > ${test_dir}/RunTests.sh
567 chmod +x ${test_dir}/RunTests.sh
570 for test_dir in `find artifacts/corefx_tests/tests/ -type d -name "Invariant.Tests"`; do
571 file=$(find ${test_dir} -name RunTests.sh)
573 sed "s/\$RUNTIME_PATH\/corerun xunit.console.dll/CORECLR_GLOBAL_INVARIANT=1 \$RUNTIME_PATH\/corerun xunit.console.dll/g" $file > $file.bak
578 # 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).
579 sql_version=$(ls ./.packages/system.data.sqlclient/ | tail -n 1)
580 cp ./.packages/system.data.sqlclient/$sql_version/runtimes/unix/lib/netcoreapp2.1/System.Data.SqlClient.dll artifacts/corefx_tests/tests/System.Data.Common.Tests/
582 # There are no tests in Microsoft.Extensions.DependencyInjection.Specification.Tests
583 rm -rf artifacts/corefx_tests/tests/Microsoft.Extensions.DependencyInjection.Specification.Tests
585 source /etc/os-release
587 cp %{_reldir_fx_withoob}/*.dll artifacts/corefx_tests/coreroot/
588 cp artifacts/bin/tizen.${VERSION_ID}-%{_barch}.%{dotnet_buildtype_host}/corehost/dotnet artifacts/corefx_tests/dotnet_host
589 cp artifacts/bin/tizen.${VERSION_ID}-%{_barch}.%{dotnet_buildtype_host}/corehost/libhostfxr.so artifacts/corefx_tests/dotnet_host/host/fxr/%{dotnet_version}
590 cp artifacts/bin/tizen.${VERSION_ID}-%{_barch}.%{dotnet_buildtype_host}/corehost/libhostpolicy.so artifacts/corefx_tests/coreroot/
591 ln -s ../../../coreroot/ artifacts/corefx_tests/dotnet_host/shared/Microsoft.NETCore.App/%{dotnet_version}
592 ln -s ../dotnet_host/dotnet artifacts/corefx_tests/coreroot/dotnet
593 cp %{_reldir_fx_dotnet_host}/shared/Microsoft.NETCore.App/%{dotnet_version}/Microsoft.NETCore.App.deps.json artifacts/corefx_tests/coreroot
595 mv artifacts/corefx_tests/tests %{buildroot}/%{fxtestdir}/
596 mv artifacts/corefx_tests/coreroot/* %{buildroot}/%{fxtestdir}/coreroot/
597 mv artifacts/corefx_tests/dotnet_host %{buildroot}/%{fxtestdir}/
598 cp runtest_fx.sh %{buildroot}/%{fxtestdir}/runtest.sh
599 chmod +x %{buildroot}/%{fxtestdir}/runtest.sh
607 crossgen2_self_contained=("crossgen2" "libjitinterface_x64.so" "libclrjit_universal_arm_x64.so" "libclrjit_universal_arm64_x64.so")
608 for name in "${crossgen2_self_contained[@]}";
610 cp %{_reldir_crossgen2_publish}/$name %{buildroot}%{dotnetmicdir}
613 result_list=("ld-linux-x86-64.so.2" "libssl.so.1.1")
616 local library_list=$2
617 if [ -f $path ]; then
618 ldd_result=$(/usr/bin/ldd $path)
619 echo "$ldd_result" | while read line;
621 if [[ "$line" != *"GLIBC_"* ]] && [[ "$line" != *"linux-vdso.so.1"* ]] &&
622 [[ "$line" != *"ld-linux-x86-64.so.2"* ]]; then
623 cut_path=`echo $line | cut -d ' ' -f3`
624 cut_name=`echo $line | cut -d ' ' -f1`
625 library_list+=($cut_name)
626 echo "${library_list[@]}"
627 if [ -f $cut_path ]; then
628 result_list+=$(search_ldd $cut_path $library_list)
635 for name in "${crossgen2_self_contained[@]}";
637 result_list+=$(search_ldd %{_reldir_crossgen2_publish}/$name)
638 echo $name: | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
639 /usr/bin/ldd %{_reldir_crossgen2_publish}/$name | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
641 result_list+=$(search_ldd %{buildroot}/../../../../../lib64/libssl.so.1.1)
643 unique_result=($(echo "${result_list[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
644 for name in "${unique_result[@]}";
646 cp %{buildroot}/../../../../../lib64/$name %{buildroot}%{dotnetmicdir}/$name
647 echo $name: | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
648 /usr/bin/ldd %{buildroot}/../../../../../lib64/$name | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
656 cp runtest_clr.sh %{buildroot}/%{clrtestdir}/runtest.sh
657 chmod +x %{buildroot}/%{clrtestdir}/runtest.sh
658 cp unsupportedCrossgenLibs.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedCrossgenLibs.txt | true
659 cp unsupportedCrossgenTests.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedCrossgenTests.txt | true
660 cp unsupportedTests.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedTests.txt | true
662 %define _tcreldir artifacts/tests/coreclr/linux.%{_barch}.%{dotnet_buildtype_clr}
663 cp -r %{_tcreldir}/* %{buildroot}/%{clrtestdir}
664 find %{buildroot}/%{clrtestdir} -name "*.pdb" -exec rm {} \;
665 find %{buildroot}/%{clrtestdir} -name "*.cmd" -exec rm {} \;
666 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/in
667 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/sharedFramework
668 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/PDB
669 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/x64
670 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/gcinfo
671 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/inc
672 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/lib
673 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/IL
674 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/crossgen2
676 %ifarch %{arm} aarch64 riscv64
677 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/R2RDump/Microsoft.DiaSymReader.Native.x86.dll
678 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/R2RDump/Microsoft.DiaSymReader.Native.amd64.dll
681 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/ILCompiler.*.dll
682 rm -rf %{buildroot}/%{clrtestdir}/build/
683 rm %{buildroot}/%{clrtestdir}/Tests/Core_Root/{superpmi,SOS_README.md,mcs,*.a,*.so,ilasm,ildasm}
685 cp %{buildroot}/%{clrtestdir}/bin/*.so %{buildroot}/%{clrtestdir}/Tests/Core_Root
686 mv %{buildroot}/%{clrtestdir}/Tests/Core_Root %{buildroot}/%{clrtestdir}/coreroot
690 mkdir -p %{buildroot}/%{clrtestdir}/bin
691 cp %{_reldir_clr}/superpmi %{buildroot}/%{clrtestdir}/bin
692 cp %{_reldir_clr}/mcs %{buildroot}/%{clrtestdir}/bin
693 cp %{_reldir_clr}/libsuperpmi-shim-collector.so %{buildroot}/%{clrtestdir}/bin
694 cp %{_reldir_clr}/libsuperpmi-shim-counter.so %{buildroot}/%{clrtestdir}/bin
695 cp %{_reldir_clr}/libsuperpmi-shim-simple.so %{buildroot}/%{clrtestdir}/bin
698 ### Copy nupkg to nuget directory
700 mkdir -p %{buildroot}/nuget
701 cp ./nuget/*.nupkg %{buildroot}/nuget
705 %manifest %{name}.manifest
706 %dir %{_datadir}/%{dotnetdir}
707 %dir %{_datadir}/%{netcoreappdir}
708 %dir %{_datadir}/%{dotnettizendir}
709 %{_datadir}/%{netcoreappdir}/corerun
710 %{_datadir}/%{netcoreappdir}/libclrjit.so
711 %{_datadir}/%{netcoreappdir}/libclrgc.so
712 %{_datadir}/%{netcoreappdir}/libcoreclr.so
713 %{_datadir}/%{netcoreappdir}/libmscordaccore.so
714 %{_datadir}/%{netcoreappdir}/libmscordbi.so
715 %{_datadir}/%{netcoreappdir}/libcoreclrtraceptprovider.so
716 %{_datadir}/%{netcoreappdir}/libjitinterface_%{_tarch}.so
717 %{_datadir}/%{dotnettizendir}/netcoreapp
718 %{_datadir}/%{netcoreappdir}/ilasm
719 %{_datadir}/%{netcoreappdir}/ildasm
720 %{_datadir}/%{netcoreappdir}/createdump
725 %if 0%{skipmanagedtools}
728 %dir %{_datadir}/%{netcoreappdir}/crossgen2
729 %{_datadir}/%{netcoreappdir}/crossgen2/crossgen2.dll
730 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.Diagnostics.dll
731 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.ReadyToRun.dll
732 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.TypeSystem.dll
733 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.DependencyAnalysisFramework.dll
734 %{_datadir}/%{netcoreappdir}/crossgen2/Microsoft.DiaSymReader.dll
735 %{_datadir}/%{netcoreappdir}/crossgen2/System.CommandLine.dll
737 %{_datadir}/%{netcoreappdir}/crossgen2/libjitinterface_%{_tarch}.so
742 # symlink to .NET version for compatibility
743 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.0.0
744 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.0
745 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.1
746 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.4
747 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.0.0
748 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.1.3
749 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/6.0.0
750 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/6.0.9
752 %files -n coreclr-test
753 %manifest %{name}.manifest
757 %files -n coreclr-devel
758 %manifest %{name}.manifest
759 %dir %{_datadir}/%{netcoreappdir}/lib
760 %dir %{_datadir}/%{netcoreappdir}/src
761 %dir %{_datadir}/%{netcoreappdir}
762 %{_datadir}/%{netcoreappdir}/lib/*
763 %{_datadir}/%{netcoreappdir}/src/*
767 %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.pdb
772 %if 0%{skipmanagedtools}
774 %{_datadir}/%{netcoreappdir}/crossgen2/*.pdb
781 %manifest %{name}.manifest
782 %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.dll
785 %files -n corefx-native
786 %manifest %{name}.manifest
787 %{_datadir}/%{netcoreappdir}/libSystem.Globalization.Native.so
788 %{_datadir}/%{netcoreappdir}/libSystem.IO.Compression.Native.so
789 %{_datadir}/%{netcoreappdir}/libSystem.Native.so
790 %{_datadir}/%{netcoreappdir}/libSystem.Net.Security.Native.so
791 %{_datadir}/%{netcoreappdir}/libSystem.Security.Cryptography.Native.OpenSsl.so
793 %files -n corefx-test-native
794 %manifest %{name}.manifest
795 %{fxtestdir}/coreroot/libSystem.IO.Ports.Native.so
798 %{fxtestdir}/coreroot/Microsoft.NETCore.App.deps.json
799 %{fxtestdir}/coreroot/dotnet
800 %{fxtestdir}/coreroot/libhostpolicy.so
801 %{fxtestdir}/dotnet_host/*
807 %files -n corefx-managed
808 %manifest %{name}.manifest
809 %{_datadir}/%{netcoreappdir}/*.dll
810 %exclude %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.dll
812 %files -n corefx-managed-devel
813 %manifest %{name}.manifest
814 %{_datadir}/%{netcoreappdir}/*.pdb
815 %exclude %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.pdb
819 %files -n corefx-test
820 %manifest %{name}.manifest
822 %{fxtestdir}/coreroot/*.dll
823 %{fxtestdir}/runtest.sh
828 %files -n corefx-managed-ref
829 %manifest %{name}.manifest
833 %files -n crossgen2-mic
834 %manifest %{name}.manifest
842 rm -f %{_datadir}/%{netcoreappdir}/*.Backup
845 %post -p /sbin/ldconfig
847 %postun -p /sbin/ldconfig