[Development] Porting QT to new OS

Thiago Macieira thiago.macieira at intel.com
Thu Nov 7 06:42:20 CET 2019

On Wednesday, 6 November 2019 20:41:10 PST martin ribelotta wrote:
> This question is in the air time to time but the information is very
> disperse and not so convincent for me.
> Actually in my understand, Qt need:
> 1) POSIX compliant base (pthreads? mmap? fork?)
> I can disable parts individually or need some kind of #ifdef sparse by the
> code? I see some kind of preprocessor magic scattered in the code like
> this:
> https://github.com/qt/qtbase/blob/4b0af2cdbf61572b22ea6b8aa17fc9f52c71ac4b/
> src/corelib/thread/qthread.cpp#L174

Yes, POSIX compliant base including pthreads and filesystem API. What the 
filesystem API accesses is irrelevant, it just has to exist. Threading support 
is mandatory in Qt, even though there are #ifndef QT_NO_THREAD around. Those 
aren't tested and aren't guaranteed to even compile. You can try that at 
first, but I recommend aiming for full threading.

> 2) QPA plugin
> Minimal is a good start point? I only have a framebuffer in memory
> directly accessable for the CPU and vsync interrupt (with manual page
> flipping)

Yes, that's minimal's purpose: something to get you started.

> 3) Support for atomics in target architecture?
> In my case maybe it wouldn't be a problem, the target is ARMv7 in thumb2
> mode

Atomics are mandatory. ARMv7-A and R have support for them. I don't know about 
M and don't know about Thumb support.

Lacking atomic instructions is not an excuse. Atomics can be emulated with 
locks. Also, since you'll be running with no MMU and single processor, maybe 
regular accesses are atomic enough.

> 4) What about the memory footprint?

A couple of megabytes.

> What are the hot spots of qtcore in consumption?

Impossible to say without knowing what features you left enabled.

> I'm followin the Qt for MCU project with great interest but in this
> moment, my clients are looking for something really minimal like
> freeRTOS, and my intention is to evaluate the work for port Qt to
> this.
> Intuitively, it seems that port qt to a non-posix system can be a
> titanic task, but at least I want to evaluate the manpower for this.

Yes, don't go there. The only non-POSIX system supported is Windows.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products

More information about the Development mailing list