From b72d2dff623665f42985ef9b6419636ca35a51d1 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Sun, 31 Mar 2024 09:19:47 +0200 Subject: feat: split MONERO and WOWNERO prefixed functions So basically: when we open the .so file, we define some symbols, and it appears that if we load something else, with the same symbols, under the same thread we cause some funky behaviour - like calling function a wownero function MONERO_Wallet_address() resulting in a monero address being generated. Needless to say, this is undesired, and a blocker for https://github.com/cypherstack/stack_wallet/pull/818 I'm afraid that this may not solve all of our issues (but will solve some significant roadblocks), because of the "genesis block" issue, as output of nm -gDC release/wownero/x86_64-linux-gnu_libwallet2_api_c.so | grep genesis indicate that these functions may share *something* in common across both WOW and XMR libraries. In a case in which this fix won't be sufficient, I think that the way forward would be to close the dynamic libraries, but before we do that I want to check if maybe there is a change to run multiple wallets at once. --- build_single.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'build_single.sh') diff --git a/build_single.sh b/build_single.sh index 85f1633..c1aa747 100755 --- a/build_single.sh +++ b/build_single.sh @@ -3,13 +3,13 @@ set -e repo=$1 if [[ "x$repo" == "x" ]]; then - echo "Usage: $0 monero/wownero" + echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$(nproc)" exit 1 fi if [[ "x$repo" != "xwownero" && "x$repo" != "xmonero" ]]; then - echo "Usage: $0 monero/wownero" + echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$(nproc)" echo "Invalid target given, only monero and wownero are supported targets" fi @@ -165,7 +165,7 @@ then ${HOST_ABI}-ranlib $PWD/$repo/contrib/depends/${HOST_ABI}/lib/libpolyseed.a fi -pushd libbridge +pushd ${repo}_libwallet2_api_c rm -rf build/${HOST_ABI} || true mkdir -p build/${HOST_ABI} -p cd build/${HOST_ABI} @@ -189,8 +189,8 @@ pushd release/$repo else APPENDIX="${APPENDIX}so" fi - xz -e ../../libbridge/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX} - mv ../../libbridge/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}.xz ${HOST_ABI}_libwallet2_api_c.${APPENDIX}.xz + xz -e ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX} + mv ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}.xz ${HOST_ABI}_libwallet2_api_c.${APPENDIX}.xz # Extra libraries if [[ "$HOST_ABI" == "x86_64-w64-mingw32" || "$HOST_ABI" == "i686-w64-mingw32" ]]; then -- cgit v1.2.3