Skip to content
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
jkotas merged 2 commits into
dotnet:masterfrom
janvorli:implement-unix-eh
Jun 22, 2016
Merged

Implement Linux hardware and software exception handling#1417
jkotas merged 2 commits into
dotnet:masterfrom
janvorli:implement-unix-eh

Conversation

@janvorli
Copy link
Copy Markdown
Member

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.

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.
@janvorli
Copy link
Copy Markdown
Member Author

@jkotas can you take a look please?


internal class UnixMethodCodeNode : MethodCodeNode
{
public static readonly ObjectNodeSection ContentSection = new ObjectNodeSection("__managedcode", SectionType.Executable);
Copy link
Copy Markdown
Member

@jkotas jkotas Jun 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Jun 22, 2016

LGTM otherwise. Thanks!

@janvorli janvorli force-pushed the implement-unix-eh branch 4 times, most recently from 226139c to 7c971cf Compare June 22, 2016 17:33
@janvorli janvorli force-pushed the implement-unix-eh branch from 7c971cf to 273799f Compare June 22, 2016 17:39
@janvorli
Copy link
Copy Markdown
Member Author

@jkotas I've reflected all your feedback (separate commit so that you can see the delta)

@jkotas jkotas merged commit d8ba6a0 into dotnet:master Jun 22, 2016
@janvorli janvorli deleted the implement-unix-eh branch June 22, 2016 18:01
// 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we can delete src/scripts/linkerscript?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@janvorli
Copy link
Copy Markdown
Member Author

Implements #911

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants