【问题标题】:shared:ERROR: closure compiler failed (rc: 1)共享:错误:闭包编译器失败(rc:1)
【发布时间】:2019-08-31 06:56:38
【问题描述】:

我想构建 ffmpeg.js,但是运行 make all 时出现以下错误:

    pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])
{shouldRunNow=false}Module["noExitRuntime"]=true;run();return
 __ffmpegjs_return}module["exports"]=__ffmpegjs;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
    ^^^^^^^^^^^^^^^
    1 error(s), 6 warning(s)
    shared:ERROR: closure compiler failed (rc: 1)
    Makefile:316: recipe for target 'ffmpeg-webm.js' failed
    make: *** [ffmpeg-webm.js] Error 1 

Makefile 中的相关行是:

# Compile bitcode to JavaScript.
# NOTE(Kagami): Bump heap size to 64M, default 16M is not enough even
# for simple tests and 32M tends to run slower than 64M.
EMCC_COMMON_ARGS = \
    --closure 1 \
    -s TOTAL_MEMORY=67108864 \
    -s OUTLINING_LIMIT=20000 \
    -O3 --memory-init-file 0 \
    --pre-js $(PRE_JS) \
    -o $@

ffmpeg-webm.js: $(FFMPEG_WEBM_BC) $(PRE_JS) $(POST_JS_SYNC)
    emcc $(FFMPEG_WEBM_BC) $(WEBM_SHARED_DEPS) \ --------->>>>> THIS IS LINE 316
        --post-js $(POST_JS_SYNC) \
        $(EMCC_COMMON_ARGS)

如何正确使用 emcc 构建 ffmpeg.js?

【问题讨论】:

    标签: ffmpeg emscripten cc


    【解决方案1】:

    它说关闭编译器失败。删除--closure 1。您可能需要将优化标志减少到-O2 才能编译。如您所见,根据我的经验,Emscripten 优化器在 JS 模块化代码方面存在一些错误。

    尝试编译没有任何优化标志的任何东西总是好的,然后逐渐启用它们。

    【讨论】:

      猜你喜欢
      • 2015-09-13
      • 1970-01-01
      • 1970-01-01
      • 2014-06-01
      • 2020-02-02
      • 1970-01-01
      • 1970-01-01
      • 2013-04-16
      • 1970-01-01
      相关资源
      最近更新 更多