summaryrefslogtreecommitdiff
path: root/src/pal
AgeCommit message (Collapse)AuthorFilesLines
2015-06-07build,win: Enables Whole Program Optimization.Hadi Brais1-3/+3
* Enables whole program optimization for release configuration on Windows. * Fixes all messages "/LTCG specified but no code generation required; remove /LTCG from link command line to improve linker performance" which slow down the build process. * Fixes all messages "MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance" which slow down the build process. * The previous two fixes work in Release and Debug builds on Windows. Issue-URL: #1086
2015-06-04Changes necessary to make PAL headers compatible with c++ headers,Prem Ramanathan35-703/+834
allowing them to be used side by side with c++11 headers. Contains few fixes to PAL library as well.
2015-06-04Initialize signal-handling thread in PAL initializationstephentoub1-2/+2
Without this, ctrl-C will not interrupt a program, nor will Console.CancelKeyPress in corefx work.
2015-05-27Merge pull request #1061 from janvorli/pal-error-stringsAditya Mandaleeka6-251/+255
Add PAL error message strings
2015-05-27Implement FlushProcessWriteBuffers using the page protection mechanismJan Vorlicek3-3/+91
2015-05-27Add PAL error message stringsJan Vorlicek6-251/+255
This change adds PAL error message strings to PAL. Until now, the FormatMessage in PAL formatted the PAL error codes as "Error xxx". With this change, it inserts textual form of the messages.
2015-05-22Remove the InitializeStringResources functionJan Vorlicek3-20/+0
Now that the default string resources are embedded in the libcoreclr, it is no longer necessary to set the LC_MESSAGES locale to en_US in the PAL.
2015-05-22CoreClr: Make tests run on FreeBSD and document how to run them.Jostein Kjønigsen1-1/+1
Not all platforms have bash in /bin/. Documentation added to the general FreeBSD build-instructions.
2015-05-20Merge pull request #1022 from janvorli/readytorun-linuxJan Kotas1-0/+8
Enable ReadyToRun feature on Unix
2015-05-20Enable ReadyToRun feature on UnixJan Vorlicek1-0/+8
This change enables building the ReadyToRun feature on Unix systems.
2015-05-18Ensure fallback to English resources on non-Windows platformsAditya Mandaleeka2-22/+13
Take the resources in RC files and build a static library that contains the ID->English string mappings. Use those strings as the key to gettext so that when gettext is not able to find a suitable string in the desired language, it falls back on returning the English string.
2015-05-13chmod +x freebsd lldb scriptTony Narlock1-0/+0
2015-05-12Merge pull request #986 from janvorli/fix-osx-personalityJan Vorlicek1-1/+5
Fix OSX personality routines encoding
2015-05-12Fix OSX personality routines encodingJan Vorlicek1-1/+5
This change fixes a crash that occured in case a managed callback called from a native code throws an exception. The correct behavior is to exit the process and dump the managed call stack. It works ok on Linux, but on OSX, it crashes with segmentation violation trying to execute code at address 4. The problem is caused by the fact that either the assembler or the linker ignores personality routines specified using the encoding 0 (absolute pointer) and stores value 4 instead of the routine address no matter what routine is specified. Fortunatelly, there is another encoding that can be used and that works. It is an indirect PC relative encoding (code 0x9b). However, there is another problem. The linker issues a warning when there are more than 3 personality routines in the whole libcoreclr.dylib: ld: warning: too many personality routines for compact unwind to encode As for now, I have removed the ExceptionHijackPersonalityRoutine from the ExceptionHijack asm helper to fix this problem. We will need to figure out what to do about it once we enable the thread hijacking on Unix. This personality routine's purpose is to make stack walker walk stack of a highjacked function as if the highhack routine was called from it. It seems we can use a different technique for that - to create a helper frame that would have IP pointing to a function that is never called, but has an unwind info that ensures that we walk through the hijack correctly. The same technique is used for hardware exception handling on OSX.
2015-05-11Merge pull request #979 from stephentoub/export_opensemaphorewJan Kotas1-0/+8
Export OpenSemaphoreW from PAL
2015-05-11Merge pull request #980 from janvorli/fix-vm-range-issueJan Kotas1-2/+6
Fix VM total space issue
2015-05-12Fix VM total space issueJan Vorlicek1-2/+6
This change fixes an issue that caused brick table corruption due to an incorrectly reported VM total space and the gc_heap::grow_brick_card_tables not being resilient against that. This change updates the GlobalMemoryStatusEx PAL function to return appropriate VM user space size value and also modifies the gc_heap::grow_brick_card_tables so that in case an end address of a new GC heap segment is larger than the approximate maximum obtained using the GlobalMemoryStatusEx, we don't clip down the range that the new card_table / brick_table will cover. Otherwise an object allocated above that range would cause indexing into the card_table to overrun the end of the table.
2015-05-11Export OpenSemaphoreW from PALStephen Toub1-0/+8
Semaphore.OpenExisting uses OpenSemaphoreW from the PAL, but it's not being exported, resulting in EntryPointNotFoundExceptions.
2015-05-08Merge pull request #960 from adityamandaleeka/pipes-for-create-thread-suspendedAditya Mandaleeka4-64/+134
Add ability to use pipes for creating threads suspended
2015-05-08Use pipes for creating threads suspended on Darwin tooAditya Mandaleeka3-10/+0
Remove USE_PIPES_FOR_CREATING_SUSPENDED_THREADS and just enable it for all the platforms. Previously, it was disabled on Darwin.
2015-05-08Updated FreeBSD installation instructions with LLDB stepsAnders Jensen-Waud1-0/+32
Included build instructions for FreeBSD on how to manually build and install LLDB on FreeBSD STABLE Included FreeBSD LLDB install script Fixed spacing issues Fixed installation formatting
2015-05-07Add ability to use pipes for creating threads suspendedAditya Mandaleeka6-64/+144
Added the ability in PAL to create a thread in suspended state by specifying a pipe which ResumeThread will write to in order to wake it up. This functionality is protected behind USE_PIPES_FOR_CREATING_SUSPENDED_THREADS which is enabled on everything except Darwin.
2015-05-07Merge pull request #956 from dotnet-bot/from-tfsJan Kotas3-72/+248
Merge changes from TFS
2015-05-07Merge changes from parent branchdotnet-bot3-72/+248
[tfs-changeset: 1466545]
2015-05-07Changes for building using VS2015Jan Kotas2-6/+6
2015-05-03Remove inaccurate commentsRichard Lander1-9/+0
2015-05-02Fixed PAL thread allocation stack overflow.Mike McLaughlin2-4/+6
Add -Bsymbolic linker option to prevent static variables from being shared across PAL instances Install coreclrpal and palrt libraries so VS has easy access to link against them. Don't install the debug-pal library to binary directory. Fix "corerun" lldb test command.
2015-04-30Fix new set of warningsJan Vorlicek3-4/+3
This change fixes a new bunch of warnings that were recently introduced unnoticed to the coreclr / pal. Also, I've discovered that in release build, there are some additional warnings, so I've fixed them as well. I have also added a compiler switch to treat warnings as errors so that we catch a new issue right away next time.
2015-04-29Fix warnings introduced by crossgenJohn Chen (CLR)1-2/+1
2015-04-28Build crossgen for LinuxJohn Chen (JOCHEN7)6-15/+129
- Crossgen is now built as part of coreclr - Crossgen successfully compiles mscorlib.dll - Resulting mscorlib.ni.dll not yet usable
2015-04-28Merge pull request #848 from Djuffin/dbi-linuxEugene Zemtsov2-79/+3
Make DbgShim really useful for managed attach on Linux
2015-04-28Delete some dead exception handling related code in the PALJan Kotas9-433/+0
2015-04-28Remove unused code and address codereview commentsEugene Zemtsov1-10/+1
2015-04-28Merge pull request #858 from mikem8361/staticpalMike McLaughlin4-115/+130
Go back to a statically linked PAL (issue #728).
2015-04-28Merge pull request #853 from janvorli/fix-coreclr-resources-localeJan Vorlicek3-1/+21
Add back setting locale for gettext
2015-04-28Add back setting locale for gettextJan Vorlicek3-1/+21
Add back setting locale for gettext that was accidentally removed by change #736
2015-04-27Go back to a statically linked PAL (issue #728).Mike McLaughlin4-115/+130
Cleanup signal handling. Make sure the default signal action will happen if no previous handler by restore the signal and returning from the handler restarting the h/w exception.
2015-04-27Merge pull request #815 from mikem8361/palthreadMike McLaughlin7-142/+152
Handle threads in side-by-side statically linked PALs
2015-04-27Handle threads in side-by-side statically linked PALsMike McLaughlin7-142/+152
Create CPalThread object on the fly in InternalGetCurrentThread. SIGUSR1/SIGUSR2 are needed by the PAL thread suspend/resume logic. Enable them for PAL_InitializeDLL. Added an assert and ExitProcess to the on the fly CPalThread data allocation failure path. Fixed a problem introduced in #807. HandleSuspendSignal and HandleResumeSignal needed to indicate whether to chain or continue the SIGUSR1/2 signal.
2015-04-27Get rid of *scanf_unsafe function which do nothing useful and incorrectly ↵Eugene Zemtsov1-73/+2
pass arguments to real scanf functions
2015-04-27Mark dbgshim functions as extern "C", for easier load via GetProcAddressEugene Zemtsov1-0/+4
2015-04-28PAL: Resolve libc-location build-time on FreeBSD.Jostein Kjønigsen3-1/+9
This closes https://github.com/dotnet/coreclr/issues/801
2015-04-26Complete FreeBSD bringupGeoff Norton1-0/+6
Fixes issue #801 which was caused by the CoreCLR and PAL being dlopened, but pthread not being initialized by the runtime linker yet. FreeBSD requires that the main executable load pthread, rather than a downstream dependency. Also fixed a few missing calls to pthread_attr_init which was causing asserts() on FBSD.
2015-04-26Allow building with VS2015 installedDick van den Brink1-3/+7
Previous it was required to have VS2013 but now VS2015 can also be used. The default is still 2013 though. On a machine with both version installed it is possible to force VS2013/VS2015 with a parameter. Note: Still some work has to be done to make compilation successfull on VS2015.
2015-04-25Merge pull request #807 from mikem8361/testcoreclrindebuggerMike McLaughlin6-362/+202
Implemented hardware exception chaining.
2015-04-25Fix OSX hardware exception handlingJan Vorlicek1-68/+2
This change fixes a bug in the OSX hardware exception handling. The catch_exception_raise function in machexceptions.cpp creates a stack frame that allows stack unwinder to walk to the place where the hardware exception happened from the actual exception handling code. The problem was that this method stores the address of the faulting instruction PLUS 1 as the return address on the stack. There was a long comment about the reasons for doing so, but these reasons are not valid for jitted code that we unwind using the windows style unwinder and the "+1" breaks the unwinder in some cases. In the case that we've hit, there was an idiv instruction with instruction code 0xF7 0xFF, followed by instruction code 0x25. The windows style unwinder got the address of the second byte of the instruction code, the 0xFF, which followed by the 0x25 is an unconditional indirect jump. So the unwinder decided based on that that it is in the epilogue of the function and returned an unwound context containing an invalid instruction pointer. The fix is to not to increase the instruction by one in the catch_exception_raise. We don't do that in the Linux exception handling either. We may need to do this fixup at other place for exceptions happening in the debugger libraries where a hardware exception can happen and be handled in our C++ code as well.
2015-04-24Implemented hardware exception chaining.Mike McLaughlin6-362/+202
Test CLR hosting under a debugger (lldb). In order to test the debugger modules and coreclr running together in the same process, add the test command "corerun" to the lldb plugin that uses the CLR hosting apis to run managed code in the lldb process. Fixed a problem where the dac module was picking up an constructor in the coreclr module instead of using the dac version. This is because the corerun code was dlopen'ing coreclr with RTLD_GLOBAL which exposed all the symbols to the reset of the dynamic modules loaded. Changing it to RTLD_LOCAL (the default) fixes this problem. Changed from an ASSERT to an ERROR in the hardware exception handler because ASSERT does an SIGTRAP (DebugBreak) that keeps recursively being hit. Removed all signals that installed a fatal_signal_handler especially SIGINT which was interfering with lldb's. The rest of the signals, the default action should be good enough. Checked if the EE was started in the VM's hardware exception handler just to make sure everything is ready before the managed exception chain is called. Cleanup signal thread masking. Only wait for SIGINT/SIGQUIT explicitly instead of trying to mask all the signals we don't want to wait on.
2015-04-24basic NetBSD platform supportJustin Cormack1-2/+4
2015-04-23Merge pull request #788 from ellismg/fix-pal-dylib-loadingMatt Ellis1-0/+7
Fix loading of PAL on OSX
2015-04-23Merge pull request #787 from sokket/masterJonathan Miller6-1/+126
Fixing an issue in FILECanonicalizePath where some paths did not canonicalize properly