@@ -394,34 +394,29 @@ isMSBuildOnNETCoreSupported()
394
394
395
395
build_CoreLib_ni ()
396
396
{
397
- if [ $__SkipCrossgen == 1 ]; then
398
- echo " Skipping generating native image"
399
- return
397
+ local __CrossGenExec=$1
398
+
399
+ echo " Generating native image for System.Private.CoreLib.dll"
400
+ echo " $__CrossGenExec /Platform_Assemblies_Paths $__BinDir /IL $__IbcTuning /out $__BinDir /System.Private.CoreLib.dll $__BinDir /IL/System.Private.CoreLib.dll"
401
+ $__CrossGenExec /Platform_Assemblies_Paths $__BinDir /IL $__IbcTuning /out $__BinDir /System.Private.CoreLib.dll $__BinDir /IL/System.Private.CoreLib.dll
402
+ if [ $? -ne 0 ]; then
403
+ echo " Failed to generate native image for System.Private.CoreLib."
404
+ exit 1
400
405
fi
401
406
402
- if [ $__SkipCoreCLR == 0 -a -e $__BinDir /crossgen ]; then
403
- echo " Generating native image for System.Private.CoreLib."
404
- echo " $__BinDir /crossgen /Platform_Assemblies_Paths $__BinDir /IL $__IbcTuning /out $__BinDir /System.Private.CoreLib.dll $__BinDir /IL /System.Private.CoreLib.dll"
405
- $__BinDir /crossgen /Platform_Assemblies_Paths $__BinDir /IL $__IbcTuning /out $__BinDir /System.Private.CoreLib.dll $__BinDir /IL /System.Private.CoreLib.dll
407
+ if [ " $__BuildOS " == " Linux " ]; then
408
+ echo " Generating symbol file for System.Private.CoreLib.dll "
409
+ echo " $__CrossGenExec /Platform_Assemblies_Paths $__BinDir /CreatePerfMap $__BinDir $__BinDir /System.Private.CoreLib.dll"
410
+ $__CrossGenExec /Platform_Assemblies_Paths $__BinDir /CreatePerfMap $__BinDir $__BinDir /System.Private.CoreLib.dll
406
411
if [ $? -ne 0 ]; then
407
- echo " Failed to generate native image for System.Private.CoreLib."
412
+ echo " Failed to generate symbol file for System.Private.CoreLib."
408
413
exit 1
409
414
fi
410
-
411
- if [ " $__BuildOS " == " Linux" ]; then
412
- echo " Generating symbol file for System.Private.CoreLib."
413
- $__BinDir /crossgen /CreatePerfMap $__BinDir $__BinDir /System.Private.CoreLib.dll
414
- if [ $? -ne 0 ]; then
415
- echo " Failed to generate symbol file for System.Private.CoreLib."
416
- exit 1
417
- fi
418
- fi
419
415
fi
420
416
}
421
417
422
418
build_CoreLib ()
423
419
{
424
-
425
420
if [ $__isMSBuildOnNETCoreSupported == 0 ]; then
426
421
echo " System.Private.CoreLib.dll build unsupported."
427
422
return
@@ -447,18 +442,31 @@ build_CoreLib()
447
442
exit 1
448
443
fi
449
444
445
+ if [ $__SkipCrossgen == 1 ]; then
446
+ echo " Skipping generating native image"
447
+ return
448
+ fi
449
+
450
450
# The cross build generates a crossgen with the target architecture.
451
- if [ $__CrossBuild != 1 ]; then
451
+ if [ $__CrossBuild == 0 ]; then
452
+ if [ $__SkipCoreCLR == 1 ]; then
453
+ return
454
+ fi
455
+
452
456
# The architecture of host pc must be same architecture with target.
453
457
if [[ ( " $__HostArch " == " $__BuildArch " ) ]]; then
454
- build_CoreLib_ni
458
+ build_CoreLib_ni " $__BinDir /crossgen "
455
459
elif [[ ( " $__HostArch " == " x64" ) && ( " $__BuildArch " == " x86" ) ]]; then
456
- build_CoreLib_ni
460
+ build_CoreLib_ni " $__BinDir /crossgen "
457
461
elif [[ ( " $__HostArch " == " arm64" ) && ( " $__BuildArch " == " arm" ) ]]; then
458
- build_CoreLib_ni
462
+ build_CoreLib_ni " $__BinDir /crossgen "
459
463
else
460
464
exit 1
461
465
fi
466
+ elif [ $__DoCrossArchBuild == 1 ]; then
467
+ if [[ ( " $__CrossArch " == " x86" ) && ( " $__BuildArch " == " arm" ) ]]; then
468
+ build_CoreLib_ni " $__CrossComponentBinDir /crossgen"
469
+ fi
462
470
fi
463
471
}
464
472
0 commit comments