Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-22479

Qt fails to build on linux/sparc64 due to issues in the atomic code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.8.x, 5.0.0
    • 4.7.3
    • Core: Threads
    • None
    • sparc64-unknown-linux-gnu
    • 1ee0985319a0f41be12c3c8ff3813a74b43835e f668407b30868ef137016b70011ce888e7950d4e

    Description

      Qt fails to build on linux/sparc64 with the following problem:
      g++ -c -m64 -pipe -I/usr/include/freetype2 -I/usr/include/dbus-1.0 -I/usr/lib/sparc64-linux-gnu/dbus-1.0/include -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_DBUS_LIB -DDBUS_API_SUBJECT_TO_CHANGE -DQT_LINKED_LIBDBUS -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQT_NO_DEBUG -DQT_XML_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include/QtXml -I../../include -I../../include/QtDBus -I.rcc/release-shared -I.moc/release-shared -o .obj/release-shared/qdbusabstractadaptor.o qdbusabstractadaptor.cpp
      In file included from ../../include/QtCore/qatomic_sparc.h:1:0,
      from ../../include/QtCore/../../src/corelib/arch/qatomic_arch.h:78,
      from ../../include/QtCore/qatomic_arch.h:1,
      from ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:227,
      from ../../include/QtCore/qbasicatomic.h:1,
      from ../../include/QtCore/../../src/corelib/thread/qatomic.h:46,
      from ../../include/QtCore/qatomic.h:1,
      from ../../include/QtCore/../../src/corelib/tools/qbytearray.h:45,
      from ../../include/QtCore/qbytearray.h:1,
      from ../../include/QtCore/../../src/corelib/tools/qstring.h:46,
      from ../../include/QtCore/qstring.h:1,
      from ../../include/QtCore/../../src/corelib/kernel/qobject.h:48,
      from ../../include/QtCore/qobject.h:1,
      from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:45,
      from ../../include/QtCore/qcoreapplication.h:1,
      from qdbusintegrator.cpp:42:
      ../../include/QtCore/../../src/corelib/arch/qatomic_sparc.h: In member function 'bool QBasicAtomicPointer<T>::testAndSetOrdered(T*, T*) [with T = const QString]':
      qdbusintegrator.cpp:74:1: instantiated from here
      ../../include/QtCore/../../src/corelib/arch/qatomic_sparc.h:238:85: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
      ../../include/QtCore/../../src/corelib/arch/qatomic_sparc.h:131:23: error: initializing argument 2 of 'int q_atomic_test_and_set_acquire_ptr(volatile void*, void*, void*)' [-fpermissive]
      ../../include/QtCore/../../src/corelib/arch/qatomic_sparc.h:238:85: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
      ../../include/QtCore/../../src/corelib/arch/qatomic_sparc.h:131:23: error: initializing argument 3 of 'int q_atomic_test_and_set_acquire_ptr(volatile void*, void*, void*)' [-fpermissive]
      make[3]: *** [.obj/release-shared/qdbusintegrator.o] Error 1

      The problem is that the type of some arguments in src/corelib/arch/qatomic_sparc.h are missing a const attribute. In that case the second and third arguments of q_atomic_test_and_set_acquire_ptr() are only read in the assembly code (src/corelib/arch/sparc/qatomic64.s), so it's possible to declare them const.

      This is the only thing required to get Qt building on linux/sparc64, but I preferred to also change other functions with missing const attribute, so that the same kind of problem doesn't appear again in the future. You'll find the patch as an attachement

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            aurel32 Aurelien Jarno
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes