platform/upstream/coreclr.git
2 years ago[Tizen] Support armv7hl build accepted/tizen_unified accepted/tizen/unified/20211223.050247 submit/tizen/20211223.031503
Woongsuk Cho [Thu, 23 Dec 2021 02:55:18 +0000 (11:55 +0900)]
[Tizen] Support armv7hl build

Patch to remove build errors that occur in armv7hl, a newly supported arch from Tizen 7.0.
Runtime test in armv7hl is not performed (to be verified after platform stabilization)

2 years ago[Tizen] Add support for aarch64 for coredumps created by minicoredumper (#327) accepted/tizen/6.5/unified/20211122.213410 accepted/tizen/unified/20211122.122534 submit/tizen/20211121.211701 submit/tizen_6.5/20211121.211854
Mateusz Moscicki/System (PLT) /SRPOL/Engineer/Samsung Electronics [Sun, 21 Nov 2021 21:15:30 +0000 (22:15 +0100)]
[Tizen] Add support for aarch64 for coredumps created by minicoredumper (#327)

Co-authored-by: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
2 years ago[x86/Linux] Fix SIGSEGV on Debugger.Break() during debugging. tizen_6.0_hotfix accepted/tizen/6.5/unified/20211028.225403 accepted/tizen/unified/20210923.052934 submit/tizen/20210922.225908 submit/tizen_6.0_hotfix/20210922.230120 submit/tizen_6.5/20211028.163301 tizen_6.5.m2_release
Mikhail Kurinnoi [Mon, 20 Sep 2021 15:20:04 +0000 (08:20 -0700)]
[x86/Linux] Fix SIGSEGV on Debugger.Break() during debugging.

SIGSEGV occur in src/vm/i386/cgenx86.cpp `HelperMethodFrame::UpdateRegDisplay()` at line `pRD->pCurrentContext->Eip = pRD->ControlPC = m_MachState.GetRetAddr();`, since `pRD->pCurrentContext` is NULL.
The point of issue - wrong code block compilation in DebuggerWalkStack() in case of Linux x86.

2 years agoAdd YieldProcessor implementation for arm accepted/tizen/unified/20210629.130321 submit/tizen/20210629.000826
Gleb Balykov [Mon, 28 Jun 2021 18:41:50 +0000 (21:41 +0300)]
Add YieldProcessor implementation for arm

3 years agoFix memory leaked caused by Marshal.GetFunctionPointerForDelegate (#28074) accepted/tizen_6.0_unified tizen_6.0 accepted/tizen/6.0/unified/20210115.041837 accepted/tizen/unified/20210115.125752 submit/tizen/20210115.013305 submit/tizen_6.0/20210115.013248
Aaron Robinson [Tue, 11 Aug 2020 23:52:55 +0000 (19:52 -0400)]
Fix memory leaked caused by Marshal.GetFunctionPointerForDelegate (#28074)

3 years agor0InUse should be true for SoftFP in CodeGen::genProfilingLeaveCallback in src/jit... accepted/tizen/6.0/unified/20201202.212218 accepted/tizen/unified/20201202.124951 submit/tizen/20201201.072115 submit/tizen_6.0/20201201.072121 submit/tizen_6.0_hotfix/20201201.072132
이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 [Tue, 1 Dec 2020 07:18:08 +0000 (16:18 +0900)]
r0InUse should be true for SoftFP in CodeGen::genProfilingLeaveCallback in src/jit/codegenarm.cpp (#321)

3 years agoRemove --arch option from runtest.sh
Timur [Wed, 28 Oct 2020 11:15:01 +0000 (14:15 +0300)]
Remove --arch option from runtest.sh

Signed-off-by: Timur <t-mustafin@partner.samsung.com>
3 years ago[Tizen] Add RelativeStubPrecode for arm64, which replaces StubPrecode in FNV images
Gleb Balykov [Thu, 24 Sep 2020 09:33:53 +0000 (12:33 +0300)]
[Tizen] Add RelativeStubPrecode for arm64, which replaces StubPrecode in FNV images

3 years ago[Tizen] Add method to write coredump of .NET process (#317) accepted/tizen_6.0_unified_hotfix accepted/tizen/6.0/unified/20201030.104646 accepted/tizen/6.0/unified/hotfix/20201102.235357 accepted/tizen/unified/20201005.101320 submit/tizen/20201005.013439 submit/tizen_6.0/20201029.205501 submit/tizen_6.0_hotfix/20201102.192901 submit/tizen_6.0_hotfix/20201103.115101 tizen_6.0.m2_release
Mateusz Moscicki/System (PLT) /SRPOL/Engineer/Samsung Electronics [Mon, 5 Oct 2020 01:33:40 +0000 (03:33 +0200)]
[Tizen] Add method to write coredump of .NET process (#317)

This method allows to create minimal coredump (as createdump does) of a
process that is in dumping state after crash.

3 years agofix dwarf-based unwinding to the end of stack
Yaroslav Yamshchikov [Fri, 18 Sep 2020 12:25:21 +0000 (15:25 +0300)]
fix dwarf-based unwinding to the end of stack

We experience CLR crash on some architectures (at least on x86) in case
of unhandled managed exception. libunwind steps to the very end of a
stack, and if .eh_frame info is correct, it returns with retcode 0 and
ip=0 from unw_step, then PAL calls unw_is_signal_frame with
c->validate==0 which in turn dereferences zeroed ip in access_mem.
libunwind spec says that retcode 0 from unw_step means very end of a
stack, so PAL should not expect any frames, signal or not. It should
convert cursor back to SEH representation and return with TRUE.

corresponding PR to dotnet/runtime on upstream:
https://github.com/dotnet/runtime/pull/42620

3 years agoRevert "[Tizen] Fix crash on accessing 0x0 while unwinding (#287)"
Yaroslav Yamshchikov [Thu, 24 Sep 2020 11:40:17 +0000 (14:40 +0300)]
Revert "[Tizen] Fix crash on accessing 0x0 while unwinding (#287)"

This reverts commit c4a72f57bee753daf09ffbc2a2dfe65ed1582919.

3 years ago[Tizen] Add RelativeFixupPrecode for arm64, which replaces FixupPrecode in FNV images accepted/tizen/unified/20200922.034817 submit/tizen/20200921.230336
Gleb Balykov [Mon, 14 Sep 2020 10:30:50 +0000 (13:30 +0300)]
[Tizen] Add RelativeFixupPrecode for arm64, which replaces FixupPrecode in FNV images

3 years agoBuild tests in gbs for x86/x64 (#307) accepted/tizen/unified/20200907.144049 submit/tizen/20200901.065247
Gleb Balykov/Platform Lab /SRR/Engineer/Samsung Electronics [Tue, 25 Aug 2020 08:35:27 +0000 (11:35 +0300)]
Build tests in gbs for x86/x64 (#307)

* Add -msse2 compile option

Cherry-pick of https://github.com/dotnet/runtime/pull/33135

* Use prefixed hex format in asm

Cherry-pick of https://github.com/dotnet/runtime/pull/33205

* [Tizen] Add CoreCLR tests build dependencies v3.1.3 for x86

* [Tizen] Add CoreCLR tests build dependencies v3.1.3 for x64

* [Tizen] Allow build of tests for x86/x64

3 years agoFix buffer overrun in JIT for Vector256<T> types on ARM64. (#35864) (#308) accepted/tizen/unified/20200811.050456 submit/tizen/20200811.004222
Timur Mustafin/Platform Lab /SRR/Engineer/Samsung Electronics [Mon, 10 Aug 2020 09:40:39 +0000 (12:40 +0300)]
Fix buffer overrun in JIT for Vector256<T> types on ARM64. (#35864) (#308)

Stop recognizing Vector256<T> types as intrinsic for ARM64 in Crossgen2.

Signed-off-by: Timur <t-mustafin@partner.samsung.com>
3 years agoImplement genProfilingEnterCallback genProfilingLeaveCallback on Arm64 (dotnet/corecl... accepted/tizen/unified/20200731.145700 submit/tizen/20200731.014213
Mikhail Kurinnoi [Thu, 23 Jul 2020 08:37:35 +0000 (11:37 +0300)]
Implement genProfilingEnterCallback genProfilingLeaveCallback on Arm64 (dotnet/coreclr#26460)

* Split genProfilingEnterCallback and genProfilingLeaveCallback into architecture specific versions
* Remove redundant genStackLevel save/restore logic on Arm, Arm64, Amd64
* Implement JIT_ProfilerEnterLeaveTailcallStub in assembly
* Define RBM_PROFILER_{ENTER,LEAVE,TAILCALL}_TRASH for TARGET_ARM64
* Define REG_PROFILER_{ENTER,LEAVE}_ARG_FUNC_ID and RBM_PROFILER_{ENTER,LEAVE}_ARG_CALLER_SP
* Simplify r0Trashed logic in src/jit/codegenarm.cpp
* Remove wrong comment in src/jit/codegenarm.cpp
* On Arm genPrologPadForReJit does nothing so remove it in src/jit/codegenarm.cpp
* Implement LinearScan::BuildNode for GT_PROF_HOOK and GT_RETURN in src/jit/lsraarm64.cpp
* Shouldn't a call to CORINFO_HELP_PROF_FCN_TAILCALL be marked as a No-GC?
* Implement genProfilingEnterCallback genProfilingLeaveCallback in src/jit/codegenarm64.cpp
* Implement NYI profiler methods in src/vm/arm64/profiler.cpp
* Implement ProfileEnterNaked ProfileLeaveNaked ProfileTailcallNaked in src/vm/arm64/asmhelpers.S
* Implement profiler helpers on win-arm64
* Remove logic for !FINAL_FRAME_LAYOUT in codegenarm64.cpp
* Remove unused macro in src\jit\target.h
* genProfilingLeaveCallback ignores helper on arm in src\jit\codegenarm.cpp
* Refactor genProfilingLeaveCallback in src\jit\codegenarm.cpp

Commit migrated from https://github.com/dotnet/coreclr/commit/d88bc184d054fe8e4915964330ca65378d59ef27

3 years ago[Tizen] Fix unsupportedCrossgenLibs.arm64 (#304) accepted/tizen/unified/20200724.124146 submit/tizen/20200723.225658
Timur Mustafin/AI Compiler Lab /SRR/Engineer/Samsung Electronics [Thu, 23 Jul 2020 22:26:39 +0000 (01:26 +0300)]
[Tizen] Fix unsupportedCrossgenLibs.arm64 (#304)

Signed-off-by: Timur <t.mustafin@partner.samsung.com>
3 years ago[Tizen] Add skips for arm64
Timur [Thu, 23 Jul 2020 10:45:33 +0000 (13:45 +0300)]
[Tizen] Add skips for arm64

Signed-off-by: Timur <t.mustafin@partner.samsung.com>
3 years ago[Tizen] Disable default build of tests
Gleb Balykov [Wed, 22 Jul 2020 08:02:06 +0000 (11:02 +0300)]
[Tizen] Disable default build of tests

To build tests for armel/arm64 add: --define 'skiptests 0'

3 years ago[Tizen] Do not pack debug dlls
Gleb Balykov [Fri, 17 Jul 2020 13:51:15 +0000 (16:51 +0300)]
[Tizen] Do not pack debug dlls

This is required to workaround rpmbuild issue (rpmbuild tries to get debug symbols from these dlls)

3 years ago[Tizen] Disable default non-portable build for armel
Gleb Balykov [Fri, 17 Jul 2020 12:51:32 +0000 (15:51 +0300)]
[Tizen] Disable default non-portable build for armel

This is required for portable build of managed part of tests. To cross build CLR for tizen use -portablebuild=false.

3 years ago[Tizen] Add skipgeneratelayout option to skip generation of coreroot
Gleb Balykov [Fri, 17 Jul 2020 12:28:45 +0000 (15:28 +0300)]
[Tizen] Add skipgeneratelayout option to skip generation of coreroot

3 years ago[Tizen] Set obj dir to be TargetRid specific
Gleb Balykov [Fri, 17 Jul 2020 09:55:06 +0000 (12:55 +0300)]
[Tizen] Set obj dir to be TargetRid specific

This allows to perform build for different arches in the same repository

3 years ago[Tizen] Add skiprestore option to skip restore of packages
Gleb Balykov [Wed, 15 Jul 2020 10:29:10 +0000 (13:29 +0300)]
[Tizen] Add skiprestore option to skip restore of packages

Partial cherry-pick of https://github.com/dotnet/coreclr/pull/27633

3 years ago[Tizen] Add flag skipstressdependencies to skip build of x64 specific .so for stress...
Gleb Balykov [Tue, 14 Jul 2020 15:54:53 +0000 (18:54 +0300)]
[Tizen] Add flag skipstressdependencies to skip build of x64 specific .so for stress testing

3 years ago[Tizen] Do not access crossgen if it is not needed
Gleb Balykov [Tue, 14 Jul 2020 15:49:49 +0000 (18:49 +0300)]
[Tizen] Do not access crossgen if it is not needed

3 years ago[Tizen] Fix issue with return from non-sourced script if tools are already initialized
Gleb Balykov [Tue, 14 Jul 2020 15:19:04 +0000 (18:19 +0300)]
[Tizen] Fix issue with return from non-sourced script if tools are already initialized

3 years ago[Tizen] Build CoreCLR tests in spec
Gleb Balykov [Mon, 13 Jul 2020 21:25:19 +0000 (00:25 +0300)]
[Tizen] Build CoreCLR tests in spec

3 years ago[Tizen] Add skips for armel
Gleb Balykov [Mon, 13 Jul 2020 20:33:33 +0000 (23:33 +0300)]
[Tizen] Add skips for armel

3 years ago[Tizen] Fix clang version passing
Gleb Balykov [Mon, 13 Jul 2020 20:33:02 +0000 (23:33 +0300)]
[Tizen] Fix clang version passing

3 years ago[Tizen] Add updated scripts to run tests
Gleb Balykov [Mon, 13 Jul 2020 13:44:25 +0000 (16:44 +0300)]
[Tizen] Add updated scripts to run tests

- CLRTest.CrossGen.targets is used as a template for crossgen part of individual test script
- runtest.sh is used for launching tests

3 years ago[Tizen] Add CoreCLR tests build dependencies v3.1.3 for armel, arm64
Gleb Balykov [Fri, 17 Jul 2020 12:44:09 +0000 (15:44 +0300)]
[Tizen] Add CoreCLR tests build dependencies v3.1.3 for armel, arm64

3 years ago[Tizen] Add CoreCLR tests BuildTools v3.1.3 for armel,arm64
Gleb Balykov [Mon, 13 Jul 2020 15:17:29 +0000 (18:17 +0300)]
[Tizen] Add CoreCLR tests BuildTools v3.1.3 for armel,arm64

3 years ago[Tizen] Enable relocations optimizations for Tizen arm64 accepted/tizen/unified/20200714.065733 submit/tizen/20200714.001703
Gleb Balykov [Wed, 8 Jul 2020 09:47:00 +0000 (12:47 +0300)]
[Tizen] Enable relocations optimizations for Tizen arm64

3 years ago[Tizen] Update CreateDictionaryLookupHelper on arm64 to support relative indirection
Gleb Balykov [Tue, 7 Jul 2020 12:32:41 +0000 (15:32 +0300)]
[Tizen] Update CreateDictionaryLookupHelper on arm64 to support relative indirection

3 years ago[Tizen] Support relative indirection for 1st and 2nd levels of vtable on arm64
Gleb Balykov [Thu, 2 Jul 2020 14:01:13 +0000 (17:01 +0300)]
[Tizen] Support relative indirection for 1st and 2nd levels of vtable on arm64

3 years ago[Tizen] Add clang8/9/10 build support (#295)
Gleb Balykov/AI Compiler Lab /SRR/Engineer/Samsung Electronics [Sun, 12 Jul 2020 21:43:32 +0000 (00:43 +0300)]
[Tizen] Add clang8/9/10 build support (#295)

3 years ago[Tizen] Unify dnetmemoryenumlib terms to match the codebase (#291) accepted/tizen_5.5_unified accepted/tizen/5.5/unified/20200729.230651 accepted/tizen/5.5/unified/wearable/hotfix/20201027.101953 accepted/tizen/unified/20200703.155115 submit/tizen/20200703.012556 submit/tizen_5.5/20200629.221218 submit/tizen_5.5/20200729.021615 submit/tizen_5.5_wearable_hotfix/20201026.184306
Mateusz Moscicki/System (PLT) /SRPOL/Engineer/Samsung Electronics [Fri, 3 Jul 2020 01:22:42 +0000 (03:22 +0200)]
[Tizen] Unify dnetmemoryenumlib terms to match the codebase (#291)

3 years ago[Tizen] Fix cross build arm64 rootfs creation (#284) accepted/tizen/unified/20200630.131323 submit/tizen/20200629.221257
Gleb Balykov/AI Compiler Lab /SRR/Engineer/Samsung Electronics [Mon, 29 Jun 2020 21:43:42 +0000 (00:43 +0300)]
[Tizen] Fix cross build arm64 rootfs creation (#284)

3 years ago[Tizen] Fix crash on accessing 0x0 while unwinding (#287)
이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 [Mon, 29 Jun 2020 21:43:30 +0000 (06:43 +0900)]
[Tizen] Fix crash on accessing 0x0 while unwinding (#287)

Change-Id: I663d0fcdcd6fd8fb4c521d9bdbb4d234c96022ae

3 years agoFix a FNV error on arm64 (#286)
정동헌/Common Platform Lab(SR)/Principal Engineer/삼성전자 [Fri, 26 Jun 2020 02:15:41 +0000 (11:15 +0900)]
Fix a FNV error on arm64 (#286)

Simple HelloWorld app can run with NI of System.Private.CoreLib.dll, HelloWorld.dll and System.Console.dll

3 years agoFix TPA map hash calculation. (#288)
Mikhail Kurinnoi/AI Compiler Lab /SRR/Staff Engineer/Samsung Electronics [Thu, 25 Jun 2020 22:30:09 +0000 (01:30 +0300)]
Fix TPA map hash calculation. (#288)

* Fix TPA map hash calculation.

The point of issue is "the Turkish-I Problem". After locale changed, towupper() provide another result for "i" and different hash are calculated in case if file name have "i" letter.

* Regression test for #37910

3 years ago[Tizen] Pass compilation flags to asm files (#285)
Gleb Balykov/AI Compiler Lab /SRR/Engineer/Samsung Electronics [Tue, 23 Jun 2020 21:35:00 +0000 (00:35 +0300)]
[Tizen] Pass compilation flags to asm files (#285)

3 years ago[Tizen] Force Inline for Generic Methods (#224) accepted/tizen/unified/20200623.124116 submit/tizen/20200622.225420
정동헌/Common Platform Lab(SR)/Principal Engineer/삼성전자 [Mon, 22 Jun 2020 22:44:28 +0000 (07:44 +0900)]
[Tizen] Force Inline for Generic Methods (#224)

This patch enables more generic method inlining for methods which are not compiled by NI.

3 years agoFix missing TransitionBlock methods (#33134) accepted/tizen/5.5/unified/20200623.152349 submit/tizen_5.5/20200623.003918
JUNG DONG-HEON [Thu, 18 Jun 2020 11:10:23 +0000 (20:10 +0900)]
Fix missing TransitionBlock methods (#33134)

3 years ago[Tizen] Add arm64 rootfs build script
Gleb Balykov [Mon, 15 Jun 2020 16:04:11 +0000 (19:04 +0300)]
[Tizen] Add arm64 rootfs build script

3 years ago[Tizen] Enable aarch64 gbs build
Gleb Balykov [Wed, 17 Jun 2020 08:21:05 +0000 (11:21 +0300)]
[Tizen] Enable aarch64 gbs build

3 years ago[Tizen] Add tizen arm64 toolchain file. Explicitly pass non-portable build to fix...
Gleb Balykov [Thu, 11 Jun 2020 12:29:13 +0000 (15:29 +0300)]
[Tizen] Add tizen arm64 toolchain file. Explicitly pass non-portable build to fix arm64 build on tizen (on armel non-portable build is default, tizen rid in general is non-portable).

3 years agoAdd JIT/Stress/ABI Tests
JUNG DONG-HEON [Tue, 9 Jun 2020 06:34:36 +0000 (15:34 +0900)]
Add JIT/Stress/ABI Tests

Cherrypick only test parts of below patches in public dotnet/runtime github
be8e050a6d27040d6c249382d99d57d973e919b2 Implement instantiating and unboxing through portable stublinker code… (#106)
0e949491faee53d2a7ad4d5649be17e98e5d3a96 Some minor ABI stress improvements
3f339687a8151e989bbb4673aab9b0abcddf5642 Mark emitted types assembly as collectible in ABI stress (dotnet/coreclr#26253)
a25dd1a45b6fdad114ffaa915550906c986aa1ca Remove redundant ABI stress tests (dotnet/coreclr#26183)
57945676a6395da61b61ce427a055e77d330db86 Fix GenerateShuffleArray to support cyclic shuffles (dotnet/coreclr#26169)
3b0ba1ee24823030a3fc7278dd064d24a49a90bb Add ABI stress tests (dotnet/coreclr#26090)

3 years agoImplement instantiating and unboxing through portable stublinker code… (#106)
JUNG DONG-HEON [Mon, 8 Jun 2020 01:20:14 +0000 (10:20 +0900)]
Implement instantiating and unboxing through portable stublinker code… (#106)

* Implement instantiating and unboxing through portable stublinker code
- Handle only the cases with register to register moves
- Shares abi processing logic with delegate shuffle thunk creation
- Architecture specific logic is relatively simple
- Do not permit use of HELPERREG in computed instantiating stubs
- Fix GetArgLoc such that it works on all architectures and OS combinations

Add a JIT stress test case for testing all of the various combinations
- Use the same calling convention test architecture that was used as part of tail call work

Rename secure delegates to wrapper delegates
- Secure delegates are no longer a feature of the runtime
- But the wrapper delegate lives on as a workaround for a weird detail of the ARM32 abi

3 years agoFix GenerateShuffleArray to support cyclic shuffles (dotnet/coreclr#26169)
JUNG DONG-HEON [Thu, 28 May 2020 02:15:47 +0000 (11:15 +0900)]
Fix GenerateShuffleArray to support cyclic shuffles (dotnet/coreclr#26169)

* Fix GenerateShuffleArray to support cyclic shuffles

The GenerateShuffleArray was not handling case when there was a cycle in
the register / stack slots shuffle and it resulted in an infinite loop
in this function. This issue is Unix Amd64 ABI specific.
To fix that, this change reworks the algorithm completely. Besides
fixing the issue, it has also better performance in some cases.
To fix the cyclic shuffling, I needed an extra helper register. However,
there was no available general purpose register available, so I had to
use xmm8 for this purpose.

* Remove special handling of the hang from ABI stress

3 years ago[x86/Linux] Fix SIGSEGV during evaluation abort routine. accepted/tizen/5.5/unified/20200608.142150 accepted/tizen/unified/20200608.144754 submit/tizen/20200607.233857 submit/tizen_5.5/20200607.233848
Mikhail Kurinnoi [Thu, 4 Jun 2020 14:48:52 +0000 (17:48 +0300)]
[x86/Linux] Fix SIGSEGV during evaluation abort routine.

In case of evaluation with implicit function call aborted by ```ICorDebugEval::Abort()```, CoreCLR crash with SIGSEGV at line https://github.com/dotnet/runtime/blob/e25517ea27311297c1e3946acb3b4382d5fa7fef/src/coreclr/src/vm/jitinterface.cpp#L14293 since ```m_pJM``` is ```NULL```.
This happens because during ```EECodeInfo::Init()``` call, ```codeAddress``` parameter provide address inside native code region (this address belong to CallDescrWorkerInternal(), libcoreclr.so), but not address inside managed code, so, ```ExecutionManager::FindCodeRange()``` can't find appropriate ```RangeSection```.

During investigation I found, that at line https://github.com/dotnet/runtime/blob/e25517ea27311297c1e3946acb3b4382d5fa7fef/src/coreclr/src/vm/stackwalk.cpp#L2584 current context was not changed properly (we have wrong ```Eip``` register value).
I found, that ```FuncEvalFrame::UpdateRegDisplay()``` code
https://github.com/dotnet/runtime/blob/e25517ea27311297c1e3946acb3b4382d5fa7fef/src/coreclr/src/debug/ee/debugger.inl#L238-L247
don't have x86/Linux support implemented.

I propose changes, that were already made for other ```UpdateRegDisplay()``` implementations in order to provide proper context for x86/Linux.

3 years ago[Tizen] Enable ASan annotation of passing to native code buffers
Andrey Kazmin [Thu, 14 May 2020 13:57:25 +0000 (16:57 +0300)]
[Tizen] Enable ASan annotation of passing to native code buffers

Turn on ASan inteceptors while marshaling managed buffers to native code.
We could not properly annotate already allocated on heap buffers, so
we have to disable pinning of such objects.
Current patch affects only pinning of native arrays.

3 years ago[Tizen] Cleanup confusing symlinks accepted/tizen/5.5/unified/20200601.002556 accepted/tizen/unified/20200601.051718 submit/tizen/20200529.025703 submit/tizen_5.5/20200529.025744
Hyungju Lee [Mon, 25 May 2020 08:19:52 +0000 (17:19 +0900)]
[Tizen] Cleanup confusing symlinks

Change-Id: I032c9ff1e0f43e39d0d05a38eb95dabe2f1b6b25

3 years agoUpdate package version to 3.1.3
Alexander Soldatov/AI Compiler Lab /SRR/Staff Engineer/Samsung Electronics [Fri, 22 May 2020 09:14:11 +0000 (12:14 +0300)]
Update package version to 3.1.3

3 years agoSet vtable offset as contained
JUNG DONG-HEON [Thu, 5 Dec 2019 07:23:39 +0000 (16:23 +0900)]
Set vtable offset as contained

- Can remove a machine instruction which adds vtable offset

3 years ago[Tizen] Change the visibility of symbols for dnetmemoryenumlib accepted/tizen/5.5/unified/20200522.160111 accepted/tizen/unified/20200529.124257 submit/tizen/20200528.065414 submit/tizen_5.5/20200512.212247
Mateusz Moscicki [Fri, 8 May 2020 11:40:06 +0000 (13:40 +0200)]
[Tizen] Change the visibility of symbols for dnetmemoryenumlib

4 years ago[Tizen] Skip tests, which throw System.OutOfMemoryException on TW3 accepted/tizen/5.5/unified/20200423.150450 accepted/tizen/unified/20200423.054553 submit/tizen/20200422.104050 submit/tizen_5.5/20200422.104039
Gleb Balykov [Tue, 24 Mar 2020 15:09:46 +0000 (18:09 +0300)]
[Tizen] Skip tests, which throw System.OutOfMemoryException on TW3

4 years ago[Tizen] Enable Debug builds for i686
Sangwook Kim [Fri, 27 Mar 2020 09:05:25 +0000 (18:05 +0900)]
[Tizen] Enable Debug builds for i686

4 years ago[Tizen] Add a config knob for importing ibc files
Swift Kim [Thu, 1 Aug 2019 06:10:49 +0000 (15:10 +0900)]
[Tizen] Add a config knob for importing ibc files

4 years agoFix PIE options (#26323) accepted/tizen/unified/20200416.080052 submit/tizen/20200415.223728
Jan Vorlicek [Fri, 23 Aug 2019 15:03:01 +0000 (17:03 +0200)]
Fix PIE options (#26323)

* Fix PIE options

We were missing passing the -pie linker option. That means that while we
were compiling our code as position independent, the executables
(not shared libraries) were not marked as position independent and
ASLR was not applied to them. They were always loaded to fixed addresses.

This change adds the missing -pie option and also replaces all the individual
settings of -fPIE / -fPIC on the targets we build by a centralized setting
of CMAKE_POSITION_INDEPENDENT_CODE variable that causes cmake to add the
appropriate compiler options everywhere.

* Fix native parts of coreclr tests build

The native parts of the tests are not built using the root CMakeLists.txt
so I am moving enabling the position independent code to configurecompiler.cmake

Change-Id: Ieafff8984ec23e5fdb00fb0c2fb017e53afbce88

4 years ago[Tizen] Fix build of Runtime_1241 test accepted/tizen/unified/20200402.155517 submit/tizen/20200402.013218
Gleb Balykov [Wed, 25 Mar 2020 15:17:50 +0000 (18:17 +0300)]
[Tizen] Fix build of Runtime_1241 test

4 years ago[Tizen] Add FEATURE_LARGEADDRESS_SUPPORT
Sangwook Kim [Tue, 18 Feb 2020 06:48:15 +0000 (15:48 +0900)]
[Tizen] Add FEATURE_LARGEADDRESS_SUPPORT

Many diagnostic tools are unaware of 32-bit applications which have
large address spaces (> 2GB). Such tools include the TraceEvent library
(required by PerfView and dotnet-trace), and Visual Studio. They assume
the address range 0x80000000 through 0xFFFFFFFF as the system space and
thus often fail to read symbols from event traces generated by CoreCLR.

This workaround is to support such scenarios by simply discarding MSBs
of 32-bit instruction pointer values in the trace output. Only a minimal
set of values required for symbol resolution are affected by this
change. Beware that you will have to manually restore the original
values when you inspect them in lldb or etc.

4 years ago[Tizen] Fix usage of ni.exe in readytorun test
Gleb Balykov [Mon, 16 Mar 2020 16:25:20 +0000 (19:25 +0300)]
[Tizen] Fix usage of ni.exe in readytorun test

4 years ago[Tizen] Add System.Private.CoreLib.pdb to coreclr-devel package
Gleb Balykov [Wed, 11 Mar 2020 13:13:19 +0000 (16:13 +0300)]
[Tizen] Add System.Private.CoreLib.pdb to coreclr-devel package

4 years ago[Tizen] Move the executables(ilasm, ildasm) to use in dotnettool from devel rpm
j-h.choi [Tue, 7 Jan 2020 07:14:33 +0000 (16:14 +0900)]
[Tizen] Move the executables(ilasm, ildasm) to use in dotnettool from devel rpm

4 years agomodify integral tryparse to use memcpy (#2295)
John Salem [Thu, 13 Feb 2020 02:14:46 +0000 (18:14 -0800)]
modify integral tryparse to use memcpy (#2295)

4 years agoFix OverflowException from IntPtr casting (#14381)
Swift Kim [Fri, 31 Jan 2020 14:27:40 +0000 (23:27 +0900)]
Fix OverflowException from IntPtr casting (#14381)

4 years ago[Tizen] Reduce arm_phdr_cb call overhead
JUNG DONG-HEON [Thu, 9 Jan 2020 07:38:00 +0000 (16:38 +0900)]
[Tizen] Reduce arm_phdr_cb call overhead

- Too many calls to arm_phdr_cb even though it get the same data.
- It caches an ARM_CB_DATA for libcoreclr.so, then reuse.

4 years ago[Tizen] RPM version of Tizen will be upgrade to 4.14.1.
Woongsuk Cho [Tue, 31 Dec 2019 04:59:26 +0000 (13:59 +0900)]
[Tizen] RPM version of Tizen will be upgrade to 4.14.1.

4 years agoChange bIsFree check in DacValidateMethodTable (#1086)
Dong-Heon Jung [Mon, 23 Dec 2019 19:11:43 +0000 (04:11 +0900)]
Change bIsFree check in DacValidateMethodTable (#1086)

Some commands of SOS validate a method table in DacValidateMethodTable.
In the function, it checks whether a method table is FreeObjectMethodTable or not with GetClass() value.
However, GetClass() should not be NULL. (There is an assert in GetClass())
In this patch, it compares pMT address with g_pFreeObjectMethodTable address only.

4 years ago[Tizen] add pie linker option to createdump
Woongsuk Cho [Thu, 12 Dec 2019 11:41:39 +0000 (20:41 +0900)]
[Tizen] add pie linker option to createdump

4 years agoHandle glibc sys/sysctl.h deprecation (#27048)
Omair Majid [Wed, 16 Oct 2019 09:25:29 +0000 (05:25 -0400)]
Handle glibc sys/sysctl.h deprecation (#27048)

glibc has deprecated sys/sysctl.h:

    In file included from /coreclr/src/pal/src/misc/sysinfo.cpp:32:
    /usr/include/sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]
    #warning "The <sys/sysctl.h> header is deprecated and will be removed."
     ^
    1 error generated.

Fix that by preferring sysconf and only including sys/sysctl.h if
HAVE_SYSCONF is not true. This mirrors the order of the implementation
code in this file (sysinfo.cpp) which checks for HAVE_SYSCONF
before HAVE_SYSCTL.

Fixes #27008

4 years ago[Tizen] Use -mstackrealign to sync up with Tizen build changes
Mikhail Kashkarov [Fri, 6 Dec 2019 15:57:11 +0000 (18:57 +0300)]
[Tizen] Use -mstackrealign to sync up with Tizen build changes

Tizen i586 now builds with -mstackrealign by default:

    "Realign the stack at entry. On the x86, the -mstackrealign option
    generates an alternate prologue and epilogue that realigns the
    run-time stack if necessary. This supports mixing legacy codes that
    keep 4-byte stack alignment with modern codes that keep 16-byte
    stack alignment for SSE compatibility. ..."

Change-Id: I36afd18998829f897c6b2b48687c4ae1d172b84b
Signed-off-by: Mikhail Kashkarov <m.kashkarov@partner.samsung.com>
4 years agoEnable NGEN for methods marked with AggressiveOptimization (#27259)
Dong-Heon Jung [Fri, 18 Oct 2019 00:23:51 +0000 (09:23 +0900)]
Enable NGEN for methods marked with AggressiveOptimization (#27259)

- Methods marked with AggressiveOptimization are not NGENed at all.
- The methods are compiled during the runtime with high JITC overhead.
- It makes launching time slower over 6% in our embedded systems.

4 years agoMark Relocation Section as NotNeeded (#25715)
Dong-Heon Jung [Fri, 30 Aug 2019 21:05:53 +0000 (06:05 +0900)]
Mark Relocation Section as NotNeeded (#25715)

- After relocation, relocation section in zap image is not necessary.
- Mark the section as NotNeeded by giving advice(madvise with MADV_DONTNEED)
- It reduces 120~150KB PSS in tizen sample apps.

4 years ago[Tizen] Use PTRACE_GETREGSET for any arch when creating dump
Swift Kim [Mon, 18 Nov 2019 07:38:56 +0000 (16:38 +0900)]
[Tizen] Use PTRACE_GETREGSET for any arch when creating dump

Also ignore ptrace NT_FPREGSET failures for arm processes on aarch64
kernels. Fixes #25707.

4 years ago[Tizen] Add createdump to build output
Sangwook Kim [Mon, 18 Nov 2019 01:20:57 +0000 (10:20 +0900)]
[Tizen] Add createdump to build output

4 years ago[Tizen] Add coreclr_preload_assembly to CoreCLR host API
Konstantin Baladurin [Fri, 5 Jul 2019 16:36:28 +0000 (19:36 +0300)]
[Tizen] Add coreclr_preload_assembly to CoreCLR host API

4 years ago[Tizen] Enable Tizen ASan runtime support
Vyacheslav Cherkashin [Fri, 19 Jul 2019 12:05:47 +0000 (15:05 +0300)]
[Tizen] Enable Tizen ASan runtime support

Enable libasansi.so support (libasan.so with switchable interceptors).

Change-Id: I9ee9b47b7beab55f036ffc0697ffab2583e9701c
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
4 years ago[Tizen] Implement ASan wrapper for Linux AMD64
Vyacheslav Cherkashin [Mon, 29 Jul 2019 16:02:37 +0000 (19:02 +0300)]
[Tizen] Implement ASan wrapper for Linux AMD64

Change-Id: I48446ce7c8771a4c75149512bb7d8a8cb3fae8e5
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
4 years ago[Tizen] Implement ASan wrapper for Linux ARM32
Vyacheslav Cherkashin [Mon, 22 Jul 2019 10:40:47 +0000 (13:40 +0300)]
[Tizen] Implement ASan wrapper for Linux ARM32

This commit implements wrappers that allow interception transitions
from managed to external unmanaged code (CIL -> native) and back
(native -> CIL). This allows enable/disable ASan during transitions.
Due to this, we sanitize only external code, which allows us to
achieve acceptable performance.

Change-Id: I53ecdc14d28f7210cd9e7f5bd4db0c8ef5ed81fc
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
4 years ago[Tizen] Implement detecting of sanitized libraries
Andrey Drobyshev [Tue, 16 Jul 2019 12:23:18 +0000 (15:23 +0300)]
[Tizen] Implement detecting of sanitized libraries

Parse ".dynamic" section (ELF dynamic array tags) of the module being
added, find ".rel(a).plt" section and search it for presence of
'__asan_init' symbol.

Change-Id: Ie7cc4c818b791b5f00713b42ba15131325b8152c
Signed-off-by: Andrey Drobyshev <a.drobyshev@samsung.com>
4 years agoPrevent freeing of the profiler on process shutdown.
David Mason [Wed, 18 Sep 2019 20:19:36 +0000 (13:19 -0700)]
Prevent freeing of the profiler on process shutdown.

4 years ago[Tizen] skip dotnet specific arguments in corerun
Konstantin Baladurin [Fri, 4 Oct 2019 16:45:44 +0000 (19:45 +0300)]
[Tizen] skip dotnet specific arguments in corerun

Now we use corerun to run corefx tests instead of dotnet, because last
one isn't available for Tizen/armel. So we need to skip dotnet specific
arguments, we patch corerun for it because Microsoft.DotNet.RemoteExecutor
tries to execute binary that it gets from /proc/self/maps, so we need a
binary that will behave like dotnet.

4 years agoBuild error fix on FEATURE_PREJIT=true
Swift Kim [Fri, 12 Jul 2019 06:50:08 +0000 (15:50 +0900)]
Build error fix on FEATURE_PREJIT=true

This fix is to update usages of SetupGcCoverage() under
FEATURE_PREJIT aligned to the signature change in #25261.

4 years ago[Linux/x86] Use ebp from current context during unwinding (#26789)
Konstantin Baladurin [Thu, 26 Sep 2019 17:06:57 +0000 (20:06 +0300)]
[Linux/x86] Use ebp from current context during unwinding (#26789)

pCurrentContextPointers in REGDISPLAY can contain NULLs so we need to use
ebp value from pCurrentContext. This patch contains following changes:

- GetRegdisplayFP returns ebp from pCurrentContext
- GetRegdisplayFP is used instead of *GetEbpLocation()
- Set##reg##Location also updates register value in pCurrentContext

4 years ago[JIT/x86] Fix LinearScan::allocateRegisters (#26649)
Konstantin Baladurin [Fri, 13 Sep 2019 17:28:08 +0000 (20:28 +0300)]
[JIT/x86] Fix LinearScan::allocateRegisters (#26649)

Check for `lvLRACandidate` instead of `!lvDoNotEnregister` when checking whether `this` may be enregistered and has an Interval.

4 years agoLinux/x86: fix build (#26594)
Konstantin Baladurin [Mon, 9 Sep 2019 15:40:14 +0000 (00:40 +0900)]
Linux/x86: fix build (#26594)

4 years ago[Tizen] Pack test libs to coreclr-test
Gleb Balykov [Wed, 11 Sep 2019 13:53:14 +0000 (16:53 +0300)]
[Tizen] Pack test libs to coreclr-test

4 years ago[Tizen] Add unsupported tests
Gleb Balykov [Tue, 10 Mar 2020 17:22:57 +0000 (20:22 +0300)]
[Tizen] Add unsupported tests

4 years ago[Tizen] Replace new runtest.sh, which calls dotnet internally, with old runtest.sh
Gleb Balykov [Wed, 21 Aug 2019 16:47:37 +0000 (19:47 +0300)]
[Tizen] Replace new runtest.sh, which calls dotnet internally, with old runtest.sh

4 years ago[Tizen] Partially revert a6292a6.
Mikhail Kurinnoi [Mon, 19 Aug 2019 12:06:58 +0000 (15:06 +0300)]
[Tizen] Partially revert a6292a6.

NetcoreDBG depends from PAL functions.
Instead of SOS plugin, that use PAL static libs, debugger should be able
to operate with any runtime version and can't be statically linked to PAL.

4 years agoadd access(2) call before dlopening files
Yaroslav Yamshchikov [Thu, 18 Jul 2019 10:14:14 +0000 (13:14 +0300)]
add access(2) call before dlopening files

4 years agocorbbtprof: set byte alignment for CORBBTPROF structures (#25816)
Konstantin Baladurin [Tue, 23 Jul 2019 04:01:22 +0000 (07:01 +0300)]
corbbtprof: set byte alignment for CORBBTPROF structures (#25816)

Fix patch fixes SIGBUG that occurs due to unaligned read/write

4 years agoFail to explicitly tail call on x86 unix. (#25032)
Jarret Shook [Fri, 19 Jul 2019 04:07:08 +0000 (21:07 -0700)]
Fail to explicitly tail call on x86 unix. (#25032)

* Fail to explicitly tail call on x86 unix.

* Correctly return 100

* Correct return value

* Add noway assert in morphTailCall to avoid morphing slow tail calls on unix.

* Address feedback

4 years ago[Tizen] Disable jithost arena cache
Gleb Balykov [Fri, 2 Aug 2019 14:28:27 +0000 (17:28 +0300)]
[Tizen] Disable jithost arena cache

4 years ago[Tizen] Disable IBC Logger as a default
DongHeon Jung [Thu, 18 Jul 2019 08:28:55 +0000 (17:28 +0900)]
[Tizen] Disable IBC Logger as a default

- Profile information is collected by ibc logger.
  Hower it is not used and saved into profile file.
- The patch disables IBC logger which is enabled by default.
- It disables IBC logger only with ibclogger.h file.
  IBCLOGGER_ENABLED definition is only used in ibclogger files.

4 years agoFix a build error when IBCLOGGER_ENABLED is not defined (#25691)
Dong-Heon Jung [Wed, 17 Jul 2019 03:09:40 +0000 (12:09 +0900)]
Fix a build error when IBCLOGGER_ENABLED is not defined (#25691)

- Even if DACCESS_COMPILE or CROSSGEN_COMPILE is defined,
  coreclr can be built without IBCLOGGER_ENABLED definition.

4 years ago[Tizen] Enable PGO for Linux/arm
Konstantin Baladurin [Thu, 18 Apr 2019 09:29:56 +0000 (12:29 +0300)]
[Tizen] Enable PGO for Linux/arm

4 years ago[Tizen] seperate PIC and PIE to fix x86_64 build error
Woongsuk Cho [Thu, 9 May 2019 09:02:22 +0000 (18:02 +0900)]
[Tizen] seperate PIC and PIE to fix x86_64 build error