From f4e0ffb11c158908cfc33df1e06fcd032501ef1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tero=20Alam=C3=A4ki?= Date: Thu, 27 Jul 2017 11:43:38 +0300 Subject: [PATCH] Enable custom shared memory schemes on INTEGRITY Replaced dependency to libdl.a with libshm_client.a. Defined symbols 'shm_area_password' and 'shm_area_name' internally. The build for INTEGRITY is static only so libdl.a is not needed. Change-Id: I7e34528835132d79ea582a30cf9ff61cdda198da Reviewed-by: Oswald Buddenhagen Reviewed-by: Rolland Dudemaine Reviewed-by: Thiago Macieira --- mkspecs/common/ghs-base.conf | 2 +- src/corelib/global/qglobal.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mkspecs/common/ghs-base.conf b/mkspecs/common/ghs-base.conf index bd1f3eb5ab..addc05241c 100644 --- a/mkspecs/common/ghs-base.conf +++ b/mkspecs/common/ghs-base.conf @@ -39,4 +39,4 @@ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_LFLAGS_RELEASE -g QMAKE_LFLAGS_CXX11 += --c++11 --thread_local_storage QMAKE_LFLAGS_EXCEPTIONS_ON += --exceptions -QMAKE_LIBS_CORE = -lposix -livfs -lsocket -lnet -ldl +QMAKE_LIBS_CORE = -lposix -livfs -lsocket -lnet -lshm_client diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4223d2a3e1..12e908f09f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -95,6 +95,19 @@ #include #endif +#if defined(Q_OS_INTEGRITY) +extern "C" { + // Function mmap resides in libshm_client.a. To be able to link with it one needs + // to define symbols 'shm_area_password' and 'shm_area_name', because the library + // is meant to allow the application that links to it to use POSIX shared memory + // without full system POSIX. +# pragma weak shm_area_password +# pragma weak shm_area_name + char *shm_area_password = "dummy"; + char *shm_area_name = "dummy"; +} +#endif + #include "archdetect.cpp" #ifdef qFatal