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