Skip to content

Conversation

kripken
Copy link
Member

@kripken kripken commented Aug 2, 2023

Fixes #19944

Without this, we hit

error: handleI64Signatures: missing name for argument 1 in glGetTexLevelParameteriv

@kripken kripken requested a review from sbc100 August 2, 2023 22:06
self.btest('glgettexenv.c', args=['-sLEGACY_GL_EMULATION', '-lGL', '-lSDL'], expected='1')
# Test with 4GB maximum memory to test that GL emulation does not error
# during link.
self.btest('glgettexenv.c', args=['-sLEGACY_GL_EMULATION', '-lGL', '-lSDL', '-sMAXIMUM_MEMORY=4GB', '-sALLOW_MEMORY_GROWTH'], expected='1')
Copy link
Collaborator

Choose a reason for hiding this comment

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

You would also get the same error by referencing these symbols in a wasm64 build.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would that be better? It seems less intrusive to increase the max memory to me. Unless you mean we should also have wasm64 coverage?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, this approach seems fine.

if (argc == 1234) {
GLint i;
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &i);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just taking the address of this function would also be enough to trigger the error. (i.e. printf("%p\n", glGetTexLevelParameteriv) ) although I'm not sure that is more readable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh wait, I remember now how I went about testing and fixing this the last time it came up. We can use -sINCLUDE_FULL_LIBRARY for force inclusion of all JS library funcs.

See #19902

Instead of this test I would add a wasm64 or 4gb mode to other.test_full_js_library. That should catch this as well as any others.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good, done. I also confirmed the new test fails before the fix here.

@kripken kripken enabled auto-merge (squash) August 2, 2023 22:22
@kripken kripken disabled auto-merge August 2, 2023 22:23
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

Nice!

@kripken kripken enabled auto-merge (squash) August 2, 2023 23:02
@kripken kripken merged commit d482a46 into main Aug 2, 2023
@kripken kripken deleted the four.emu branch August 2, 2023 23:45
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.

Build error with glGetTexLevelParameteriv signature when linking wasm32 with MAXIMUM_MEMORY=4GB
2 participants