patch m1/llvm14 (#50)

* patch wasm cmake

* patch UNL Report

* patch change

* patch import

* patch invoke

* patch xahau genesis test
This commit is contained in:
Denis Angell
2023-09-19 14:41:55 +02:00
committed by GitHub
parent b6b6e0fe5c
commit aa6d05c8b9
6 changed files with 13 additions and 8 deletions

View File

@@ -2,6 +2,8 @@
NIH dep: wasmedge: web assembly runtime for hooks.
#]===================================================================]
find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
@@ -24,6 +26,7 @@ ExternalProject_Add (wasmedge_src
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DLLVM_DIR=${LLVM_DIR}
-DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR}
-DLLVM_ENABLE_TERMINFO=OFF
$<$<NOT:$<BOOL:${is_multiconfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
$<$<BOOL:${MSVC}>:
"-DCMAKE_C_FLAGS=-GR -Gd -fp:precise -FS -MP -march=native"
@@ -63,4 +66,6 @@ set_target_properties (wasmedge PROPERTIES
"${wasmedge_src_BINARY_DIR}/include/api/"
)
target_link_libraries (ripple_libs INTERFACE wasmedge)
target_link_libraries(ripple_libs INTERFACE ${CURSES_LIBRARY})
target_link_libraries(ripple_libs INTERFACE xar)
add_library (NIH::WasmEdge ALIAS wasmedge)

View File

@@ -159,7 +159,7 @@ NegativeUNLVote::addReportingTx(
auto const& keyMap = app_.config().IMPORT_VL_KEYS;
for (auto const& [_, pk] : keyMap)
{
STTx repUnlTx(ttUNL_REPORT, [&](auto& obj)
STTx repUnlTx(ttUNL_REPORT, [pk = pk, seq](auto& obj)
{
obj.set(([&]()
{

View File

@@ -528,7 +528,7 @@ Change::activateXahauGenesis()
}
{
ripple::STArray hooks{sfHooks, genesis_hooks.size()};
ripple::STArray hooks{sfHooks, static_cast<int>(genesis_hooks.size())};
int hookCount = 0;
for (auto const& [hookOn, wasmBytes, params] : genesis_hooks)

View File

@@ -67,7 +67,7 @@ public:
uint64_t x = b + i * 5U;
if (x > i && x > b)
return XRPAmount{x};
return XRPAmount{static_cast<ripple::XRPAmount::value_type>(x)};
// fallback in case of overflow
return XRPAmount{2 * DROPS_PER_XRP};

View File

@@ -84,7 +84,7 @@ Invoke::calculateBaseFee(ReadView const& view, STTx const& tx)
XRPAmount extraFee{0};
if (tx.isFieldPresent(sfBlob))
extraFee += XRPAmount{ tx.getFieldVL(sfBlob).size() };
extraFee += XRPAmount{ static_cast<XRPAmount>(tx.getFieldVL(sfBlob).size()) };
if (tx.isFieldPresent(sfHookParameters))
{
@@ -98,7 +98,7 @@ Invoke::calculateBaseFee(ReadView const& view, STTx const& tx)
(param.isFieldPresent(sfHookParameterValue) ?
param.getFieldVL(sfHookParameterValue).size() : 0);
}
extraFee += XRPAmount { paramBytes };
extraFee += XRPAmount { static_cast<XRPAmount>(paramBytes) };
}
return Transactor::calculateBaseFee(view, tx) + extraFee;

View File

@@ -595,7 +595,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
}
uint8_t const key[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
topic1 == 'S' ? 0 : topic1, topic2};
static_cast<uint8_t>(topic1 == 'S' ? 0 : topic1), static_cast<uint8_t>(topic2)};
// check actioning prior to vote
{
auto entry = env.le(keylet::hookState(env.master.id(), uint256::fromVoid(key), beast::zero));
@@ -1592,7 +1592,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
}
uint8_t const key[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
topic1 == 'S' ? 0 : topic1, topic2};
static_cast<uint8_t>(topic1 == 'S' ? 0 : topic1), static_cast<uint8_t>(topic2)};
// check actioning prior to vote
{
auto entry = env.le(keylet::hookState(env.master.id(), uint256::fromVoid(key), beast::zero));
@@ -1697,7 +1697,7 @@ struct XahauGenesis_test : public beast::unit_test::suite
}
uint8_t const key[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
topic1 == 'S' ? 0 : topic1, topic2};
static_cast<uint8_t>(topic1 == 'S' ? 0 : topic1), static_cast<uint8_t>(topic2)};
// check actioning prior to vote
{
auto entry = env.le(keylet::hookState(