diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d38499d2b0..12eaac641fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(eosio_cdt) set(VERSION_MAJOR 1) set(VERSION_MINOR 4) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") diff --git a/InstallClang.txt b/InstallClang.txt index a2cff9f9068..b52ee3af561 100644 --- a/InstallClang.txt +++ b/InstallClang.txt @@ -10,7 +10,7 @@ endmacro( eosio_clang_install ) macro( eosio_clang_install_and_symlink file symlink ) set(BINARY_DIR ${CMAKE_BINARY_DIR}/EosioClang-prefix/src/EosioClang-build/bin) add_custom_command( TARGET EosioClang POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/${file} ${CMAKE_BINARY_DIR}/bin/ ) - add_custom_command( TARGET EosioClang POST_BUILD COMMAND ln -sf ${CMAKE_BINARY_DIR}/bin/${file} ${CMAKE_BINARY_DIR}/bin/${symlink} ) + add_custom_command( TARGET EosioClang POST_BUILD COMMAND cd ${CMAKE_BINARY_DIR}/bin && ln -sf ${file} ${symlink} ) install(FILES ${BINARY_DIR}/${file} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) @@ -27,7 +27,7 @@ endmacro( eosio_tool_install ) macro( eosio_tool_install_and_symlink file symlink ) set(BINARY_DIR ${CMAKE_BINARY_DIR}/EosioTools-prefix/src/EosioTools-build/bin) add_custom_command( TARGET EosioTools POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/${file} ${CMAKE_BINARY_DIR}/bin/ ) - add_custom_command( TARGET EosioTools POST_BUILD COMMAND ln -sf ${CMAKE_BINARY_DIR}/bin/${file} ${CMAKE_BINARY_DIR}/bin/${symlink} ) + add_custom_command( TARGET EosioTools POST_BUILD COMMAND cd ${CMAKE_BINARY_DIR}/bin && ln -sf ${file} ${symlink} ) install(FILES ${BINARY_DIR}/${file} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) diff --git a/README.md b/README.md index 3009b26bb75..2eb9bcbdb44 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # EOSIO.CDT (Contract Development Toolkit) -## Version : 1.4.0 +## Version : 1.4.1 EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to facilitate contract writing for the EOSIO platform. In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that EOSIO.CDT has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. @@ -22,21 +22,32 @@ $ brew remove eosio.cdt ``` #### Debian Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.4.0/eosio.cdt-1.4.0.x86_64.deb -$ sudo apt install ./eosio.cdt-1.4.0.x86_64.deb +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.4.1/eosio.cdt-1.4.1.x86_64.deb +$ sudo apt install ./eosio.cdt-1.4.1.x86_64.deb ``` #### Debian Package Uninstall ```sh $ sudo apt remove eosio.cdt ``` -#### RPM Package Install +#### Fedora RPM Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.4.0/eosio.cdt-1.4.0.x86_64-0.x86_64.rpm -$ sudo yum install ./eosio.cdt-1.4.0.x86_64-0.x86_64.rpm +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.4.1/eosio.cdt-fedora-1.4.1.x86_64-0.x86_64.rpm +$ sudo yum install ./eosio.cdt-fedora-1.4.1.x86_64-0.x86_64.rpm ``` -#### RPM Package Uninstall +#### Fedora RPM Package Uninstall +```sh +$ sudo yum remove eosio.cdt +``` + +#### Centos RPM Package Install +```sh +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.4.1/eosio.cdt-centos-1.4.1.x86_64-0.x86_64.rpm +$ sudo yum install ./eosio.cdt-centos-1.4.1.x86_64-0.x86_64.rpm +``` + +#### Centos RPM Package Uninstall ```sh $ sudo yum remove eosio.cdt ``` diff --git a/libraries/eosiolib/fixed_key.hpp b/libraries/eosiolib/fixed_key.hpp index 33d5c81ce28..2484fc1a30b 100644 --- a/libraries/eosiolib/fixed_key.hpp +++ b/libraries/eosiolib/fixed_key.hpp @@ -63,7 +63,7 @@ namespace eosio { const size_t sub_word_shift = 8 * sizeof(Word); const size_t num_sub_words = sizeof(word_t) / sizeof(Word); auto sub_words_left = num_sub_words; - for( Word w_itr = arr_begin; w_itr != arr_end; ++w_itr ) { + for( auto w_itr = arr_begin; w_itr != arr_end; ++w_itr ) { if( sub_words_left > 1 ) { temp_word |= static_cast(*w_itr); temp_word <<= sub_word_shift; diff --git a/libraries/eosiolib/multi_index.hpp b/libraries/eosiolib/multi_index.hpp index bfc28df5729..c56f82a0a89 100644 --- a/libraries/eosiolib/multi_index.hpp +++ b/libraries/eosiolib/multi_index.hpp @@ -112,7 +112,8 @@ struct secondary_index_db_functions {\ #define MAKE_TRAITS_FOR_ARITHMETIC_SECONDARY_KEY(TYPE)\ template<>\ struct secondary_key_traits {\ - static constexpr TYPE lowest() { return std::numeric_limits::lowest(); }\ + static_assert( std::numeric_limits::is_specialized, "TYPE does not have specialized numeric_limits" );\ + static constexpr TYPE true_lowest() { return std::numeric_limits::lowest(); }\ }; namespace _multi_index_detail { @@ -132,21 +133,27 @@ namespace _multi_index_detail { MAKE_TRAITS_FOR_ARITHMETIC_SECONDARY_KEY(uint128_t) WRAP_SECONDARY_SIMPLE_TYPE(idx_double, double) - MAKE_TRAITS_FOR_ARITHMETIC_SECONDARY_KEY(double) + template<> + struct secondary_key_traits { + static constexpr double true_lowest() { return -std::numeric_limits::infinity(); } + }; WRAP_SECONDARY_SIMPLE_TYPE(idx_long_double, long double) - MAKE_TRAITS_FOR_ARITHMETIC_SECONDARY_KEY(long double) + template<> + struct secondary_key_traits { + static constexpr long double true_lowest() { return -std::numeric_limits::infinity(); } + }; WRAP_SECONDARY_ARRAY_TYPE(idx256, eosio::key256) template<> struct secondary_key_traits { - static constexpr eosio::key256 lowest() { return eosio::key256(); } + static constexpr eosio::key256 true_lowest() { return eosio::key256(); } }; WRAP_SECONDARY_ARRAY_TYPE(idx256, eosio::fixed_bytes<32>) template<> struct secondary_key_traits> { - static constexpr eosio::fixed_bytes<32> lowest() { return eosio::fixed_bytes<32>(); } + static constexpr eosio::fixed_bytes<32> true_lowest() { return eosio::fixed_bytes<32>(); } }; } @@ -419,7 +426,7 @@ class multi_index const_iterator cbegin()const { using namespace _multi_index_detail; - return lower_bound( secondary_key_traits::lowest() ); + return lower_bound( secondary_key_traits::true_lowest() ); } const_iterator begin()const { return cbegin(); } diff --git a/libraries/eosiolib/name.hpp b/libraries/eosiolib/name.hpp index 8e1a007affb..e3d9cac2a44 100644 --- a/libraries/eosiolib/name.hpp +++ b/libraries/eosiolib/name.hpp @@ -218,5 +218,6 @@ namespace eosio { */ template inline constexpr eosio::name operator""_n() { - return eosio::name{std::string_view{eosio::detail::to_const_char_arr::value, sizeof...(Str)}}; + constexpr auto x = eosio::name{std::string_view{eosio::detail::to_const_char_arr::value, sizeof...(Str)}}; + return x; } diff --git a/modules/EosioWasmToolchain.cmake.in b/modules/EosioWasmToolchain.cmake.in index b60cd9ca4cb..77714be1f32 100644 --- a/modules/EosioWasmToolchain.cmake.in +++ b/modules/EosioWasmToolchain.cmake.in @@ -3,12 +3,12 @@ set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_CROSSCOMPILING 1) set(CMAKE_C_COMPILER_WORKS 1) set(CMAKE_CXX_COMPILER_WORKS 1) -set(CMAKE_CXX_STANDARD 17) + set(EOSIO_CDT_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") set(EOSIO_WASMSDK_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") -set(CMAKE_C_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cc") -set(CMAKE_CXX_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cpp") +set(CMAKE_C_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cc" CACHE PATH "cc" FORCE) +set(CMAKE_CXX_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cpp" CACHE PATH "cxx" FORCE) set(CMAKE_C_FLAGS " -O3 ") set(CMAKE_CXX_FLAGS " -O3 ") @@ -37,7 +37,6 @@ include_directories( macro(add_contract CONTRACT_NAME TARGET) add_executable( ${TARGET}.wasm ${ARGN} ) target_compile_options( ${TARGET}.wasm PUBLIC -abigen ) - set_target_properties( ${TARGET}.wasm PROPERTIES LINKER_LANGUAGE C ) get_target_property(BINOUTPUT ${TARGET}.wasm BINARY_DIR) target_compile_options( ${TARGET}.wasm PUBLIC -abigen_output=${BINOUTPUT}/${TARGET}.abi ) target_compile_options( ${TARGET}.wasm PUBLIC -contract ${CONTRACT_NAME} ) diff --git a/scripts/generate_bottle.sh b/scripts/generate_bottle.sh index d279f744536..4feac525f94 100644 --- a/scripts/generate_bottle.sh +++ b/scripts/generate_bottle.sh @@ -1,6 +1,18 @@ #! /bin/bash -NAME="${PROJECT}-${VERSION}.high_sierra.bottle.tar.gz" +VERS=`sw_vers -productVersion | awk '/10\.13\..*/{print $0}'` +if [[ -z "$VERS" ]]; +then + VERS=`sw_vers -productVersion | awk '/10\.14.*/{print $0}'` + if [[ -z "$VERS" ]]; + then + echo "Error, unsupported OS X version" + exit -1 + fi + MAC_VERSION="mojave" +else + MAC_VERSION="high_sierra" +fi mkdir -p ${PROJECT}/${VERSION}/opt/eosio_cdt/lib/cmake @@ -42,7 +54,7 @@ echo "class EosioCdt < Formula bottle do root_url \"https://github.com/eosio/eosio.cdt/releases/download/v${VERSION}\" - sha256 \"${hash}\" => :high_sierra + sha256 \"${hash}\" => :${MAC_VERSION} end def install raise \"Error, only supporting binary packages at this time\"