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

configuration issues of ICC build in QT

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.2.0 RC1
    • 5.1.1
    • Build System
    • None
    • Ubuntu (Note: the issue should not be related to OS)
    • d2580054f9d63b1045790b5bd530f02f090dd60a

    Description

      Deal,

      I cannot build QT with the configuration files you provided. First of all, below is my script:
      #! /bin/bash

      1. sudo apt-get install libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev

      rm -rf qt-everywhere-opensource-src-5.1.1
      tar zxvf qt-everywhere-opensource-src-5.1.1.tar.gz
      cd qt-everywhere-opensource-src-5.1.1
      mkdir prefix
      echo yes|./configure --prefix=./prefix/ -nomake tests -nomake examples -no-openssl -no-javascript-jit -opensource
      make >& ../log.gcc.txt

      It works with GCC, when I added "-platform linux-icc-64" (or -platform linux-icc) to use ICC. I get below error:

      icpc -c -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing -std=c++0x -w1 -Wcheck -wd654,1572,411,873,1125,2259,2261 -D_REENTRANT -D_REENTRANT -D_REENTRANT -DQT_NO_LIBUDEV -DQT_NO_XKB -DQT_UIC -DQT_NO_CAST_FROM_ASCII -DQT_UIC_CPP_GENERATOR -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I../../../mkspecs/linux-icc -I. -I. -Icpp -I. -I../../../include -I../../../include/QtCore -I.moc/release-shared -o .obj/release-shared/customwidgetsinfo.o customwidgetsinfo.cpp
      In file included from ../../../include/QtCore/qglobal.h(1),
      from ../../../include/QtCore/../../src/corelib/tools/qalgorithms.h(45),
      from ../../../include/QtCore/qalgorithms.h(1),
      from ../../../include/QtCore/../../src/corelib/tools/qlist.h(45),
      from ../../../include/QtCore/qlist.h(1),
      from treewalker.h(45),
      from customwidgetsinfo.h(45),
      from customwidgetsinfo.cpp(42):
      ../../../include/QtCore/../../src/corelib/global/qglobal.h(975): catastrophic error: #error directive: "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC or -fPIE."

      1. error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
        ^

      compilation aborted for customwidgetsinfo.cpp (code 4)
      make[3]: *** [.obj/release-shared/customwidgetsinfo.o] Error 4

      I tried to add -fPIC for QMAKE_CFLAGS in qtbase/mkspecs/linux-icc/qmake.conf and this issue is work arounded. Now, my question is, is this the correct approach? Because I have read GCC's mkspecs files, and I see it is using QMAKE_CFLAGS_APP = -fPIE, I tried to add this for ICC but it does not work as expected, it looks like the QT configuration will not handle this for ICC.

      If it is not correct approach, could you please fix it with a better solution? If it is correct, please fix it.

      Next issue is (note: I know it may be bad to submit 2 issues in my ticket, but it will be difficult to describe if I start a new ticket), after the -fPIC resolved, I get some other issues (similar issues). Take one as example:
      ld: warning: libQt5CLucene.so.5, needed by /home/sgeng2/Desktop/IPS/QT/qt-everywhere-opensource-src-5.1.1/qttools/lib/libQt5Help.so, not found (try using -rpath or -rpath-link)
      ld: warning: libQt5Sql.so.5, needed by /home/sgeng2/Desktop/IPS/QT/qt-everywhere-opensource-src-5.1.1/qttools/lib/libQt5Help.so, not found (try using -rpath or -rpath-link)

      /home/sgeng2/Desktop/IPS/QT/qt-everywhere-opensource-src-5.1.1/qttools/lib/libQt5Help.so: undefined reference to `QCLuceneIndexWriter::setMergeFactor(int)'

      The issue is easy to understand, I have compared the command line generated for ICC and GCC and find the issue there, GCC has below option in command line:
      -Wl,-rpath-link,/home/sgeng2/Desktop/IPS/QT/qt-everywhere-opensource-src-5.1.1/qttools/lib
      But, ICC does not have it, which will cause the issue. It works if I add it manually, or, another possible way is to add the option -lQt5CLucene. So, I think the configuration script is not handling correctly for ICC, it should be same with GCC. I can work around by adding these additional options in each projects's .pro, but the best solution should be making it behavior same with GCC. As I am not familiar with how these mkspecs and configuration script works in QT, I am here to ask for your help.

      Thanks,
      Shenghong

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            shenghong GengShenghong
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes