SHA256
1
0
forked from pool/wireshark
wireshark/wireshark-1.12.6-fix-QT-PIC-PIE.patch

48 lines
1.8 KiB
Diff
Raw Normal View History

From: Andreas Stieger <astieger@suse.com>
Date: Mon, 13 Jul 2015 11:30:56 +0200
Subject: Compilation fails with qt5 5.4.1 and autotools due to lack of -fPIC
References: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=11230
Upstream: not yet
Workaround for compilation error on Factory:
[ 1248s] In file included from /usr/include/qt5/QtGui/qwindowdefs.h:37:0,
[ 1248s] from /usr/include/qt5/QtWidgets/qwidget.h:37,
[ 1248s] from /usr/include/qt5/QtWidgets/qframe.h:37,
[ 1248s] from /usr/include/qt5/QtWidgets/QFrame:1,
[ 1248s] from accordion_frame.h:25,
[ 1248s] from accordion_frame.cpp:26:
[ 1248s] /usr/include/qt5/QtCore/qglobal.h:1052: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)."
[ 1248s] # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
[ 1248s] ^
Should be considered a temporary fix.
Some discussion: https://build.opensuse.org/request/show/314996
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