-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
how to make the change of system lib source to work? #22462
Comments
If you see the printf in the console then I don't see how the following line wouldn't be a call to malloc. You can check contents libfetch.a if you like by extracting that object files and using |
yes, i am also very confused by the result, after change calloc to malloc, i even did printf in the dlcalloc function, the browser console showed that the real function be called was still dlcalloc. |
I don't think the compiler would ever change a calloc to a malloc though.. that seem backwards. Something strange much be going on. What does the it looks like if you inspect (via objdump or similar) the By the way why are trying to make this change from calloc to malloc? |
seriously, i seeked for the compiled emscripten_fetch.o file, but i can't find it.it would be auto removed after compile? |
i have confirmed that when there is a memset after malloc, the compiler will change these to a calloc call. |
To get |
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.64 (a1fe390)
clang version 19.0.0git (https:/github.com/llvm/llvm-project 4d8e42ea6a89c73f90941fd1b6e899912e31dd34)
Target: wasm32-unknown-emscripten
Thread model: posix
i make a little change the emscripten_fetch.c file of the fetch lib,
emscripten/system/lib/fetch/emscripten_fetch.c
Line 88 in 5a1578a
to something like this:
after change the code ,i remove the libfetch*.a in cache/sysroot/lib folder, and after compile , in runtime, i see the 'change calloc to malloc' output in the browser console, but when i see the wasm decode in web browser, there is no malloc call, the calloc call is still there, why?
The text was updated successfully, but these errors were encountered: