Use pre-built engine option

hi, when I modify native C++ plugin code, and regenerate a new bc(bitcode) file by emscripten, but there seems my exported scene just use and link the previous bc file when i build WebGL Development Build and enable the use pre-built engine option on, so is there some ways to regenerate the pre-built engine or clean the previous cached bc file?

2905936--214067--upload_2017-1-3_21-52-20.png

if I understand correctly are you generating the bc file by manually invoking emcc, right ?

yes, i generate it by emcc manually, and replace the old bc file in unity project folder.

This might be a bug in the il2cpp cache. Does deleting your Library/il2cpp_cache folder help fix this?

seems cached on other places? i delete the whole Library folder but it didn’t fix this.
my unity version is 5.4.3f1.
test: if i disable the use pre-built engine option, i can build a html performed correctly.

Can you please file a bug with a repro case for us to look at?

hi, the attachment prebuiltengine.rar is a test project, and i found that if enbale the pre-built engine option when exported to the WebGL, the bc file will not link? some test results as belows:
2907391--214220--upload_2017-1-4_21-30-35.png

  • unity version: 5.4.3f1
  • emscripten version: 1.34.1
  • bc file source code locate on prebuiltengine/c source code
  • the development build file is too large, i didn’t upload web1/web2/web3 dirs.

2907391–214221–prebuiltengine.rar (26.8 KB)

the complete browser console output is :

blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:11592 Uncaught abort(“external function ‘int_sqrt’ is missing. perhaps a side module was not linked in? if this function was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment”) at Error
at jsStackTrace (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:1120:12)
at stackTrace (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:1134:21)
at abort (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:2677152:43)
at _int_sqrt (eval at loadDynamicLibrary (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:346:19), :1005:35)
at _test_Start_m1752206257 (eval at loadDynamicLibrary (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:346:19), :298036:20)
at Array.asm._test_Start_m1752206257 (eval at loadDynamicLibrary (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:346:19), :438707:39)
at ftCall_vii (eval at loadDynamicLibrary (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:346:19), :2402:47)
at _Z31RuntimeInvoker_Void_t1841601450PK10MethodInfoPvPS2 [RuntimeInvoker_Void_t1841601450(MethodInfo const*, void*, void**)] (eval at loadDynamicLibrary (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:346:19), :397717:2)
at Array.asm._Z31RuntimeInvoker_Void_t1841601450PK10MethodInfoPvPS2 [RuntimeInvoker_Void_t1841601450(MethodInfo const*, void*, void**)] (eval at loadDynamicLibrary (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:346:19), :489713:72)
at Object.ftCall_iiii [as dynCall_iiii] (eval at loadDynamicLibrary (blob:http://127.0.0.1/979b05f7-32e9-480b-b59d-e5bf37d52565:346:19), :2725:48)

and i check the emscripten document for keyword ‘EMCC_FORCE_STDLIBS’, it seems that unity eliminate the process of linking bc file when enable the use pre-built engine option.