Wireshark-bugs: [Wireshark-bugs] [Bug 11230] New: Compilation fails with qt5 5.4.1 due to lack o
Date: Thu, 28 May 2015 01:35:09 +0000
Bug ID 11230
Summary Compilation fails with qt5 5.4.1 due to lack of -fPIC
Product Wireshark
Version Git
Hardware x86-64
OS All
Status UNCONFIRMED
Severity Major
Priority Low
Component Build process
Assignee bugzilla-admin@wireshark.org
Reporter anish@chelsio.com

Build Information:
Paste the COMPLETE build information from "Help->About Wireshark", "wireshark
-v", or "tshark -v".
--
In file included from /usr/include/qt/QtCore/qnamespace.h:37:0,
                 from /usr/include/qt/QtCore/qobjectdefs.h:41,
                 from /usr/include/qt/QtCore/qobject.h:40,
                 from /usr/include/qt/QtCore/QObject:1,
                 from capture_file.h:25,
                 from capture_file.cpp:22:
/usr/include/qt/QtCore/qglobal.h:1050: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. "\



set(CMAKE_POSITION_INDEPENDENT_CODE ON) is no longer enough (or is failing)

I was able to hammer at it and get it to compile with this hacky patch (which
is most probably wrong, however I am not proficient with this at all) :

diff --git a/configure.ac b/configure.ac
index bcd6f9e..a39a96f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1071,18 +1071,18 @@ AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
 # in the address space to make attacks more difficult.
 #
 CFLAGS_before_pie="$CFLAGS"
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE)
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIC)
 if test "x$CFLAGS" != "x$CFLAGS_before_pie"
 then
        # Restore CFLAGS
        CFLAGS="$CFLAGS_before_pie"

        LDFLAGS_before_pie="$LDFLAGS"
-       AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
+       AC_WIRESHARK_LDFLAGS_CHECK([-fPIC -pie])
        if test "x$LDFLAGS" != "x$LDFLAGS_before_pie"
        then
                # We can use PIE
-               PIE_CFLAGS="-fPIE"
+               PIE_CFLAGS="-fPIC"
                PIE_LDFLAGS="-pie"

                # Restore LDFLAGS


You are receiving this mail because:
  • You are watching all bug changes.