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

Qt pkgconfig flags should contain -fPIC

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.5.1
    • Build System
    • None
    • Debian GNU/Linux unstable

    Description

      [ Forwarded from Debian #808822. ]

      A trivial test case is:

      $ echo "#include <QtCore/QCoreApplication>" > foo.cc
      $ g++ $(pkg-config --cflags Qt5Core) -c foo.cc
      In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qcoreapplication.h:37:0,
                       from /usr/include/x86_64-linux-gnu/qt5/QtCore/QCoreApplication:1,
                       from foo.cc:1:
      /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1067:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."
       #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
          ^
      

      Looks like the generated .pc files should include -fPIC.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            mandriver Dmitry Shachnev
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes