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

[wasm64] Fix pointer size detection #20201

Merged
merged 1 commit into from
Sep 7, 2023
Merged

[wasm64] Fix pointer size detection #20201

merged 1 commit into from
Sep 7, 2023

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 7, 2023

Fixes: #20175

@sbc100 sbc100 requested a review from kripken September 7, 2023 01:31
@@ -217,10 +217,16 @@ set(EMSCRIPTEN_SYSROOT "${_emcache_output}/sysroot")
list(APPEND CMAKE_FIND_ROOT_PATH "${EMSCRIPTEN_SYSROOT}")
list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)

if ($ENV{CFLAGS} MATCHES "MEMORY64")
if (${CMAKE_C_FLAGS} MATCHES "MEMORY64")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What sets this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html (its set from both the CFLAGS env var and also from the -DCMAKE_C_FLAGS command line flag).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who sets MEMORY64 in the env, though?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are looking for the -sMEMORY64 flag here. I just use MEMORY64 because it could be -s MEMORY64 or -sMEMORY64.

The key I'm looking for doesn't change with this PR.. I'm just looking in a better place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now, thanks.

@sbc100 sbc100 merged commit 30c96f6 into main Sep 7, 2023
@sbc100 sbc100 deleted the cmake_wasm64 branch September 7, 2023 16:09
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.

cmake toolchain hardcodes sizeof void pointer to 32-bit
2 participants