1 %{!?dotnet_buildtype: %define dotnet_buildtype Release}
2 %{!?skiptests: %define skiptests 1}
4 %define dotnet_buildtype_clr %{dotnet_buildtype}
5 %define dotnet_buildtype_fx %{dotnet_buildtype}
7 %if "%{?dotnet_buildtype}" == "Checked"
8 %define dotnet_buildtype_fx Debug
11 %define _binaries_in_noarch_packages_terminate_build 0
12 %define _unpackaged_files_terminate_build 0
14 %define skipmscorlib 0
16 %define skipmanagedtools 0
19 %define skipmanagedtools 1
22 %ifarch %{arm} aarch64 %{ix86} x86_64
27 %define pgo_instrument 0
28 %define pgo_optimize 0
30 %define dotnet_version 6.0.0
35 Summary: Microsoft .NET Runtime with Microsoft .NET foundation class libraries (CoreCLR and CoreFX)
36 Group: Development/Languages
38 URL: http://github.com/dotnet/runtime
39 Source0: %{name}-%{version}.tar.gz
40 Source1: %{name}.manifest
43 BuildRequires: python-xml
45 BuildRequires: pkgconfig(libunwind)
46 BuildRequires: pkgconfig(uuid)
47 # System.Globalization.Native.so
48 BuildRequires: libicu-devel
49 BuildRequires: tizen-release
50 # System.Net.Security.Native.so
51 # System.Net.Http.Native.so
52 BuildRequires: krb5-devel
53 BuildRequires: libcurl-devel
54 # No matter what tizen-release package you use in any profile
62 # Accelerate python, clang
64 BuildRequires: python-accel-armv7l-cross-arm
65 BuildRequires: clang-accel-armv7l-cross-arm
69 BuildRequires: python-accel-armv7hl-cross-arm
70 BuildRequires: clang-accel-armv7hl-cross-arm
74 BuildRequires: python-accel-aarch64-cross-aarch64
75 BuildRequires: clang-accel-aarch64-cross-aarch64
79 BuildRequires: llvm >= 3.8
80 BuildRequires: llvm-devel >= 3.8
81 BuildRequires: clang >= 3.8
82 BuildRequires: clang-devel >= 3.8
83 BuildRequires: lldb >= 3.8
84 BuildRequires: lldb-devel >= 3.8
85 BuildRequires: gettext-tools
86 BuildRequires: libopenssl1.1-devel
88 BuildRequires: libstdc++-devel
89 BuildRequires: pkgconfig(lttng-ust)
91 BuildRequires: libatomic
92 BuildRequires: gcc-devel-static
94 %if 0%{skipmscorlib} && 0%{skipmanaged} && 0%{skipmanagedtools}
96 %ifarch %{arm} aarch64
97 BuildRequires: patchelf
100 BuildRequires: patchelf
101 BuildRequires: glibc-64bit
102 BuildRequires: libgcc-64bit
103 BuildRequires: libstdc++-64bit
104 BuildRequires: libunwind-64bit
105 BuildRequires: libuuid-64bit
106 BuildRequires: zlib-64bit
107 BuildRequires: libopenssl11-64bit
111 %if 0%{pgo_instrument} || 0%{pgo_optimize}
112 BuildRequires: binutils-gold
113 BuildRequires: compiler-rt
117 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.
119 %package -n coreclr-test
120 Summary: Dotnet Core Unit Test
123 %description -n coreclr-test
126 %package -n coreclr-devel
127 Summary: Dotnet Core Development package
130 %description -n coreclr-devel
131 Headers and static libraries
134 Summary: Core Library for MS .NET
137 %description -n mscorlib
138 The System.Private.CoreLib.dll for .NET Core Runtime (coreclr)
140 %package -n corefx-native
141 Summary: Core foundational native libraries
145 %description -n corefx-native
146 The native part (.so) of dotnet core foundational libraries
148 %package -n corefx-managed
149 Summary: Core foundational managed libraries
152 Requires: corefx-native
156 %description -n corefx-managed
157 The managed part (.dll) of dotnet core foundational class libraries
159 %package -n corefx-managed-devel
160 Summary: Core foundational managed libraries for debugging (.pdb)
161 Requires: corefx-managed
165 %description -n corefx-managed-devel
166 The managed debugging files (.pdb) of dotnet core fundational class libraries
168 %package -n corefx-managed-ref
169 Summary: Core foundational managed class libraries for developer
173 %description -n corefx-managed-ref
174 The managed part (.dll) of dotnet core foundational class libraries for developer
177 %package -n corefx-test
178 Summary: Dotnet Libraries Unit Test
179 Requires: corefx-native
180 Requires: corefx-managed
184 %description -n corefx-test
188 %package -n corefx-test-native
189 Summary: Dotnet Libraries Unit Test, native part
190 Requires: corefx-native
191 Requires: corefx-managed
193 %description -n corefx-test-native
194 Unit Test objs, native part
197 %package -n crossgen2-mic
198 Summary: Publish crossgen2 as a single file with self-contained
203 %description -n crossgen2-mic
204 Publish crossgen2 as a single file with self-contained
208 %setup -q -n %{name}-%{version}
211 %if 0%{skipmscorlib} && 0%{skipmanaged} && 0%{skipmanagedtools}
213 %ifarch %{arm} aarch64
214 # Detect interpreter name from cross-gcc
215 LD_INTERPRETER=$(patchelf --print-interpreter /emul/usr/bin/gcc)
216 LD_RPATH=$(patchelf --print-rpath /emul/usr/bin/gcc)
217 for file in $( find ./.dotnet ./.packages -name "dotnet" -type f -o -name "ilasm" -type f)
219 patchelf --set-interpreter ${LD_INTERPRETER} ${file}
220 patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
222 for file in $( find ./.dotnet ./.packages ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
224 patchelf --set-rpath ${LD_RPATH}:%{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
229 for file in $( find ./.dotnet ./.packages ./libicu-57.1 -iname "*.so" -or -iname "*.so.*" )
231 patchelf --set-rpath %{_builddir}/%{name}-%{version}/libicu-57.1/ ${file}
237 # disable asan build when global forced asan build
239 export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS`
240 /usr/bin/gcc-unforce-options
241 export LD_LIBRARY_PATH=`pwd`/libicu-57.1
243 # enable ASan support for only external libs
244 export TIZEN_ASAN_ENVIRONMENT=1
247 BASE_FLAGS=" --target=%{_host} "
252 # Even though build architectur is x86_64, it will be running on arm board.
253 # So we need to pass the arch argument as arm.
254 %define _barch %{?cross:%{cross}}%{!?cross:x64}
263 export CLANG_NO_LIBDIR_SUFFIX=1
264 BASE_FLAGS="$(echo $BASE_FLAGS | sed -e 's/--target=i686/--target=i586/')"
265 BASE_FLAGS="$BASE_FLAGS -mstackrealign"
270 export CLANG_NO_LIBDIR_SUFFIX=1
275 export CLANG_NO_LIBDIR_SUFFIX=1
291 %define _reldir_clr artifacts/bin/coreclr/Linux.%{_barch}.%{dotnet_buildtype_clr}
292 %define _reldir_fx_native artifacts/bin/native/net6.0-Linux-%{dotnet_buildtype_fx}-%{_barch}
293 %define _reldir_fx_managed artifacts/bin/microsoft.netcore.app.runtime.linux-%{_barch}/%{dotnet_buildtype_fx}/runtimes/linux-%{_barch}/lib/net6.0/
294 %define _reldir_fx_withoob artifacts/bin/runtime/net6.0-Linux-%{dotnet_buildtype_fx}-%{_barch}
295 %define _reldir_crossgen2_publish %{_reldir_clr}/crossgen2/linux-%{_barch}/publish
297 export CFLAGS="${BASE_FLAGS}"
298 export CXXFLAGS="${BASE_FLAGS}"
299 export ASMFLAGS="${BASE_FLAGS}"
302 %if %{dotnet_buildtype} == "Release"
303 export CXXFLAGS+="-fstack-protector-strong -D_FORTIFY_SOURCE=2"
305 export CXXFLAGS+="-fstack-protector-strong"
309 %if 0%{pgo_instrument}
310 %define _pgo_flags --pgoinstrument
313 # pgo optimization is enabled by default
314 %define _pgo_flags ""
316 %define _pgo_flags --nopgooptimize
320 %define _source_version_flags /p:EnableSourceLink=false /p:DisableSourceLink=true /p:EnableSourceControlManagerQueries=false /p:EmbedUntrackedSources=false
321 %define _build_args --keepnativesymbols true --arch %{_barch} --runtimeConfiguration %{dotnet_buildtype_clr} --librariesConfiguration %{dotnet_buildtype_fx} %{_source_version_flags}
322 %define _build_args_release --keepnativesymbols true --arch %{_barch} --runtimeConfiguration Release --librariesConfiguration Release %{_source_version_flags}
324 export NUGET_PACKAGES=%{_builddir}/%{name}-%{version}/.packages/
325 export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/
327 # Build native CoreCLR and native CoreFX
328 ./build.sh --portablebuild false %{_build_args} --subset clr.runtime+clr.jit+clr.iltools+libs.native --cmakeargs -DFEATURE_IBCLOGGER=true --cmakeargs -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true --cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro %{_pgo_flags}
331 # Publish crossgen2 as a single file with self-contained
332 ./build.sh --portablebuild false %{_build_args} --subset clr.alljits --cmakeargs -DFEATURE_IBCLOGGER=true --cmakeargs -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true --cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro %{_pgo_flags}
333 ./.dotnet/dotnet publish --self-contained true -r linux-%{_barch} ./src/coreclr/tools/aot/crossgen2/crossgen2.csproj -c %{dotnet_buildtype_clr} -p:PublishSingleFile=true
338 # Build mscorlib (System.Private.CoreLib.dll)
339 ./build.sh --portablebuild false %{_build_args} --subset clr.corelib
344 # Build managed CoreFX
345 ./build.sh %{_build_args} --subset libs.ref+libs.src+libs.packages /p:UseSharedCompilation=false
347 %if 0%{skipmanagedtools}
349 # Build managed tools
350 ./build.sh %{_build_args} --subset clr.tools /p:UseSharedCompilation=false
354 # Build CoreFX managed tests, which are reused for all arches
355 ./build.sh %{_build_args} --subset libs.pretest+libs.tests --testscope all /p:DisableImplicitFSharpCoreReference=true /p:UseSharedCompilation=false
361 # Build CoreCLR tests
363 %if %{dotnet_buildtype} != "Release"
364 # Build Release CoreCLR & CoreFX (these are required for some tests)
366 # Build native CoreCLR and native CoreFX
367 ./build.sh --portablebuild false %{_build_args_release} --subset clr.runtime+clr.jit+clr.iltools+libs.native --cmakeargs -DFEATURE_IBCLOGGER=true --cmakeargs -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true --cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro %{_pgo_flags}
369 # Build mscorlib (System.Private.CoreLib.dll)
370 ./build.sh --portablebuild false %{_build_args_release} --subset clr.corelib
372 # Build managed CoreFX
373 ./build.sh %{_build_args_release} --subset libs.ref+libs.src+libs.packages /p:UseSharedCompilation=false
376 # Build native part of tests as non-portable (i.e. for Tizen)
377 ./src/tests/build.sh -%{dotnet_buildtype_clr} portablebuild=false -%{_barch} -priority1 skipgenerateversion skipmanaged skipgeneratelayout skiprestorepackages /p:__SkipPackageRestore=true
379 # Build managed part of tests
380 ./src/tests/build.sh -%{dotnet_buildtype_clr} -%{_barch} -priority1 skipgenerateversion copynativeonly skiprestorepackages /p:__SkipPackageRestore=true
381 ./src/tests/build.sh -%{dotnet_buildtype_clr} -%{_barch} -priority1 skipgenerateversion skipnative skipgeneratelayout skiptestwrappers /p:DisableImplicitFSharpCoreReference=true
382 ./src/tests/build.sh -%{dotnet_buildtype_clr} -%{_barch} -priority1 skipgenerateversion generatelayoutonly skiprestorepackages /p:__SkipPackageRestore=true
386 # .NET Core Runtime dir
387 %define dotnetdir dotnet
388 %define netshareddir %{dotnetdir}/shared
389 %define netcoreappdir %{netshareddir}/Microsoft.NETCore.App/%{dotnet_version}
390 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}
393 %define clrtestdir /opt/usr/coreclr-tc
394 %define fxtestdir /opt/usr/corefx-tc
395 mkdir -p %{buildroot}/%{clrtestdir}
396 mkdir -p %{buildroot}/%{fxtestdir}
397 mkdir -p %{buildroot}/%{fxtestdir}/coreroot
399 # .NET Tizen Runtime dir
400 %define dotnettizendir dotnet.tizen
401 %define dotnetfwdir %{dotnettizendir}/framework
402 mkdir -p %{buildroot}%{_datadir}/%{dotnettizendir}
403 mkdir -p %{buildroot}%{_datadir}/%{dotnetfwdir}
404 ln -sf %{_datadir}/%{netcoreappdir} %{buildroot}%{_datadir}/%{dotnettizendir}/netcoreapp
408 %define dotnetmicdir /opt/usr/dotnet/mic
409 mkdir -p %{buildroot}/%{dotnetmicdir}
412 # symlink to .NET version for compatibility
413 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.0.0
414 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.0
415 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.1
416 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.4
417 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.0.0
418 ln -sf %{dotnet_version} %{buildroot}%{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.1.3
421 cp %{_reldir_clr}/corerun %{buildroot}%{_datadir}/%{netcoreappdir}
422 cp %{_reldir_clr}/libclrjit.so %{buildroot}%{_datadir}/%{netcoreappdir}
423 cp %{_reldir_clr}/libclrgc.so %{buildroot}%{_datadir}/%{netcoreappdir}
424 cp %{_reldir_clr}/libcoreclr.so %{buildroot}%{_datadir}/%{netcoreappdir}
425 cp %{_reldir_clr}/libdbgshim.so %{buildroot}%{_datadir}/%{netcoreappdir}
426 cp %{_reldir_clr}/libmscordaccore.so %{buildroot}%{_datadir}/%{netcoreappdir}
427 cp %{_reldir_clr}/libmscordbi.so %{buildroot}%{_datadir}/%{netcoreappdir}
428 cp %{_reldir_clr}/libcoreclrtraceptprovider.so %{buildroot}%{_datadir}/%{netcoreappdir}
429 cp %{_reldir_clr}/libjitinterface_%{_tarch}.so %{buildroot}%{_datadir}/%{netcoreappdir}
430 cp %{_reldir_clr}/ilasm %{buildroot}%{_datadir}/%{netcoreappdir}
431 cp %{_reldir_clr}/ildasm %{buildroot}%{_datadir}/%{netcoreappdir}
434 cp %{_reldir_fx_native}/libSystem.Globalization.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
435 cp %{_reldir_fx_native}/libSystem.IO.Compression.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
436 cp %{_reldir_fx_native}/libSystem.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
437 cp %{_reldir_fx_native}/libSystem.Net.Security.Native.so %{buildroot}%{_datadir}/%{netcoreappdir}
438 cp %{_reldir_fx_native}/libSystem.Security.Cryptography.Native.OpenSsl.so %{buildroot}%{_datadir}/%{netcoreappdir}
441 cp %{_reldir_fx_native}/libSystem.IO.Ports.Native.so %{buildroot}/%{fxtestdir}/coreroot
443 # .NET Core Headers and static libraries
444 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src/
445 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
446 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/dlls/
447 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
448 cp -rf src/coreclr/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/
449 cp -rf src/coreclr/pal/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
450 cp -rf src/coreclr/pal/prebuilt %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/
451 cp -rf src/coreclr/debug/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
452 cp -rf src/coreclr/debug/shim %{buildroot}%{_datadir}/%{netcoreappdir}/src/debug/
453 cp -rf src/coreclr/dlls/dbgshim %{buildroot}%{_datadir}/%{netcoreappdir}/src/dlls/
454 cp -rf src/coreclr/hosts/inc %{buildroot}%{_datadir}/%{netcoreappdir}/src/coreclr/hosts/
455 cp -rf src/coreclr/pal/src/include %{buildroot}%{_datadir}/%{netcoreappdir}/src/pal/src
456 cp -rf %{_reldir_clr}/lib %{buildroot}%{_datadir}/%{netcoreappdir}
458 # System.Private.CoreLib.dll
461 cp %{_reldir_clr}/IL/System.Private.CoreLib.dll %{buildroot}%{_datadir}/%{netcoreappdir}
462 cp %{_reldir_clr}/IL/System.Private.CoreLib.pdb %{buildroot}%{_datadir}/%{netcoreappdir}
465 # Managed tools and managed CoreFX
469 %if 0%{skipmanagedtools}
471 cp %{_reldir_clr}/createdump %{buildroot}%{_datadir}/%{netcoreappdir}
472 cp %{_reldir_clr}/libdnetmemoryenum.so %{buildroot}%{_datadir}/%{netcoreappdir}
475 mkdir -p %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
476 cp %{_reldir_clr}/crossgen2/crossgen2.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
477 cp %{_reldir_clr}/crossgen2/ILCompiler.Diagnostics.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
478 cp %{_reldir_clr}/crossgen2/ILCompiler.ReadyToRun.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
479 cp %{_reldir_clr}/crossgen2/ILCompiler.TypeSystem.ReadyToRun.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
480 cp %{_reldir_clr}/crossgen2/ILCompiler.DependencyAnalysisFramework.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
481 cp %{_reldir_clr}/crossgen2/Microsoft.DiaSymReader.dll %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
483 cp %{_reldir_clr}/libjitinterface_%{_tarch}.so %{buildroot}%{_datadir}/%{netcoreappdir}/crossgen2
487 cp %{_reldir_fx_managed}/*.dll %{buildroot}%{_datadir}/%{netcoreappdir}
488 cp %{_reldir_fx_managed}/*.pdb %{buildroot}%{_datadir}/%{netcoreappdir}
490 # Copy files for test rpm
493 mkdir artifacts/corefx_tests
494 mkdir artifacts/corefx_tests/tests
495 mkdir artifacts/corefx_tests/coreroot
497 for test_dir in `find ./artifacts/bin -type d -name "*.Tests"`; do
498 test=$(basename $test_dir)
499 mkdir artifacts/corefx_tests/tests/$test
501 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" \)`
503 cp $FILE artifacts/corefx_tests/tests/$test/
506 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" \)`
508 cp -r $DIR artifacts/corefx_tests/tests/$test/
512 for test in System.Runtime.Loader.Tests System.Resources.ResourceManager.Tests System.IO.Packaging.Tests; do
513 test_dir=$(find ./artifacts/bin -type d -name $test)
514 file_dir=$(find $test_dir -name $test.dll)
515 file_dir=$(dirname $file_dir)
516 cp -r $file_dir/* artifacts/corefx_tests/tests/$test/
519 for test_dir in `find artifacts/corefx_tests/tests/ -type d -name "*.Tests"`; do
520 test=$(basename $test_dir)
521 sed "s/TEST_NAME_DLL/${test}.dll/" RunTests.sh > ${test_dir}/RunTests.sh
522 chmod +x ${test_dir}/RunTests.sh
525 for test_dir in `find artifacts/corefx_tests/tests/ -type d -name "Invariant.Tests"`; do
526 file=$(find ${test_dir} -name RunTests.sh)
528 sed "s/\$RUNTIME_PATH\/corerun xunit.console.dll/CORECLR_GLOBAL_INVARIANT=1 \$RUNTIME_PATH\/corerun xunit.console.dll/g" $file > $file.bak
533 # This is a workaround for missing xunit.console.dll for ILCompiler tests (which are technically not corefx tests, but for now are placed in corefx-tests rpm).
534 # For corefx tests xunit is set up (and copied to test dir) in ./eng/testing/xunit/xunit.console.targets.
535 # ILCompiler tests do not use this set up approach, so explicitly perform copy step (see CopyRunnerToOutputDirectory target in ./eng/testing/xunit/xunit.console.targets for details).
536 cp ./.packages/microsoft.dotnet.xunitconsolerunner/*/tools/netcoreapp3.1/* artifacts/corefx_tests/tests/ILCompiler.TypeSystem.ReadyToRun.Tests/
538 cp %{_reldir_fx_withoob}/*.dll artifacts/corefx_tests/coreroot/
540 mv artifacts/corefx_tests/tests %{buildroot}/%{fxtestdir}/
541 mv artifacts/corefx_tests/coreroot/* %{buildroot}/%{fxtestdir}/coreroot/
542 cp runtest_fx.sh %{buildroot}/%{fxtestdir}/runtest.sh
543 chmod +x %{buildroot}/%{fxtestdir}/runtest.sh
551 crossgen2_self_contained=("crossgen2" "libjitinterface_x64.so" "libclrjit_unix_armel_x64.so" "libclrjit_unix_arm64_x64.so")
552 for name in "${crossgen2_self_contained[@]}";
554 cp %{_reldir_crossgen2_publish}/$name %{buildroot}%{dotnetmicdir}
557 result_list=("ld-linux-x86-64.so.2" "libssl.so.1.1")
560 local library_list=$2
561 if [ -f $path ]; then
562 ldd_result=$(/usr/bin/ldd $path)
563 echo "$ldd_result" | while read line;
565 if [[ "$line" != *"GLIBC_"* ]] && [[ "$line" != *"linux-vdso.so.1"* ]] &&
566 [[ "$line" != *"ld-linux-x86-64.so.2"* ]]; then
567 cut_path=`echo $line | cut -d ' ' -f3`
568 cut_name=`echo $line | cut -d ' ' -f1`
569 library_list+=($cut_name)
570 echo "${library_list[@]}"
571 if [ -f $cut_path ]; then
572 result_list+=$(search_ldd $cut_path $library_list)
579 for name in "${crossgen2_self_contained[@]}";
581 result_list+=$(search_ldd %{_reldir_crossgen2_publish}/$name)
582 echo $name: | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
583 /usr/bin/ldd %{_reldir_crossgen2_publish}/$name | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
585 result_list+=$(search_ldd %{buildroot}/../../../../../lib64/libssl.so.1.1)
587 unique_result=($(echo "${result_list[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
588 for name in "${unique_result[@]}";
590 cp %{buildroot}/../../../../../lib64/$name %{buildroot}%{dotnetmicdir}/$name
591 echo $name: | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
592 /usr/bin/ldd %{buildroot}/../../../../../lib64/$name | tee -a %{buildroot}%{dotnetmicdir}/crossgen2-mic.txt > /dev/null
599 cp runtest_clr.sh %{buildroot}/%{clrtestdir}/runtest.sh
600 chmod +x %{buildroot}/%{clrtestdir}/runtest.sh
601 cp unsupportedCrossgenLibs.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedCrossgenLibs.txt | true
602 cp unsupportedCrossgenTests.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedCrossgenTests.txt | true
603 cp unsupportedTests.%{_barch}.txt %{buildroot}/%{clrtestdir}/unsupportedTests.txt | true
605 %define _tcreldir artifacts/tests/coreclr/Linux.%{_barch}.%{dotnet_buildtype_clr}
606 cp -r %{_tcreldir}/* %{buildroot}/%{clrtestdir}
607 find %{buildroot}/%{clrtestdir} -name "*.pdb" -exec rm {} \;
608 find %{buildroot}/%{clrtestdir} -name "*.cmd" -exec rm {} \;
609 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/in
610 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/sharedFramework
611 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/PDB
612 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/x64
613 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/gcinfo
614 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/inc
615 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/lib
616 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/IL
617 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/crossgen2
619 %ifarch %{arm} aarch64
620 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/R2RDump/Microsoft.DiaSymReader.Native.x86.dll
621 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/R2RDump/Microsoft.DiaSymReader.Native.amd64.dll
624 rm -rf %{buildroot}/%{clrtestdir}/Tests/Core_Root/ILCompiler.*.dll
625 rm -rf %{buildroot}/%{clrtestdir}/build/
626 rm %{buildroot}/%{clrtestdir}/Tests/Core_Root/{superpmi,SOS_README.md,mcs,*.a,*.so,ilasm,ildasm}
627 #rm %{buildroot}/%{clrtestdir}/Tests/Core_Root/api-ms-win-core-debug-l1-1-0.dll
628 #rm %{buildroot}/%{clrtestdir}/Tests/Core_Root/api-ms-win-core-debug-l1-1-1.dll
630 cp %{buildroot}/%{clrtestdir}/bin/*.so %{buildroot}/%{clrtestdir}/Tests/Core_Root
631 mv %{buildroot}/%{clrtestdir}/Tests/Core_Root %{buildroot}/%{clrtestdir}/coreroot
635 mkdir -p %{buildroot}/%{clrtestdir}/bin
636 cp %{_reldir_clr}/superpmi %{buildroot}/%{clrtestdir}/bin
637 cp %{_reldir_clr}/mcs %{buildroot}/%{clrtestdir}/bin
638 cp %{_reldir_clr}/libsuperpmi-shim-collector.so %{buildroot}/%{clrtestdir}/bin
639 cp %{_reldir_clr}/libsuperpmi-shim-counter.so %{buildroot}/%{clrtestdir}/bin
640 cp %{_reldir_clr}/libsuperpmi-shim-simple.so %{buildroot}/%{clrtestdir}/bin
643 ### Copy nupkg to nuget directory
645 mkdir -p %{buildroot}/nuget
646 cp ./nuget/*.nupkg %{buildroot}/nuget
650 %manifest %{name}.manifest
651 %dir %{_datadir}/%{dotnetdir}
652 %dir %{_datadir}/%{netcoreappdir}
653 %dir %{_datadir}/%{dotnettizendir}
654 %{_datadir}/%{netcoreappdir}/corerun
655 %{_datadir}/%{netcoreappdir}/libclrjit.so
656 %{_datadir}/%{netcoreappdir}/libclrgc.so
657 %{_datadir}/%{netcoreappdir}/libcoreclr.so
658 %{_datadir}/%{netcoreappdir}/libdbgshim.so
659 %{_datadir}/%{netcoreappdir}/libmscordaccore.so
660 %{_datadir}/%{netcoreappdir}/libmscordbi.so
661 %{_datadir}/%{netcoreappdir}/libcoreclrtraceptprovider.so
662 %{_datadir}/%{netcoreappdir}/libjitinterface_%{_tarch}.so
663 %{_datadir}/%{dotnettizendir}/netcoreapp
664 %{_datadir}/%{netcoreappdir}/ilasm
665 %{_datadir}/%{netcoreappdir}/ildasm
670 %if 0%{skipmanagedtools}
672 %{_datadir}/%{netcoreappdir}/createdump
673 %{_datadir}/%{netcoreappdir}/libdnetmemoryenum.so
675 %dir %{_datadir}/%{netcoreappdir}/crossgen2
676 %{_datadir}/%{netcoreappdir}/crossgen2/crossgen2.dll
677 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.Diagnostics.dll
678 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.ReadyToRun.dll
679 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.TypeSystem.ReadyToRun.dll
680 %{_datadir}/%{netcoreappdir}/crossgen2/ILCompiler.DependencyAnalysisFramework.dll
681 %{_datadir}/%{netcoreappdir}/crossgen2/Microsoft.DiaSymReader.dll
683 %{_datadir}/%{netcoreappdir}/crossgen2/libjitinterface_%{_tarch}.so
688 # symlink to .NET version for compatibility
689 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.0.0
690 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.0
691 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.1
692 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/2.1.4
693 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.0.0
694 %{_datadir}/%{netshareddir}/Microsoft.NETCore.App/3.1.3
696 %files -n coreclr-test
697 %manifest %{name}.manifest
701 %files -n coreclr-devel
702 %manifest %{name}.manifest
703 %dir %{_datadir}/%{netcoreappdir}/lib
704 %dir %{_datadir}/%{netcoreappdir}/src
705 %dir %{_datadir}/%{netcoreappdir}
706 %{_datadir}/%{netcoreappdir}/lib/*
707 %{_datadir}/%{netcoreappdir}/src/*
708 %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.pdb
713 %manifest %{name}.manifest
714 %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.dll
717 %files -n corefx-native
718 %manifest %{name}.manifest
719 %{_datadir}/%{netcoreappdir}/libSystem.Globalization.Native.so
720 %{_datadir}/%{netcoreappdir}/libSystem.IO.Compression.Native.so
721 %{_datadir}/%{netcoreappdir}/libSystem.Native.so
722 %{_datadir}/%{netcoreappdir}/libSystem.Net.Security.Native.so
723 %{_datadir}/%{netcoreappdir}/libSystem.Security.Cryptography.Native.OpenSsl.so
725 %files -n corefx-test-native
726 %manifest %{name}.manifest
727 %{fxtestdir}/coreroot/libSystem.IO.Ports.Native.so
732 %files -n corefx-managed
733 %manifest %{name}.manifest
734 %{_datadir}/%{netcoreappdir}/*.dll
735 %exclude %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.dll
737 %files -n corefx-managed-devel
738 %manifest %{name}.manifest
739 %{_datadir}/%{netcoreappdir}/*.pdb
740 %exclude %{_datadir}/%{netcoreappdir}/System.Private.CoreLib.pdb
743 %files -n corefx-test
744 %manifest %{name}.manifest
746 %{fxtestdir}/coreroot/*.dll
747 %{fxtestdir}/runtest.sh
752 %files -n corefx-managed-ref
753 %manifest %{name}.manifest
757 %files -n crossgen2-mic
758 %manifest %{name}.manifest
766 rm -f %{_datadir}/%{netcoreappdir}/*.Backup
769 #From .NET6.0, the version is accumulated in vconf and set in descending order
770 #%{dotnet_version}:x.x.x:~~~:6.0.0
772 /usr/bin/vconftool set -t string db/dotnet/runtime_version %{dotnet_version} -f
775 %postun -p /sbin/ldconfig