From d5439cebb49aa4ee2afcc1d05a5224633af1aa30 Mon Sep 17 00:00:00 2001 From: sumogr Date: Fri, 20 Mar 2020 20:03:03 +0000 Subject: [PATCH 1/6] [cmake] fix for building static on ubuntu xenial and other old linux versions --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d54206c831..ad8c0771d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -643,7 +643,7 @@ else() endif() # linker - if (NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))) + if (NOT WIN32 AND NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)) # Windows binaries die on startup with PIE when compiled with GCC <9.x add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS) endif() From d7483492ca91d3f259f541b83c3f7cb483d0bbae Mon Sep 17 00:00:00 2001 From: sumogr Date: Fri, 20 Mar 2020 20:21:19 +0000 Subject: [PATCH 2/6] retrigger workflow checks From fe2c7bfb1ed98a3872f259d2be1259bcd686cb38 Mon Sep 17 00:00:00 2001 From: sumogr Date: Sat, 21 Mar 2020 04:42:57 +0000 Subject: [PATCH 3/6] [depends] update qt 5.7.1 download link --- contrib/depends/packages/qt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/depends/packages/qt.mk b/contrib/depends/packages/qt.mk index 56fcbb171a..65618eb573 100644 --- a/contrib/depends/packages/qt.mk +++ b/contrib/depends/packages/qt.mk @@ -1,6 +1,6 @@ PACKAGE=qt $(package)_version=5.7.1 -$(package)_download_path=https://download.qt.io/archive/qt/5.7/5.7.1/submodules +$(package)_download_path=http://linorg.usp.br/Qt/archive/qt/5.7/5.7.1/submodules $(package)_suffix=opensource-src-$($(package)_version).tar.gz $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=95f83e532d23b3ddbde7973f380ecae1bac13230340557276f75f2e37984e410 From 0209cd6081bd6daae0ce08dca0d5522589dac36b Mon Sep 17 00:00:00 2001 From: Sumo Gr Date: Sun, 22 Mar 2020 00:52:17 +0200 Subject: [PATCH 4/6] [simplewallet] "trivial vanity display fix" --- src/simplewallet/simplewallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 465588b46f..9367158148 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3823,9 +3823,9 @@ bool simple_wallet::ask_wallet_create_if_needed() bool ok = true; if (!m_restoring) { - message_writer(console_color_yellow, true) << tr("No wallet found with that name. Confirm creation of new wallet named: "); + message_writer(console_color_yellow, true) << tr("No wallet found with that name. Creation of new wallet named:"); message_writer(console_color_green, true) << wallet_path; - confirm_creation = input_line("", true); + confirm_creation = input_line("Confirm creation?", true); if(std::cin.eof()) { LOG_ERROR("Unexpected std::cin.eof() - Exited simple_wallet::ask_wallet_create_if_needed()"); From c34400a2d7aa254f47fe116a8746370b3833c4d9 Mon Sep 17 00:00:00 2001 From: sumogr Date: Sun, 22 Mar 2020 14:03:29 +0000 Subject: [PATCH 5/6] [daemon] Modify show disk --- src/daemon/rpc_command_executor.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 2cd90fd1ef..cd519675ad 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -566,10 +566,14 @@ bool t_rpc_command_executor::show_disk() { } } - size_t chainsize = (ires.database_size)/1000000; + uint64_t chainsize = (ires.database_size)/1000000; uint64_t freespace = (ires.free_space)/1000000; - - std::cout << std:: endl << "\033[1mBlockchain db current size on disk: \033[0m" << "\033[32;1m" << chainsize << " MB" << "\033[0m" << " " << std::endl; + std::string os_version = tools::get_os_version_string(); + std::string win = "Windows"; + if (!(os_version.find(win) != std::string::npos)) + { + std::cout << std:: endl << "\033[1mBlockchain db current size on disk: \033[0m" << "\033[32;1m" << chainsize << " MB" << "\033[0m" << " " << std::endl; + } std::cout << "\033[1mRemaining disk space: \033[0m" << "\033[32;1m" << freespace << " MB" << "\033[0m" << std::endl; return true; @@ -646,8 +650,9 @@ bool t_rpc_command_executor::show_status() { bootstrap_msg += " was used before"; } } - size_t chainsize = (ires.database_size)/1000000; + uint64_t chainsize = (ires.database_size)/1000000; std::string os_version = tools::get_os_version_string(); + std::string win = "Windows"; std::string network_type = (ires.testnet ? "testnet" : ires.stagenet ? "stagenet" : "mainnet"); double perc = round(get_sync_percentage(ires)); std::stringstream str; @@ -676,8 +681,11 @@ bool t_rpc_command_executor::show_status() { std::cout << "\033[1mCurrent Height: \033[0m" << "\033[32;1m" << (unsigned long long)ires.height << "\033[0m" << " " << "\033[1mNetwork Height: \033[0m" << "\033[32;1m" << (unsigned long long)net_height << "\033[0m" << " " << "\033[1mSync percentage: \033[0m" << "\033[32;1m" << perc << "%" << "\033[0m" << " " << - "\033[1mBootstrap: \033[0m" << "\033[32;1m" << bootstrap_msg << "\033[0m" << std::endl << - "\033[1mBlockchain db current size on disk: \033[0m" << "\033[32;1m" << chainsize << " MB" << "\033[0m" << " " << std::endl; + "\033[1mBootstrap: \033[0m" << "\033[32;1m" << bootstrap_msg << "\033[0m" << std::endl; + if (!(os_version.find(win) != std::string::npos)) + { + std::cout << "\033[1mBlockchain db current size on disk: \033[0m" << "\033[32;1m" << chainsize << " MB" << "\033[0m" << " " << std::endl; + } std::cout << "\033[1m------------" << std::endl; std::cout << "NETWORK INFO" << std::endl; std::cout << "------------\033[0m" << std::endl; From 57699a0487ff95fd2838dffb9d5ecd76cba1f843 Mon Sep 17 00:00:00 2001 From: Sumo Gr Date: Mon, 23 Mar 2020 07:18:27 +0200 Subject: [PATCH 6/6] [MSYS2] Fix broken lib linker Due to a recent msys2 bug with -D_FORTIFY_SOURCE and -fstack-protector flags (Ref: https://github.com/msys2/MINGW-packages/issues/5868) libssp dynamic library (dll) was missing when trying to run blockchain utilities as it now needs to add -fstack-protector explicitely to this EXEs for -lssp to be added. Link lssp directly to these binaries --- src/blockchain_utilities/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/blockchain_utilities/CMakeLists.txt b/src/blockchain_utilities/CMakeLists.txt index a2ce69654b..da0b00b10d 100644 --- a/src/blockchain_utilities/CMakeLists.txt +++ b/src/blockchain_utilities/CMakeLists.txt @@ -174,7 +174,7 @@ endif() if (WIN32) add_custom_command(TARGET utilities_menu POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-utilities-menu.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-utilities-menu.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() set(CMAKE_EXE_LINKER_FLAGS "${LD_BACKCOMPAT_FLAGS}") @@ -210,7 +210,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_import POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-import.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-import.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_export @@ -240,7 +240,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_export POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-export.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-export.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_blackball @@ -271,7 +271,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_blackball POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-mark-spent-outputs.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-mark-spent-outputs.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_usage @@ -301,7 +301,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_usage POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-usage.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-usage.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_ancestry @@ -331,7 +331,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_ancestry POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-ancestry.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-ancestry.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_depth @@ -361,7 +361,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_depth POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-depth.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-depth.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_stats @@ -391,7 +391,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_stats POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-stats.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-stats.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_prune_known_spent_data @@ -422,7 +422,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_prune_known_spent_data POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-prune-known-spent-data.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-prune-known-spent-data.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() monero_add_executable(blockchain_prune @@ -440,7 +440,7 @@ endif() if (WIN32) add_custom_command(TARGET blockchain_prune POST_BUILD COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/bin/sumo-blockchain-prune.exe ${CMAKE_BINARY_DIR}/bin/blockchain_utilities/sumo-blockchain-prune.exe) -set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") +set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lssp -lpthread -Wl,-Bdynamic ${CMAKE_CXX_STANDARD_LIBRARIES}") endif() target_link_libraries(blockchain_prune