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

String interning is broken on GCC #79

Open
Javier-varez opened this issue Apr 1, 2021 · 0 comments
Open

String interning is broken on GCC #79

Javier-varez opened this issue Apr 1, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Javier-varez
Copy link
Owner

It seems GCC ignores section attributes for static members of a template class. This causes the interned strings to be stored in .rodata instead of the custom interned sections .interned_strings. This is currently supported by clang (at least from version 10), but GCC silently ignores the section attribute and does not even provide a warning message.

https://stackoverflow.com/questions/36279162/section-attribute-of-a-function-template-is-silently-ignored-in-gcc
https://stackoverflow.com/questions/54040665/gcc-section-attribute-ignored-in-a-templated-function
https://stackoverflow.com/questions/42513904/is-attribute-section-something-on-a-static-member-of-a-template-class
https://answers.launchpad.net/gcc-arm-embedded/+question/615576

It appears to be reported as a bug in GCC too:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70435

@Javier-varez Javier-varez added the bug Something isn't working label Apr 1, 2021
Javier-varez added a commit that referenced this issue Apr 1, 2021
We still need to keep the operator _intern because there is no easy way
to translate it into a macro.

Added a pragma message to notify the user of the problem and let them
know user string interning is not currently possible on GCC.

Relates to #79.

Change-Id: Ia1c51d59f7df41cf9e1e98d3ed4834e53128da5a
Javier-varez added a commit that referenced this issue Apr 1, 2021
We still need to keep the operator _intern because there is no easy way
to translate it into a macro.

Added a pragma message to notify the user of the problem and let them
know user string interning is not currently possible on GCC.

Relates to #79.

Change-Id: Ia1c51d59f7df41cf9e1e98d3ed4834e53128da5a
Javier-varez added a commit that referenced this issue Apr 1, 2021
We still need to keep the operator _intern because there is no easy way
to translate it into a macro.

Added a pragma message to notify the user of the problem and let them
know user string interning is not currently possible on GCC.

Relates to #79.

Change-Id: Ia1c51d59f7df41cf9e1e98d3ed4834e53128da5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant