Wireshark-dev: Re: [Wireshark-dev] -fPIC on Ubuntu Wily

From: Hauke Mehrtens <hauke@xxxxxxxxxx>
Date: Fri, 30 Oct 2015 21:11:42 +0100
On 10/27/2015 11:45 PM, Evan Huus wrote:
> After recently upgrading to Ubuntu 15.10, my cmake configure failed with:
> -- Performing Test WORKS_WITH_FPIC - Failed
> CMake Error at CMakeLists.txt:938 (message):
>   Couldn't compile Qt without -fPIC nor with -fPIC
> 
> Digging into the logs, the test being run (and its output) is as follows:
> 
> /usr/bin/c++    -Wall -W -Wextra -Wendif-labels -Wpointer-arith
> -Warray-bounds -Wformat-security -fwrapv -fno-strict-overflow
> -fno-delete-null-pointer-checks -Wvla -Waddress -Wattributes
> -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings
> -Wwrite-strings -Wno-long-long -fexcess-precision=fast
> -DWORKS_WITH_FPIC -fPIC -fPIE -I/usr/include/x86_64-linux-gnu/qt5
> -I/usr/include/x86_64-linux-gnu/qt5/QtCore
> -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64    -o
> CMakeFiles/cmTryCompileExec1538407922.dir/src.cxx.o -c
> /home/eapache/pkg/linux_amd64/wireshark.org/wireshark/CMakeFiles/CMakeTmp/src.cxx
> In file included from
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qnamespace.h:37:0,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs.h:41,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:40,
>                  from
> /usr/include/x86_64-linux-gnu/qt5/QtCore/qabstractanimation.h:37,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/QtCore:4,
>                  from
> /home/eapache/pkg/linux_amd64/wireshark.org/wireshark/CMakeFiles/CMakeTmp/src.cxx:1:
> /usr/include/x86_64-linux-gnu/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)."
>  #  error "You must build your code with position independent code if
> Qt was built with -reduce-relocations. "\
>     ^
> 
> I suspect because we are passing both -fPIC *and* -fPIE (and that
> -fPIE is being passed second) something is not working correctly? I'm
> not familiar with how those flags work together.
> 
> Thoughts?
> Evan

Hi,

I have the same problem in debian testing with QT 5.4 and also with the
new qt5.5.1 which I got as a normal update today.

Here is the issue:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=11643

Here someone else reported the same problem some time ago:
https://www.wireshark.org/lists/wireshark-bugs/201505/msg00563.html

Hauke