From 995eddf714f946414cbc91c46ad938337c4f5500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 15 Nov 2019 09:39:18 +0100 Subject: [PATCH] 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 e9e2a4b0443885490357ad20ba8bf8e5f54029c8) --- platform/javascript/detect.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 01f7504caf6..66ea3554994 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -49,12 +49,10 @@ def configure(env): env['CC'] = em_path + '/emcc' env['CXX'] = em_path + '/emcc' - #env['AR'] = em_path+"/emar" - env['AR'] = em_path + "/emcc" + env['AR'] = em_path + "/emar" env['ARFLAGS'] = "-o" + env['RANLIB'] = em_path + "/emranlib" -# env['RANLIB'] = em_path+"/emranlib" - env['RANLIB'] = em_path + "/emcc" env['OBJSUFFIX'] = '.bc' env['LIBSUFFIX'] = '.bc' env['CCCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES"