Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support TLS access emitted in ILC (x64 win/linux) #429

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

VSadov
Copy link
Member

@VSadov VSadov commented Jun 14, 2023

These are companion changes for dotnet/runtime#87148

The change is for win-x64 and linux-x64 combinations as that is enough to discuss and test the parts of the runtime design that are not platform-specific.

More platform combinations can come as separate changes.

@VSadov
Copy link
Member Author

VSadov commented Jun 14, 2023

CC: @filipnavara

@@ -344,7 +344,7 @@ class MCObjectFileInfo {
}

MCSection *getTLSExtraDataSection() const { return TLSExtraDataSection; }
const MCSection *getTLSDataSection() const { return TLSDataSection; }
MCSection *getTLSDataSection() const { return TLSDataSection; }
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? Could we just mark things const on the objwriter side? Changes to LLVM outside of tools/objwriter need to be ported every time we update LLVM so there's a lot of value in keeping them as minimal as possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

Could we just mark things const on the objwriter side

I tried and propagating the const requires a lot of changes (const can be viral).
It is also inconsistent with the treatment other section accessors - i.e why getTLSDataSection is a const and getTLSBSSSection isn't?

I think the difference is unintentional. If we want const, we should make other sections accessors const as well.

Copy link
Member Author

@VSadov VSadov Jun 14, 2023

Choose a reason for hiding this comment

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

One possibility is to keep getTLSDataSection() as const (for no reason) and just cast the const away in the object writer.

There is a danger that something may eventually make dependency on this being const and it would not be easily noticeable when updating.

Copy link
Member Author

Choose a reason for hiding this comment

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

cast the const away in the object writer

Such workaround stands out in the code and feels like a mildly dangerous hack.
I think we can do such change if removing the const becomes a burden when updating. It probably won't if upstream code does not change. It does not look like this part changes often.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to be sure - I have noted the concern, but any way to deal with this issue has a downside. Removing the 'const' seems not distinctly worse than other solutions.
We need to pick one way to move forward while decision is not binding, since it is an implementation detail that can be changed. I am going to merge what we have, but will keep an eye if this becomes an issue.

@VSadov
Copy link
Member Author

VSadov commented Jun 15, 2023

Thanks!!

@VSadov VSadov merged commit 0bd20ce into dotnet:dotnet/main Jun 15, 2023
@VSadov VSadov deleted the tls1 branch June 15, 2023 06:55
@VSadov
Copy link
Member Author

VSadov commented Jun 15, 2023

@agocke - Is there something that need to be done to make this published/used by the runtime or it is automatic and just a matter of codeflow latency?

@agocke
Copy link
Member

agocke commented Jun 15, 2023

It should just move forwards. I'll keep an eye out for the darc update

@agocke
Copy link
Member

agocke commented Jun 15, 2023

Looks like flow is currently blocked on some unrelated changes: dotnet/runtime#87522

directhex added a commit to directhex/llvm-project that referenced this pull request Jun 19, 2023
Changes to support TLS access emitted in ILC (x64 win/linux)
directhex added a commit that referenced this pull request Jun 19, 2023
* Merge pull request #429 from VSadov/tls1

Changes to support TLS access emitted in ILC (x64 win/linux)

* Fix DWARF debug information emitted for empty enum (#433)

(cherry picked from commit 167a9c5)

---------

Co-authored-by: Filip Navara <filip.navara@gmail.com>
radekdoulik pushed a commit to radekdoulik/llvm-project that referenced this pull request May 9, 2024
* Merge pull request dotnet#429 from VSadov/tls1

Changes to support TLS access emitted in ILC (x64 win/linux)

* Fix DWARF debug information emitted for empty enum (dotnet#433)

(cherry picked from commit 167a9c5)

---------

Co-authored-by: Filip Navara <filip.navara@gmail.com>
akoeplinger pushed a commit that referenced this pull request May 17, 2024
* Merge pull request #429 from VSadov/tls1

Changes to support TLS access emitted in ILC (x64 win/linux)

* Fix DWARF debug information emitted for empty enum (#433)

(cherry picked from commit 167a9c5)

---------

Co-authored-by: Filip Navara <filip.navara@gmail.com>
radekdoulik pushed a commit that referenced this pull request Aug 16, 2024
* Merge pull request #429 from VSadov/tls1

Changes to support TLS access emitted in ILC (x64 win/linux)

* Fix DWARF debug information emitted for empty enum (#433)

(cherry picked from commit 167a9c5)

---------

Co-authored-by: Filip Navara <filip.navara@gmail.com>
radekdoulik pushed a commit that referenced this pull request Sep 2, 2024
* Merge pull request #429 from VSadov/tls1

Changes to support TLS access emitted in ILC (x64 win/linux)

* Fix DWARF debug information emitted for empty enum (#433)

(cherry picked from commit 167a9c5)

---------

Co-authored-by: Filip Navara <filip.navara@gmail.com>
radekdoulik pushed a commit that referenced this pull request Sep 12, 2024
* Merge pull request #429 from VSadov/tls1

Changes to support TLS access emitted in ILC (x64 win/linux)

* Fix DWARF debug information emitted for empty enum (#433)

(cherry picked from commit 167a9c5)

---------

Co-authored-by: Filip Navara <filip.navara@gmail.com>
radekdoulik pushed a commit that referenced this pull request Sep 19, 2024
* Merge pull request #429 from VSadov/tls1

Changes to support TLS access emitted in ILC (x64 win/linux)

* Fix DWARF debug information emitted for empty enum (#433)

(cherry picked from commit 167a9c5)

---------

Co-authored-by: Filip Navara <filip.navara@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants