From dd91f8d46dbdf62cc276bc204425c4ae106d913e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?= Date: Fri, 14 Mar 2014 19:33:54 -0300 Subject: Enable sparc detection. It has been working in Debian for some time. It also adds detection for 64bits Sparc. Change-Id: Ie4fc0f58b37672b79191ebe51de0caf2eaf8a1d9 Reviewed-by: Thiago Macieira --- src/corelib/global/qprocessordetection.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index 384df8fd54..c9fb728593 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -294,12 +294,15 @@ SPARC is big-endian only prior to V9, while V9 is bi-endian with big-endian as the default byte order. Assume all SPARC systems are big-endian. */ -// #elif defined(__sparc__) -// # define Q_PROCESSOR_SPARC -// # if defined(__sparc_v9__) -// # define Q_PROCESSOR_SPARC_V9 -// # endif -// # define Q_BYTE_ORDER Q_BIG_ENDIAN +#elif defined(__sparc__) +# define Q_PROCESSOR_SPARC +# if defined(__sparc_v9__) +# define Q_PROCESSOR_SPARC_V9 +# endif +# if defined(__sparc64__) +# define Q_PROCESSOR_SPARC_64 +# endif +# define Q_BYTE_ORDER Q_BIG_ENDIAN #endif -- cgit v1.2.3 From 60b6b28c213a420ee40e254ff1823876098e0a04 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 10 Nov 2013 23:20:46 +0100 Subject: Support MIPS atomic on pre-MIPS32 architectures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The atomic functions on MIPS are based on the sync opcode with an immediate argument, which is something introduced in the MIPS32 instruction set. This prevent to use Qt on pre-MIPS32 CPU, like the Loongson 2 CPU. However some of the pre-MIPS32 CPUs interprets the sync opcode with and immediate argument as a sync opcode without argument (which is a stronger ordering than with the argument), and for the others the kernel emulates it. It is therefore fine to use the current MIPS atomic functions on pre-MIPS32 CPU. This patch allows that by temporarily changing the instruction set to MIPS32 around the sync instruction, so that binutils doesn't choke on it. Change-Id: I9cc984bd55b5f172736ce9e638a6f4e271b79fe7 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Thiago Macieira --- src/corelib/arch/qatomic_mips.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h index 463612212b..7bfe16a450 100644 --- a/src/corelib/arch/qatomic_mips.h +++ b/src/corelib/arch/qatomic_mips.h @@ -110,13 +110,19 @@ template struct QAtomicOps : QBasicAtomicOps template template inline void QBasicAtomicOps::acquireMemoryFence(const T &) Q_DECL_NOTHROW { - asm volatile ("sync 0x11" ::: "memory"); + asm volatile (".set push\n" + ".set mips32\n" + "sync 0x11\n" + ".set pop\n" ::: "memory"); } template template inline void QBasicAtomicOps::releaseMemoryFence(const T &) Q_DECL_NOTHROW { - asm volatile ("sync 0x12" ::: "memory"); + asm volatile (".set push\n" + ".set mips32\n" + "sync 0x11\n" + ".set pop\n" ::: "memory"); } template template inline -- cgit v1.2.3 From 3866c89dee50e3a1156097f3f866e280b327ba28 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 16 Jul 2014 18:39:40 -0700 Subject: Work around ICC bug in local static symbols for Q_GLOBAL_STATIC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling the innerFunction() of the Q_GLOBAL_STATIC expansion, ICC emits global symbols for the internal "holder" local static variable and its guard. If there are two global statics of the same name in two different .cpp files, the linker will incorrectly merge the two "holder" variables. This was noted between the "customTypes" global statics of qmetatype.cpp and qdbusmetatype.cpp in a static build. The C++ standard requires that local static variables declared in inline functions must be the same, regardless of whether the body of the function got inlined or not. The IA-64 C++ ABI does that by requiring local static symbols for inline functions to be global and mergeable ("link once"). However, two functions in anonymous namespaces in different files are not considered to be the same function, so their local statics should not be merged. This is where ICC failed: the local statics are global and mergeable, even though the function is in an anonymous namespace. ICC correctly emits the function itself as a local symbol. Alternative solutions were: 1) add "static", but you can't use a static symbol in a template parameter in C++98 mode 2) remove the "inline" keyword, but then GCC 4.8 will not inline Intel issue ID: 6000058488 Task-number: QTBUG-40053 Change-Id: I307622222499682dde711b2771c8cf7557400799 Reviewed-by: Jędrzej Nowacki --- src/corelib/global/qglobalstatic.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h index ad39452cf4..1c44569dbd 100644 --- a/src/corelib/global/qglobalstatic.h +++ b/src/corelib/global/qglobalstatic.h @@ -68,8 +68,17 @@ enum GuardValues { // until the constructor returns ... // We better avoid these kind of problems by using our own locked implementation. +#if defined(Q_OS_UNIX) && defined(Q_CC_INTEL) +// Work around Intel issue ID 6000058488: +// local statics inside an inline function inside an anonymous namespace are global +// symbols (this affects the IA-64 C++ ABI, so OS X and Linux only) +# define Q_GLOBAL_STATIC_INTERNAL_DECORATION Q_DECL_HIDDEN +#else +# define Q_GLOBAL_STATIC_INTERNAL_DECORATION Q_DECL_HIDDEN inline +#endif + #define Q_GLOBAL_STATIC_INTERNAL(ARGS) \ - Q_DECL_HIDDEN inline Type *innerFunction() \ + Q_GLOBAL_STATIC_INTERNAL_DECORATION Type *innerFunction() \ { \ struct HolderBase { \ ~HolderBase() Q_DECL_NOTHROW \ -- cgit v1.2.3