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

Update/fix CheckSizeType cmake check #18309

Merged
merged 1 commit into from
Dec 5, 2022
Merged

Update/fix CheckSizeType cmake check #18309

merged 1 commit into from
Dec 5, 2022

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Dec 2, 2022

Update the CheckTypeSize files to v3.10.2 (mostly arbitrary version).

Local patch to CheckTypeSize is not much smaller. Instead of executing the program and using the return value (doesn't work for return values greater than 255), we simply inject -oformat=wasm onto the link command, and then we can use strings on the binary just like the upstream check. This is basically a single line patch against upstream now.

Fixes: #18278 #18238 #17268 #17811

@sbc100 sbc100 requested a review from RReverser December 2, 2022 18:19
@sbc100
Copy link
Collaborator Author

sbc100 commented Dec 2, 2022

@thewtex, I think you originally contributed the forked version of CheckTypeSize... a very long time ago now.

The main concern I have is not knowing which version of cmake we should fork CheckTypeSize from. I chose v3.10.2 mostly arbitrarily and seems to work nicely.. at least of me locally.

@RReverser
Copy link
Collaborator

I think #18084 should be excluded from the Fixes list, as we don't want it to auto-close and the issue has more to do with Node.js upgrade.

@RReverser
Copy link
Collaborator

Although it looks like Github only marks the first issue in the list as auto-close anyway...

@sbc100
Copy link
Collaborator Author

sbc100 commented Dec 2, 2022

Done.

@sbc100
Copy link
Collaborator Author

sbc100 commented Dec 5, 2022

Good to land?

@sbc100 sbc100 enabled auto-merge (squash) December 5, 2022 20:16
@sbc100 sbc100 disabled auto-merge December 5, 2022 20:17
@sbc100 sbc100 enabled auto-merge (squash) December 5, 2022 20:18
Update the CheckTypeSize files to v3.10.2 (mostly arbitrary version, but
this is what we use in CI).

Local patch to CheckTypeSize is not much smaller.  Instead of executing
the program and using the return value (doesn't work for return values
greater than 255), we simply inject `-oformat=wasm` onto the link
command, and then we can use `strings` on the binary just like the
upstream check.  This is basically a single line patch against upstream
now.

Fixes: #18278 #18238 #17268 #18084 #17811
@sbc100 sbc100 merged commit 677a8d0 into main Dec 5, 2022
@sbc100 sbc100 deleted the fix_cmake branch December 5, 2022 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve sizeof in Emscripten CMake implementation
2 participants