-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix locale #37
Comments
From some brief research locale files seem to just be ASCII text, though they are compiled to that? https://stackoverflow.com/questions/65514890/glibcs-isalpha-function-and-the-en-us-utf-8-locale I believe all we should have to do is compile the locale files and place them in the appropriate directory in the file system |
If what I posted above is true it shouldnt take any actual changes, just fixing the build and setup processes. @robinyuan1002 and @yzhang71 can you try that out. |
To reproduce the issue, I created a simple program that uses I digged into this a little bit. And found something interesting (actually by accident). So So it is still unknown what is trying to override |
Great, @qianxichen233 can you save a branch where we can reproduce this? Robin and I will look into it. @robinyuan1002 after your finals lets create a few test cases with different locale related functions. |
The problem might be that wasm doesn't handle weak externs correctly at all. Seems like there's some discussion here: emscripten-core/emscripten#12819 |
I just pushed a branch named "fix-locale", which contains the changes I made. Basically the changes I decribed above, and I also reverted three locale related file back to its unmodified state. |
The problem now is that when we use uselocale function in a test case and try to compile this test case into wasm, we encountered many errors(e.g /home/lind-wasm/src/glibc/sysroot/lib/wasm32-wasi/libc.a(uselocale.o): relocation R_WASM_MEMORY_ADDR_TLS_SLEB cannot be used against an undefined symbol |
There seems to be some weird things happening with linking in _nl_current. I'm not sure if this a vtable thing like @yzhang71 saw before. Dennis can you possibly help Robin look at this? |
a little bit more information: we tried to output the pre-compiled c file (with all macro expanded) and we can see clearly _nl_current stuff are defined in the file, something like |
I found out that these |
Okay, so it sounds like you've found a workaround for this now! Let's document this as an issue to work more on later, but just do the ordering in a way that works for us and move on. |
Definitely agree with Justin that this should be good enough for now. We're having issues with TLS elsewhere yes? Probably worth starting an issue on TLS to track any problems we encounter. |
When fixing bash, I faced a lot of issues related to locale. Previously, locale is not working and I commented them out since I thought they are not important as locale is mainly used for setting up language specific context. But it turns out locale is used much more often than I thought. For example, isblank will look up locale to determine language specific blank character. I currently have to manually modify each function that uses locale, which is working fine, but it might probably be a better choice to just completely fix locale.
The text was updated successfully, but these errors were encountered: