wireshark/wireshark-1.12.6-fix-QT-PIC-PIE.patch

48 lines
1.9 KiB
Diff

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
Index: wireshark-2.0.1/configure.ac
===================================================================
--- wireshark-2.0.1.orig/configure.ac
+++ wireshark-2.0.1/configure.ac
@@ -1079,18 +1079,18 @@ AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-nee
# in the address space to make attacks more difficult.
#
WS_CHECKED_CFLAGS_before_pie="$WS_CHECKED_CFLAGS"
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIC, C)
if test "x$can_add_to_cflags" = "xyes"
then
# Restore CFLAGS
WS_CHECKED_CFLAGS="$WS_CHECKED_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