diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a54347b3825..3dcadf2112a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -476,7 +476,7 @@ jobs: b_ems: docker: - - image: trzeci/emscripten:sdk-tag-1.38.22-64bit + - image: trzeci/emscripten:sdk-tag-1.39.3-64bit environment: TERM: xterm steps: diff --git a/.travis.yml b/.travis.yml index 5754fa0a9fe0..38d59fa931b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,7 +110,7 @@ matrix: before_install: - nvm install 8 - nvm use 8 - - docker pull trzeci/emscripten:sdk-tag-1.38.22-64bit + - docker pull trzeci/emscripten:sdk-tag-1.39.3-64bit env: - SOLC_EMSCRIPTEN=On - SOLC_INSTALL_DEPS_TRAVIS=Off @@ -127,7 +127,7 @@ matrix: # # This key here has no significant on anything, apart from caching. Please keep # it in sync with the version above. - - EMSCRIPTEN_VERSION_KEY="1.38.22" + - EMSCRIPTEN_VERSION_KEY="1.39.3" # OS X Mavericks (10.9) # https://en.wikipedia.org/wiki/OS_X_Mavericks diff --git a/Changelog.md b/Changelog.md index 064c3bb201f3..7b828a989002 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,10 @@ Compiler Features: * Yul Optimizer: Perform loop-invariant code motion. +Build System: + * Update to emscripten version 1.39.3. + + Bugfixes: * SMTChecker: Fix internal error when using ``abi.decode``. diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 4d24668e6787..afd14511897e 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -86,7 +86,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA elseif(EMSCRIPTEN) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0") # Leave only exported symbols as public and aggressively remove others - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections -fvisibility=hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -fvisibility=hidden") # Optimisation level set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") # Re-enable exception catching (optimisations above -O1 disable it) @@ -110,7 +110,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s STRICT=1") # Export the Emscripten-generated auxiliary methods which are needed by solc-js. # Which methods of libsolc itself are exported is specified in libsolc/CMakeLists.txt. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap','addFunction','removeFunction','Pointer_stringify','lengthBytesUTF8','_malloc','stringToUTF8','setValue']") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap','addFunction','removeFunction','UTF8ToString','lengthBytesUTF8','_malloc','stringToUTF8','setValue']") # Do not build as a WebAssembly target - we need an asm.js output. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM=0") diff --git a/scripts/build_emscripten.sh b/scripts/build_emscripten.sh index 25f6f7f8c17a..b457b741d801 100755 --- a/scripts/build_emscripten.sh +++ b/scripts/build_emscripten.sh @@ -34,7 +34,7 @@ else BUILD_DIR="$1" fi -docker run -v $(pwd):/root/project -w /root/project trzeci/emscripten:sdk-tag-1.38.22-64bit \ +docker run -v $(pwd):/root/project -w /root/project trzeci/emscripten:sdk-tag-1.39.3-64bit \ ./scripts/travis-emscripten/install_deps.sh -docker run -v $(pwd):/root/project -w /root/project trzeci/emscripten:sdk-tag-1.38.22-64bit \ +docker run -v $(pwd):/root/project -w /root/project trzeci/emscripten:sdk-tag-1.39.3-64bit \ ./scripts/travis-emscripten/build_emscripten.sh $BUILD_DIR diff --git a/scripts/travis-emscripten/build_emscripten.sh b/scripts/travis-emscripten/build_emscripten.sh index 5c8a06e58f92..8011205db2cb 100755 --- a/scripts/travis-emscripten/build_emscripten.sh +++ b/scripts/travis-emscripten/build_emscripten.sh @@ -55,11 +55,11 @@ fi WORKSPACE=/root/project # Increase nodejs stack size -if ! [ -e /emsdk_portable/node/bin/node_orig ] +if ! [ -e /emsdk_portable/node/current/bin/node_orig ] then - mv /emsdk_portable/node/bin/node /emsdk_portable/node/bin/node_orig - echo -e '#!/bin/sh\nexec /emsdk_portable/node/bin/node_orig --stack-size=8192 $@' > /emsdk_portable/node/bin/node - chmod 755 /emsdk_portable/node/bin/node + mv /emsdk_portable/node/current/bin/node /emsdk_portable/node/current/bin/node_orig + echo -e '#!/bin/sh\nexec /emsdk_portable/node/current/bin/node_orig --stack-size=8192 $@' > /emsdk_portable/node/current/bin/node + chmod 755 /emsdk_portable/node/current/bin/node fi # Boost @@ -70,8 +70,8 @@ cd "$WORKSPACE"/boost_1_70_0 --with-system --with-filesystem --with-test --with-program_options cxxflags="-Wno-unused-local-typedef -Wno-variadic-macros -Wno-c99-extensions -Wno-all" \ --prefix="$WORKSPACE"/boost_1_70_0_install install ) -ln -sf "$WORKSPACE"/boost_1_70_0_install/lib/* /emsdk_portable/sdk/system/lib -ln -sf "$WORKSPACE"/boost_1_70_0_install/include/* /emsdk_portable/sdk/system/include +ln -sf "$WORKSPACE"/boost_1_70_0_install/lib/* /emsdk_portable/emscripten/sdk/system/lib +ln -sf "$WORKSPACE"/boost_1_70_0_install/include/* /emsdk_portable/emscripten/sdk/system/include echo -en 'travis_fold:end:compiling_boost\\r' echo -en 'travis_fold:start:install_cmake.sh\\r' @@ -94,8 +94,6 @@ make -j 4 cd .. mkdir -p upload -# Patch soljson.js to provide backwards-compatibility with older emscripten versions -echo ";/* backwards compatibility */ Module['Runtime'] = Module;" >> $BUILD_DIR/libsolc/soljson.js cp $BUILD_DIR/libsolc/soljson.js upload/ cp $BUILD_DIR/libsolc/soljson.js ./ diff --git a/scripts/travis-emscripten/emscripten.jam b/scripts/travis-emscripten/emscripten.jam index cff1977c5501..0cc92bd564df 100644 --- a/scripts/travis-emscripten/emscripten.jam +++ b/scripts/travis-emscripten/emscripten.jam @@ -1,4 +1,4 @@ -# This is a copy of emscripten.jam from https://github.com/tee3/boost-build-emscripten +# Modified version of emscripten.jam from https://github.com/tee3/boost-build-emscripten # which is released under the following license: # # Boost Software License - Version 1.0 - August 17th, 2003 @@ -55,12 +55,8 @@ rule init ( version ? : command * : options * ) { command = [ common.get-invocation-command emscripten : em++ : $(command) ] ; - root = ; if $(command) { - root = [ common.get-absolute-tool-path $(command[-1]) ] ; - root = $(root:P) ; - version ?= [ MATCH "^([0-9.]+)" : [ SHELL \""$(command)\" --version" ] ] ; if $(version) { @@ -83,15 +79,10 @@ rule init ( version ? : command * : options * ) # @todo this seems to be the right way, but this is a list somehow toolset.add-requirements emscripten:node ; - if $(.debug-configuration) - { - ECHO "emscripten: using compiler" $(version) "at" $(root) ; - } - - toolset.flags emscripten.compile STDHDRS $(condition) : $(root)/libexec/system/include ; - toolset.flags emscripten.link STDLIBPATH $(condition) : $(root)/libexec/system/lib ; - toolset.flags emscripten AR $(condition) : $(root)/bin/emar ; - toolset.flags emscripten RANLIB $(condition) : $(root)/bin/emranlib ; + toolset.flags emscripten.compile STDHDRS $(condition) : /emsdk_portable/emscripten/sdk/system/include ; + toolset.flags emscripten.link STDLIBPATH $(condition) : /emsdk_portable/emscripten/sdk/system/lib ; + toolset.flags emscripten AR $(condition) : /emsdk_portable/emscripten/sdk/emar ; + toolset.flags emscripten RANLIB $(condition) : /emsdk_portable/emscripten/sdk/emranlib ; } type.set-generated-target-suffix EXE : emscripten : js ; diff --git a/test/externalTests/common.sh b/test/externalTests/common.sh index dd9aa77aa80c..e5a2dd3e7e9a 100644 --- a/test/externalTests/common.sh +++ b/test/externalTests/common.sh @@ -37,7 +37,7 @@ function setup_solcjs cd "$dir" printLog "Setting up solc-js..." - git clone --depth 1 -b v0.5.0 https://github.com/ethereum/solc-js.git solc + git clone --depth 1 -b master https://github.com/ethereum/solc-js.git solc cd solc npm install @@ -107,7 +107,7 @@ function force_solc_truffle_modules if [ -d "$d" ]; then cd $d rm -rf solc - git clone --depth 1 -b v0.5.0 https://github.com/ethereum/solc-js.git solc + git clone --depth 1 -b master https://github.com/ethereum/solc-js.git solc cp "$1" solc/soljson.js fi )