-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Compilation errors when built with O2 optimizations #4506
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
Comments
Also worth trying |
I have clear cache and set EMCC_DEBUG=1. I got this in debug log. DEBUG:root:testing for asm.js target, because if not present (i.e. this is plain vanilla llvm, not emscripten fastcomp), we will use the wasm target instead (set EMCC_WASM_BACKEND to skip this check) How to build fastcomp? |
You can use the sdk or build manually from source. |
One thing I do not understand, isn't sdk-incoming-64bit already Fastcomp enabled? Can you tell me which branch or tag is Fastcomp enabled by default? |
I'm having the same issue on SDK version 1.36.9 which is downloaded and built by |
@kripken same issue when building from sources with VS2015 yesterday with
|
This is likely windows-specific, so I don't think I can help much, maybe @juj has an idea. But I would check if you see that problem on small "hello world" programs too, might help narrow things down. |
Yes I do. This simple code causes the problem. #include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
cout << "Welcome to C++ Programming" << endl;
}
Full debug log:
|
I think this is not an unexistent fastcomp problem as my debug log says |
Those |
|
What does |
There is only 1 line in my
This folder exists on my PC and is filled with clang tools. |
Ah! I see what's going wrong. A silly programmer (me) forgot that an OS exists where |
Unfortunately, it does not fix the issue. My cmdline output is as follows F:\Emscripten\emscripten\incoming>emcc helloworld.cpp -O2 -o helloworld.js |
My problem is now fixed with installing incoming and then clearing cache. But now I'm seeing a new problem that constructing a module produced by const libflifem = _libflifem({ memoryInitializerPrefixURL: "built/" })
const decoder = new libflifem.FLIFDecoder();
// VM362:2 Uncaught TypeError: libflifem.FLIFDecoder is not a constructor
// a few seconds later
a = new libflifem.FLIFDecoder();
// FLIFDecoder {$$: Object} Workaround: add a setTimeout with timer 0 after module construction. (works on Chrome, not work on Firefox) |
After putting some printf in js_optimizer.py, it seems that it split the work into 3 files in But I checked that folder did not contain these files! I find another folder(below) contains some temp files so this is not a permission issue.
I have tried O2 flag on the 1.35.0 installer. It works fine. So I shall stick to the official Windows installer for now. |
Ok, sounds like that |
The last call stack suggests that something went wrong during building the native
where If this does not give a clue, try |
Hi juj, optimizer.exe exists in that folder. I'll continue to troubleshoot with printfs. I'll update here if there is progress. |
Upgrading to 1.36.14 reintroduced this issue X(
is_vanilla.txt:
|
I found this debug log:
The valid directory name is
Fixing this value removed the problem. |
optimizer.exe on win10 x64 Not working properly,So I suspect this is the case optimizer.exe 在win10 x64上 不能正常的工作,因此我怀疑是这个文件的事情,虽然配置文件指定了这个文件路径! |
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
If I remove the O2, I can built without errors. The emsdk is installed from sdk-incoming-64bit on 2016-08-21.
emsdk install --vs2015 sdk-incoming-64bit
I have plenty of free RAM(Total:16GB with no other programs running) and SSD space when the error happened.
F:\Emscripten\emscripten\incoming>emcc F:\App\SDL_App\TestEmscripten\TestEmscripten.cpp --bind -s FULL_ES2=1 -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s ASSERTIONS=1 -D EMSCRIPTEN -std=c++11 -I F:\App\SDL_App\ext\glm-0.9.5.3\glm -O2 --llvm-opts 2 -o project.html
Traceback (most recent call last):
File "F:\Emscripten\emscripten\incoming\emcc", line 13, in
emcc.run()
File "F:\Emscripten\emscripten\incoming\emcc.py", line 1811, in run
JSOptimizer.flush()
File "F:\Emscripten\emscripten\incoming\emcc.py", line 1708, in flush
run_passes(chunks[0], title, just_split=False, just_concat=False)
File "F:\Emscripten\emscripten\incoming\emcc.py", line 1681, in run_passes
final = shared.Building.js_optimizer(final, passes, debug_level >= 4, JSOptimizer.extra_info, just_split=just_split, just_concat=just_concat)
File "F:\Emscripten\emscripten\incoming\tools\shared.py", line 1756, in js_optimizer
ret = js_optimizer.run(filename, passes, NODE_JS, debug, extra_info, just_split, just_concat)
File "F:\Emscripten\emscripten\incoming\tools\js_optimizer.py", line 555, in run
return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, source_map, extra_info, just_split, just_concat))
File "F:\Emscripten\emscripten\incoming\tools\tempfiles.py", line 78, in run_and_clean
return func()
File "F:\Emscripten\emscripten\incoming\tools\js_optimizer.py", line 555, in
return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, source_map, extra_info, just_split, just_concat))
File "F:\Emscripten\emscripten\incoming\tools\js_optimizer.py", line 450, in run_on_js
filenames = pool.map(run_on_chunk, commands, chunksize=1)
File "F:\Emscripten\python\2.7.5.3_64bit\lib\multiprocessing\pool.py", line 250, in map
return self.map_async(func, iterable, chunksize).get()
File "F:\Emscripten\python\2.7.5.3_64bit\lib\multiprocessing\pool.py", line 554, in get
raise self._value
WindowsError: [Error 2] The system cannot find the file specified
The text was updated successfully, but these errors were encountered: