Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

remove emulated TLS for OSX#1905

Closed
MartinNowak wants to merge 1 commit intodlang:masterfrom
MartinNowak:rm_emu_tls
Closed

remove emulated TLS for OSX#1905
MartinNowak wants to merge 1 commit intodlang:masterfrom
MartinNowak:rm_emu_tls

Conversation

@MartinNowak
Copy link
Member

  • native TLS supported since 2.072.0

- native TLS supported since 2.072.0
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @MartinNowak!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

PetarKirov
PetarKirov previously approved these changes Aug 19, 2017
@PetarKirov
Copy link
Member

CyberShadow/DAutoTest fails due to dlang/dlang.org#1796.

@jacob-carlborg
Copy link
Contributor

jacob-carlborg commented Aug 19, 2017

@MartinNowak @ZombineDev 32bit is still using emulated TLS: https://github.com/dlang/dmd/blob/master/src/ddmd/toobj.d#L1239.

To elaborate, I never got the implementation to work on 32bit, although it's using the same scheme as far as I can see. Since 32bit macOS is basically a dead platform, Walter decided it wasn't worth spending time on it and the 64bit implementation was approved.

There are a few cases where 32bit macOS might still be interesting:

  • The simulator (for iOS, WatchOS and TvOS) is actually running x86 code and not ARM code. iOS will soon be 64bit only as well, but I'm not sure about WatchOS. This assumes that someone actually cares about running DMD compiled code in the simulators. It might be enough with LDC

  • As far as I understand, Guillaume Piolat is developing audio plugins on macOS and supports 32bit. I'm not sure if DMD is needed or if LDC is enough. I think the customers might be using old 32bit plugins which are not available for 64bit and therefore cannot move the main application to 64bit either

Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

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

Decide what to do about OSX 32bit.

@PetarKirov PetarKirov dismissed their stale review August 19, 2017 14:59

As per @jacob-carlborg's comments

@MartinNowak
Copy link
Member Author

Yes, smelled a bit as if 32-bit was still relying on this. Any reference to the OSX TLS implementation? Can't find any in dlang/dmd#5346, but I guess you didn't reverse engineer all of it @jacob-carlborg.
I found https://stackoverflow.com/a/29929949/2371032 which mentions TLS support in XCode 8.

@MartinNowak
Copy link
Member Author

Decide what to do about OSX 32bit.

Keep as long as it's not much to keep.

@jacob-carlborg
Copy link
Contributor

Any reference to the OSX TLS implementation?

There's no official reference, as far as I know. What I found out is documented here [1][2].

[1] https://github.com/dlang/dmd/blob/master/src/ddmd/toobj.d#L1212
[2] https://github.com/dlang/dmd/blob/master/src/ddmd/backend/el.c#L1285

@jacob-carlborg
Copy link
Contributor

TLS was supported before Xcode 8. __thread was supported but not thread_local, IIRC.

@dnadlinger
Copy link
Contributor

TLS is supported on OS X 10.7+.

@MartinNowak
Copy link
Member Author

There's no official reference, as far as I know. What I found out is documented here [1][2].

Unfortunately doesn't document from what you derived this. Guess from their runtime linker and llvm/clang, right?

@jacob-carlborg
Copy link
Contributor

Unfortunately doesn't document from what you derived this. Guess from their runtime linker and llvm/clang, right?

From dyld and looking at the assembly and object dumps from Clang.

@PetarKirov
Copy link
Member

Darwin_64_32 fails consistently on autotester, so it looks we can't move forward with this PR. Please reopen, if I'm misunderstanding.

@PetarKirov PetarKirov closed this Aug 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants