{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3645","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3645/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3645/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3645/events","html_url":"https://github.com/kripken/emscripten/issues/3645","id":97670295,"number":3645,"title":"LLVM optimization step fails","user":{"login":"dgrechka","id":5637547,"avatar_url":"https://avatars.githubusercontent.com/u/5637547?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrechka","html_url":"https://github.com/dgrechka","followers_url":"https://api.github.com/users/dgrechka/followers","following_url":"https://api.github.com/users/dgrechka/following{/other_user}","gists_url":"https://api.github.com/users/dgrechka/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrechka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrechka/subscriptions","organizations_url":"https://api.github.com/users/dgrechka/orgs","repos_url":"https://api.github.com/users/dgrechka/repos","events_url":"https://api.github.com/users/dgrechka/events{/privacy}","received_events_url":"https://api.github.com/users/dgrechka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-28T10:30:05Z","updated_at":"2015-07-28T18:08:06Z","closed_at":null,"body":"Hi,\r\n\r\nI try to compile linked bitcode to JavaScript, however emcc call fails with \"Failed to run llvm optimizations\". I don't specify any optimization flags, I just run \"emcc -o out.js ..... \"\r\n\r\nThe output:\r\n```\r\nDEBUG    root: using response file for llvm-link\r\nDEBUG    root: emcc step \"link\" took 17.00 seconds\r\nDEBUG    root: saving intermediate processing steps to c:/users/dmitry/appdata/local/temp\\emscripten_temp\r\nDEBUG    root: emcc: LLVM opts: -strip-debug -internalize -internalize-public-api-list=main,malloc,free,__cxa_can_catch,__cxa_is_pointer_type,malloc,free -globa\r\nldce -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt -enable-emscripten-cxx-exceptions -disable-loop-vectorization -disable-slp-vectorization -vectorize-\r\nloops=false -vectorize-slp=false -vectorize-slp-aggressive=false\r\nTraceback (most recent call last):\r\n  File \"C:\\Program Files\\Emscripten\\emscripten\\1.34.1\\\\emcc\", line 1260, in <module>\r\n    shared.Building.llvm_opt(final, link_opts)\r\n  File \"C:\\Program Files\\Emscripten\\emscripten\\1.34.1\\tools\\shared.py\", line 1429, in llvm_opt\r\n    assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output\r\nAssertionError: Failed to run llvm optimizations:\r\n\r\nTraceback (most recent call last):\r\n  File \"C:\\Program Files\\Emscripten\\emscripten\\1.34.1\\\\emcc\", line 1260, in <module>\r\n    shared.Building.llvm_opt(final, link_opts)\r\n  File \"C:\\Program Files\\Emscripten\\emscripten\\1.34.1\\tools\\shared.py\", line 1434, in llvm_opt\r\n    assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output\r\nAssertionError: Failed to run llvm optimizations:\r\n```\r\n\r\n\r\nI can see that bitcode optimizer does not produce any output file for my input file. There are no error messages as well.\r\n\r\nWhen I call the optimizer explicitly the result is the same. No output file, no stderr.\r\nI also tried to remove any opt.exe prameters which are added by emcc. The same behavior.\r\nEven when I call optimizer to perform analysis (eg opt.exe -analyze a.out.bc) it does not produce any messages.\r\n\r\nOther utilites that come with emscripten (e.g. llvm-bcanalyzer) read the file successfuly.\r\n\r\nThe file I try to compile is at http://home.dgrechka.net/filestore/for_external/a.out.bc\r\n\r\nWhat can cause such problem?\r\n\r\n\r\nPlatform: windows\r\npython: Python 2.7.5\r\nemsdk: emsdk-1.34.1-full-64bit.exe\r\n\r\n\r\n```\r\nc:\\Program Files\\Emscripten\\clang\\e1.34.1_64bit>opt.exe -version\r\nLLVM (http://llvm.org/):\r\n  LLVM version 3.7.0svn\r\n  DEBUG build.\r\n  Built Jul  3 2015 (18:07:05).\r\n  Default target: x86_64-pc-windows-msvc\r\n  Host CPU: sandybridge\r\n```\r\n\r\nRegards,\r\nDmitry."},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/125699366","html_url":"https://github.com/kripken/emscripten/issues/3645#issuecomment-125699366","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3645","id":125699366,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T18:08:06Z","updated_at":"2015-07-28T18:08:06Z","body":"Running `EMCC_LEAVE_INPUTS_RAW=1 EMCC_DEBUG=1 ~/Dev/emscripten/emcc -O2 a.out.bc` on my linux machine works, so I can't reproduce the problem. Perhaps it is windows-only?\r\n\r\nIs there some way on windows to run it in a debugger, maybe that will show something?"}}