Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problem with inline SWP asm using arm-none-linux-qnueabi-g++

Problem with inline SWP asm using arm-none-linux-qnueabi-g++

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daveP
    wrote on last edited by
    #1

    Hi, This my first post as I'm new to QT so please bear with me. I'm developing some QT apps for an iMx53 eval board and needed to compile qt for arm. So I cloned qt-everywhere-opensource-src-4.8.5, configured it for arm-none-linux then built. However, the following statement in qatomic_armv5.h failed:

    @ in inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
    {
    int originalValue;
    #ifndef QT_NO_ARM_EABI
    asm volatile("swp %0, %2, [%3]"
    : "=&r"(originalValue), "=m" (_q_value)
    : "r"(newValue),"r"(&_q_value)
    : "cc", "memory");@

    with the error message that %1 was not directly accessible. After some research I editted the code as shown below:

    @inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
    {
    int originalValue;
    #ifndef QT_NO_ARM_EABI
    asm volatile("swp %[dest], %[source], [%[mem]]"
    : [dest]"=&r"(originalValue) //, "=m" (_q_value)
    : [source]"r"(newValue), [mem]"r"(&_q_value)
    : "cc", "memory");@

    This seemed to work and the whole thing built ok. The question is, is this a valid amendment and will the code still work as intended? I'm not sure this is a bug so didn't know if I should use the bugtracker. Thank you for your patience and help in advance.

    DaveP.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I think this question is a bit too low-level for this forum (It's more user oriented) You should rather post it on the mailing list, there you'll find Qt's developer/maintainer.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        daveP
        wrote on last edited by
        #3

        Hi, Thanks for that, and I apologise. I followed the link you suggested.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          There's no need to apologize :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved