This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Implement Linux hardware and software exception handling#1417
Merged
Conversation
This change implements code manager for Linux, context manipulation and compiler changes necessary to enable exception handling. All calls to libunwind are disabled for now on non-OSX though, since our build system doesn't support specifying additional dynamic libraries, which prevents us from using the libunwind. Those pieces of code are under CAN_LINK_SHARED_LIBUNWIND ifdef so that the ifdef can easily be located and removed after we add the necessary support to the build system. On OSX, the unwind functionality is part of the compiler support libraries, so it works. I have verified that everything works with the libunwind though by manually invoking clang to link everything together and adding the necessary libraries to its command line. The exception handling test was passing with that.
Member
Author
|
@jkotas can you take a look please? |
|
|
||
| internal class UnixMethodCodeNode : MethodCodeNode | ||
| { | ||
| public static readonly ObjectNodeSection ContentSection = new ObjectNodeSection("__managedcode", SectionType.Executable); |
Member
There was a problem hiding this comment.
Is the name the only difference? We have been compensating for simple difference like this via if-checks, not by creating new types - e.g. look for .IsWindows under src/ILCompiler.Compiler.
Member
|
LGTM otherwise. Thanks! |
226139c to
7c971cf
Compare
7c971cf to
273799f
Compare
Member
Author
|
@jkotas I've reflected all your feedback (separate commit so that you can see the delta) |
| // On Windows, the #pragma ... /merge directive folds the book-end sections and all .modules$I sections from all input | ||
| // obj files into .rdata in alphabetical order. | ||
| // | ||
| // On Linux, a linker script is used (see src/scripts/linkerscript) to do the equivalent since there is no similar |
Member
There was a problem hiding this comment.
Does this mean we can delete src/scripts/linkerscript?
Member
Author
There was a problem hiding this comment.
Yes, it does. But the linker script is currently referred to by the dotnet build that builds the tests, so we cannot remove it until we replace it with a new build tool.
Member
Author
|
Implements #911 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change implements code manager for Linux, context manipulation
and compiler changes necessary to enable exception handling.
All calls to libunwind are disabled for now on non-OSX though, since
our build system doesn't support specifying additional dynamic
libraries, which prevents us from using the libunwind.
Those pieces of code are under CAN_LINK_SHARED_LIBUNWIND ifdef so
that the ifdef can easily be located and removed after we add
the necessary support to the build system.
On OSX, the unwind functionality is part of the compiler support
libraries, so it works.
I have verified that everything works with the libunwind though
by manually invoking clang to link everything together and adding
the necessary libraries to its command line. The exception handling
test was passing with that.