{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/7799","repository_url":"https://api.github.com/repos/kripken/emscripten","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/7799/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/7799/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/7799/events","html_url":"https://github.com/kripken/emscripten/pull/7799","id":395428064,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxODg0NjQw","number":7799,"title":"Update core wasm32 typedefs to be compatible with reference-sysroot.","user":{"login":"sunfishcode","id":4503403,"node_id":"MDQ6VXNlcjQ1MDM0MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/4503403?v=4","gravatar_id":"","url":"https://api.github.com/users/sunfishcode","html_url":"https://github.com/sunfishcode","followers_url":"https://api.github.com/users/sunfishcode/followers","following_url":"https://api.github.com/users/sunfishcode/following{/other_user}","gists_url":"https://api.github.com/users/sunfishcode/gists{/gist_id}","starred_url":"https://api.github.com/users/sunfishcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunfishcode/subscriptions","organizations_url":"https://api.github.com/users/sunfishcode/orgs","repos_url":"https://api.github.com/users/sunfishcode/repos","events_url":"https://api.github.com/users/sunfishcode/events{/privacy}","received_events_url":"https://api.github.com/users/sunfishcode/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-01-03T00:54:52Z","updated_at":"2019-01-03T17:47:24Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/7799","html_url":"https://github.com/kripken/emscripten/pull/7799","diff_url":"https://github.com/kripken/emscripten/pull/7799.diff","patch_url":"https://github.com/kripken/emscripten/pull/7799.patch"},"body":"Change `time_t` from `long` (32-bit) to `long long` (64-bit). This fixes the [2038 bug](https://en.wikipedia.org/wiki/Year_2038_problem). It's also consistent with the [x32 ABI](https://en.wikipedia.org/wiki/X32_ABI).\r\n\r\nChange the fallback for `wchar_t` and `wint_t` from `unsigned` to `int`. This is not an ABI change in practice because the headers prefer to use `__WCHAR_TYPE__` and `__WINT_TYPE__` when they're defined, and clang defines those to be `int`. So this just makes the fallback cases for other hypothetical compilers consistent with clang. (And fwiw, no one specifically chose `int` for these, that's just the default in clang if the target doesn't override it. So if anyone feels strongly that wchar_t/wint_t should be something different, we can change them).\r\n\r\nChange `suseconds_t` from `long` to `long long`. This matches x32, uses what would otherwise be padding a `struct timeval`, and generally makes it easier for users to avoid overflow in time calculations.\r\n\r\nChange `_Reg` from `__PTRDIFF_TYPE__` (32-bit) to `__INT64_TYPE__` (64-bit). `_Reg` is only used for `nlink_t` and `register_t`. For `nlink_t`, this matches x32, and theoretically supports filesystems that support billions of links. For `register_t`, since wasm supports native `i64` values, a 64-bit int is the closest mapping of this concept.\r\n\r\nThis PR doesn't currently include any provision for ABI versioning. At least in theory, the wasm32 ABI shouldn't be considered stable yet; the upstream LLVM component hasn't emerged from Experimental status yet (though it is expected to in a few months), though I'm open to practical concerns here.\r\n"},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/451221787","html_url":"https://github.com/kripken/emscripten/pull/7799#issuecomment-451221787","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/7799","id":451221787,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTIyMTc4Nw==","user":{"login":"sunfishcode","id":4503403,"node_id":"MDQ6VXNlcjQ1MDM0MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/4503403?v=4","gravatar_id":"","url":"https://api.github.com/users/sunfishcode","html_url":"https://github.com/sunfishcode","followers_url":"https://api.github.com/users/sunfishcode/followers","following_url":"https://api.github.com/users/sunfishcode/following{/other_user}","gists_url":"https://api.github.com/users/sunfishcode/gists{/gist_id}","starred_url":"https://api.github.com/users/sunfishcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunfishcode/subscriptions","organizations_url":"https://api.github.com/users/sunfishcode/orgs","repos_url":"https://api.github.com/users/sunfishcode/repos","events_url":"https://api.github.com/users/sunfishcode/events{/privacy}","received_events_url":"https://api.github.com/users/sunfishcode/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T17:47:24Z","updated_at":"2019-01-03T17:47:24Z","author_association":"COLLABORATOR","body":"> These changes are consistent with changes I also had plans to make in #7649. My only request is the addition of a minimal \"emscripten metadata\" section for the generated wasm before making ABI changes like these. Without that it will be impossible for wasmjit (and others) to detect that this code is incompatible with the ABI it currently targets. Users who unwittingly build wasm files with incompatible versions of emscripten won't be able to easily discover the root problem, and think either wasmjit or emscripten is broken.\r\n\r\nWould you be willing to submit a patch for this part? I don't know what you need here, and I'm not very familiar with the parts of Emscripten and Binaryen that would be involved."}}
{"actor":{"display_login":"sunfishcode"}}