HTML5: Fix support for Emscripten 1.39.1+

A change in upstream Emscripten 1.39.1+ made our buildsystem error
out where it was previously only issuing a warning:
```
[  5%] Linking Static Library ==> main/libmain.javascript.opt.bc
shared:WARNING: Assuming object file output in the absence of `-c`, based on output filename. Please add with `-c` or `-r` to avoid this warning
Ranlib Library         ==> main/libmain.javascript.opt.bc
/opt/emsdk/upstream/bin/llvm-ranlib: error: unable to load 'main/libmain.javascript.opt.bc': file too small to be an archive
```

As advised on emscripten-core/emscripten#9806, we should be using
`emar` here to create the static library and not `emcc`.
This was apparently done to workaround Emscripten issues in the past,
but evidently this is no longer necessary.

The rest of the `env` redefinitions should probably be re-assessed
against the current state of Emscripten.

Fixes #33374.

(cherry picked from commit e9e2a4b044)
This commit is contained in:
Rémi Verschelde 2019-11-15 09:39:18 +01:00
parent f7eed5166b
commit e647b5b73c
1 changed files with 1 additions and 2 deletions

View File

@ -84,8 +84,7 @@ def configure(env):
env['CXX'] = 'em++' env['CXX'] = 'em++'
env['LINK'] = 'emcc' env['LINK'] = 'emcc'
env['RANLIB'] = 'emranlib' env['RANLIB'] = 'emranlib'
# Emscripten's ar has issues with duplicate file names, so use cc env['AR'] = 'emar'
env['AR'] = 'emcc'
env['ARFLAGS'] = '-o' env['ARFLAGS'] = '-o'
if (os.name == 'nt'): if (os.name == 'nt'):