Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 552440 - net-analyzer/wireshark-1.12.6 - In file included from accordion_frame.cpp:26: /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..
Summary: net-analyzer/wireshark-1.12.6 - In file included from accordion_frame.cpp:26:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL: https://code.wireshark.org/review/git...
Whiteboard:
Keywords:
: 564022 (view as bug list)
Depends on:
Blocks: 559130
  Show dependency tree
 
Reported: 2015-06-18 06:35 UTC by octoploid
Modified: 2016-11-21 00:16 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net-analyzer:wireshark-1.12.6:20150623-042447.log.xz (20150623-042447.log.xz,67.79 KB, application/x-xz)
2015-06-23 04:46 UTC, Jeroen Roovers (RETIRED)
Details
wireshark-1.12.6_build.log.gz (wireshark-1.12.6_build.log.gz,114.16 KB, application/gzip)
2015-07-04 12:52 UTC, jospezial
Details

Note You need to log in before you can comment on or make changes to this bug.
Description octoploid 2015-06-18 06:35:30 UTC
...
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../wiretap   -fPIE -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DQT_GUI_LIB -I/usr/include '-DPLUGIN_INSTALL_DIR="/usr/lib64/wireshark/plugins/1.12.6"'  -march=amdfam10 -O2 -pipe -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 -fvisibility=hidden -fPIE  -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtWidgets -I/usr/include/qt5 -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5 -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -c -o capture_file_dialog.o capture_file_dialog.cpp
In file included from /usr/include/qt5/QtGui/qwindowdefs.h:37:0,
                 from /usr/include/qt5/QtWidgets/qwidget.h:37,
                 from /usr/include/qt5/QtWidgets/qframe.h:37,
                 from /usr/include/qt5/QtWidgets/QFrame:1,
                 from accordion_frame.h:25,
                 from accordion_frame.cpp:26:
/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)."
 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\

From /usr/include/qt5/QtCore/qglobal.h:

1050 #if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \                                                                                 
1051     (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500))                                                                                    
1052 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\                                                           
1053          "Compile your code with -fPIC (-fPIE is not enough)."                                                                                                           
1054 #endif 

Reproducible: Always
Comment 1 Jan Janecek 2015-06-19 18:11:02 UTC
I have the same error when building media-libs/phonon[qt5] on Hardened with gcc-5.1.

I guess more qt5 applications will hit this error on Hardened, since every executable is built as PIE.

Easiest solution would be to configure qt5 with -no-reduce-relocations.
Comment 2 Mike Gilbert gentoo-dev 2015-06-20 22:29:14 UTC
Please attach a build log.
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2015-06-22 20:18:00 UTC
Many other packages will hit this, especially if they don't use qmake or the cmake macros provided by qt upstream (which take care of -fPIC themselves). But note that only building with gcc >= 5 is affected.

(In reply to Jan Janecek from comment #1)
> Easiest solution would be to configure qt5 with -no-reduce-relocations.

We're not going to do that. The proper fix is to build with -fPIC, so wireshark build system should be fixed and a patch sent upstream.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2015-06-23 04:25:53 UTC
1) Please attach the entire build log to this bug report
2) Please post your `emerge --info net-analyzer/wireshark' output in a comment.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2015-06-23 04:46:49 UTC
Created attachment 405568 [details]
net-analyzer:wireshark-1.12.6:20150623-042447.log.xz
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2015-06-24 05:32:22 UTC
Should be hacked around well enough in -1.12.6, -1.99.7 and -99999999.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2015-06-24 06:06:15 UTC
The real problem seems to be that the libtool checks for issuing PIC are in place, but that ui/qt/ isn't built using libtool,
Comment 8 octoploid 2015-06-24 09:28:13 UTC
It is still broken:

x4 qt # x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../wiretap   -fPIE -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DQT_GUI_LIB -I/usr/include '-DPLUGIN_INSTALL_DIR="/usr/lib64/wireshark/plugins/1.12.6"'  -march=amdfam10 -O2 -pipe -fPIC -DPIC -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 -fvisibility=hidden -fPIE  -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtWidgets -I/usr/include/qt5 -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5 -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -c -o accordion_frame.o accordion_frame.cpp                             
In file included from /usr/include/qt5/QtGui/qwindowdefs.h:37:0,
                 from /usr/include/qt5/QtWidgets/qwidget.h:37,
                 from /usr/include/qt5/QtWidgets/qframe.h:37,
                 from /usr/include/qt5/QtWidgets/QFrame:1,
                 from accordion_frame.h:25,
                 from accordion_frame.cpp:26:
/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)."
 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\

The problem is that -fPIE comes last in the command line above.
When I append -fPIC after the last -fPIE it works fine.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2015-06-25 04:40:45 UTC
See comment #4. I'm not going to fix bugs by guessing your configuration.
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2015-06-27 06:47:11 UTC
(In reply to octoploid from comment #10)

Look, either you provide the information requested in comment #4 and have a quick fix maybe today, or you keep up the arrogance and wait until the next upstream release, which could be months away.
Comment 12 octoploid 2015-06-27 07:40:33 UTC
(In reply to Jeroen Roovers from comment #11)
> (In reply to octoploid from comment #10)
> 
> Look, either you provide the information requested in comment #4 and have a
> quick fix maybe today, or you keep up the arrogance and wait until the next
> upstream release, which could be months away.

This has nothing to do with arrogance. My "emerge --info" is full
of fake entries, because I use a hand-rolled toolchain.
It would only cause unnecessary confusion.

The issue at hand is clear enough without this superfluous info.
Switching from autotools to CMake would fix it.
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2015-06-27 07:43:46 UTC
(In reply to octoploid from comment #12)
> (In reply to Jeroen Roovers from comment #11)
> > (In reply to octoploid from comment #10)
> This has nothing to do with arrogance. My "emerge --info" is full
> of fake entries, because I use a hand-rolled toolchain.
> It would only cause unnecessary confusion.

That invalidates any contribution you make to the Gentoo distribution.
Comment 14 jospezial 2015-07-03 10:11:24 UTC
Really still does not compile. Please reopen.

[ebuild     U  ] net-analyzer/wireshark-1.12.6:0/1.12.6::gentoo [1.12.5:0/1.12.5::gentoo] USE="caps crypt filecaps geoip gtk3 ipv6 lua netlink pcap qt5 smi ssl zlib -adns -doc -doc-pdf -kerberos -portaudio -qt4 -sbc (-selinux)" 0 KiB

x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../wiretap   -fPIE -DINET6 -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DQT_GUI_LIB -
I/usr/include '-DPLUGIN_INSTALL_DIR="/usr/lib64/wireshark/plugins/1.12.6"'  -march=native -O2 -pipe -fPIC -DPIC -Wall -W -Wextra -Wendif-labels -Wpointer-arit
h -Warray-bounds -Wformat-security -fwrapv -fno-strict-overflow -fno-delete-null-pointer-checks -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifier
s -Wpragmas -Wno-overlength-strings -Wwrite-strings -Wno-long-long -fexcess-precision=fast -fvisibility=hidden -fPIE  -I/usr/include/qt5/QtCore -I/usr/include
/qt5  -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtWidgets -I/usr/include/qt5 -I/usr/include
/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets 
-I/usr/include/qt5 -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at
-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/inclu
de/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/
include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -pthread 
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -c -o byte_view_text.o byte_view_text.cpp
In file included from /usr/include/qt5/QtGui/qwindowdefs.h:37:0,
                 from /usr/include/qt5/QtWidgets/qwidget.h:37,
                 from /usr/include/qt5/QtWidgets/qframe.h:37,
                 from /usr/include/qt5/QtWidgets/QFrame:1,
                 from accordion_frame.h:25,
                 from accordion_frame.cpp:26:
/usr/include/qt5/QtCore/qglobal.h:1097: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. "\



emerge --info qtcore
Portage 2.2.20 (python 3.3.5-final-0, default/linux/amd64/13.0, gcc-5.1.0, glibc-2.20-r2, 4.1.1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.1-x86_64-AMD_Athlon-tm-_II_X2_240_Processor-with-gentoo-2.2
KiB Mem:     4047324 total,    574468 free
KiB Swap:   11010040 total,  11009824 free
Timestamp of repository gentoo: Fri, 03 Jul 2015 09:15:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25 p1.2) 2.25
ccache version 3.2.2 [enabled]
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/ccache:          3.2.2::gentoo
dev-util/cmake:           3.2.3::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.10.3-r1::gentoo, 1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25-r1::gentoo
sys-devel/gcc:            5.1.0::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage
    priority: -1000

overlay_jl
    location: /usr/local/portage
    masters: gentoo
    priority: 0

betagarden
    location: /var/lib/layman/betagarden
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/betagarden.git
    masters: gentoo
    priority: 50

gamerlay
    location: /var/lib/layman/gamerlay
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/gamerlay.git
    masters: gentoo
    priority: 50

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

qt
    location: /var/lib/layman/qt
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/qt.git
    masters: gentoo
    priority: 50

wine-overlay
    location: /var/lib/layman/wine-overlay
    sync-type: laymansync
    sync-uri: git://github.com/NP-Hardass/wine-overlay.git
    masters: gentoo
    priority: 50

Installed sets: @kde-applications-live, @kde-frameworks-live, @kde-plasma-live
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask-write=y --keep-going --quiet-build=y"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow 3dnowext 64bit X Xaw3d a52 aac aacplus aacs aalib accessibility ace acl acpi activefilter aften alsa amd64 ap apm apng archive arping audacious audiofile automount bazaar bdplus berkdb binary-drivers bluetooth bluray boost bzip2 bzr cairo canusb ccache cdda cddb cdio cdparanoia cdr cdrdao cdrom cgi charconv chm chroot cjk clang cli client colordiff colors compress consolekit corefonts cpio cracklib crypt css cue cups curl curlwrappers cvs cxx daemon dbus declarative device-mapper dga dhcp doom doomsday dos download-subs dri dri3 dts dump dv dvb dvd dvdnav eap eap-sim eap-tls ebook egl emerald emoticon enca encode enscript equalizer evdev exif extensions extras faac faad fam farstream fat fax fbcon fdformat ffmpeg fftw firefox flac fluidsynth fontconfig foomaticdb fortran freedoom ftp fuse g3dvl gadu gallium gbm gd gdbm geoip gif gimp git glamor glut gme gnutls gpg gphoto2 gpm graphite gsm gstreamer gtk gtk3 gtkstyle gudev gui gzip hddtemp hdf hdf5 heretic hexen hid highlight hpcups hpijs http hwdb iconv icq icu id3tag idn imagemagick introspection ios ipc ipod ipv6 jack java javascript jit jpeg jpeg2k kate keymap ladspa lame lcms legacy-systray lensfun libass libcanberra libinput libkms libnotify libsamplerate libssh2 libtiger libv4l libwww live llvm-shared-libs lm_sensors logrotate lua lzma lzo mad madwifi magic man matroska md5sum meanwhile mercurial metalink midi mikmod mime minizip mixer mjpeg mmap mms mmx mmxext mng mobi mod modplug modules mono mouse mozilla mp3 mp4 mpeg mpeg2 mplayer mtp multilib multimedia multislot musepack musicbrainz nano-syntax ncat ncurses ndiff network nfs nfsidmap nfsv4 nfsv41 nls nmap-update nokia normalize nowlistening nping nptl nsplugin ntfs ntfsprogs ntp nvidia nvram obex ocr ogg ogm openal opencl opengl openmax openmp openssl oscar osdmenu otr p2p pam pango panorama parport parse-clocks pcap pci pcre pcre16 pdf pipes plugins pm-utils png policykit postproc postscript ppds printsupport privacy projectm pulseaudio pvr python python3 qalculate qml qt5 quicktime r600-llvm-compiler radio rar raw rdesktop readline recording redeyes reiser4 reiserfs remote-access replaygain rpm rtc rtmp rtsp rubberband s3tc sbsms scanner schroedinger scripttools sdl secure-delete sensord session sftp sha512 shorten shout skins slang smi sndfile snowberry sockets sound soundtouch sox speex spell sql sqlite sqlite3 sse sse2 ssh ssl startup-notification statistics stk stream subtitles subversion svg swat symlink sync-plugin-portage syslog system-jsoncpp szip taglib tcpd texteffect tftp tftpd theora threads thumbnail tiff timidity tracepath traceroute translator truetype twolame udev udisks unicode upower urlpicpreview usb v4l v4l2 vaapi vamp vcd vcdx vdpau video videos virtualbox vlm vnc vorbis vpx vroot vst wad wav wavpack webgl webkit webm webp webpresence widgets wifi winbind winpopup wmf wps wxwidgets x264 x265 xa xattr xcb xcomposite xfs xine xinerama xinetd xkb xml xmp xorg xosd xpm xrandr xscreensaver xv xvid xvmc yahoo zenmap zip zlib zvbi" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_3" PYTHON_TARGETS="python2_7 python3_3 python3_4" RUBY_TARGETS="ruby19 ruby20 ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="fbdev vesa svga vga radeon modesetting r100 r200 r300 r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

dev-qt/qtcore-4.8.9999::qt was built with the following:
USE="exceptions glib iconv icu ssl (-aqua) -debug -pch -qt3support" ABI_X86="64 -32 -x32"


dev-qt/qtcore-5.9999::qt was built with the following:
USE="icu -debug -systemd -test" ABI_X86="64"


my qtcore-5.9999 is version 5.6.0

Tell me if you need more info to solve this bug for real.
Comment 15 jospezial 2015-07-03 10:17:57 UTC
This bug should depend on
https://bugs.gentoo.org/show_bug.cgi?id=545688
net-analyzer/wireshark - switch to building with cmake
Comment 16 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-04 05:31:30 UTC
Comment on attachment 405568 [details]
net-analyzer:wireshark-1.12.6:20150623-042447.log.xz

(In reply to jospezial from comment #14)
> Really still does not compile. Please reopen.
> Tell me if you need more info to solve this bug for real.

Your complete build.log.
Comment 17 jospezial 2015-07-04 12:52:15 UTC
Created attachment 406172 [details]
wireshark-1.12.6_build.log.gz

Here it is.
Comment 18 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-05 04:46:33 UTC
Looks like ui/qt/Makefile.am is adding PIE:

--- a/ui/qt/Makefile.am
+++ b/ui/qt/Makefile.am
@@ -84,7 +84,7 @@

 # Common headers
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) \
-       $(LIBGNUTLS_CFLAGS) $(PIE_CFLAGS)
+       $(LIBGNUTLS_CFLAGS)

 AM_CXXFLAGS = $(AM_CLEAN_CFLAGS)

Maybe someone wants to test this patch.
Comment 19 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-05 04:53:50 UTC
According to configure.ac, only dumpcap should be compiled with PIE_CFLAGS.
Comment 20 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-05 04:56:38 UTC
Use PIE_CFLAGS when building qt-shark, since otherwise I get errors like:

 /usr/include/qt5/QtCore/qglobal.h:1079:4: error: #error "You must build your
 code with position independent code if Qt was built with -reduce-relocations. "
 "Compile your code with -fPIC or -fPIE."

 There is almost certainly a better way to do this: I'm cheating here because I
 don't know enough about autofoo, and it seems to work. I suspect we should be
 checking PIE for the C++ compiler separately (since presumably they're not
 guaranteed to be related like gcc/g++ are). I also suspect we should only be
 building with it in the first place if Qt really needs it, though I have no idea
 how to check that. The qt docs I've found suggest that qt5's cmake module has a
 flag for it, but autofoo is never mentioned...
Comment 21 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-05 05:11:54 UTC
On the other hand, if Qt5 requires those -fPIC -DPIC, then you wouldn't expect this output:

$ pkg-config --cflags Qt5Gui
-I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5
Comment 22 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-05 05:18:42 UTC
Additionally, AC_WIRESHARK_COMPILER_FLAGS_CHECK from acinclude.m4 happily adds any GCC option it checks for to CFLAGS_FOR_BUILD. It preserves and restores CFLAGS, but not CFLAGS_FOR_BUILD.
Comment 23 Davide Pesavento (RETIRED) gentoo-dev 2015-07-05 12:24:38 UTC
(In reply to Jeroen Roovers from comment #20)
> Use PIE_CFLAGS when building qt-shark, since otherwise I get errors like:
> 
>  /usr/include/qt5/QtCore/qglobal.h:1079:4: error: #error "You must build your
>  code with position independent code if Qt was built with
> -reduce-relocations. "
>  "Compile your code with -fPIC or -fPIE."
> 

This is an old commit. -fPIE is no longer enough with Qt >= 5.4.2 and gcc >= 5. You must use -fPIC.
Comment 24 Davide Pesavento (RETIRED) gentoo-dev 2015-07-05 12:28:24 UTC
(In reply to Jeroen Roovers from comment #21)
> On the other hand, if Qt5 requires those -fPIC -DPIC, then you wouldn't
> expect this output:
> 
> $ pkg-config --cflags Qt5Gui
> -I/usr/include/qt5/QtGui -I/usr/include/qt5 -I/usr/include/qt5/QtCore
> -I/usr/include/qt5

Qt upstream doesn't really care about pkgconfig. I found several major bugs in the 4.x .pc files some time ago. Unfortunately the only reliable and upstream-supported ways of building against Qt are qmake and cmake (although the latter has had some important bugs as well)...
Comment 25 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-06 02:56:34 UTC
(In reply to Davide Pesavento from comment #23)
> (In reply to Jeroen Roovers from comment #20)
> > Use PIE_CFLAGS when building qt-shark, since otherwise I get errors like:
> > 
> >  /usr/include/qt5/QtCore/qglobal.h:1079:4: error: #error "You must build your
> >  code with position independent code if Qt was built with
> > -reduce-relocations. "
> >  "Compile your code with -fPIC or -fPIE."
> > 
> 
> This is an old commit. -fPIE is no longer enough with Qt >= 5.4.2 and gcc >=
> 5. You must use -fPIC.

Yes, I was quoting the bug I was referring to. Maybe that wasn't very obvious.
Comment 26 Alexey Shvetsov archtester gentoo-dev 2015-07-24 08:53:26 UTC
Its related to qtcore:5

/usr/include/qt5/QtCore/qglobal.h

#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \
    (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500))
#  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)."
#endif
Comment 27 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-25 07:03:14 UTC
(In reply to Alexey Shvetsov from comment #26)
> Its related to qtcore:5

I think we established that in comment #0.
Comment 28 jospezial 2015-07-25 11:21:22 UTC
The same:

 * Package:    media-libs/phonon-4.8.3-r1
 * Repository: gentoo
 * Maintainer: kde@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc gstreamer kernel_linux pulseaudio qt5 userland_GNU vlc
 * FEATURES:   ccache preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking phonon-4.8.3.tar.xz to /var/tmp/portage/media-libs/phonon-4.8.3-r1/work
>>> Source unpacked in /var/tmp/portage/media-libs/phonon-4.8.3-r1/work
>>> Preparing source in /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3 ...
 * Applying phonon-4.7.0-plugin-install.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3 ...
 * qt5: running myconfigure
>>> Working in BUILD_DIR: "/var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5"
cmake --no-warn-unused-cli -C /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/gentoo_common_config.cmake -G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=TRUE -DPHONON_BUILD_DESIGNER_PLUGIN=OFF -DWITH_GLIB2=ON -DWITH_PulseAudio=ON -DWITH_QZeitgeist=OFF -DQT_QMAKE_EXECUTABLE=/usr/lib64/qt5/bin/qmake -DPHONON_BUILD_PHONON4QT5=ON -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/gentoo_rules.cmake -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/gentoo_toolchain.cmake  /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3
Not searching for unused variables given on the command line.
loading initial cache file /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/gentoo_common_config.cmake
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-gcc
-- Check for working C compiler: /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-g++
-- Check for working CXX compiler: /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Enabling backend state machine validation.
-- Using CMake automoc builtin
-- Performing Test HAVE_FPIE_SUPPORT
-- Performing Test HAVE_FPIE_SUPPORT - Success
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL - Success
-- Performing Test __KDE_HAVE_GCC_VISIBILITY
-- Performing Test __KDE_HAVE_GCC_VISIBILITY - Success
Change Dir: /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_9ddff/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_9ddff.dir/build.make CMakeFiles/cmTC_9ddff.dir/build
gmake[1]: Entering directory '/var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_9ddff.dir/check_qt_visibility.cpp.o
/usr/lib64/ccache/bin/x86_64-pc-linux-gnu-g++    -DNDEBUG -march=native -O2 -pipe  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fvisibility=hidden  -fPIE -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/lib64/qt5/mkspecs/linux-g++ -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui    -o CMakeFiles/cmTC_9ddff.dir/check_qt_visibility.cpp.o -c /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/CMakeTmp/check_qt_visibility.cpp
In file included from /usr/include/qt5/QtCore/QtGlobal:1:0,
                 from /var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/CMakeTmp/check_qt_visibility.cpp:1:
/usr/include/qt5/QtCore/qglobal.h:1097: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. "\
    ^
CMakeFiles/cmTC_9ddff.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_9ddff.dir/check_qt_visibility.cpp.o' failed
gmake[1]: *** [CMakeFiles/cmTC_9ddff.dir/check_qt_visibility.cpp.o] Error 1
gmake[1]: Leaving directory '/var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_9ddff/fast' failed
gmake: *** [cmTC_9ddff/fast] Error 2

CMake Error at cmake/FindPhononInternal.cmake:416 (message):
  Qt compiled without support for -fvisibility=hidden.  This will break
  plugins and linking of some applications.  Please fix your Qt installation
  (try passing --reduce-exports to configure).
Call Stack (most recent call first):
  CMakeLists.txt:47 (include)


-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/media-libs/phonon-4.8.3-r1/work/phonon-4.8.3-qt5/CMakeFiles/CMakeOutput.log".
 * ERROR: media-libs/phonon-4.8.3-r1::gentoo failed (configure phase):
 *   cmake failed
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 3404:  Called multibuild_foreach_variant 'myconfigure'
 *   environment, line 2423:  Called _multibuild_run 'myconfigure'
 *   environment, line 2421:  Called myconfigure
 *   environment, line 3400:  Called multilib_src_configure
 *   environment, line 2922:  Called cmake-utils_src_configure
 *   environment, line  783:  Called _execute_optionally 'src_configure'
 *   environment, line  300:  Called enable_cmake-utils_src_configure
 *   environment, line 1103:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";

I was testing cmake-3.3.0
Comment 29 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-25 11:24:22 UTC
(In reply to jospezial from comment #28)
> The same:
> 
>  * Package:    media-libs/phonon-4.8.3-r1

No, that's not about wireshark at all. File a new bug report.
Comment 30 jospezial 2015-08-14 13:09:52 UTC
not fixed with net-analyzer/wireshark-1.12.7
Comment 31 Davide Pesavento (RETIRED) gentoo-dev 2015-08-26 19:00:39 UTC
Well, not a qt bug so removing qt@ from CC, re-add us if you need anything.
Comment 32 Jeroen Roovers (RETIRED) gentoo-dev 2015-09-15 03:56:39 UTC
*** Bug 559460 has been marked as a duplicate of this bug. ***
Comment 33 Alex Orange 2015-09-16 15:04:46 UTC
Just to add something to this discussion. It appears an inaccuracy was stated in comment #3 and never removed. This affects gcc 4.8 as well (see my bug marked duplicate of this). Apparently the error message is slightly different but the same problem.
Comment 34 Alex Orange 2015-09-29 02:21:35 UTC
Disregard my comment. Apparently my bug was erroneously marked as a duplicate of this. Turns out it's a -O2/-O3 problem. I've unduplicated it.
Comment 35 jospezial 2015-10-15 11:14:35 UTC
not fixed with net-analyzer/wireshark-1.12.8

I will test 2.0.0_rc1 next.
Comment 36 jospezial 2015-10-15 12:01:11 UTC
Fixed in net-analyzer/wireshark-2.0.0_rc1

=================================================================
                        Package Settings
=================================================================

net-analyzer/wireshark-2.0.0_rc1::gentoo was built with the following:
USE="caps crypt filecaps geoip gtk3 ipv6 lua netlink pcap qt5 smi ssl zlib -adns -doc -doc-pdf -kerberos -portaudio -qt4 -sbc (-selinux)" ABI_X86="64" CPU_FLAGS_X86="-sse4_2"
CXXFLAGS="-march=native -O2 -pipe -fPIC -DPIC"
Comment 37 Jeroen Roovers (RETIRED) gentoo-dev 2015-10-25 07:44:06 UTC
*** Bug 564022 has been marked as a duplicate of this bug. ***
Comment 38 Andreas Sturmlechner gentoo-dev 2016-11-20 23:13:15 UTC
No more pre-2.0.0 version in tree, I guess this can be closed?