UICommon.so needs the rpath for Qt5 libs too

--- VirtualBox-7.0.18/Config.kmk.orig
+++ VirtualBox-7.0.18/Config.kmk
@@ -7932,7 +7932,7 @@
     	/usr/local/lib
    endif
    ifeq ($(KBUILD_TARGET),solaris)
-    TEMPLATE_VBoxQtGuiExe_LDFLAGS.solaris = -Wl,-z,ignore # Same as VBOX_LD_as_needed.
+    TEMPLATE_VBoxQtGuiExe_LDFLAGS.solaris = -Wl,-z,ignore '$(VBOX_GCC_RPATH_OPT)$(VBOX_PATH_QT_LIB)' # Same as VBOX_LD_as_needed.
     TEMPLATE_VBoxQtGuiExe_LIBS += \
     	rt socket nsl
    endif
diff --git a/configure b/configure
index c1c2965..82c9971 100755
--- a/configure
+++ b/configure
@@ -1699,7 +1699,8 @@ EOF
           # store only the first path, remove all other paths
           # most likely pkg-config gave us -I/usr/include/qt6 -I/usr/include/qt6/QtCore
           INCQT6=`echo "$INCQT6"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
-          cnf_append "VBOX_PATH_QT_LIB" "`strip_L "$LIBQT6"`"
+          # This is not quite right since the qt libpath does not have to be first but only one entry works...
+          cnf_append "VBOX_PATH_QT_LIB" '$'"(firstword `strip_L "$LIBQT6"`)"
           cnf_append "PATH_SDK_QT6_INC" "$INCQT6"
           # This is not quite right since the qt libpath does not have to be first...
           cnf_append "PATH_SDK_QT6_LIB" '$'"(firstword `strip_L "$LIBQT6"`)"