[TRE-2857] Add patchelf, crossgen2-mic pkg & Modify dotnet-generate-ni.post script 13/269113/1 accepted/tizen/unified/20220111.010908 submit/tizen/20220110.213957 submit/tizen/20220111.003339
authorj-h.choi <j-h.choi@samsung.com>
Mon, 10 Jan 2022 03:28:54 +0000 (12:28 +0900)
committerj-h.choi <j-h.choi@samsung.com>
Mon, 10 Jan 2022 03:32:21 +0000 (12:32 +0900)
Change-Id: Ib8692fc68cbba6c66c007166b4c200de97983c0e

patterns/tv-dotnet-runtime.yaml
scripts/tv-dotnet-generate-ni.post

index 91ddef9..3bea5bf 100644 (file)
@@ -7,3 +7,5 @@ Packages:
 - corefx-native
 - mscorlib
 - coreclr-diagnostics
+- crossgen2-mic
+- patchelf
index 1147b82..c6238b4 100644 (file)
@@ -1,47 +1,34 @@
 #!/bin/sh
 echo "############### tv-dotnet-generate-ni.post ################"
-# Generate NI for dlls and exes under platform directories
-
-export IBCDATA_DIR=/usr/share/dotnet.tizen/ibcdata
 
 # remove previous native image
 dotnettool --ni-reset-system
 
-# generate native image
-dotnettool --ibc-dir $IBCDATA_DIR --ni-system
-
-# remove ibc data files
-if [ -d $IBCDATA_DIR ]
-then
-    rm -rf $IBCDATA_DIR
-fi
-
-
-
-##################################################################
-#                                                                #
-#                            Obsolute                            #
-#                                                                #
-##################################################################
-# Generate NI for System
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Collections.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.IO.FileSystem.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Linq.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Linq.Expressions.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.ObjectModel.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Private.DataContractSerialization.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Private.Uri.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Private.Xml.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Reflection.Metadata.dll
-#nitool --dll /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Text.RegularExpressions.dll
-# Generate NI for Xamarin and Device API
-#nitool --dll /usr/share/dotnet.tizen/framework/ElmSharp.dll
-#nitool --dll /usr/share/dotnet.tizen/framework/Tizen.dll
-#nitool --dll /usr/share/dotnet.tizen/framework/Tizen.Applications.Common.dll
-#nitool --dll /usr/share/dotnet.tizen/framework/Tizen.Applications.UI.dll
-#nitool --dll /usr/share/dotnet.tizen/framework/Xamarin.Forms.Core.dll
-#nitool --dll /usr/share/dotnet.tizen/framework/Xamarin.Forms.Platform.dll
-#nitool --dll /usr/share/dotnet.tizen/framework/Xamarin.Forms.Platform.Tizen.dll
-#nitool --dll /usr/share/dotnet.tizen/framework/Xamarin.Forms.Xaml.dll
-# Generate Launcher
-#nitool --dll /usr/bin/Tizen.Runtime.Coreclr.dll
+# set the patchelf
+export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
+export MIC_CROSSGEN2_ENABLED=1
+
+DOTNET_MIC_DIR=/opt/usr/dotnet/mic
+
+chmod 755 /usr/bin/patchelf
+chmod 755 $DOTNET_MIC_DIR/*
+
+/usr/bin/patchelf --set-interpreter $DOTNET_MIC_DIR/ld-linux-x86-64.so.2 $DOTNET_MIC_DIR/crossgen2
+/usr/bin/patchelf --set-rpath $DOTNET_MIC_DIR $DOTNET_MIC_DIR/crossgen2
+
+for file in $( find $DOTNET_MIC_DIR -type f \( -name "*.so" -or -name "*.so.*" \) -not -name "*.dbg" -not -name "ld-*.so*" )
+do
+    /usr/bin/patchelf --set-rpath $DOTNET_MIC_DIR ${file}
+done
+
+# generate native image for system
+dotnettool --ni-system --inputbubble
+
+# generate native image for all app
+dotnettool --ni-regen-all-app
+dotnettool --tac-regen-all
+
+# remove files and package related to dotnet used only in MIC
+rm -rf $DOTNET_MIC_DIR
+rpm -e patchelf
+rpm -e crossgen2-mic