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

all gcc versions - thread local storage broken #11

Closed
danielhams opened this issue Aug 28, 2019 · 3 comments

Comments

@danielhams
Copy link
Owner

commented Aug 28, 2019

simple example, just compile a c file a variable declared like this:

__thread int a=0;

Unclear at the moment if this problem is coming from inside gcc or is binutils related.

gcc should be using emutls - so shouldn't emit thread local storage references in the assembly (if I've understood correctly).

@danielhams

This comment has been minimized.

Copy link
Owner Author

commented Aug 30, 2019

Example (crashing) simple C program with thread local variable here:

https://gist.github.com/danielhams/6e41c5843ee604074c2d6e7ca61e1595

Example (crashing) simple C++ program with thread local variable here:

https://gist.github.com/danielhams/05a3ecb77181b69d6bf5fb563686d833

More complex use of thread local storage + threads here:

https://gist.github.com/danielhams/a0859edf5782c1cc3f06b2bd46023ee9

@danielhams

This comment has been minimized.

Copy link
Owner Author

commented Aug 31, 2019

Looks like this will be resolved by specifying --enable-tls=no to the gcc configures.

This forces on the emutls - and gets the above example programs correctly working.

@danielhams

This comment has been minimized.

Copy link
Owner Author

commented Sep 5, 2019

fixed on 0.1.2

@danielhams danielhams closed this Sep 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.