diff -Nur a/src/qt-console/bat.pro.in b/src/qt-console/bat.pro.in
--- a/src/qt-console/bat.pro.in	2023-06-05 16:36:20.200951580 +0800
+++ b/src/qt-console/bat.pro.in	2023-06-05 16:37:07.576951580 +0800
@@ -26,7 +26,7 @@
 LIBS        += -L../lib -lbaccfg -lbac -L../findlib -lbacfind @OPENSSL_LIBS@
 LIBTOOL_LINK = @QMAKE_LIBTOOL@ --silent --tag=CXX --mode=link
 LIBTOOL_INSTALL = @QMAKE_LIBTOOL@ --silent --mode=install
-QMAKE_LINK   = $${LIBTOOL_LINK} $(CXX)
+QMAKE_LINK   = $${LIBTOOL_LINK} $(CXX) -fPIE -Wl,-pie
 QMAKE_INSTALL_PROGRAM = $${LIBTOOL_INSTALL} install -m @SBINPERM@ -p
 QMAKE_CLEAN += .libs/* bat
 
diff -Nur a/src/qt-console/tray-monitor/tray-monitor.pro.in b/src/qt-console/tray-monitor/tray-monitor.pro.in
--- a/src/qt-console/tray-monitor/tray-monitor.pro.in	2023-06-05 16:36:20.208951580 +0800
+++ b/src/qt-console/tray-monitor/tray-monitor.pro.in	2023-06-05 16:37:53.676951580 +0800
@@ -37,7 +37,7 @@
 INCLUDEPATH += ../.. . 
 LIBTOOL_LINK = @QMAKE_LIBTOOL@ --silent --tag=CXX --mode=link
 LIBTOOL_INSTALL = @QMAKE_LIBTOOL@ --silent --mode=install
-QMAKE_LINK   = $${LIBTOOL_LINK} $(CXX)
+QMAKE_LINK   = $${LIBTOOL_LINK} $(CXX) -fPIE -Wl,-pie
 QMAKE_INSTALL_PROGRAM = $${LIBTOOL_INSTALL} install -m @SBINPERM@ -p
 QMAKE_CLEAN += obj/* .libs/* bacula-tray-monitor release/bacula-tray-monitor
 QMAKE_CXXFLAGS += -DTRAY_MONITOR
