Wireshark mailing list archives
Re: Build wireshark-qt with Clang : -fPIC or -fPIE
From: Alexis La Goutte <alexis.lagoutte () gmail com>
Date: Fri, 15 Nov 2013 16:43:30 +0100
On Thu, Nov 7, 2013 at 2:38 PM, Evan Huus <eapache () gmail com> wrote:
On Thu, Nov 7, 2013 at 8:34 AM, Alexis La Goutte <alexis.lagoutte () gmail com> wrote:Hi, When i try to build wireshark-qt with clang (and autotools) i have the following error message : dev:~/wireshark-clang/ui/qt$ make CXX accordion_frame.o In file included from /usr/include/qt5/QtGui/qwindowdefs.h:45:0, from /usr/include/qt5/QtWidgets/qwidget.h:45, from /usr/include/qt5/QtWidgets/qframe.h:45, from /usr/include/qt5/QtWidgets/QFrame:1, from accordion_frame.h:27, from accordion_frame.cpp:28: /usr/include/qt5/QtCore/qglobal.h:1079:4: error: #error "You must buildyourcode with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC or -fPIE." # error "You must build your code with position independent code if Qtwasbuilt with -reduce-relocations. "\ ^ I fixed the issue with : --- a/configure.ac +++ b/configure.ac @@ -927,7 +927,7 @@ 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, C) +AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE) if test "x$CLFAGS" != "x$CFLAGS_before_pie" then # Restore CFLAGS There is any reason to limit -fPIE to only C ?Not that I know of. Note that $(PIE_CFLAGS) is already included in AM_CPPFLAGS in ui/qt/Makefile.am because that's what fixed the problem for me the first time a few months ago. It may have been an unnecessary and/or incorrect way of fixing the issue though.
Any other comments ? It is ok for push my fix ? Regards,
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Build wireshark-qt with Clang : -fPIC or -fPIE Alexis La Goutte (Nov 07)
- Re: Build wireshark-qt with Clang : -fPIC or -fPIE Evan Huus (Nov 07)
- Re: Build wireshark-qt with Clang : -fPIC or -fPIE Alexis La Goutte (Nov 15)
- Re: Build wireshark-qt with Clang : -fPIC or -fPIE Evan Huus (Nov 07)