-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Windows: test_conststructs failure #11
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
Comments
Thanks for reporting this issue. Your analysis looks correct to me. The structure has fields of size 4-8-4, which on Linux gets aligned basically as-is. On Windows, if it gets to size 24, I would guess it ends up as 4-(4 padding to align the 8)-8-4-(4 padding to make the total a multiple of 8). Presumably this information is encoded in the |datalayout| section in the .ll file, which Emscripten currently ignores, so we should address that. |
Emscripten now uses bundled headers, so it should work on Windows exactly the same as on all other platforms. I'm closing this issue, but if you see that the problem still exists, please reopen. |
Make file_packager.py compatible with PThreadFS
On my Windows 7 system, running:
gives this output:
Here are the generated src.cpp.o.ll and src.cpp.o.js files:
http://pastebin.com/krJWXweS
http://pastebin.com/bkwFWGjy
The problem seems to be that the double member variable in the IUB struct is not correctly aligned/padded. Emscripten seems to think that the size of the IUB struct is 16 bytes, wheras clang will align and pad the double in a way that makes the struct 24 bytes.
The problem can be observed in the generated src.cpp.o.js file where Emscripten allocates 64 "bytes" (16 "bytes" for each entry in the iub array):
but then goes ahead and copies 96 "bytes" when initializing the array:
The text was updated successfully, but these errors were encountered: