CopperSpice on arm target

Discuss issues related to installing or building
Post Reply
john
Posts: 2
Joined: Fri Oct 09 2020 6:48 am

CopperSpice on arm target

Post by john »

Hi,
This project is really awesome, great job everyone and thank you for all your efforts.

I'm trying to make my qt app run on my ARM target device, but using copperspice instead of qt.

So far I've noted ARM isn't yet an officially supported target, and I've worked around that by changing src/core/global/qglobal.h to #define Q_PROCESSOR_ARM instead of bailing out with an error.

What are your thoughts on this endeavor? Is ARM something you would eventually like to support or are there any major obstacles that could make it not worth while?

I guess I'm just looking for a general discussion before spending too much time on something that you've already deemed pointless.

Thanks again.

barbara
Posts: 200
Joined: Sat Apr 04 2015 2:32 am

Re: CopperSpice on arm target

Post by barbara »

Thank you so much for your interest in CopperSpice. We are absolutely interested in supporting ARM processors and would greatly appreciate working with you to ensure this happens. Please let us know what you have found or where you might need some assistance. The team will do our very best to help out. Pull requests are more than welcome.

Can you let us know what target hardware you are using and any other relevant information.

We look forward to working with you.

Barbara

john
Posts: 2
Joined: Fri Oct 09 2020 6:48 am

Re: CopperSpice on arm target

Post by john »

My target is something that resembles a raspberry pi in that it has an arm cpu, and a gpu that's GLESv2 capable.
I will later try to make copperspice render to a framebuffer device, but for now my experiments is focused around making CsCore build.

The most important change would be to add the Q_PROCESSOR_ARM:

Code: Select all

diff --git a/src/core/global/qglobal.h b/src/core/global/qglobal.h
index 2842c30c5..f1931c03c 100755
--- a/src/core/global/qglobal.h
+++ b/src/core/global/qglobal.h
@@ -84,6 +84,8 @@
 
 #  endif
 
+#elif defined(__ARM_ARCH)
+#  define Q_PROCESSOR_ARM
 #else
 #error Unable to detect system architecture, contact CopperSpice development
 
Then there's a couple of small things for cscore:
copperspice/src/core/string/qstring8.cpp:657:29: error: conversion from ‘wchar_t’ to ‘QChar32’ is ambiguous
Same goes for qstring16.cpp:658.
I'm not too familiar with wchar_t, but it seems it's not the same size as char16_t on arm, so likely 4 bytes. Perhaps one could use the gcc define __ARM_SIZEOF_WCHAR_T?

Not sure if this one is a good idea:

Code: Select all

diff --git a/src/core/string/qstring8.cpp b/src/core/string/qstring8.cpp
index 4fd4b5266..1acc201a9 100644
--- a/src/core/string/qstring8.cpp
+++ b/src/core/string/qstring8.cpp
@@ -654,7 +654,7 @@ QString8 QString8::fromStdWString(const std::wstring &str, size_type numOfChars)
             break;
          }
 
-         retval.push_back(ch);
+         retval.push_back(static_cast<char32_t>(ch));
          --numOfChars;
       }
    }
I was able to set up cmake to only build CsCore, and then I went on to add CsGui and opengl. cmake then tried to build the rcc tool, but that one had a dependency on XML, so I had to add that too in order to make it move on to building CsGui.

To complicate matters even more, I eventually have to builds copperspice with openembedded, and I haven't quite nailed putting together a working recipe file there yet.

Post Reply