From a44d15a7e9cdd1a87d028cc409c5a097ae9a278b Mon Sep 17 00:00:00 2001 From: "moneromooo.monero" Date: Sat, 3 Mar 2018 22:56:38 +0000 Subject: [PATCH 1/4] get_libwallet_api.sh: fix debug/release hardcoded path --- get_libwallet_api.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index 9b42cfce..b6fc3589 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -122,8 +122,8 @@ rm -fr $MONERO_DIR/include rm -fr $MONERO_DIR/bin -mkdir -p $MONERO_DIR/build/release -pushd $MONERO_DIR/build/release +mkdir -p $MONERO_DIR/build/$BUILD_TYPE +pushd $MONERO_DIR/build/$BUILD_TYPE # reusing function from "utils.sh" platform=$(get_platform) @@ -209,7 +209,7 @@ if test -z "$CPU_CORE_COUNT"; then fi # Build libwallet_merged -pushd $MONERO_DIR/build/release/src/wallet +pushd $MONERO_DIR/build/$BUILD_TYPE/src/wallet eval $make_exec version -C ../.. eval $make_exec -j$CPU_CORE_COUNT eval $make_exec install -j$CPU_CORE_COUNT @@ -218,21 +218,21 @@ popd # Build monerod # win32 need to build daemon manually with msys2 toolchain if [ "$platform" != "mingw32" ] && [ "$ANDROID" != true ]; then - pushd $MONERO_DIR/build/release/src/daemon + pushd $MONERO_DIR/build/$BUILD_TYPE/src/daemon eval make -j$CPU_CORE_COUNT eval make install -j$CPU_CORE_COUNT popd fi # build install epee -eval make -C $MONERO_DIR/build/release/contrib/epee all install +eval make -C $MONERO_DIR/build/$BUILD_TYPE/contrib/epee all install # install easylogging -eval make -C $MONERO_DIR/build/release/external/easylogging++ all install +eval make -C $MONERO_DIR/build/$BUILD_TYPE/external/easylogging++ all install # Install libunwind echo "Installing libunbound..." -pushd $MONERO_DIR/build/release/external/unbound +pushd $MONERO_DIR/build/$BUILD_TYPE/external/unbound # no need to make, it was already built as dependency for libwallet # make -j$CPU_CORE_COUNT $make_exec install -j$CPU_CORE_COUNT From 8b97eed79c560b74adb84f0ea6b2f935edbe2e14 Mon Sep 17 00:00:00 2001 From: "moneromooo.monero" Date: Sat, 3 Mar 2018 22:56:52 +0000 Subject: [PATCH 2/4] monero-wallet-gui.pro: use hardening flags --- monero-wallet-gui.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/monero-wallet-gui.pro b/monero-wallet-gui.pro index c92550a9..94c675bf 100644 --- a/monero-wallet-gui.pro +++ b/monero-wallet-gui.pro @@ -116,6 +116,8 @@ android { +QMAKE_CXXFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wformat -Wformat-security -fstack-protector -fstack-protector-strong +QMAKE_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wformat -Wformat-security -fstack-protector -fstack-protector-strong ios { message("Host is IOS") @@ -236,6 +238,7 @@ win32 { message("Target is 64bit") } + QMAKE_LFLAGS += -Wl,--dynamicbase -Wl,--nxcompat } linux { @@ -276,6 +279,8 @@ linux { message(Building with libunwind) LIBS += -Wl,-Bdynamic -lunwind } + + QMAKE_LFLAGS += -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack } macx { @@ -300,6 +305,7 @@ macx { -lcrypto \ -ldl + QMAKE_LFLAGS += -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack } From 986275c42c60223b1fedcf8688d8026dbad7b792 Mon Sep 17 00:00:00 2001 From: "moneromooo.monero" Date: Sat, 3 Mar 2018 22:57:18 +0000 Subject: [PATCH 3/4] get_libwallet_api.sh: fix comment referencing the wrong library --- get_libwallet_api.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index b6fc3589..96e0ac41 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -230,7 +230,7 @@ eval make -C $MONERO_DIR/build/$BUILD_TYPE/contrib/epee all install # install easylogging eval make -C $MONERO_DIR/build/$BUILD_TYPE/external/easylogging++ all install -# Install libunwind +# Install libunbound echo "Installing libunbound..." pushd $MONERO_DIR/build/$BUILD_TYPE/external/unbound # no need to make, it was already built as dependency for libwallet From f45b0a7d25920f445d83d14415791dda48b8185c Mon Sep 17 00:00:00 2001 From: "moneromooo.monero" Date: Sat, 3 Mar 2018 23:01:03 +0000 Subject: [PATCH 4/4] main: do not crash if we can't load some stuff This happens with some Qt widgets/components aren't found --- main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.cpp b/main.cpp index 08bcb9e3..fba82fec 100644 --- a/main.cpp +++ b/main.cpp @@ -255,7 +255,17 @@ int main(int argc, char *argv[]) // Load main window (context properties needs to be defined obove this line) engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); + if (engine.rootObjects().isEmpty()) + { + qCritical() << "Error: no root objects"; + return 1; + } QObject *rootObject = engine.rootObjects().first(); + if (!rootObject) + { + qCritical() << "Error: no root objects"; + return 1; + } #ifdef WITH_SCANNER QObject *qmlCamera = rootObject->findChild("qrCameraQML");