2
1

0007-Add-initial-support-of-ARC-architecture.patch 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. From a695eec2ef21240bbc6cd8cd1bdbab76f8da8dfd Mon Sep 17 00:00:00 2001
  2. From: Vineet Gupta <vgupta@synopsys.com>
  3. Date: Wed, 20 May 2015 10:37:25 +0300
  4. Subject: [PATCH 1/2] Add initial support of ARC architecture
  5. DesignWare ARC 700 and ARC HS38 are families of 32-bit CPUs
  6. developed by Synopsys, Inc.
  7. This change implements following:
  8. [1] Defines ARC as one embedded targets
  9. [2] Defines default tools prefixed for ARC like
  10. arc-linux-g++ etc
  11. [3] Defines "inotify" syscall numbers for ARC
  12. (note ARC fully compliant to Linux UAPI headers)
  13. [4] Disables 16-bit aligned data access
  14. For now we're using generic atomic ops even though it may
  15. introduce performance panalty.
  16. Change-Id: I91e879ac55c2f3643a544f97cd59671a81ccc3c2
  17. This patch was submited in upstream Qt4 and if it ever gets accepted,
  18. it should be removed from Buildroot.
  19. https://codereview.qt-project.org/#/c/112667
  20. ---
  21. configure | 6 ++++
  22. mkspecs/qws/linux-arc-g++/qmake.conf | 21 ++++++++++++++
  23. mkspecs/qws/linux-arc-g++/qplatformdefs.h | 42 +++++++++++++++++++++++++++
  24. src/corelib/arch/qatomic_arch.h | 2 ++
  25. src/corelib/io/qfilesystemwatcher_inotify.cpp | 5 ++++
  26. src/gui/painting/qblendfunctions.cpp | 4 +--
  27. 6 files changed, 78 insertions(+), 2 deletions(-)
  28. create mode 100644 mkspecs/qws/linux-arc-g++/qmake.conf
  29. create mode 100644 mkspecs/qws/linux-arc-g++/qplatformdefs.h
  30. diff --git a/configure b/configure
  31. index 10ad7ca..c7ef074 100755
  32. --- a/configure
  33. +++ b/configure
  34. @@ -2829,6 +2829,9 @@ if [ "$CFG_EMBEDDED" != "no" ]; then
  35. *86_64)
  36. CFG_EMBEDDED=x86_64
  37. ;;
  38. + *arc)
  39. + CFG_EMBEDDED=arc
  40. + ;;
  41. *)
  42. CFG_EMBEDDED=generic
  43. ;;
  44. @@ -3309,6 +3312,9 @@ if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
  45. arm*)
  46. CFG_ARCH=arm
  47. ;;
  48. + arc)
  49. + CFG_ARCH=arc
  50. + ;;
  51. *)
  52. CFG_ARCH="$CFG_EMBEDDED"
  53. ;;
  54. diff --git a/mkspecs/qws/linux-arc-g++/qmake.conf b/mkspecs/qws/linux-arc-g++/qmake.conf
  55. new file mode 100644
  56. index 0000000..a14587b
  57. --- /dev/null
  58. +++ b/mkspecs/qws/linux-arc-g++/qmake.conf
  59. @@ -0,0 +1,21 @@
  60. +#
  61. +# qmake configuration for building with arc-linux-g++
  62. +#
  63. +
  64. +include(../../common/linux.conf)
  65. +include(../../common/gcc-base-unix.conf)
  66. +include(../../common/g++-unix.conf)
  67. +include(../../common/qws.conf)
  68. +
  69. +# modifications to g++.conf
  70. +QMAKE_CC = arc-linux-gcc
  71. +QMAKE_CXX = arc-linux-g++
  72. +QMAKE_LINK = arc-linux-g++
  73. +QMAKE_LINK_SHLIB = arc-linux-g++
  74. +
  75. +# modifications to linux.conf
  76. +QMAKE_AR = arc-linux-ar cqs
  77. +QMAKE_OBJCOPY = arc-linux-objcopy
  78. +QMAKE_STRIP = arc-linux-strip
  79. +
  80. +load(qt_config)
  81. diff --git a/mkspecs/qws/linux-arc-g++/qplatformdefs.h b/mkspecs/qws/linux-arc-g++/qplatformdefs.h
  82. new file mode 100644
  83. index 0000000..a654aa7
  84. --- /dev/null
  85. +++ b/mkspecs/qws/linux-arc-g++/qplatformdefs.h
  86. @@ -0,0 +1,42 @@
  87. +/****************************************************************************
  88. +**
  89. +** Copyright (C) 2015 The Qt Company Ltd.
  90. +** Contact: http://www.qt.io/licensing/
  91. +**
  92. +** This file is part of the qmake spec of the Qt Toolkit.
  93. +**
  94. +** $QT_BEGIN_LICENSE:LGPL$
  95. +** Commercial License Usage
  96. +** Licensees holding valid commercial Qt licenses may use this file in
  97. +** accordance with the commercial license agreement provided with the
  98. +** Software or, alternatively, in accordance with the terms contained in
  99. +** a written agreement between you and The Qt Company. For licensing terms
  100. +** and conditions see http://www.qt.io/terms-conditions. For further
  101. +** information use the contact form at http://www.qt.io/contact-us.
  102. +**
  103. +** GNU Lesser General Public License Usage
  104. +** Alternatively, this file may be used under the terms of the GNU Lesser
  105. +** General Public License version 2.1 or version 3 as published by the Free
  106. +** Software Foundation and appearing in the file LICENSE.LGPLv21 and
  107. +** LICENSE.LGPLv3 included in the packaging of this file. Please review the
  108. +** following information to ensure the GNU Lesser General Public License
  109. +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
  110. +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  111. +**
  112. +** As a special exception, The Qt Company gives you certain additional
  113. +** rights. These rights are described in The Qt Company LGPL Exception
  114. +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  115. +**
  116. +** GNU General Public License Usage
  117. +** Alternatively, this file may be used under the terms of the GNU
  118. +** General Public License version 3.0 as published by the Free Software
  119. +** Foundation and appearing in the file LICENSE.GPL included in the
  120. +** packaging of this file. Please review the following information to
  121. +** ensure the GNU General Public License version 3.0 requirements will be
  122. +** met: http://www.gnu.org/copyleft/gpl.html.
  123. +**
  124. +** $QT_END_LICENSE$
  125. +**
  126. +****************************************************************************/
  127. +
  128. +#include "../../linux-g++/qplatformdefs.h"
  129. diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
  130. index d154b7e..a48c42a 100644
  131. --- a/src/corelib/arch/qatomic_arch.h
  132. +++ b/src/corelib/arch/qatomic_arch.h
  133. @@ -94,6 +94,8 @@ QT_BEGIN_HEADER
  134. # include "QtCore/qatomic_sh4a.h"
  135. #elif defined(QT_ARCH_NACL)
  136. # include "QtCore/qatomic_generic.h"
  137. +#elif defined(QT_ARCH_ARC)
  138. +# include "QtCore/qatomic_generic.h"
  139. #else
  140. # error "Qt has not been ported to this architecture"
  141. #endif
  142. diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp
  143. index 8bca422..e3e2565 100644
  144. --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
  145. +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
  146. @@ -143,6 +143,11 @@
  147. # define __NR_inotify_add_watch 27
  148. # define __NR_inotify_rm_watch 28
  149. // no inotify_init for aarch64
  150. +#elif defined (__arc__)
  151. +# define __NR_inotify_init 1043
  152. +# define __NR_inotify_add_watch 27
  153. +# define __NR_inotify_rm_watch 28
  154. +# define __NR_inotify_init1 26
  155. #else
  156. # error "This architecture is not supported. Please talk to qt-bugs@trolltech.com"
  157. #endif
  158. diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
  159. index de8790a..cc2f5b6 100644
  160. --- a/src/gui/painting/qblendfunctions.cpp
  161. +++ b/src/gui/painting/qblendfunctions.cpp
  162. @@ -309,9 +309,9 @@ template <typename T> void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl,
  163. const uchar *src = srcPixels + y * sbpl;
  164. const uchar *srcEnd = src + srcOffset;
  165. while (src < srcEnd) {
  166. -#if defined(QT_ARCH_ARMV5) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) || (defined(QT_ARCH_SPARC) && defined(Q_CC_GNU)) || (defined(QT_ARCH_INTEGRITY) && !defined(_X86_))
  167. +#if defined(QT_ARCH_ARMV5) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) || (defined(QT_ARCH_SPARC) && defined(Q_CC_GNU)) || (defined(QT_ARCH_INTEGRITY) && !defined(_X86_)) || defined(QT_ARCH_ARC)
  168. // non-16-bit aligned memory access is not possible on PowerPC,
  169. - // ARM <v6 (QT_ARCH_ARMV5) & SH & AVR32 & SPARC w/GCC
  170. + // ARM <v6 (QT_ARCH_ARMV5) & SH & AVR32 & SPARC w/GCC & ARC
  171. quint16 spix = (quint16(src[2])<<8) + src[1];
  172. #else
  173. quint16 spix = *(quint16 *) (src + 1);
  174. --
  175. 2.1.0